/*
 * GNB D안(흰 패널) — 2026-12 메뉴 개편
 * 서버가 그린 메뉴(ul > li > a.depth1 + ol) 위에 gnb-plate.js 가 클래스를 붙였을 때만 적용된다.
 * JS가 없거나 실패하면 layout.css 의 기존 hover 드롭다운이 그대로 동작한다.
 */
:root {
    --gnb-paper : #fff;
    --gnb-btn : #f3f3f4;
    --gnb-btn-hover : #e9e9eb;
    --gnb-ink : #111;
    --gnb-ink-2 : #333;
    --gnb-muted : #6b6b70;
    --gnb-scrim : rgba(17, 17, 17, .32);
    --gnb-shadow : 0 18px 40px -24px rgba(17, 17, 17, .28);
    --gnb-dur : .42s;
    --gnb-dur-short : .2s;
    --gnb-ease : cubic-bezier(.22, 1, .36, 1);
}

/* ---------- PC: 화면 폭 흰 패널 ---------- */
/* 패널을 헤더(고정·transform) 기준으로 펼치려고 1depth li 의 기준점을 푼다 */
header.desktop_header.gnb-plate nav > ul > li { position : static; }
header.desktop_header.gnb-plate.is-plate-open { background-color : var(--gnb-paper); }
/* 키보드로 열어도 1depth 밑줄이 보이게 */
header.desktop_header.gnb-plate nav > ul > li.is-open .depth1 span:before { bottom : 0; opacity : 1; }

header.desktop_header.gnb-plate .gnb-panel {
    position : absolute; top : 100%; left : 0; right : 0;
    background-color : var(--gnb-paper); box-shadow : var(--gnb-shadow); border-top : 1px solid #eee;
    clip-path : inset(0 0 100% 0); visibility : hidden;
    transition : clip-path var(--gnb-dur) var(--gnb-ease), visibility 0s linear var(--gnb-dur);
}
header.desktop_header.gnb-plate li.is-open > .gnb-panel { clip-path : inset(0 0 -48px 0); visibility : visible; transition-delay : 0s; }
/* 열린 채로 다른 1depth 로 옮길 때는 다시 펼치지 않고 바로 바꾼다 */
header.desktop_header.gnb-plate .gnb-panel.is-instant,
header.desktop_header.gnb-plate .gnb-panel.is-instant :is(.gnb-panel__title, li) { transition : none; }

header.desktop_header.gnb-plate .gnb-panel__in { display : grid; grid-template-columns : minmax(0, 3fr) minmax(0, 10fr); gap : 2rem; max-width : 90rem; margin : 0 auto; padding : 2rem 2rem 2.4rem; }
header.desktop_header.gnb-plate .gnb-panel__title { font-size : 1.4rem; font-weight : 700; line-height : 1.25; color : var(--gnb-ink); letter-spacing : -.03em; }

/* layout.css 의 드롭다운(절대위치·고정폭·hover 노출) 규칙을 패널 안에서 되돌린다 */
header.desktop_header.gnb-plate nav .gnb-panel ol {
    position : static; transform : none; width : auto; min-width : 0; padding : 0; border : 0; border-radius : 0; background : none;
    opacity : 1; visibility : inherit; transition : none;
    display : grid; grid-template-columns : repeat(4, minmax(0, 1fr)); gap : .6rem; align-content : start;
}
header.desktop_header.gnb-plate nav .gnb-panel ol li { display : grid; }
header.desktop_header.gnb-plate nav .gnb-panel ol a {
    display : flex; align-items : center; justify-content : space-between; gap : .6rem;
    min-height : 2.8rem; padding : .55rem .8rem .55rem 1.1rem; border-radius : .6rem;
    background-color : var(--gnb-btn); color : var(--gnb-ink-2);
    font-size : .8rem; font-weight : 500; line-height : 1.4; white-space : normal; word-break : keep-all;
    transition : background-color var(--gnb-dur-short) ease, color var(--gnb-dur-short) ease;
}
header.desktop_header.gnb-plate nav .gnb-panel ol a:hover { background-color : var(--gnb-btn-hover); color : var(--gnb-ink); font-weight : 500; }
header.desktop_header.gnb-plate nav .gnb-panel ol a:active { background-color : var(--gnb-btn-hover); }
header.desktop_header.gnb-plate nav .gnb-panel ol a:focus-visible { outline : 2px solid var(--point); outline-offset : 2px; }
header.desktop_header.gnb-plate nav .gnb-panel ol a svg { flex : none; width : 1rem; height : 1rem; fill : currentColor; transition : transform var(--gnb-dur-short) ease; }
header.desktop_header.gnb-plate nav .gnb-panel ol a:hover svg { transform : translateX(3px); }

