/* 네비 4형(head4) — 흰 띠 확장형 · 2026-11-08 (최부장님 지시)
   index.html 의 add_stylesheet() 가 이 파일을 부른다. 수정하면 filemtime 으로 캐시가 자동 갱신된다.
   PC(1024px 이상)만 새로 만들었다. 모바일(1023px 이하) 부분은 head/style.css 와 같다.

   오버 모션 — #header 에 --showSubnav 가 들어오면 (11/8 개편: 중메뉴는 1형처럼 대메뉴마다 밑에 세로로)
     ① 왼쪽 흰 면이 scaleX(0→1) 로 펼쳐진다(origin right · .3s)
     ② 대메뉴 칸이 왼쪽부터 차례로 넓어진다(width --w0→--w1 · .6s · 칸마다 .05s 늦게) — 띠가 왼쪽으로만 늘어난다.
        두 폭은 index.html 의 fit() 이 잰다. 자리가 모자라면 --hd4-spread 보다 좁힌다(로고를 덮거나 햄버거를 밀어내지 않게)
     ③ 흰 판이 scaleY(0→1) 로 내려온다(origin top · .35s · 지연 .3s) — 높이는 가장 긴 중메뉴 칸(스크립트가 --hd4-drop-h)
     ④ 중메뉴 칸이 왼쪽부터 차례로 나타난다(opacity·translateY · 지연 .6s + 칸마다 .05s)
     ⑤ 본문 덮개 .6 · 로고 원래 색(글자 로고 #1b1c21) · 고른 대메뉴 밑줄이 translateY 로 올라온다
   닫힐 때는 역순이다(아래 기본값의 지연이 닫힘 순서, --showSubnav 쪽 지연이 열림 순서). */

:root {
    --hd4-h: 90px;
    --hd4-ease: cubic-bezier(.4, 0, .2, 1);
    --hd4-ink: #1b1c21;
}

.mobileMenu_style1 .mobileMenu_top .close {
    right: 20px !important;
}

/* =========================================
   [PC] 바 (1024px 이상)
   ========================================= */
