@import url("site-hero-enter.css");

/* 공통 상단 내비 — index(다크 히어로) + 서브페이지(nav-sub: 밝은 히어로) */

:root {
    /* tailwind-built `bg-mist` 와 동일 — 로고 PNG 매트·헤더 바 톤을 맞춰 박스/이색 완화 */
    --cti-nav-bg: rgb(244 246 249);
}

html {
    scrollbar-gutter: stable;
}

/* 한 줄 고정: 줄바꿈 시 특정 긴 라벨만 흔들리는 현상 방지 */
.site-nav__links {
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
/* 모든 페이지에서 상단 메뉴 간격·폰트 기준 통일 (index / 서브 간 미세 이동 방지) */
#site-nav .site-nav__links {
    font-size: 0.75rem;
    column-gap: 0.35rem;
    row-gap: 0;
    min-width: 0;
    overflow: hidden;
}
@media (min-width: 640px) {
    #site-nav .site-nav__links {
        column-gap: 0.4rem;
    }
}
@media (min-width: 768px) {
    #site-nav .site-nav__links {
        column-gap: 0.45rem;
    }
}
#site-nav .site-nav__links > .flex {
    column-gap: 0.45rem;
}
.site-nav__links::-webkit-scrollbar {
    display: none;
}

/* 로고를 경계선 안에서 가능한 크게 고정 */
#site-nav .nav-logo {
    display: block;
    width: auto !important;
    height: calc(4.25rem - 0.875rem) !important;
    max-height: calc(4.25rem - 0.875rem) !important;
    max-width: min(18rem, 72vw) !important;
    object-fit: contain;
    object-position: left center;
    background-color: var(--cti-nav-bg);
}
@media (min-width: 640px) {
    #site-nav .nav-logo {
        height: calc(4.25rem - 0.75rem) !important;
        max-height: calc(4.25rem - 0.75rem) !important;
        max-width: min(20rem, 76vw) !important;
    }
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 6.35rem;
    flex-shrink: 0;
    width: 6.35rem;
    min-width: 6.35rem;
    max-width: 6.35rem;
    letter-spacing: -0.01em;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.25;
    color: rgb(71 85 105);
    border-radius: 0.375rem;
    padding: 0.35rem 0.18rem;
    border-width: 1px;
    border-style: solid;
    border-color: transparent;
    background-color: transparent;
    background-clip: padding-box;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-ligatures: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.nav-link:hover {
    color: rgb(15 23 42);
}

.nav-family-select {
    flex: 0 0 7rem;
    width: 7rem;
    min-width: 7rem;
    max-width: 7rem;
    height: 2rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.96);
    color: rgb(51 65 85);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.2rem 1.45rem 0.2rem 0.55rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.95rem;
    cursor: pointer;
}
.nav-lang-select {
    flex: 0 0 4.35rem;
    width: 4.35rem;
    min-width: 4.35rem;
    max-width: 4.35rem;
    height: 2rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.96);
    color: rgb(51 65 85);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.2rem 1.35rem 0.2rem 0.55rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 0.95rem;
    cursor: pointer;
}
.nav-lang-select:focus {
    outline: none;
    border-color: rgb(148 163 184);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}
