/* heimdex_blog 헤더 + 홈 배너 디자인 (원본 screen.css에서 그대로 추출) */

:root {

    /* Colours */
    --color-green: #a4d037;
    --color-yellow: #fecd35;
    --color-red: #f05230;
    --color-darkgrey: #15171A;
    --color-midgrey: #738a94;
    --color-lightgrey: #f1f1f1;
    --color-secondary-text: #979797;
    --color-border: #e1e1e1;
    --color-wash: #e5eff5;
    --color-darkmode: #151719;

    /*
    An accent color is also set by Ghost itself in
    Ghost Admin > Settings > Brand

    --ghost-accent-color: {value};

    You can use this variable throughout your styles
     */

    /* Fonts */
    --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    --font-serif: Georgia, Times, serif;
    --font-mono: Menlo, Courier, monospace;

}


/* Full width page blocks */
.outer {
    position: relative;
    padding: 0 max(4vmin, 20px);
}

/* Centered content container blocks */
.inner {
    margin: 0 auto;
    max-width: 1200px;
    width: 100%;
}


/* 3. Site Header
/* ---------------------------------------------------------- */

.site-header {
    position: relative;
    color: #fff;
    background: var(--ghost-accent-color);
}

.site-header-cover {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-header-content {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    padding-top: calc(19vmin + 44px);
    padding-bottom: 19vmin;
    text-align: center;
    color: var(--color-darkgrey);
}

.has-cover .site-header-content {
    height: 420px;
    min-height: 0;
    background-color: #e8ecf2;
    color: #fff;
}

.site-header-content.left-aligned {
    padding-bottom: 0;
    text-align: left;
}

.has-cover .site-header-content.left-aligned {
    align-items: flex-end;
    padding-bottom: max(4vmin, 32px);
}

.site-header-content.no-content {
    padding-top: 0;
    padding-bottom: 2vmin;
}

.site-header-inner {
    position: relative;
}

.site-header-content.left-aligned .site-header-inner {
    align-items: flex-start;
}

.site-logo {
    flex-shrink: 0;
    margin: 0 auto;
    max-height: 120px;
}

.site-header-content.left-aligned .site-logo {
    margin-right: auto;
    margin-left: 0;
    max-height: 96px;
}

.site-title {
    z-index: 10;
    margin: 0;
    padding: 0;
    font-size: 5rem;
    font-weight: 800;
}

.has-serif-title:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]) .site-title {
    font-family: var(--gh-font-heading, var(--font-serif));
}

.has-cover .site-title {
    font-size: 6rem;
}

.site-header-content.left-aligned .site-title {
    font-size: 4.4rem;
}

.has-cover .site-header-content.left-aligned .site-title {
    font-size: 4.6rem;
}

.site-description {
    display: inline-block;
    z-index: 10;
    max-width: 960px;
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.1;
}

.site-description:first-child {
    font-family: var(--gh-font-heading, var(--font-sans));
}

.has-serif-title:not([class*=" gh-font-heading"]):not([class^="gh-font-heading"]) .site-description:first-child {
    font-family: var(--gh-font-heading, var(--font-serif));
}

:is(.site-logo, .site-title) + .site-description {
    max-width: 640px;
    margin-top: 16px;
    font-size: 2.4rem;
    font-weight: 400;
    line-height: 1.4;
}

.site-logo + .site-description {
    margin-top: 20px;
}

.site-title + .site-description {
    color: var(--color-secondary-text);
}

.has-cover .site-description {
    letter-spacing: -0.005em;
    color: #fff;
}

.has-cover :is(.site-logo, .site-title) + .site-description {
    font-size: 2.4rem;
}

.has-cover .site-header-content.left-aligned :is(.site-logo, .site-title) + .site-description {
    font-size: 2.2rem;
}

@media (min-width: 992px) {
    .is-head-stacked.has-cover .site-header-content {
        padding-top: calc(19vmin + 120px);
    }
}

@media (max-width: 991px) {
    .site-header-content {
        padding-top: calc(19vmin + 32px);
    }
}

