/* Explain: Styles for site header, footer, and integrated search UI elements. */
.topbar {
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.4;
}

.topbar a,
.topbar summary {
    color: rgba(255, 255, 255, 0.82);
    transition: color 200ms ease;
}

.topbar a:hover,
.topbar summary:hover {
    color: #ffffff;
}

details.lang-menu > summary {
    list-style: none;
    cursor: pointer;
}

details.lang-menu > summary::-webkit-details-marker {
    display: none;
}

.header-search {
    align-items: center;
    gap: 0.2rem;
    min-height: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    padding-left: 0.6rem;
    padding-right: 0.15rem;
}

.header-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 0.45rem;
    outline: none;
}

.header-search button {
    display: inline-flex;
    height: 0.9rem;
    width: 0.9rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--accent-color);
    color: #ffffff;
    font-size: 0.45rem;
    transition: background 200ms ease;
}

.header-search button:hover {
    background: var(--primary-color);
}

.site-banner-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.3rem 0.9rem 0.3rem 0.35rem;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
    transition: background 200ms ease, color 200ms ease;
}

.site-banner-link:hover,
.site-banner-link:focus-visible {
    background: #ffffff;
    color: var(--primary-color);
}

.site-banner-logo {
    display: inline-flex;
    height: 1.5rem;
    width: 1.5rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.5rem;
    background: #ffffff;
}

.footer-social {
    display: inline-flex;
    height: 2.4rem;
    width: 2.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.95rem;
    transition: background 200ms ease, transform 200ms ease;
}

.footer-social:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-2px);
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: inherit;
    font-size: 0.86rem;
    line-height: 1.7;
    opacity: 0.72;
    transition: opacity 200ms ease;
}

.footer-link i {
    display: inline-flex;
    width: 1.25rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.75;
}

.footer-link:hover {
    opacity: 1;
}

/* ── 푸터 기관 정보·문의처·바로가기 정렬·간격 통일 ── */
.footer-col-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.85;
}

.footer-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 1.1rem;
}

.footer-row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.82;
    overflow-wrap: anywhere;
    transition: opacity 200ms ease;
}

.footer-row i {
    display: inline-flex;
    width: 1.25rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.75;
}

a.footer-row:hover {
    opacity: 1;
}

.footer-row a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-empty {
    display: block;
    font-size: 0.86rem;
    line-height: 1.7;
    opacity: 0.6;
    overflow-wrap: anywhere;
}

.site-popup-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.site-popup {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 36, 68, 0.6);
    padding: 1.25rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.site-popup-toggle:checked ~ .site-popup {
    display: flex;
}

.site-popup-card {
    position: relative;
    width: 100%;
    max-width: 26rem;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 1.5rem;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(15, 36, 68, 0.4);
}

.site-popup-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.site-popup-body {
    padding: 1.5rem;
}

.site-popup-close {
    display: inline-flex;
    min-height: 2.9rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--surface-color);
    padding: 0 1.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    transition: background 200ms ease;
}

.site-popup-close:hover {
    background: #e8eef7;
}

/* ── 사이트 검색 결과 ── */
.search-status {
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    background: var(--surface-color);
    padding: 0.7rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.search-status-empty {
    color: var(--text-muted);
}

.search-status-error {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.07);
    color: #b91c1c;
}

.search-result-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #ffffff;
    padding: 0.9rem 1.1rem;
    transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.search-result-card:hover {
    border-color: var(--accent-color);
    background: var(--surface-color);
    transform: translateY(-2px);
}

.search-result-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.search-result-title {
    min-width: 0;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.search-result-badge {
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    padding: 0.18rem 0.65rem;
    color: var(--accent-color);
    font-size: 0.72rem;
    font-weight: 700;
}

.search-result-snippet {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

/* ── 통합 검색 결과 카드 ──
   종류 배지·제목·요약·부가 정보의 줄 간격과 위치를 모든 카드에서 동일하게 유지합니다. */
.search-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: 100%;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: #ffffff;
    padding: 1.25rem;
    box-shadow: var(--shadow-card);
    transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

.search-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 16px 34px rgba(15, 36, 68, 0.12);
    transform: translateY(-2px);
}

/* 종류 배지 줄 — 배지가 없는 카드도 같은 높이를 차지해 제목 시작 위치가 흔들리지 않습니다. */
.search-card-head {
    display: flex;
    min-height: 1.7rem;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.search-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    background: var(--accent-soft);
    padding: 0.15rem 0.7rem;
    color: var(--accent-color);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
}

.search-card-tag {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
}

/* 제목 — 최대 두 줄, 카드마다 같은 높이를 차지합니다. */
.search-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.5em * 2);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-color);
    overflow-wrap: anywhere;
}

/* 요약 — 최대 세 줄, 카드마다 같은 높이를 차지해 부가 정보 줄을 같은 위치에 고정합니다. */
.search-card-snippet {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: calc(1.6em * 3);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.search-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.search-card-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    overflow-wrap: anywhere;
}

.search-card-meta-item i {
    flex-shrink: 0;
    opacity: 0.8;
}

/* ── 결과 없음 안내 ──
   다른 목록 화면의 빈 상태와 같은 톤(점선 테두리·원형 아이콘·제목·설명)으로 통일합니다. */
.search-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    min-height: 15rem;
    border: 1px dashed var(--border-color);
    border-radius: 1.5rem;
    background: var(--surface-color);
    padding: 2.25rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.7;
}

.search-empty-card > i {
    display: inline-flex;
    height: 3.5rem;
    width: 3.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffffff;
    color: var(--accent-color);
    font-size: 1.35rem;
}

.search-empty-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--text-color);
}

.search-empty-desc {
    max-width: 26rem;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.search-empty-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.search-empty-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2.4rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: #ffffff;
    padding: 0 1rem;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.search-empty-chip i {
    color: var(--accent-color);
    font-size: 0.75rem;
}

.search-empty-chip:hover {
    border-color: var(--accent-color);
    background: var(--surface-color);
    color: var(--accent-color);
}

.search-hl {
    border-radius: 0.2rem;
    background: var(--accent-soft);
    box-shadow: inset 0 -0.55em 0 rgba(37, 99, 235, 0.16);
    padding: 0 0.1rem;
    color: inherit;
    font-weight: inherit;
}