.nav-family-select:focus {
    outline: none;
    border-color: rgb(148 163 184);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

/* 패밀리 사이트: 푸터 하단 우측 */
.footer-family-select {
    width: auto;
    min-width: 8.75rem;
    max-width: 12rem;
    height: 2.125rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.5rem;
    background-color: rgba(255, 255, 255, 0.98);
    color: rgb(30 41 59);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.28rem 1.55rem 0.28rem 0.65rem;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23334155'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 1rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.footer-family-select:focus {
    outline: none;
    border-color: rgb(148 163 184);
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}
.footer-family-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-left: auto;
}
.footer-family-slot {
    display: flex;
    flex: 1 1 auto;
    justify-content: flex-end;
    align-items: center;
    min-width: 8.75rem;
    margin-left: auto;
}
#site-page-footer .footer-family-slot .footer-family-wrap,
#pb-footer-legal .footer-family-slot .footer-family-wrap {
    display: flex;
    justify-content: flex-end;
    width: auto;
    padding: 0;
    position: static;
    margin-left: 0;
}
.footer-tel-fax-dd {
    align-items: center;
    justify-content: space-between;
}
footer.has-footer-family,
#site-page-footer.has-footer-family {
    position: relative;
}
footer.has-footer-family > .max-w-5xl,
footer.has-footer-family > .mi-page-footer__bar {
    padding-right: 0.5rem;
    padding-bottom: 2.85rem;
}
footer.has-footer-family > .footer-family-wrap,
footer.has-footer-family > .max-w-5xl > .footer-family-wrap,
footer.has-footer-family > .mi-page-footer__bar > .footer-family-wrap {
    position: absolute;
    right: clamp(1.25rem, 4vw, 2.5rem);
    bottom: 0.65rem;
    width: auto;
    padding: 0;
    z-index: 2;
    margin-left: 0;
}
.site-footer-util {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100%;
    box-sizing: border-box;
    border-top: 1px solid rgb(203 213 225 / 0.55);
    background: rgb(226 232 240 / 0.45);
    padding: 0.55rem clamp(1rem, 4vw, 2.5rem) 0.65rem;
    text-align: right;
}
.site-footer-util .footer-family-wrap {
    margin-left: auto !important;
    margin-right: 0 !important;
    justify-content: flex-end !important;
    width: auto !important;
}
.footer-family-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem clamp(1rem, 4vw, 2.5rem) 0.55rem;
}
@media (max-width: 639.98px) {
    .footer-family-slot {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
    footer.has-footer-family > .footer-family-wrap {
        position: static;
        justify-content: flex-end;
        margin-left: auto;
        padding: 0 1rem 0.5rem;
        display: flex;
        width: 100%;
    }
    footer.has-footer-family,
    #site-page-footer.has-footer-family {
        padding-bottom: 0.25rem;
    }
    footer.has-footer-family > .max-w-5xl,
    footer.has-footer-family > .mi-page-footer__bar {
        padding-bottom: 0.35rem;
    }
    .site-footer-util {
        justify-content: flex-end;
    }
}
/* 클릭 순간 transition 끄기 → 미세 점프 완화 */
#site-nav .nav-link:active {
    transform: none;
    padding: 0.35rem 0.18rem;
    border-width: 1px;
    letter-spacing: -0.01em;
    transition: none;
}
#site-nav .nav-link:focus {
    outline: none;
}
#site-nav .nav-link:focus-visible {
    outline: 2px solid rgba(15, 23, 42, 0.32);
    outline-offset: 0;
}

/* 고정 헤더: backdrop-filter 제거로 탭/호버 시 GPU·합성 부담 완화 */
#site-nav {
    transition:
        background-color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
}

#site-nav:not(.nav-is-solid) {
    background-color: rgba(255, 255, 255, 0.1);
    border-bottom-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

#site-nav.nav-is-solid {
    background-color: var(--cti-nav-bg);
    border-bottom-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 12px 40px -18px rgba(15, 23, 42, 0.12);
}

#site-nav:not(.nav-is-solid) .nav-link {
    color: rgba(248, 250, 252, 0.9);
}
#site-nav:not(.nav-is-solid) .nav-link:hover:not(.nav-link-active) {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}
#site-nav:not(.nav-is-solid) .nav-link-active {
    background-color: rgba(248, 250, 252, 0.92);
    color: rgb(15 23 42) !important;
}
#site-nav:not(.nav-is-solid) .nav-link-active:hover {
    color: rgb(15 23 42) !important;
    background-color: rgb(241 245 249);
}
#site-nav:not(.nav-is-solid) .nav-link:active:not(.nav-link-active) {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}
#site-nav:not(.nav-is-solid) .nav-link.nav-link-active:active {
    background-color: rgba(248, 250, 252, 0.92);
    color: rgb(15 23 42) !important;
}
#site-nav:not(.nav-is-solid) .nav-logo {
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));
}
#site-nav.nav-is-solid .nav-logo {
    filter: none;
}

#site-nav.nav-is-solid .nav-link:hover:not(.nav-link-active) {
    background-color: rgba(15, 23, 42, 0.06);
}
#site-nav.nav-is-solid .nav-link-active {
    background-color: rgb(241 245 249);
    color: rgb(15 23 42) !important;
}
#site-nav.nav-is-solid .nav-link-active:hover {
    background-color: rgb(226 232 240);
    color: rgb(15 23 42) !important;
}
#site-nav.nav-is-solid .nav-link:active:not(.nav-link-active) {
    background-color: rgba(15, 23, 42, 0.06);
    color: rgb(15 23 42);
}
#site-nav.nav-is-solid .nav-link.nav-link-active:active {
    background-color: rgb(241 245 249);
    color: rgb(15 23 42) !important;
}