.hd4 .hd4-bar {
    position: fixed;
    top: 0;                       /* 회원 줄이 있으면 member_bar.php 가 32px 로 내리고 스크롤에 맞춰 옮긴다 */
    left: 0;
    width: 100%;
    height: var(--hd4-h);
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    background: var(--c-primary, #253D67);   /* 위가 흰 페이지: 왼쪽 면을 메인색으로 — 흰 글자 로고가 보이게 */
    transition: background-color .4s var(--hd4-ease);
}
/* 위가 사진인 블럭(.stair-top)이 있는 페이지만 맨 위에서 왼쪽 면을 투명하게 */
body:has(.stair-top) .hd4 .hd4-bar { background: transparent; }
/* 페이지를 다 읽기 전(.--ready 없음)에는 왼쪽 면을 칠하지 않는다 — .stair-top 은 바보다 뒤에 읽혀서, 칠해 두면 접속 때 메인색이 나왔다 사라진다(11/8 최부장님 지시) */
.hd4:not(.--ready) .hd4-bar { background: transparent; transition: none; }
/* 팝업레이어 안내 글자(#hd_pop .sound_only) — 이 테마에는 숨김 규칙이 없어 화면 맨 위에 그려진다. 바가 투명하면 드러나므로 화면에서만 감춘다(읽기 프로그램에는 남는다) */
body:has(.hd4) #hd_pop .sound_only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
/* 스크롤하면(--hideStuff) 어느 페이지든 왼쪽 메인색 면을 없앤다 — 오른쪽 흰 띠는 그대로(11/8 최부장님 지시).
   면이 없어지면 바 빈자리로 비치는 본문을 누를 수 있어야 하므로, 바 자체만 클릭을 통과시킨다(로고·띠는 그대로 눌린다) */
.hd4.--hideStuff .hd4-bar { background: transparent; }
.hd4.--hideStuff:not(.--showSubnav) .hd4-bar { pointer-events: none; }
.hd4.--hideStuff .hd4-bar > * { pointer-events: auto; }
.hd4.--hideStuff .hd4-band { box-shadow: 0 3px 10px rgba(0, 0, 0, .08); }

/* 로고 */
.hd4 .hd4-logo {
    position: relative;
    z-index: 2;                   /* 펼쳐지는 흰 면(z 1) 위 */
    display: flex;
    align-items: center;
    padding: 0 40px 0 80px;
    white-space: nowrap;
}
.hd4 .hd4-logo a { display: inline-flex; align-items: center; }
/* 이미지 로고 — 바 위에서는 흰색, 흰 면이 펼쳐지면 원래 색. 글자 로고(.logo-text)와 같은 시점·같은 전환이다.
   filter 는 투명 PNG 를 전제로 한다(바탕까지 칠해진 PNG 는 흰 사각형이 된다). 모바일(.mobile-logo)은 바가 흰색이라 원래 색 그대로 */
.hd4 .hd4-logo img { height: 45px; width: auto; vertical-align: middle; filter: brightness(0) invert(1); transition: filter .3s var(--hd4-ease) .3s; }
.hd4.--showSubnav .hd4-logo img { filter: brightness(1) invert(0); transition-delay: 0s; }
.hd4 .hd4-bar .logo-text { color: #fff; transition: color .3s var(--hd4-ease) .3s; }
.hd4 .hd4-bar .logo-text .logo-l2 { opacity: .7; }
.hd4.--showSubnav .hd4-bar .logo-text { color: var(--hd4-ink); transition-delay: 0s; }
.hd4.--showSubnav .hd4-bar .logo-text .logo-l2 { opacity: .45; }
/* 스크롤 — 메인색 면이 없어져 본문 위에 놓이므로 로고는 원래 색(맨 위로 돌아오면 다시 흰색) */
.hd4.--hideStuff .hd4-logo img { filter: brightness(1) invert(0); transition-delay: 0s; }
.hd4.--hideStuff .hd4-bar .logo-text { color: var(--hd4-ink); transition-delay: 0s; }
.hd4.--hideStuff .hd4-bar .logo-text .logo-l2 { opacity: .45; }

/* 오른쪽 흰 띠 — 폭은 화면 절반 이상, 대메뉴가 많으면 내용만큼 늘어난다 */
.hd4 .hd4-band {
    position: relative;           /* z-index 를 주지 않는다 — ::before 가 바의 쌓임 맥락에서 로고 아래에 놓여야 한다 */
    display: flex;
    align-items: stretch;
    min-width: 50%;
    max-width: calc(100% - 220px);
    padding-left: 30px;
    background: #fff;
    transition: box-shadow .3s var(--hd4-ease);
}
/* 띠 왼쪽 끝에서 화면 왼쪽 끝까지 덮는 흰 면 */
.hd4 .hd4-band::before {
    content: '';
    position: absolute;
    z-index: 1;
    top: 0;
    right: 100%;
    width: 100vw;
    height: 100%;
    background: #fff;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform .3s var(--hd4-ease) .6s;   /* 닫힘: 마지막 */
    pointer-events: none;
}
.hd4.--showSubnav .hd4-band::before {
    transform: scaleX(1);
    transition-delay: 0s;                              /* 열림: 처음 */
}

/* 대메뉴 — 균등폭. 열리면 칸이 넓어진다(왼쪽부터 차례로) */
.hd4 .hd4-gnb {
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    margin: 0;
}
.hd4 { --hd4-spread: 168px; }    /* 열렸을 때 칸 폭(간격 여유) — 자리가 모자라면 index.html 의 fit() 이 줄인다 */
.hd4 .hd4-gnb { justify-content: flex-end; }
/* 닫힌 모양 — 띠 폭을 대메뉴가 나눠 갖는다. fit() 은 이 상태에서 칸마다 폭을 잰다 */
.hd4 .menu-item {
    position: relative;           /* 중메뉴 칸의 기준 */
    flex: 1 1 0;
    min-width: 110px;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
/* 잰 뒤(.hd4-fit) — 칸마다 잰 폭(--w0)에서 열린 폭(--w1)으로 넓히기만 한다.
   🔴 나눠 갖는 상태(flex 1)에서 min-width 만 키우면 앞 칸이 넓어지는 동안 뒤 칸이 좁아져 글자가 오른쪽으로 밀렸다(11/8 1920폭 최대 24px 실측).
      칸 폭을 고정해 두면 띠 오른쪽 끝이 고정이라 글자는 왼쪽으로만 간다. */
.hd4.hd4-fit .menu-item {
    flex: 0 0 auto;
    width: var(--w0);
    min-width: 0;
    transition: width .6s cubic-bezier(.22, .61, .36, 1) .25s;   /* 닫힘: 중메뉴가 걷힌 뒤 한꺼번에 */
}
.hd4.hd4-fit.--showSubnav .menu-item {
    width: var(--w1);
    transition-delay: calc(.08s + var(--i, 0) * .05s); /* 열림: 왼쪽부터 */
}
.hd4 .menu-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--hd4-ink);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;             /* 밑줄이 아래에서 올라오는 동안 칸 밖은 가린다 */
    transition: color .25s var(--hd4-ease);
}
.hd4 .menu-link::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 22px;
    width: 24px;
    height: 2px;
    margin-left: -12px;
    background: var(--c-primary, #253D67);
    opacity: 0;
    transform: translateY(14px);
    transition: transform .3s var(--hd4-ease), opacity .3s var(--hd4-ease);
}
.hd4 .menu-link:hover,
.hd4 .menu-link.is-over,
.hd4 .menu-link.active { color: var(--c-primary, #253D67); }
.hd4 .menu-link:hover::after,
.hd4 .menu-link.is-over::after,
.hd4 .menu-link.active::after { opacity: 1; transform: translateY(0); }

/* 중메뉴 칸 — 대메뉴 바로 밑, 가운데 맞춤 세로 목록(1형과 같은 모양). 흰 판(.hd4-drop) 위에 놓인다 */
.hd4 .hd4-sub {
    position: absolute;
    z-index: 4;
    top: 100%;
    left: -30px;
    right: -30px;
    margin: 0;
    padding: 24px 0 30px;
    list-style: none;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s var(--hd4-ease), transform .2s var(--hd4-ease), visibility 0s linear .2s;   /* 닫힘: 처음 */
}
.hd4.--showSubnav .hd4-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .4s var(--hd4-ease), transform .4s var(--hd4-ease), visibility 0s;
    transition-delay: calc(.6s + var(--i, 0) * .05s); /* 열림: 넷째, 왼쪽부터 */
}
.hd4 .hd4-sub li { margin: 0; padding: 0; }
.hd4 .hd4-sub a {
    display: inline-block;
    padding: 7px 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: #666;
    white-space: nowrap;
    text-decoration: none;
    transition: color .2s;
}
.hd4 .hd4-sub a:hover { color: var(--c-primary, #253D67); }

/* 번역 · 문의 */
.hd4 .head-right { display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.hd4 .inquiry-btn {
    background-color: var(--c-primary, #253D67);
    color: var(--c-bg);
    padding: 12px 26px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: background-color .3s;
}
/* 오버 색은 bg_sub.php 의 .inquiry-btn.btn_site_bg:hover 한 곳에서 지정한다(1형과 같다) */
.hd4 .inquiry-btn:hover { color: var(--c-bg) !important; }

/* 전체 메뉴 단추 */
.hd4 .hd4-burger {
    flex: 0 0 var(--hd4-h);
    width: var(--hd4-h);
    height: var(--hd4-h);
    border: 0;
    border-left: 1px solid #eceef1;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
}
.hd4 .hd4-burger span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--hd4-ink);
    transition: width .3s var(--hd4-ease), background-color .3s;
}
.hd4 .hd4-burger span:nth-child(2) { width: 18px; margin-left: 8px; }
.hd4 .hd4-burger:hover span { background: var(--c-primary, #253D67); }
.hd4 .hd4-burger:hover span:nth-child(2) { width: 26px; margin-left: 0; }

/* =========================================
   [PC] 풀다운 흰 판 — 중메뉴 칸들 뒤
   ========================================= */
.hd4 .hd4-drop {
    position: absolute;
    z-index: 3;
    top: 100%;
    left: 0;
    width: 100%;
    height: var(--hd4-drop-h, 220px);
    background: #fff;
    border-top: 1px solid #eceef1;
    box-shadow: 0 18px 30px rgba(0, 0, 0, .06);
    transform: scaleY(0);
    transform-origin: center top;
    visibility: hidden;
    transition: transform .35s var(--hd4-ease) .2s, visibility 0s linear .55s;   /* 닫힘: 둘째 */
}
.hd4.--showSubnav .hd4-drop {
    transform: scaleY(1);
    visibility: visible;
    transition: transform .35s var(--hd4-ease) .3s, visibility 0s linear .3s;   /* 열림: 셋째 */
}

/* 본문 덮개 */
.hd4 .hd4-dim {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: #000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s var(--hd4-ease) .3s, visibility 0s linear .6s;
}
.hd4.--showSubnav .hd4-dim {
    opacity: .6;
    visibility: visible;
    transition: opacity .3s var(--hd4-ease) .3s, visibility 0s linear 0s;
}

/* =========================================
   [PC] 전체 메뉴 덮개 (햄버거)
   ========================================= */
.hd4 .hd4-full {
    position: fixed;
    inset: 0;
    z-index: 3000;
    visibility: hidden;
    transition: visibility 0s linear .7s;
}
.hd4 .hd4-full.is-open { visibility: visible; transition-delay: 0s; }
.hd4 .hd4-full-bg {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform .5s var(--hd4-ease) .2s;
}
.hd4 .hd4-full.is-open .hd4-full-bg { transform: scaleX(1); transition-delay: 0s; }
.hd4 .hd4-full-close {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    width: var(--hd4-h);
    height: var(--hd4-h);
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s var(--hd4-ease);
}
.hd4 .hd4-full.is-open .hd4-full-close { opacity: 1; transition-delay: .4s; }
.hd4 .hd4-full-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 2px;
    margin: -1px 0 0 -14px;
    background: var(--hd4-ink);
    transform: rotate(45deg);
}
.hd4 .hd4-full-close span + span { transform: rotate(-45deg); }
.hd4 .hd4-full-close:hover span { background: var(--c-primary, #253D67); }
.hd4 .hd4-full-in {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 140px 80px 80px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 40px 30px;
    align-content: start;
}
.hd4 .hd4-full-col {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .3s var(--hd4-ease), transform .3s var(--hd4-ease);
}
.hd4 .hd4-full.is-open .hd4-full-col {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .5s var(--hd4-ease), transform .5s var(--hd4-ease);
    transition-delay: calc(.35s + var(--i, 0) * .07s);
}
.hd4 .hd4-full-top {
    display: block;
    padding-bottom: 16px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--hd4-ink);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--hd4-ink);
    text-decoration: none;
}
.hd4 .hd4-full-col ul { list-style: none; margin: 0; padding: 0; }
.hd4 .hd4-full-col li a {
    display: block;
    padding: 7px 0;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    transition: color .2s;
}
.hd4 .hd4-full-top:hover,
.hd4 .hd4-full-col li a:hover { color: var(--c-primary, #253D67); }

@media (max-width: 1420px) {
    .hd4 .hd4-logo { padding-left: 30px; }
    .hd4 .hd4-full-in { padding-left: 30px; padding-right: 30px; }
    .hd4 { --hd4-spread: 150px; }
}
@media (max-width: 1240px) {
    .hd4 { --hd4-spread: 112px; }
    .hd4 .menu-item { min-width: 92px; }
    .hd4 .menu-link { font-size: 15px; padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .hd4 .hd4-band::before, .hd4 .hd4-drop, .hd4 .hd4-sub, .hd4 .menu-item, .hd4 .hd4-dim,
    .hd4 .hd4-full, .hd4 .hd4-full-bg, .hd4 .hd4-full-col, .hd4 .menu-link::after, .hd4 .hd4-logo img { transition-duration: 0s !important; transition-delay: 0s !important; }
}

/* =========================================
   [Mobile] 모바일 헤더 및 메뉴 (1023px 이하) — head/style.css 와 같다
   ========================================= */
.mobile-header-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--c-bg);
    border-bottom: 1px solid #eee;
    z-index: 1000;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo img {
    height: 35px;
    width: auto;
    vertical-align: middle;
}

.mobile-hamburger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1001;
}

.mobileMenu_style1 {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: var(--c-bg);
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    visibility: hidden;
}

.mobileMenu_style1.show {
    transform: translateX(0);
    visibility: visible;
}

.light_box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.light_box.show {
    opacity: 1;
    visibility: visible;
}

.mobileMenu_top {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #333;
    border-bottom: 1px solid #444;
}

.mobileMenu_top_content {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 15px;
}
.mobileMenu_top_content li a {
    color: var(--c-bg);
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
}

.mobileMenu_top .close {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-bg) !important;
    text-decoration: none;
    z-index: 3001;
    margin-right: 25px;
}

.mobile_menu_content {
    padding: 0;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.navclass {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile_sub_menu {
    border-bottom: 1px solid #f1f1f1;
    position: relative;
}

.mobile_sub_menu > a {
    display: block;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.mobile_sublink_button {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 55px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.mobile_sublink_button iconify-icon {
    font-size: 1.2rem;
    color: #999;
    pointer-events: none;
}

.mobile_sub_nvi {
    display: none;
    background: #fcfcfc;
    padding: 10px 0;
}

.mobile_sub_nvi.active {
    display: block;
}

.mobile_sub_nvi ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile_sub_nvi li a {
    display: block;
    padding: 8px 30px;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
}

/* =========================================
   [Media Queries] 반응형 분기점 — head 와 같다(1023/1024 · 1240)
   ========================================= */
@media (max-width: 1240px) {
    .inquiry-btn {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .nav-container,
    .hd4 .hd4-full,
    .hd4 .hd4-dim {
        display: none !important;
    }
    .mobile-header-bar {
        display: flex !important;
    }
}

@media (min-width: 1024px) {
    .mobile-header-bar,
    .mobileMenu_style1,
    .light_box {
        display: none !important;
    }
}
