.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: #fff;
    border-bottom: 1px solid #e8ecf0;
}

.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: 36px;
}

.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 #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.site-header__menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: #374151;
    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;
}

.site-header__nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 999px;
    background: var(--site-nav-indicator-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: #374151;
    border-radius: 999px;
    background: transparent;
    transition: color 0.28s ease;
}

.site-header__nav-link:hover {
    color: #1e3a5f;
}

.site-header__nav-link.is-active {
    color: #1e3a5f;
    font-weight: 600;
    background: transparent;
}

.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 #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.site-header__search-toggle:hover,
.site-header.is-search-open .site-header__search-toggle {
    border-color: #cbd5e1;
    color: #1e3a5f;
}

.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 {
        max-height: 43px;
    }
}

@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 0;
}

.home-search-results__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.home-search-results__count {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
}

.home-search-results__list {
    display: grid;
    gap: 0.75rem;
}

.home-search-results__list a {
    display: block;
    padding: 1rem 1.125rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.home-search-results__list a:hover {
    border-color: #cbd5e1;
}

.home-search-results__list p {
    margin-top: 0.35rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.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;
    }
}