@media (max-width: 767px) {
    .has-cover .site-header-content {
        min-height: 240px;
    }
    .site-header-inner {
        gap: 16px;
    }
    .site-logo {
        max-width: 60%;
    }
    .site-title {
        font-size: 3.4rem !important;
    }
    .site-description {
        font-size: 2.2rem !important;
    }
    .site-logo + .site-description {
        margin-top: 12px !important;
    }
    .site-title + .site-description {
        margin-top: 12px !important;
    }
}


/* 4. Site Navigation
/* ---------------------------------------------------------- */

.gh-head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    font-size: 1.6rem;
    line-height: 1.3em;
    background-color: transparent;
    overflow: visible;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    color: #272833;
    z-index: 2000;
    transition: background-color 0.3s ease;
}

.gh-head.is-scrolled {
    background-color: #FCFCFF;
}


.gh-head a {
    text-decoration: none;
}

.gh-head-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 30px;
    padding-right: 30px;
}

/* Brand
/* ---------------------------------------------------------- */

.gh-head-brand {
    display: flex;
    align-items: center;
    flex: 1 0 0;
    min-width: 0;
}

.gh-head-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    color: inherit;
    white-space: nowrap;
}

.gh-head-logo-icon {
    width: 31px;
    height: 34px;
}

.gh-head-logo-text {
    width: 112px;
    height: 23px;
}

/* Default (white bg): show dark logo, hide white logo */
.gh-head-logo-white {
    display: none;
}

.gh-head-logo-dark {
    display: block;
}



/* Primary Navigation
/* ---------------------------------------------------------- */

.gh-head-menu {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gh-head-menu .nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gh-head-menu .nav li {
    margin: 0;
    padding: 0;
}

.gh-head-menu .nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    font-family: "Pretendard", var(--font-sans);
    font-weight: 500;
    font-size: 1.6rem;
    line-height: 1.4;
    letter-spacing: -0.5px;
    color: inherit;
}

.gh-head-menu .nav a:hover {
    opacity: 0.85;
}

.gh-head-menu .nav a {
    border-bottom: 2.5px solid transparent;
}

.gh-head-menu .nav .nav-active a,
.tag-news .gh-head-menu .nav .nav-news a,
.tag-insight .gh-head-menu .nav .nav-insight a,
.tag-trend .gh-head-menu .nav .nav-trend a {
    border-bottom-color: #234c77;
}


.gh-head-menu .nav-more-toggle {
    position: relative;
    width: 30px;
    height: 30px;
    margin: 0 -6px;
    padding: 0;
    font-size: inherit;
    background-color: transparent;
    text-transform: inherit;
}

.gh-head-menu .nav-more-toggle svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 992px) {
    body:not(.is-dropdown-loaded) .gh-head-menu .nav > li {
        opacity: 1;
    }
}


/* Dropdown
/* ---------------------------------------------------------- */

.gh-dropdown {
    position: absolute;
    top: 100%;
    right: -16px;
    z-index: 90;
    width: 200px;
    padding: 12px 0;
    margin-top: 24px;
    opacity: 0;
    visibility: hidden;
    text-align: left;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 7px 20px -5px rgba(0, 0, 0, 0.15);
    transform: translate3d(0, 6px, 0);
    transition: opacity 0.3s, transform 0.2s;
}

.is-head-middle-logo .gh-dropdown {
    right: auto;
    left: -24px;
}

.is-dropdown-mega .gh-dropdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: column;
    column-gap: 40px;
    min-width: 320px;
    padding: 20px 32px;
}

.is-dropdown-open .gh-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gh-head-menu .gh-dropdown li a {
    display: block;
    padding: 6px 20px;
    color: #15171a;
}

.is-dropdown-mega .gh-dropdown li a {
    padding: 8px 0;
}


/* Secondary Navigation
/* ---------------------------------------------------------- */

.gh-social {
    display: flex;
    align-items: center;
    gap: 20px;
}

.gh-social-link {
    line-height: 0;
    color: inherit;
}

.gh-social-link:hover {
    opacity: 0.9;
}

.gh-social-link svg {
    width: 18px;
    height: 18px;
}

.gh-head-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex: 1 0 0;
    min-width: 0;
    gap: 24px;
    list-style: none;
    text-align: right;
}

.gh-head-members {
    display: flex;
    gap: 20px;
    align-items: center;
}

.gh-head-link {
    font-weight: 500;
    color: inherit;
}

