.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

/* ── Sticky footer: 내용이 짧으면 푸터를 화면 하단에 고정 ── */
html {
    height: 100%;
}

.site-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.site-shell > .site-main {
    flex: 1 0 auto;
    width: 100%;
}

.site-shell > footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* ── Site header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--site-header-bg, #fff);
    border-bottom: 1px solid #cccccc;
}

.site-header__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
}

.site-header__logo {
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e3a5f;
    line-height: 1.2;
}

.site-header__logo-img {
    /* 기본(모바일): 로고관리 모바일 높이만 */
    max-height: var(--site-logo-height-mobile, 36px);
    height: var(--site-logo-height-mobile, 36px);
    width: auto;
    object-fit: contain;
}

.site-header__menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    /* 어떤 헤더 배경에서도 보이도록 고정 대비 칩 */
    background: rgba(255, 255, 255, .94);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .18),
        0 0 0 1px rgba(255, 255, 255, .35);
    cursor: pointer;
}

.site-header__menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: #111827;
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

.site-header.is-menu-open .site-header__menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.site-header.is-menu-open .site-header__menu-toggle span:nth-child(2) {
    opacity: 0;
}

.site-header.is-menu-open .site-header__menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-header__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.site-header.is-menu-open .site-header__nav {
    display: flex;
}

/* 모바일 햄버거 드롭다운 — 전 사이트 공통 */
@media (max-width: 1023px) {
    .site-header__nav,
    .site-header.is-menu-open .site-header__nav {
        background: #fff !important;
        border-bottom: 1px solid #e5e7eb !important;
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
        padding: 0 !important;
        gap: 0 !important;
    }

    .site-header__nav-link {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        padding: 0.95rem 14px 0.95rem 10px !important;
        border: 0;
        border-bottom: 1px solid #eee !important;
        border-radius: 0 !important;
        background: #fff !important;
        color: #111 !important;
        font-size: 0.9375rem;
        font-weight: 500;
        text-align: left;
        line-height: 1.4;
    }

    .site-header__nav-link::after {
        content: '›';
        flex-shrink: 0;
        margin-left: auto;
        color: #9ca3af;
        font-size: 1.25rem;
        font-weight: 400;
        line-height: 1;
    }

    .site-header__nav-link:last-child {
        border-bottom: 0 !important;
    }

    .site-header__nav-link:hover,
    .site-header__nav-link:focus-visible,
    .site-header__nav-link.is-active,
    .site-header__nav-link.is-active:hover {
        background: #f5f5f5 !important;
        color: #111 !important;
        font-weight: 600;
    }

    .site-header__nav-link:hover::after,
    .site-header__nav-link.is-active::after {
        color: #6b7280;
    }

    .site-header__nav-indicator {
        display: none !important;
    }
}

