/* ============================================================
   renew/gnb.css — 리뉴얼 GNB (PC 메가드롭다운 + MO 흰 카드 풀스크린)
   출처: Figma GNB basic 6400:403 / hover 6400:453 (REST 실측) + Mo GNB Bar(-Click)
   격리: 전부 .mo-renew 루트 하위 스코프 → 레거시 전역 CSS 미오염(전역 채택 안전)
   실측 핵심: 흰 바 R20 on #fafafa, 좌우 15 margin, h58 → hover 자연확장,
             로고=이미지(MEDICAL O)+SEOUL 텍스트, 메뉴 #3c3c3c→#323232,
             LNB #777 / point #ff0000, hover 1px #ccc 라인,
             MO: 흰 둥근 카드 안에 헤더+2컬럼 메뉴 포함(클릭 시 카드 확장).
   ============================================================ */

/* 모바일 탭 시 파란 하이라이트 박스 제거(webkit tap highlight) */
* {
    -webkit-tap-highlight-color: transparent;
}

/* ---------- 고정 바 컨테이너 ---------- */
.mo-renew .mo-gnb {
    position: fixed;
    top: 15px;
    left: 0;
    right: 0;
    z-index: 1000;
    /* 좌우 갭은 hover/클릭을 막지 않도록 통과 */
    pointer-events: none;
}

/* 흰 둥근 카드 — overflow visible(언어 드롭다운/메가패널이 잘리지 않게) */
.mo-renew .mo-gnb-inner {
    pointer-events: auto;
    position: relative;
    width: 1890px;
    max-width: calc(100vw - 30px);
    margin: 0 auto;
    padding: 0 28px 0 40px;
    background: var(--mo-white);
    border-radius: var(--mo-r-xs);
    transition: min-height 0.4s var(--mo-fade-ease);
}

/* 상단 행(로고/주메뉴/유틸/햄버거) */
.mo-renew .mo-gnb-bar {
    display: flex;
    align-items: flex-start;
    min-height: 58px;
    transition: min-height 0.35s var(--mo-fade-ease);
}

/* ---------- 로고 (지점별 SVG, 지점명 포함) ---------- */
.mo-renew .mo-gnb-logo {
    display: flex;
    align-items: center;
    height: 58px;
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
}

.mo-renew .mo-gnb-logo-img {
    display: block;
    width: auto;
}

/* PC svg ~175x17, MO svg ~155x14 — 브레이크포인트로 교체 */
.mo-renew .mo-gnb-logo-pc {
    height: 17px;
}

.mo-renew .mo-gnb-logo-mo {
    display: none;
    height: 14px;
}

/* ---------- 가운데(주메뉴 + 드롭다운 패널) ---------- */
.mo-renew .mo-gnb-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-left: 141px;
}

.mo-renew .mo-gnb-nav {
    height: 58px;
    display: flex;
    align-items: center;
}

.mo-renew .mo-gnb-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 60px;
}

.mo-renew .mo-gnb-item {
    position: relative;
}

.mo-renew .mo-gnb-link {
    display: inline-block;
    font-family: var(--mo-font-kr);
    font-size: var(--mo-fs-point);
    line-height: 1.2;
    color: var(--mo-ink-2);
    text-decoration: none;
    padding: 6px 0;
    transition: color 0.2s ease;
}

.mo-renew .mo-gnb.is-open .mo-gnb-link,
.mo-renew .mo-gnb-link:hover {
    color: var(--mo-ink);
}

/* hover 하단 라인 1px #cccccc */
.mo-renew .mo-gnb-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--mo-line);
    transform: scaleX(0);
    transform-origin: center;
    /* 가운데부터 좌우로 퍼짐(요청) */
    transition: transform 0.25s var(--mo-fade-ease);
}

.mo-renew .mo-gnb-item.is-active .mo-gnb-link::after,
.mo-renew .mo-gnb-link:hover::after {
    transform: scaleX(1);
}