/* 패널 안 제목·버튼이 차례로 떠오른다 (--i 는 JS 가 순번으로 넣음) */
header.desktop_header.gnb-plate .gnb-panel :is(.gnb-panel__title, li) {
    opacity : 0; transform : translateY(10px);
    transition : opacity var(--gnb-dur-short) ease, transform var(--gnb-dur) var(--gnb-ease);
}
header.desktop_header.gnb-plate li.is-open > .gnb-panel :is(.gnb-panel__title, li) { opacity : 1; transform : none; transition-delay : calc(60ms + var(--i, 0) * 28ms); }

/* 패널 뒤 화면을 살짝 어둡게 (헤더 z-index 33 바로 아래) */
.gnb-scrim { position : fixed; inset : 0; z-index : 32; background-color : var(--gnb-scrim); opacity : 0; visibility : hidden; pointer-events : none; transition : opacity var(--gnb-dur) var(--gnb-ease), visibility 0s linear var(--gnb-dur); }
.gnb-scrim.is-on { opacity : 1; visibility : visible; transition-delay : 0s; }

/* 새 창으로 열리는 대메뉴(AX파트너): 모바일 메뉴와 같은 ↗ 표시 (title 은 마우스를 올려야 보여서 눈에 보이는 안내 추가) */
header.desktop_header nav > ul > li > .depth1[target="_blank"] span:after { content : "↗"; margin-left : .3em; font-size : .8em; font-weight : 500; color : var(--point); }
/* '약칭(정식명)' 꼴 메뉴명(특화SW): 약칭 굵게 + 정식명 한 줄 아래 */
.gnb-btn__code { display : block; font-weight : 600; color : var(--gnb-ink); }
.gnb-btn__full { display : block; font-size : .85em; color : var(--gnb-muted); }

@media ( max-width : 1300px ) {
    header.desktop_header.gnb-plate .gnb-panel__in { grid-template-columns : minmax(0, 2fr) minmax(0, 10fr); gap : 1.5rem; }
    header.desktop_header.gnb-plate .gnb-panel__title { font-size : 1.2rem; }
}

/* ---------- 모바일: 오른쪽에서 들어오는 전체 화면 + 회색 버튼 아코디언 ---------- */
header.mobile_header.gnb-plate-m nav { transform : translateX(100%); transition : transform var(--gnb-dur) var(--gnb-ease), visibility 0s linear var(--gnb-dur); }
header.mobile_header.gnb-plate-m.active nav { transform : none; transition-delay : 0s; }
header.mobile_header.gnb-plate-m ul ol { display : grid; grid-template-columns : minmax(0, 1fr); gap : .45rem; }
header.mobile_header.gnb-plate-m ul ol.is-sw { grid-template-columns : repeat(2, minmax(0, 1fr)); }
/* 접힌 상태(max-height 0)에서도 여백이 새지 않게 위아래 여백을 칸 안의 빈 줄로 준다 */
header.mobile_header.gnb-plate-m ul ol::before,
header.mobile_header.gnb-plate-m ul ol::after { content : ''; grid-column : 1 / -1; height : .3rem; }
header.mobile_header.gnb-plate-m ul ol.is-instant { transition : none; }
header.mobile_header.gnb-plate-m ul ol li { display : grid; margin : 0; }
header.mobile_header.gnb-plate-m ul ol a {
    display : flex; align-items : center; justify-content : space-between; gap : .5rem;
    min-height : 2.6rem; padding : .5rem .6rem .5rem .8rem; border-radius : .55rem;
    background-color : var(--gnb-btn); color : var(--gnb-ink-2);
    font-size : .8rem; font-weight : 500; line-height : 1.35; word-break : keep-all;
    transition : background-color var(--gnb-dur-short) ease;
}
header.mobile_header.gnb-plate-m ul ol a:before { display : none; }
header.mobile_header.gnb-plate-m ul ol a:active { background-color : var(--gnb-btn-hover); }
header.mobile_header.gnb-plate-m ul ol a:focus-visible { outline : 2px solid var(--point); outline-offset : 2px; }
header.mobile_header.gnb-plate-m ul ol a svg { flex : none; width : .9rem; height : .9rem; fill : currentColor; }
header.mobile_header.gnb-plate-m ul ol a span { font-weight : inherit; }
header.mobile_header.gnb-plate-m ul ol a .gnb-btn__code { font-weight : 600; }