.site-header__nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 999px;
    /* 이동/호버 배경 = 메뉴 선택 배경색 */
    background: var(--site-nav-indicator-bg, var(--site-nav-active-bg, #e8eef5));
    opacity: 0;
    pointer-events: none;
    transform: translate(0, 0);
    transition:
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.2s ease;
}

.site-header__nav-indicator.is-visible {
    opacity: 1;
}

.site-header__nav-indicator.is-ready {
    /* transition armed after first paint */
}

.site-header__nav-indicator.is-no-transition {
    transition: none !important;
}

.site-header__nav-link {
    position: relative;
    z-index: 1;
    padding: 0.75rem 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--site-nav-font, #374151);
    border-radius: 999px;
    background: transparent;
    transition: color 0.28s ease, background 0.28s ease;
}

/* 호버 = 선택과 동일. 선택 항목은 호버해도 색 유지 */
.site-header__nav-link:hover,
.site-header__nav-link.is-active,
.site-header__nav-link.is-active:hover {
    color: var(--site-nav-active-font, #1e3a5f);
    background: var(--site-nav-active-bg, #e8eef5);
}

.site-header__nav-link.is-active {
    font-weight: 600;
}

body {
    background: var(--site-body-bg, transparent);
}

.site-shell > footer,
.gov-footer,
.site-footer {
    background: var(--site-footer-bg, inherit);
}

.site-header__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.site-header__search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    /* 어떤 헤더 배경에서도 아이콘이 읽히도록 고정 대비 칩 */
    background: rgba(255, 255, 255, .94);
    color: #111827;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .18),
        0 0 0 1px rgba(255, 255, 255, .35);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.site-header__search-toggle:hover,
.site-header.is-search-open .site-header__search-toggle {
    border-color: rgba(15, 23, 42, .28);
    background: #fff;
    color: #0f172a;
    box-shadow:
        0 2px 6px rgba(15, 23, 42, .2),
        0 0 0 1px rgba(255, 255, 255, .5);
}

.site-header__search-toggle svg {
    display: block;
    filter: drop-shadow(0 0 0.6px rgba(255, 255, 255, .9));
}

.site-header__search-panel {
    border-top: 1px solid #eef2f7;
    background: #fafbfc;
}

.site-header__search-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.875rem 0;
}

.site-header__search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.site-header__search-form input[type="search"]:focus {
    outline: none;
    border-color: #94a3b8;
}

.site-header__search-submit {
    flex-shrink: 0;
    height: 44px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 8px;
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

/* 검색 오버레이 모달 (웹·모바일 공통) */
.site-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
}

.site-search-overlay[hidden] {
    display: none;
}

.site-search-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.site-search-overlay__panel {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    margin-top: min(12vh, 6rem);
    padding: 1.25rem 1.25rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.site-search-overlay__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eef2f7;
}

.site-search-overlay__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.site-search-overlay__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.site-search-overlay__close:hover {
    background: #f8fafc;
    color: #0f172a;
}

.site-search-overlay__form {
    display: flex;
    gap: 0.5rem;
    padding: 0;
}

.site-search-overlay__form input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

.site-search-overlay__form input[type="search"]:focus {
    outline: none;
    border-color: #94a3b8;
}

.site-search-overlay__submit {
    flex-shrink: 0;
    height: 48px;
    padding: 0 1.25rem;
}

body.is-search-overlay-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .site-search-overlay__panel {
        margin-top: 1.25rem;
        padding: 1rem 1rem 1.25rem;
    }

    .site-search-overlay__form {
        flex-direction: column;
    }

    .site-search-overlay__submit {
        width: 100%;
    }
}

@media (min-width: 1024px) {
    .site-header__bar {
        position: relative;
        flex-wrap: nowrap;
    }

    .site-header__menu-toggle {
        display: none;
    }

    .site-header__nav {
        display: flex;
        position: relative;
        flex: 1;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 0.125rem 0.25rem;
        min-width: 0;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-header__nav::-webkit-scrollbar {
        display: none;
    }

    .site-header__nav-link {
        padding: 0.5rem 0.625rem;
        white-space: nowrap;
        font-size: 0.875rem;
        border-radius: 999px;
        background: transparent;
    }

    .site-header__actions {
        margin-left: 0.5rem;
    }

    /* 웹: 로고관리 웹 높이만 */
    .site-header__logo-img,
    .site-brand-logo {
        max-height: var(--site-logo-height, 40px);
        height: var(--site-logo-height, 40px);
    }
}

@media (min-width: 1200px) {
    .site-header__nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9375rem;
    }
}

/* ── Home shared ── */
.home-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.home-section-head__title {
    font-size: 1.375rem;
    font-weight: 700;
}

.home-section-head__title a:hover {
    color: #1e3a5f;
}

.home-section-head__more {
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.home-section-head__more:hover {
    color: #1e3a5f;
}

.home-category-posts {
    padding: 2rem 0;
}

.home-category-posts__list {
    display: grid;
    gap: 0.75rem;
}

.home-category-posts__item a {
    font-weight: 600;
    color: #1f2937;
}

.home-category-posts__item a:hover {
    color: #1e3a5f;
}

.home-category-posts__item p {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.home-search-results {
    padding: 1.5rem 0 2.5rem;
}

.home-search-results__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.4;
}

.home-search-results__count {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.home-search-results__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.home-search-results__item {
    margin: 0;
}

.home-search-results__link {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.home-search-results__link:hover {
    border-color: #cbd5e1;
}

.home-search-results__thumb {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
    background: #e8eef5;
}

.home-search-results__thumb--empty {
    background: linear-gradient(145deg, rgba(47, 111, 178, .12), rgba(47, 111, 178, .04)), #e8eef5;
}

.home-search-results__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-search-results__body {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
}

.home-search-results__cat {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.home-search-results__name {
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
}

.home-search-results__summary {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-search-results__body time {
    font-size: 0.8rem;
    color: #94a3b8;
}

@media (max-width: 640px) {
    .home-search-results__link {
        grid-template-columns: 112px 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
}

.home-empty {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.site-main {
    padding: 2rem 0 3rem;
}

.site-header {
    padding: 1rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
}

.site-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-main {
    padding: 2rem 0 3rem;
}

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
}

.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-desc {
    color: #6b7280;
    margin-bottom: 2rem;
}

.hero {
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.hero-desc {
    font-size: 1.05rem;
    max-width: 640px;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
}

.post-meta {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.post-content {
    margin-top: 1.5rem;
    line-height: 1.8;
}

.post-content p {
    margin-bottom: 1rem;
}

.thumbnail {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* ── Content motion / lazy ── */
.site-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}

.site-reveal.is-inview {
    opacity: 1;
    transform: none;
    will-change: auto;
}

.site-img-lazy {
    opacity: 0;
    transition: opacity 0.45s ease;
}

.site-img-lazy.is-loaded {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .site-header__nav-indicator,
    .site-header__nav-link,
    .site-reveal,
    .site-img-lazy {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