.gh-head-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 20px;
    height: 44px;
    font-weight: 600;
    letter-spacing: -0.005em;
    font-size: 1.6rem;
    border-radius: 48px;
    color: #fff;
    background: var(--ghost-accent-color);
}

.has-cover .gh-head-button {
    color: var(--color-darkgrey);
    background: #fff;
}

@media (max-width: 767px) {
    .gh-head-members {
        flex-direction: column-reverse;
        gap: 16px;
        width: 100%;
    }
}


/* Search
/* ---------------------------------------------------------- */

.gh-head-search {
    position: relative;
    display: flex;
    align-items: center;
}

.gh-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    outline: none;
    color: inherit;
}

.gh-search-toggle:hover {
    opacity: 0.9;
}

.gh-search-bar {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.gh-head-search.is-search-open .gh-search-bar {
    width: 280px;
    opacity: 1;
    pointer-events: auto;
}

.gh-head-search.is-search-open .gh-search-toggle {
    display: none;
}

.gh-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 4px 6px;
    background: transparent;
    border: 0;
    border-bottom: 1.5px solid #272833;
    border-radius: 0;
}


.gh-search-form svg {
    display: none;
}

.gh-search-input {
    flex: 1;
    width: 100%;
    padding: 0;
    font-family: "Pretendard", var(--font-sans);
    font-size: 1.4rem;
    font-weight: 400;
    color: #272833;
    background: transparent;
    border: 0;
    outline: none;
}

.gh-search-input::placeholder {
    color: #272833;
    opacity: 0.5;
}


.gh-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 1.8rem;
    line-height: 1;
    color: #272833;
    opacity: 0.6;
    background: transparent;
    border: 0;
    cursor: pointer;
}


.gh-search-close:hover {
    opacity: 1;
}


/* Mobile Menu Trigger
/* ---------------------------------------------------------- */

.gh-burger {
    position: relative;
    display: none;
    width: 30px;
    height: 30px;
    padding: 0;
    margin-right: -3px;
    cursor: pointer;
    background-color: transparent;
    border: 0;
    appearance: none;
}

.gh-burger::before,
.gh-burger::after {
    position: absolute;
    left: 3px;
    width: 24px;
    height: 1px;
    content: "";
    background-color: #272833;
    transition: all 0.2s cubic-bezier(0.04, 0.04, 0.12, 0.96) 0.1008s;
}


.gh-burger::before {
    top: 11px;
}

.gh-burger::after {
    bottom: 11px;
}

.gh-head-open .gh-burger::before {
    top: 15px;
    transform: rotate(45deg);
}

.gh-head-open .gh-burger::after {
    bottom: 14px;
    transform: rotate(-45deg);
}


/* Mobile Menu
/* ---------------------------------------------------------- */
/* IDs needed to ensure sufficient specificity */

