:root {
    --site-popup-height: 0px;
}

.topbar {
    top: var(--site-popup-height, 0px);
    z-index: 25;
    transition: top 0.18s ease;
}

.site-popup-root[hidden] {
    display: none;
}

.site-popup-root {
    position: sticky;
    top: 0;
    z-index: 35;
    border-bottom: 1px solid rgba(30, 36, 40, 0.08);
    background: rgba(255, 250, 244, 0.96);
    box-shadow: 0 12px 28px rgba(30, 36, 40, 0.08);
    backdrop-filter: blur(16px);
}

.site-popup {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-popup-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.site-popup-toggle {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink, #20242a);
    font: inherit;
    font-weight: 900;
    text-align: left;
    cursor: pointer;
}

.site-popup-toggle small {
    color: var(--coral, var(--gold, #f2a51d));
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.site-popup-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-popup-toggle::after {
    content: "펼치기";
    flex: 0 0 auto;
    color: var(--muted, #626a73);
    font-size: 0.82rem;
    font-weight: 800;
}

.site-popup-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.22s ease;
}

.site-popup-root:hover .site-popup-panel,
.site-popup-root:focus-within .site-popup-panel,
.site-popup-root.is-expanded .site-popup-panel {
    max-height: 420px;
    padding: 12px 0 16px;
    opacity: 1;
}

.site-popup-root:hover .site-popup-toggle::after,
.site-popup-root:focus-within .site-popup-toggle::after,
.site-popup-root.is-expanded .site-popup-toggle::after {
    content: "접기";
}

.site-popup-content {
    display: grid;
    grid-template-columns: minmax(160px, 280px) minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.site-popup-content.is-clickable {
    cursor: pointer;
}

.site-popup-content.is-clickable:hover .site-popup-copy strong,
.site-popup-content.is-clickable:focus .site-popup-copy strong {
    color: var(--coral, var(--gold, #f2a51d));
}

.site-popup-content.is-clickable:focus-visible {
    border-radius: 8px;
    outline: 2px solid rgba(242, 165, 29, 0.34);
    outline-offset: 4px;
}

.site-popup-content.is-text-only {
    grid-template-columns: 1fr;
}

.site-popup-image {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--line, #e3e5e7);
    border-radius: 8px;
    background: var(--soft, #f7f8f5);
}

.site-popup-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-popup-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.site-popup-copy strong {
    min-width: 0;
    overflow: hidden;
    color: var(--teal-deep, var(--green-deep, #283330));
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-popup-copy p {
    margin: 0;
    color: var(--muted, #626a73);
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.site-popup-actions {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-end;
    gap: 8px;
}

.site-popup-actions a,
.site-popup-actions button {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--line, #e3e5e7);
    border-radius: 999px;
    background: #fff;
    color: var(--teal-deep, var(--green-deep, #283330));
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.site-popup-actions a {
    border-color: rgba(242, 165, 29, 0.44);
    background: #fff7e6;
}

.site-popup-bar-close {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--muted, #626a73);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    cursor: pointer;
}

.site-popup-bar-close:hover,
.site-popup-bar-close:focus {
    color: var(--coral, var(--gold, #f2a51d));
}

@media (max-width: 560px) {
    .site-popup {
        width: min(100% - 24px, 1120px);
    }

    .site-popup-panel,
    .site-popup-content {
        grid-template-columns: 1fr;
    }

    .site-popup-actions {
        justify-content: flex-start;
    }

    .site-popup-toggle {
        gap: 8px;
        font-size: 0.92rem;
    }
}