/* 밝은 배경 페이지: 항상 메인 스크롤 후와 동일한 솔리드 바 */
html.nav-sub #site-nav {
    background-color: var(--cti-nav-bg) !important;
    border-bottom-color: rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 12px 40px -18px rgba(15, 23, 42, 0.12) !important;
}
html.nav-sub #site-nav .nav-link {
    color: rgb(71 85 105) !important;
}
html.nav-sub #site-nav .nav-link:hover:not(.nav-link-active) {
    color: rgb(15 23 42) !important;
    background-color: rgba(15, 23, 42, 0.06) !important;
}
html.nav-sub #site-nav .nav-link-active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.nav-sub #site-nav .nav-link-active:hover {
    background-color: rgb(226 232 240) !important;
    color: rgb(15 23 42) !important;
}
html.nav-sub #site-nav .nav-link:active:not(.nav-link-active) {
    background-color: rgba(15, 23, 42, 0.06) !important;
    color: rgb(15 23 42) !important;
}
html.nav-sub #site-nav .nav-link.nav-link-active:active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.nav-sub #site-nav .nav-logo {
    filter: none !important;
}

/* 메인(index): 히어로 최상단에서도 밝은 바·진한 글자(서브페이지와 동일 톤) */
html.nav-home-light #site-nav:not(.nav-is-solid),
html.nav-home-light #site-nav.nav-is-solid {
    background-color: var(--cti-nav-bg) !important;
    border-bottom-color: rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 12px 40px -18px rgba(15, 23, 42, 0.12) !important;
}
html.nav-home-light #site-nav:not(.nav-is-solid) .nav-link,
html.nav-home-light #site-nav.nav-is-solid .nav-link {
    color: rgb(71 85 105) !important;
}
html.nav-home-light #site-nav:not(.nav-is-solid) .nav-link:hover:not(.nav-link-active),
html.nav-home-light #site-nav.nav-is-solid .nav-link:hover:not(.nav-link-active) {
    color: rgb(15 23 42) !important;
    background-color: rgba(15, 23, 42, 0.06) !important;
}
html.nav-home-light #site-nav:not(.nav-is-solid) .nav-link-active,
html.nav-home-light #site-nav.nav-is-solid .nav-link-active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.nav-home-light #site-nav:not(.nav-is-solid) .nav-link-active:hover,
html.nav-home-light #site-nav.nav-is-solid .nav-link-active:hover {
    color: rgb(15 23 42) !important;
    background-color: rgb(226 232 240) !important;
}
html.nav-home-light #site-nav .nav-link:active:not(.nav-link-active) {
    background-color: rgba(15, 23, 42, 0.06) !important;
    color: rgb(15 23 42) !important;
}
html.nav-home-light #site-nav .nav-link.nav-link-active:active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.nav-home-light #site-nav:not(.nav-is-solid) .nav-logo,
html.nav-home-light #site-nav.nav-is-solid .nav-logo {
    filter: none !important;
}

html.cert-focus #site-nav {
    background-color: var(--cti-nav-bg) !important;
    border-bottom-color: rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 8px 30px -16px rgba(15, 23, 42, 0.1) !important;
}
html.cert-focus #site-nav .nav-link {
    color: rgb(71 85 105) !important;
}
html.cert-focus #site-nav .nav-link:hover:not(.nav-link-active) {
    color: rgb(15 23 42) !important;
    background-color: rgba(15, 23, 42, 0.06) !important;
}
html.cert-focus #site-nav .nav-link-active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.cert-focus #site-nav .nav-link-active:hover {
    background-color: rgb(226 232 240) !important;
    color: rgb(15 23 42) !important;
}
html.cert-focus #site-nav .nav-link:active:not(.nav-link-active) {
    background-color: rgba(15, 23, 42, 0.06) !important;
    color: rgb(15 23 42) !important;
}
html.cert-focus #site-nav .nav-link.nav-link-active:active {
    background-color: rgb(241 245 249) !important;
    color: rgb(15 23 42) !important;
}
html.cert-focus #site-nav .nav-logo {
    filter: none !important;
}

/* 모바일 햄버거 — 데스크톱에서는 숨김 */
.nav-mobile-toggle {
    display: none;
}
.site-nav-drawer,
.site-nav-drawer-backdrop {
    display: none;
}