@media (max-width: 767px) {
    #gh-head {
        height: 64px;
    }

    #gh-head .gh-head-inner {
        grid-template-rows: auto 1fr auto;
        grid-template-columns: 1fr;
        gap: 48px;
    }

    #gh-head .gh-head-brand {
        display: grid;
        grid-template-columns: 1fr auto auto;
        grid-column-start: 1;
        align-items: center;
        height: 64px;
    }

    #gh-head .gh-head-logo {
        font-size: 2.2rem;
    }

    #gh-head .gh-head-brand .gh-search {
        margin-left: -6px;
    }

    #gh-head .gh-burger {
        display: block;
    }

    #gh-head .gh-head-menu,
    #gh-head .gh-head-actions {
        position: fixed;
        justify-content: center;
        visibility: hidden;
        opacity: 0;
    }

    #gh-head .gh-head-menu {
        margin: 0;
        transition: none;
        transform: translateY(0);
    }

    #gh-head .nav {
        gap: 16px;
        align-items: center;
        line-height: 1.4;
    }

    #gh-head .nav a {
        font-size: 2.6rem;
        font-weight: 600;
        text-transform: none;
    }

    #gh-head .nav li {
        opacity: 0;
        transform: translateY(-4px);
    }

    #gh-head :is(.gh-head-button, .gh-head-link) {
        opacity: 0;
        transform: translateY(8px);
    }

    #gh-head .gh-head-button {
        width: 100%;
        font-size: 1.8rem;
        text-transform: none;
        opacity: 0;
        transform: translateY(8px);
    }

    .gh-head-open #gh-head {
        position: fixed;
        inset: 0;
        z-index: 3999999;
        height: 100%;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }

    .gh-head-open.has-cover #gh-head,
    .gh-head-open.has-cover #gh-head .gh-head-actions {
        background-color: var(--ghost-accent-color);
    }

    .gh-head-open #gh-head .gh-head-menu,
    .gh-head-open #gh-head .gh-head-actions {
        position: static;
        visibility: visible;
        opacity: 1;
    }

    .gh-head-open #gh-head .nav {
        display: flex;
        flex-direction: column;
    }

    .gh-head-open #gh-head .nav li {
        opacity: 1;
        transition: transform 0.2s, opacity 0.2s;
        transform: translateY(0);
    }

    .gh-head-open #gh-head .gh-head-actions {
        position: sticky;
        right: 0;
        bottom: 0;
        left: 0;
        display: inline-flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        padding: max(4vmin, 20px) 0 max(4vmin, 28px);
        background-color: #fff;
    }

    .gh-head-open #gh-head :is(.gh-head-button, .gh-head-link) {
        opacity: 1;
        transition: transform 0.4s, opacity 0.4s;
        transition-delay: 0.2s;
        transform: translateY(0);
    }

    .gh-head-open #gh-head .gh-head-link {
        transition-delay: 0.4s;
    }
}

/* 언어 전환 KOR | ENG */
.gh-lang-switch { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 1.5rem; color: inherit; }
.gh-lang-switch a { color: inherit; opacity: 0.45; }
.gh-lang-switch a.is-active { opacity: 1; }
.gh-lang-switch a:hover { opacity: 0.8; }
.gh-lang-switch .sep { opacity: 0.3; }