/* ---------- 메가드롭다운 패널(자체 클립) ---------- */
.mo-renew .mo-gnb-drop {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--mo-fade-ease);
}

.mo-renew .mo-gnb.is-open .mo-gnb-drop {
    max-height: 160px;
}

.mo-renew .mo-gnb-sub {
    list-style: none;
    margin: 0;
    padding: 30px 0 34px;
    display: none;
    flex-wrap: wrap;
    gap: 40px;
}

.mo-renew .mo-gnb-sub.is-shown {
    display: flex;
}

.mo-renew .mo-gnb-sublink {
    font-family: var(--mo-font-kr);
    font-size: var(--mo-fs-point);
    line-height: 1.2;
    color: var(--mo-sub);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mo-renew .mo-gnb-sublink:hover {
    color: var(--mo-ink);
}

.mo-renew .mo-gnb-sublink.is-point {
    color: var(--mo-red);
    margin-right: 20px;
}

/* 강조(point) 주메뉴 — hover/오픈 색 오버라이드보다 우선 */
.mo-renew .mo-gnb-link.is-point,
.mo-renew .mo-gnb.is-open .mo-gnb-link.is-point,
.mo-renew .mo-gnb-link.is-point:hover {
    color: var(--mo-red);
}

/* ---------- 우측 유틸(연구 · Login · KR) ---------- */
.mo-renew .mo-gnb-util {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 61px;
    flex: 0 0 auto;
}

.mo-renew .mo-gnb-util-link {
    font-family: var(--mo-font-kr);
    font-size: var(--mo-fs-point);
    line-height: 1.2;
    color: var(--mo-line);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mo-renew .mo-gnb-util-link:hover {
    color: var(--mo-sub);
}

/* 유틸 2단 메뉴(예: 연구 > 읽기) — 주메뉴와 동일한 메가패널로 가로 확장.
   하위는 .mo-gnb-drop 안 .mo-gnb-sub(가로 flex)로 렌더(gnb.ejs). 여기선 트리거만. */
.mo-renew .mo-gnb-util-item {
    display: inline-flex;
    align-items: center;
}

/* 언어 토글 */
.mo-renew .mo-gnb-lang {
    position: relative;
}

.mo-renew .mo-gnb-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: var(--mo-font-en);
    font-size: var(--mo-fs-point);
    color: var(--mo-line);
}

.mo-renew .mo-gnb-lang-caret {
    width: 8px;
    /* 화살표 가로 크기 */
    height: 8px;
    /* 화살표 세로 크기 */
    border: none;
    /* 기존 테두리 초기화 */
    border-bottom: 1px solid var(--mo-line);
    /* 라인 두께와 색상 */
    border-right: 1px solid var(--mo-line);
    transform: rotate(45deg);
    /* 45도 회전하여 아래 방향(V)으로 변경 */
    transition: transform 0.2s ease;
    display: inline-block;
    margin-bottom: 4px;
}

.mo-renew .mo-gnb-lang.is-open .mo-gnb-lang-caret {
    transform: rotate(225deg);
    margin-bottom: -4px;
}

/* 언어 확장: 박스 없이 토글 아래 평문으로 나열(디자이너 "국가 선택 시 확장 영역") */
.mo-renew .mo-gnb-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    text-align: right;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.mo-renew .mo-gnb-lang.is-open .mo-gnb-lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mo-renew .mo-gnb-lang-list a {
    display: block;
    padding: 0;
    margin-top: 12px;
    font-family: var(--mo-font-en);
    font-size: var(--mo-fs-point);
    line-height: 1;
    color: var(--mo-line);
    text-decoration: none;
}

.mo-renew .mo-gnb-lang-list a:hover {
    color: var(--mo-sub);
}

/* 언어 열림 = 메뉴처럼 흰 카드 확장(첨부3: 바가 KR+CH 감싸게) */
.mo-renew .mo-gnb.is-lang-open .mo-gnb-inner {
    min-height: 92px;
}

/* ---------- 햄버거(MO 전용, PC 숨김) ---------- */
/* 햄버거: 25px 2줄(실측 menu button 25x7), gap ~4 */
.mo-renew .mo-gnb-burger {
    display: none;
    flex: 0 0 auto;
    width: 25px;
    height: 44px;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 5px;
}

/* 2px 정수 → 두 줄 두께 균일(1.5px 서브픽셀 반올림으로 달라보이던 이슈 해결) */
.mo-renew .mo-gnb-burger-line {
    display: block;
    width: 25px;
    height: 1px;
    background: var(--mo-ink);
    transition: transform 0.3s var(--mo-fade-ease), opacity 0.2s ease;
}

/* ---------- 모바일 메뉴(흰 카드 안에 포함, 기본 접힘) ---------- */
.mo-renew .mo-gnb-mobile {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s var(--mo-fade-ease);
}

/* MO 플로팅 SNS — 기본 숨김(카드 레벨 오버레이). MO 메뉴 열림 시에만 우하단 고정 노출(아래 미디어쿼리). */
.mo-renew .mo-gnb-mobile-sns {
    display: none;
}

/* =============================================================
   모바일/협폭 (≤1800px → 햄버거, 디자인 기준 390)
   PC 가로 메뉴가 줄바꿈되기 전에 햄버거로 전환(지점별 메뉴 수 편차 대비
   가장 메뉴 많은 지점 기준 넉넉히 잡음). 줄바꿈 시작점 ~1580 → 1800 으로 선전환.
   ============================================================= */
@media (max-width: 1800px) {
    .mo-renew .mo-gnb {
        top: 15px;
    }

    .mo-renew .mo-float-btn {
        width: 24px;
        height: 24px;
    }

    .mo-renew .mo-float-btn.mo-float-naver {
        width: 22px;
        height: 22px;
    }

    /* 흰 둥근 카드(360/좌우15, R10 실측) — 헤더+메뉴를 한 카드에 담음 */
    .mo-renew .mo-gnb-inner {
        width: calc(100% - 30px);
        max-width: calc(100% - 30px);
        padding: 0 20px;
        border-radius: 10px;
        background: var(--mo-white);
    }

    .mo-renew .mo-gnb-bar {
        align-items: center;
        min-height: 44px;
    }

    /* 메뉴 오픈 시 흰 카드를 화면 하단(네이버/카카오 영역)까지 확장 — 첨부1 디자인 */
    .mo-renew .mo-gnb-root.is-mobile-open .mo-gnb-inner {
        min-height: calc(100vh - 30px);
    }

    /* 언어 열림 시 카드 확장(MO, 첨부3: 360x75) */
    .mo-renew .mo-gnb.is-lang-open .mo-gnb-inner {
        min-height: 78px;
    }

    .mo-renew .mo-gnb-logo {
        height: auto;
    }

    .mo-renew .mo-gnb-logo-pc {
        display: none;
    }

    .mo-renew .mo-gnb-logo-mo {
        display: block;
    }

    /* PC 주메뉴/유틸 텍스트 숨김 → 카드 내부 메뉴로 이동 */
    .mo-renew .mo-gnb-center,
    .mo-renew .mo-gnb-util-link,
    .mo-renew .mo-gnb-util-item {
        display: none;
    }

    .mo-renew .mo-gnb-util {
        height: auto;
        margin-left: auto;
        gap: 16px;
    }

    .mo-renew .mo-gnb-burger {
        display: flex;
        height: auto;
        margin-left: 20px;
    }

    /* 디자이너 코멘트: 메뉴 오픈 시 햄버거 두 줄의 상하 간격이 좁아짐(닫기 시 확장).
       X 회전 아님 — 첨부1 열린 상태도 좁혀진 ≡ 모양 유지. */
    .mo-renew .mo-gnb-root.is-mobile-open .mo-gnb-burger-line:nth-child(1) {
        transform: translateY(1px);
    }

    .mo-renew .mo-gnb-root.is-mobile-open .mo-gnb-burger-line:nth-child(2) {
        transform: translateY(-1px);
    }

    /* 메뉴: 흰 카드 안에서 펼쳐짐(상하 확장 이펙트) */
    .mo-renew .mo-gnb-root.is-mobile-open .mo-gnb-mobile {
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mo-renew .mo-gnb-mobile-cols {
        display: flex;
        gap: 16px;
        padding: 26px 0 36px;
    }

    /* 좌: 대분류 (15/lh18, 항목 간 48px, 활성=하단 1px #ccc 라인) */
    .mo-renew .mo-gnb-mcol-left {
        list-style: none;
        margin: 0;
        padding: 0;
        flex: 0 0 38%;
    }

    .mo-renew .mo-gnb-mcol-left li {
        margin-bottom: 30px;
    }

    .mo-renew .mo-gnb-mcat {
        font-family: var(--mo-font-kr);
        font-size: var(--mo-fs-point);
        line-height: 1.2;
        color: var(--mo-ink-2);
        text-decoration: none;
        display: inline-block;
    }

    .mo-renew .mo-gnb-mcat.is-muted {
        color: var(--mo-line);
    }

    /* 유틸 하위(2단) — 부모 아래 들여쓰기 */
    .mo-renew .mo-gnb-mcat-sub {
        padding-left: 12px;
        font-size: 14px;
    }

    .mo-renew .mo-gnb-mcat.is-active {
        color: var(--mo-ink);
        border-bottom: 1px solid var(--mo-line);
        padding-bottom: 6px;
    }

    /* 강조(point) 대분류 — muted/active 색보다 우선 */
    .mo-renew .mo-gnb-mcat.is-point,
    .mo-renew .mo-gnb-mcat.is-active.is-point {
        color: var(--mo-red);
    }

    /* 우: 활성 분류 서브 (15/lh18, #777, point 빨강) */
    .mo-renew .mo-gnb-mcol-right {
        flex: 1 1 auto;
        min-width: 0;
    }

    .mo-renew .mo-gnb-msub {
        list-style: none;
        margin: 0;
        padding: 0;
        display: none;
    }

    .mo-renew .mo-gnb-msub.is-shown {
        display: block;
    }

    .mo-renew .mo-gnb-msub li {
        margin-bottom: 20px;
    }

    .mo-renew .mo-gnb-msublink {
        font-family: var(--mo-font-kr);
        font-size: var(--mo-fs-point);
        line-height: 1.2;
        color: var(--mo-sub);
        text-decoration: none;
    }

    .mo-renew .mo-gnb-msublink.is-point {
        color: var(--mo-red);
    }

    /* 메뉴 열림 시에만 우하단 고정 프로스트 pill (Figma 6400:4103 Group 1175 실측: 109x53 r≈34, blur15,
       프레임 끝에서 우/하 30, naver21·kakao24·divider1x20, 내부 좌17/우18/gap14). 닫히면 display:none(기본). */
    .mo-renew .mo-gnb-root.is-mobile-open .mo-gnb-mobile-sns {
        display: inline-flex;
        position: fixed;
        right: 30px;
        bottom: 30px;
        z-index: 1001;
        align-items: center;
        gap: 14px;
        height: 53px;
        padding: 0 18px 0 17px;
        background: rgba(229, 229, 229, 0.15);
        -webkit-backdrop-filter: blur(15px);
        backdrop-filter: blur(15px);
        border: 0.5px solid #f5f5f5;
        border-radius: 30px;
    }

    .mo-renew .mo-gnb-msns {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
    }

    .mo-renew .mo-gnb-msns.mo-gnb-msns-naver {
        width: 21px;
        height: 21px;
    }

    .mo-renew .mo-gnb-msns.mo-gnb-msns-kakao {
        width: 24px;
        height: 24px;
    }

    .mo-renew .mo-gnb-msns img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .mo-renew .mo-gnb-msns-divider {
        width: 1px;
        height: 20px;
        background: #CECECE;
    }

    body.mo-gnb-locked {
        overflow: hidden;
    }
}
