/* ─────────────────────────────────────────────────────────────────────────────
   CUTIB 2026 — Navigation (Figma "Nav Off" 321:3284 / "Nav On" 317:2968)
   Fixed cream card: logo bar (60px) + black menu button.
   The button opens the full menu (numbered groups + sub menus + CONTACT)
   below the bar — height animated in main.js (initNav).
───────────────────────────────────────────────────────────────────────────── */

.site-nav {
    /* Figma icons (ico_gnb · UI Icon), drawn as masks */
    --icon-gnb-menu:  url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='4' y1='5' x2='20' y2='5' stroke-width='2' stroke='white'/%3E%3Cline x1='4' y1='11' x2='20' y2='11' stroke-width='2' stroke='white'/%3E%3Cline x1='4' y1='17' x2='20' y2='17' stroke-width='2' stroke='white'/%3E%3C/svg%3E");
    --icon-gnb-close: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='6.29289' y1='17.2929' x2='17.6066' y2='5.97918' stroke-width='2' stroke='white'/%3E%3Cline x1='17.7071' y1='17.2929' x2='6.3934' y2='5.97918' stroke-width='2' stroke='white'/%3E%3C/svg%3E");
    --icon-gnb-arrow: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 12H21M12.9 20.1L21 12L12.9 3.9' stroke-width='2' stroke-linecap='square' stroke-linejoin='round' stroke='white'/%3E%3C/svg%3E");

    position: fixed;
    top: var(--nav-pad-top);
    left: var(--nav-pad-left);
    z-index: var(--z-nav);

    display: flex;
    flex-direction: column;
    width: var(--nav-width);                 /* 600px */
    max-height: calc(100vh - var(--nav-pad-top) * 2);
    max-height: calc(100dvh - var(--nav-pad-top) * 2);

    background-color: var(--color-cream);   /* #f4f2ed */
    border-radius: var(--radius-nav);       /* 6px */
    overflow: hidden;
    opacity: 0;                             /* GSAP autoAlpha (initNavReveal) */
}

/* ── Header bar: logo | (language) | menu button ───────────────────────── */

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    height: 60px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    flex: 1 0 0;
    height: 60px;
    padding: 10px 20px;
}

.nav-logo img,
.nav-logo svg {
    width: 78px;
    height: 24px;
    color: var(--color-black);
}

.nav-logo__text {
    font-family: var(--font-ui);
    font-size: var(--text-nav);
    color: var(--color-black);
}

.nav-header .lang-switch {
    margin-right: 20px;
}

.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    padding: 0;
    background-color: var(--color-black);
    border: 0;
    cursor: pointer;
    transition: background-color var(--ease-default);
}

.nav-toggle:hover {
    background-color: var(--color-charcoal);
}

.nav-toggle__icon {
    display: block;
    width: 24px;
    height: 24px;
    background-color: var(--color-white);
    -webkit-mask: var(--icon-gnb-menu) no-repeat center / 24px 24px;
            mask: var(--icon-gnb-menu) no-repeat center / 24px 24px;
}

.site-nav.is-open .nav-toggle__icon {
    -webkit-mask-image: var(--icon-gnb-close);
            mask-image: var(--icon-gnb-close);
}

/* ── Panel (closed: height 0) ──────────────────────────────────────────── */

.nav-panel {
    flex: 0 1 auto;
    min-height: 0;          /* scrolls inside the nav max-height */
    height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-nav.is-open .nav-panel {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* One menu group: 01 · TITLE / sub links */
.nav-group {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    border-top: 1px solid #666;
    color: var(--color-black);
    line-height: 1;
    word-break: keep-all;
}

.nav-group__head {
    display: flex;
    align-items: center;
}

/* + / − toggle at the right end of a 1-depth item */
.nav-group__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin: -4px 0 -4px auto;
    padding: 0;
    background: none;
    border: 0;
    color: var(--color-black);
    cursor: pointer;
    transition: color var(--ease-default);
}

.nav-group__toggle-icon,
.nav-group__toggle-icon::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1.5px;
    background-color: currentColor;
    transform: translate(-50%, -50%);
}

.nav-group__toggle-icon::after {
    content: '';
    transform: translate(-50%, -50%) rotate(90deg);
    transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
}

.nav-group.is-open .nav-group__toggle-icon::after {
    transform: translate(-50%, -50%) rotate(0deg);   /* + → − */
}

/* 2-depth: collapsed until the toggle opens it (height animated in main.js) */
.nav-group__sub-wrap {
    height: 0;
    overflow: hidden;
}

.nav-group__num {
    width: 80px;
    flex-shrink: 0;
    font-family: var(--font-ui);            /* Space Mono */
    font-size: 14px;
    line-height: 1;
}

.nav-group__link {
    font-family: var(--font-body);          /* Pretendard */
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    transition: color var(--ease-default);
}

.nav-group__sub {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 30px 80px 0;    /* 30px = Figma gap between 1-depth and 2-depth */
}

.nav-group__sub-link {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
    transition: color var(--ease-default);
}

/* Hover · current page → key color */
.nav-group__link:hover,
.nav-group__sub-link:hover,
.nav-group.is-current .nav-group__link,
.nav-group__sub-link.is-current,
.nav-group__toggle:hover {
    color: var(--color-key);
}

/* ── CONTACT row (dark) ────────────────────────────────────────────────── */

.nav-cta {
    display: flex;
    align-items: stretch;
    flex-shrink: 0;
    background-color: rgba(0, 0, 0, 0.8);
    border-top: 1px solid #666;
    color: var(--color-white);
    transition: background-color var(--ease-default);
}

.nav-cta:hover {
    background-color: var(--color-black);
}

.nav-cta__txt {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px 30px 100px;
    font-family: var(--font-body);
    line-height: 1;
}

.nav-cta__title {
    font-size: 20px;
}

.nav-cta__desc {
    font-size: 14px;
}

.nav-cta__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    flex-shrink: 0;
    border-left: 1px solid var(--color-black);
}

.nav-cta__icon {
    display: block;
    width: 24px;
    height: 24px;
    background-color: var(--color-white);
    -webkit-mask: var(--icon-gnb-arrow) no-repeat center / 24px 24px;
            mask: var(--icon-gnb-arrow) no-repeat center / 24px 24px;
    transition: transform var(--ease-default);
}

.nav-cta:hover .nav-cta__icon {
    transform: translateX(4px);
}

/* ── Language switch (WPML) ─────────────────────────────────────────────── */

.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switch a {
    font-family: var(--font-ui);
    font-size: 12px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.4);
    transition: color var(--ease-default);
}

.lang-switch a:hover,
.lang-switch a.is-active {
    color: var(--color-black);
}


/* ══════════════════════════════════════════════════════════════════════════
   MOBILE (≤ 980px) — same card, full width
══════════════════════════════════════════════════════════════════════════ */

@media screen and (max-width: 980px) {

    .nav-group__num {
        width: 60px;
    }

    .nav-group__sub {
        padding: 30px 60px 0;
    }

    .nav-cta__txt {
        padding-left: 80px;
    }
}