/* 구독하기 버튼: 네이비 고정 (has-cover 화이트 override 무력화) */
.gh-head-members { gap: 18px; }
.gh-subscribe-btn,
.has-cover .gh-subscribe-btn {
    background: #1f3a5f !important;
    color: #fff !important;
}
.gh-subscribe-btn:hover,
.has-cover .gh-subscribe-btn:hover { background: #16293f !important; }

/* fixed 헤더 아래로 내부 페이지 콘텐츠 밀기 (홈/ko 홈 제외: 배너가 처리) */
body:not(.home-template):not(.ko-template) .site-content { padding-top: 96px; }

/* =========================================================
   모바일 헤더 재정의 (≤900px) — 기존 이식 규칙 덮어쓰기
   닫힘: 로고 좌 · 햄버거 우
   열림: 흰 배경 / 검색 최상단 / X 우상단 / 메뉴 좌측정렬 / 로그인·구독 하단
   ========================================================= */
@media (max-width: 1200px) {
    /* ---- 닫힌 상태: 데스크탑 헤더와 동일 (투명/블러 배경·로고 비율 유지), 버거만 노출 ---- */
    #gh-head {
        height: 80px !important;   /* 데스크탑과 동일. 배경(투명+블러/스크롤시 #FCFCFF)은 그대로 둠 */
    }
    #gh-head .gh-head-inner {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0 !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
    }
    #gh-head .gh-head-brand {
        display: flex !important;
        flex: 1 0 0 !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: auto !important;
        grid-template-columns: none !important;
    }
    #gh-head .gh-burger {
        display: block !important;
        position: relative;
        margin: 0;
    }
    /* 닫힘: 중앙 메뉴/우측 액션 숨김 */
    #gh-head .gh-head-menu,
    #gh-head .gh-head-actions { display: none !important; }

    /* ---- 열린 상태 ---- */
    body.gh-head-open { overflow: hidden; }

    .gh-head-open #gh-head {
        position: fixed !important;
        inset: 0 !important;
        height: 100% !important;
        background: #fff !important;
        border-bottom: 0;
        overflow-y: auto;
        z-index: 3999999;
    }
    .gh-head-open #gh-head .gh-head-inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        height: 100% !important;
        padding: 25px 20px !important;
        gap: 0 !important;
        position: relative;
    }

    /* 브랜드: 로고 숨기고 버거(X)만 우상단 고정 */
    .gh-head-open #gh-head .gh-head-brand { display: contents !important; }
    .gh-head-open #gh-head .gh-head-logo { display: none !important; }
    .gh-head-open #gh-head .gh-burger {
        display: block !important;
        position: absolute !important;
        top: 25px;
        right: 20px;
        z-index: 10;
    }

    /* 액션 컨테이너를 평면화해 개별 정렬 */
    .gh-head-open #gh-head .gh-head-actions {
        display: contents !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* 검색: 우측 상단 X 아래줄, 전체폭 */
    .gh-head-open #gh-head .gh-head-search {
        order: 1 !important;
        display: block !important;
        width: 100% !important;
        align-self: stretch !important;
        margin: 44px 0 26px 0 !important;
        position: static !important;
    }
    .gh-head-open #gh-head .gh-search-toggle { display: none !important; }
    .gh-head-open #gh-head .gh-search-bar {
        position: static !important;
        width: 100% !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        overflow: visible !important;
    }
    .gh-head-open #gh-head .gh-search-form {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        height: auto !important;
        padding: 0 0 10px !important;
        border: 0 !important;
        border-bottom: 1.5px solid #272833 !important;
        border-radius: 0 !important;
    }
    .gh-head-open #gh-head .gh-search-form svg {
        display: block !important;
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        color: #272833;
    }
    .gh-head-open #gh-head .gh-search-input {
        flex: 1 !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        font-size: 1.6rem !important;
        line-height: 1.4 !important;
    }
    .gh-head-open #gh-head .gh-search-close { display: none !important; }

    /* 메뉴: 좌측정렬 세로 */
    .gh-head-open #gh-head .gh-head-menu {
        order: 2 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        left: auto !important;
        transform: none !important;
        margin: 0 !important;
        justify-content: flex-start !important;
    }
    .gh-head-open #gh-head .nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    .gh-head-open #gh-head .nav li {
        opacity: 1 !important;
        transform: none !important;
    }
    .gh-head-open #gh-head .nav a {
        font-size: 2rem !important;
        font-weight: 600 !important;
        padding: 12px 0 !important;
        border: 0 !important;
    }

    /* 언어 전환: 메뉴 아래 */
    .gh-head-open #gh-head .gh-lang-switch {
        order: 3 !important;
        margin: 20px 0 0 !important;
        font-size: 1.6rem;
    }

    /* 로그인 / 구독: 하단 */
    .gh-head-open #gh-head .gh-head-members {
        order: 4 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        width: 100%;
        margin-top: auto !important;
        padding-top: 28px;
    }
    .gh-head-open #gh-head .gh-head-link {
        display: block;
        padding: 12px 0;
        text-align: center;
    }
    .gh-head-open #gh-head .gh-head-button,
    .gh-head-open #gh-head .gh-subscribe-btn {
        width: 100% !important;
        justify-content: center !important;
        height: 50px;
    }
}

/* 모바일 홈 배너: 중앙 텍스트 기준 확대 (cover, 좌우 일부 크롭) */
@media (max-width: 1200px) {
    .has-cover .site-header-content,
    .site-header-content {
        height: clamp(240px, 30vw, 340px) !important;
        min-height: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: #eef1f6 !important;
        color: inherit !important;
    }
    .site-header-content .site-header-cover {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 38% !important;
        display: block;
    }
}

/* 데스크탑 검색: 이전처럼 좌측 확장 + 레이어 한 층 위로 (펼침 너비는 JS가 Newsletter 우측까지로 제한) */
@media (min-width: 1201px) {
    .gh-head-search.is-search-open {
        z-index: 2500;
    }
    .gh-head-search .gh-search-bar {
        z-index: 2500 !important;
    }
    /* 검색 열릴 때 KOR | ENG 잠깐 숨김 (레이아웃 유지 위해 visibility) */
    .gh-head.is-search-active .gh-lang-switch {
        opacity: 0;
        visibility: hidden;
    }
    /* 인풋 외곽선 제거 (Ease 기본 인풋 테두리 무력화) */
    .gh-head-search .gh-search-input {
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding: 0 !important;
        height: auto !important;
        box-shadow: none !important;
    }
}