@media ( prefers-reduced-motion : reduce ) {
    header.desktop_header.gnb-plate .gnb-panel,
    header.desktop_header.gnb-plate .gnb-panel :is(.gnb-panel__title, li),
    .gnb-scrim,
    header.mobile_header.gnb-plate-m nav { transition : none; }
    header.desktop_header.gnb-plate .gnb-panel :is(.gnb-panel__title, li) { transform : none; }
}

/* ---------- 전체 메뉴(햄버거): 시안 '③ 전체화면' — 어두운 전체 화면, 왼쪽 큰 대메뉴 + 오른쪽 하위 메뉴 ---------- */
/* gnb-plate.js 가 #sideMap 에 gnb-full 을 붙였을 때만 적용. 기존 #sideMap 규칙(layout.css)은 아래에서 덮는다 */
:root {
    --gnb-night : #1d1514;
    --gnb-on-night : #f7f4f3;
    --gnb-on-night-2 : #c9c2c0;
    --gnb-veil : rgba(18, 13, 12, .45);
    --gnb-glass-line : rgba(255, 255, 255, .22);
}
#sideMap.gnb-full {
    display : block; padding : 0; overflow-y : auto; isolation : isolate;
    background-color : var(--gnb-night); color : var(--gnb-on-night);
    opacity : 0; visibility : hidden;
    transition : opacity var(--gnb-dur) var(--gnb-ease), visibility 0s linear var(--gnb-dur);
}
#sideMap.gnb-full.active { opacity : 1; visibility : visible; transition-delay : 0s; }
#sideMap.gnb-full::after { content : ''; position : fixed; inset : 0; z-index : -1; background : linear-gradient(90deg, var(--gnb-night) 30%, var(--gnb-veil) 100%); }
#sideMap.gnb-full > .container { display : none; }

/* 대메뉴별 배경 사진: 고른 메뉴의 사진만 옅게 */
#sideMap.gnb-full .gnb-full__bg img { position : fixed; inset : 0; z-index : -2; width : 100%; height : 100%; object-fit : cover; opacity : 0; transform : scale(1.06); transition : opacity .8s var(--gnb-ease), transform 2.4s var(--gnb-ease); }
#sideMap.gnb-full .gnb-full__bg img.is-on { opacity : .42; transform : none; }

#sideMap.gnb-full .gnb-full__in { display : grid; grid-template-rows : auto minmax(0, 1fr); min-height : 100%; max-width : 90rem; margin : 0 auto; padding : 0 2rem; }
#sideMap.gnb-full .gnb-full__top { display : flex; align-items : center; justify-content : space-between; height : 5rem; }
#sideMap.gnb-full .gnb-full__top a { display : block; }
#sideMap.gnb-full .gnb-full__top img { display : block; width : 9.2rem; height : auto; }
#sideMap.gnb-full .close_btn { position : static; display : grid; place-items : center; width : 3rem; height : 3rem; border : 1px solid var(--gnb-glass-line); border-radius : 50%; background : none; color : var(--gnb-on-night); transition : background-color var(--gnb-dur-short) ease; }
#sideMap.gnb-full .close_btn:hover { background-color : rgba(255, 255, 255, .1); }
#sideMap.gnb-full .close_btn:active { background-color : rgba(255, 255, 255, .16); }
#sideMap.gnb-full .close_btn svg { width : 1.3rem; height : 1.3rem; fill : currentColor; }

/* 하위 메뉴 개수에 따라 대메뉴가 위아래로 움직이지 않게 위쪽 정렬 */
#sideMap.gnb-full .gnb-full__body { display : grid; grid-template-columns : minmax(0, 5fr) minmax(0, 7fr); gap : 4rem; align-items : start; padding-block : clamp(2rem, 9vh, 6rem) 4rem; }