@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    #site-nav > div {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    #site-nav > div > div {
        gap: 0.5rem !important;
        height: 3.35rem !important;
    }

    #site-nav .nav-logo {
        height: 2.15rem !important;
        max-height: 2.15rem !important;
        max-width: 7.5rem !important;
    }

    /* 가로 스크롤 메뉴 링크 줄만 숨김 (언어/햄버거 트레이는 유지) */
    #site-nav .site-nav__links {
        flex: 0 0 auto !important;
        justify-content: flex-end !important;
        overflow: visible !important;
        min-width: 0;
        column-gap: 0.4rem;
    }

    #site-nav .site-nav__links > .flex.flex-1,
    #site-nav .site-nav__links > .flex.flex-nowrap {
        display: none !important;
    }

    #site-nav .site-nav__links > .ml-2.flex.shrink-0 {
        display: flex !important;
        align-items: center;
        gap: 0.4rem;
        margin-left: 0 !important;
    }

    #site-nav .nav-family-select {
        display: none !important;
    }

    #site-nav .nav-lang-select {
        flex: 0 0 auto;
        width: 3.4rem;
        min-width: 3.4rem;
        max-width: 3.4rem;
        height: 2rem;
        border-radius: 0.5rem;
        font-size: 0.65rem;
        padding: 0.15rem 0.95rem 0.15rem 0.4rem;
        background-position: right 0.3rem center;
        background-size: 0.7rem;
    }

    .nav-mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.35rem;
        height: 2.35rem;
        flex-shrink: 0;
        margin: 0;
        padding: 0;
        border: 1.5px solid #f0c4c8;
        border-radius: 0.65rem;
        background: #fff;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .nav-mobile-toggle:focus-visible {
        outline: 2px solid #b4232a;
        outline-offset: 2px;
    }
    .nav-mobile-toggle__bars {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.28rem;
        width: 1.05rem;
    }
    .nav-mobile-toggle__bars span {
        display: block;
        height: 2px;
        border-radius: 999px;
        background: #1e293b;
    }
    .nav-mobile-toggle__bars span:nth-child(1),
    .nav-mobile-toggle__bars span:nth-child(2) {
        width: 100%;
    }
    .nav-mobile-toggle__bars span:nth-child(3) {
        width: 58%;
    }

    .site-nav-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 60;
        background: rgba(15, 23, 42, 0.38);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    .site-nav-drawer-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .site-nav-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        z-index: 70;
        width: min(18.5rem, 86vw);
        height: auto;
        max-height: min(100dvh, 100%);
        background: #fff;
        box-shadow: -12px 0 40px -18px rgba(15, 23, 42, 0.35);
        transform: translateX(104%);
        transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
        overflow: hidden;
        border-bottom-left-radius: 0.75rem;
    }
    .site-nav-drawer.is-open {
        transform: translateX(0);
    }

    .site-nav-drawer__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 1.05rem 1.1rem 0.95rem;
        border-bottom: 1px solid #e8edf3;
    }
    .site-nav-drawer__title {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: -0.02em;
        color: #9b1c23;
    }
    .site-nav-drawer__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        border: none;
        border-radius: 0.4rem;
        background: transparent;
        color: #64748b;
        font-size: 1.35rem;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .site-nav-drawer__close:hover,
    .site-nav-drawer__close:focus-visible {
        color: #0f172a;
        background: #f1f5f9;
    }

    .site-nav-drawer__list {
        flex: 0 1 auto;
        margin: 0;
        padding: 0;
        list-style: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-nav-drawer__list li:last-child {
        border-bottom: none;
    }
    .site-nav-drawer__list li {
        border-bottom: 1px solid #e8edf3;
    }
    .site-nav-drawer__list a {
        display: block;
        padding: 1.05rem 1.15rem;
        font-size: 0.98rem;
        font-weight: 600;
        letter-spacing: -0.02em;
        color: #0f172a;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .site-nav-drawer__list a:active {
        background: #f8fafc;
    }
    .site-nav-drawer__list a.is-active {
        color: #9b1c23;
    }

    body.nav-drawer-open {
        overflow: hidden;
    }
}

@media (min-width: 768px) {
    .nav-mobile-toggle,
    .site-nav-drawer,
    .site-nav-drawer-backdrop {
        display: none !important;
    }
}