/* 왼쪽: 번호 + 큰 대메뉴 */
#sideMap.gnb-full ul.gnb-full__dep1 { display : grid; gap : .2rem; justify-content : stretch; }
#sideMap.gnb-full ul.gnb-full__dep1 > li { width : auto; }
#sideMap.gnb-full .gnb-full__dep1 :is(a, button) {
    display : flex; align-items : baseline; gap : 1rem; width : 100%; padding : .3rem 0; border : 0; background : none;
    color : var(--gnb-on-night-2); font-size : clamp(2rem, 2.2vw + 1rem, 3.2rem); font-weight : 800; line-height : 1.25; letter-spacing : -.03em; text-align : left; cursor : pointer;
    transition : color var(--gnb-dur-short) ease, transform var(--gnb-dur) var(--gnb-ease);
}
#sideMap.gnb-full .gnb-full__dep1 :is(a, button):hover,
#sideMap.gnb-full .gnb-full__dep1 button[aria-expanded="true"] { color : var(--gnb-on-night); transform : translateX(12px); }
#sideMap.gnb-full .gnb-full__dep1 :is(a, button):active { color : var(--gnb-on-night); }
#sideMap.gnb-full .gnb-full__dep1 span { font-size : inherit; font-weight : inherit; }
#sideMap.gnb-full .gnb-full__dep1 small { min-width : 2ch; font-size : .8rem; font-weight : 600; color : var(--point); font-variant-numeric : tabular-nums; }
#sideMap.gnb-full .gnb-full__dep1 svg { width : .55em; height : .55em; fill : currentColor; align-self : center; }

/* 오른쪽: 고른 대메뉴의 하위 메뉴 2열 */
#sideMap.gnb-full .gnb-full__dep2 { padding-top : .6rem; }
#sideMap.gnb-full .gnb-full__dep2.is-swap { animation : gnbFullSwap var(--gnb-dur) var(--gnb-ease); }
@keyframes gnbFullSwap { from { opacity : 0; transform : translateY(12px); } }
#sideMap.gnb-full .gnb-full__dep2 h2 { margin-bottom : 2rem; font-size : 1.4rem; font-weight : 700; color : var(--gnb-on-night); }
#sideMap.gnb-full .gnb-full__dep2 ul { display : grid; grid-template-columns : repeat(2, minmax(0, 1fr)); gap : .2rem 2rem; }
#sideMap.gnb-full .gnb-full__dep2 ul > li { width : auto; }
#sideMap.gnb-full .gnb-full__dep2 a {
    display : flex; align-items : center; justify-content : space-between; gap : 1rem; padding : .9rem 0;
    border-bottom : 1px solid var(--gnb-glass-line); color : var(--gnb-on-night); font-size : 1rem; font-weight : 600; text-align : left; word-break : keep-all;
    transition : color var(--gnb-dur-short) ease, border-color var(--gnb-dur-short) ease;
}
#sideMap.gnb-full .gnb-full__dep2 a span { font-size : inherit; font-weight : inherit; }
#sideMap.gnb-full .gnb-full__dep2 a svg { flex : none; width : 1.1rem; height : 1.1rem; fill : currentColor; opacity : .5; transition : transform var(--gnb-dur-short) ease, opacity var(--gnb-dur-short) ease; }
#sideMap.gnb-full .gnb-full__dep2 a:hover { color : var(--point); border-color : var(--point); }
#sideMap.gnb-full .gnb-full__dep2 a:active { color : var(--point); }
#sideMap.gnb-full .gnb-full__dep2 a:hover svg { opacity : 1; transform : translateX(4px); }
#sideMap.gnb-full :is(a, button):focus-visible { outline : 2px solid var(--point); outline-offset : 3px; }

@media ( max-width : 1300px ) {
    #sideMap.gnb-full .gnb-full__body { gap : 2.5rem; }
}
@media ( prefers-reduced-motion : reduce ) {
    #sideMap.gnb-full,
    #sideMap.gnb-full .gnb-full__bg img,
    #sideMap.gnb-full .gnb-full__dep1 :is(a, button) { transition : none; }
    #sideMap.gnb-full .gnb-full__dep1 :is(a, button):hover,
    #sideMap.gnb-full .gnb-full__dep1 button[aria-expanded="true"] { transform : none; }
    #sideMap.gnb-full .gnb-full__dep2.is-swap { animation : none; }
}
