﻿/* 공유 chrome 의 정본은 아래 INIT_GO 관리 블록 하나다.
 * 이전에는 같은 셀렉터(.site-header/.site-nav/.menu-toggle/.footer-inner ...)를 정의한
 * 제네릭 엔진 블록이 이 위에 함께 있었고, 그쪽 min-height:44px 같은 규칙이 관리 블록의
 * 실측 치수를 조용히 덮었다(R04#39). 소유자를 하나로 합치면서 제거했다.
 */

/* INIT_GO managed shared components — site-header, site-footer.
 *
 * 실측 정본: Figma header 561:10553 (1920x100), footer 561:10510 (1920x322),
 * 둘 다 프레임 561:10031(main) 안. 아래 수치는 그 노드에서 읽은 값이고
 * 1920 기준 vw 로 환산해 clamp 로 축소한다(페이지 styles.css 와 같은 규약).
 *
 * Prevention knowledge applied at build time (knowledge/inspection/R04 §7 and
 * the R01 global shared-chrome section):
 *   #32 one canonical owner; the shared sheet alone owns state styling.
 *   #33 fixed header, scroll state on the owning element, height morph on both
 *       desktop and mobile, state variables declared where siblings can read them.
 *   #35 the footer leaves absolute lanes for rows before the mid widths collide.
 *   #36 the desktop-to-compact switch is driven by measured content width.
 *   #38 hamburger and panel share one breakpoint; the toggle is a real toggle.
 *   #39 no page-specific layout classes live here.
 *   #14 Figma SVG 는 preserveAspectRatio="none" 를 벗겨 고유 비율을 유지한다.
 *   #64 글래스 pill 의 backdrop-filter 를 무효화하는 조상 filter/transform 을 두지 않는다.
 * Site-specific measurements stay in site/shared-component-contract.json.
 */

:root {
  --vp-shared-header-height-top: clamp(64px, 5.2083vw, 100px);   /* 100 / 1920 */
  --vp-shared-header-height-scrolled: clamp(56px, 3.75vw, 72px);
  --vp-shared-header-transition: 240ms ease;
  --vp-shared-footer-height: clamp(240px, 16.7708vw, 322px);     /* 322 / 1920 */
  --vp-shared-header-gutter: clamp(24px, 4.1667vw, 80px);        /* 로고 left 80 */
  --vp-shared-footer-gutter: clamp(24px, 5.7292vw, 110px);       /* con-box left 110 */
  --vp-shared-chrome-inline-gutter: var(--vp-shared-header-gutter);
  --vp-shared-chrome-compact-breakpoint: 1180px;
  --vp-shared-chrome-on-dark: #ffffff;
  --vp-shared-chrome-ink: #242424;
  --vp-shared-chrome-brand: #242a71;
  --vp-shared-chrome-hairline: #eeeeee;
}

/* #33 — the element that owns sticky, height and surface also owns the state.
   Declared on the header itself so a sibling mobile-menu panel can read it.
   패딩과 레인 배치는 안쪽 .site-header 가 갖는다 — 호스트가 padding 을 함께 가지면
   거터가 두 번 먹는다. */
.vp-shared-site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  /* #38 — 패널이 헤더를 덮으면 MENU 재클릭으로 닫을 수 없어 '열기 전용'이 된다.
     헤더가 패널보다 위에 있어야 같은 버튼이 진짜 토글로 동작한다. */
  z-index: 120;
  display: block;
  padding: 0;
  block-size: var(--vp-shared-header-height-top);
  background: transparent;
  transition: block-size var(--vp-shared-header-transition), background-color var(--vp-shared-header-transition);
}

/* 패널이 열리면 헤더 뒤가 흰 패널이므로 글자를 잉크색으로 뒤집는다(R04#22). */
/* 아이콘은 단색 SVG 라 색을 상속하지 않는다 — 밝은 배경에서는 검게 눌러 준다. */
/* 패널이 이미 헤더 아래에 열리고 헤더가 로고를 보여 준다 — 패널 안 로고는 중복이다. */
.mobile-menu__top .site-logo {
  display: none;
}

.mobile-menu__top {
  justify-content: flex-end;
}

/* ---- 밝은 지면용 헤더 변형 (data-chrome-theme="light") ----
 * 기본(무선언)은 어두운 히어로 위에 얹는 흰 chrome 이다 — main 은 여기에 해당해 무변경이다.
 * 흰 지면으로 시작하는 페이지(sub01-01 등)는 <body data-chrome-theme="light"> 를 선언해
 * 먹색 GNB + 컬러 로고(171x40) + 네이비 MENU pill 로 뒤집는다.
 * 훅을 헤더 호스트가 아니라 body 에 두는 이유: 12.6 shared-header-footer-consistency-guard 가
 * 페이지별 header/footer 마크업 블록 해시를 대조하므로 호스트 속성이 갈리면 shared_header_drift 가 된다.
 * 로고 스왑은 이 시트가 이미 쓰는 content:url() 패턴을 그대로 쓴다(body.is-menu-open 블록 참조).
 * 스크롤 후에는 어두운 glass 표면이 깔려 흰 글자·흰 로고가 맞으므로 light 선언도 기본 변형으로
 * 되돌아가야 한다 — 그래서 모든 light 규칙을 :not([data-scroll-state='scrolled']) 로 잠근다. */
/* 아이콘은 단색 흰 SVG 라 색을 상속하지 않는다 — 밝은 지면에서는 검게 눌러 준다. */
/* 흰 pill 은 흰 지면에서 사라진다 — 밝은 지면에서는 네이비 채움으로 뒤집는다
   (열린 메뉴 패널 위에서 쓰는 처리와 같은 규약). */
@media (prefers-reduced-motion: reduce) {
  .vp-shared-site-header {
    transition: none;
  }
}

/* ---- 헤더 안쪽: 좌 로고 / 중앙 GNB / 우 글래스 pill ---- */
.site-header {
  position: relative;
  /* 패널(.mobile-menu, z-index 110)은 같은 호스트 안의 형제다. 헤더가 그보다 위에
     있어야 MENU 재클릭으로 닫을 수 있다(#38 열기 전용 금지). */
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: space-between;
  block-size: 100%;
  min-height: 0;
  padding-inline: var(--vp-shared-header-gutter);
  border: 0;
  background: transparent;
  color: var(--vp-shared-chrome-on-dark);
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  flex: none;
}

/* 터치 타깃 44px — 시안 렌더는 그대로 두고 히트 영역만 넓힌다.
   min-block-size 로 늘리면 마진 박스가 커져 헤더의 세로 중앙 정렬 계산이 서브픽셀만큼 밀린다.
   패딩으로 히트 박스를 키우고 같은 크기의 음수 마진으로 마진 박스를 되돌리면
   중앙 정렬 결과가 수리 전과 완전히 같다(1440 로고 회귀로 실측). */
.site-logo {
  padding-block: 9px;
  margin-block: -9px;
}

.site-logo__img {
  display: block;
  inline-size: clamp(140px, 10.6419vw, 204.325px);  /* 204.325 / 1920 */
  block-size: auto;
}

/* 시안의 GNB 는 뷰포트 정중앙이다(left calc(50% + .5px), translateX -50%).
   좌우 레인 폭이 달라 space-between 만으로는 중앙에 오지 않는다. */
.site-nav {
  position: absolute;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: clamp(20px, 4.1667vw, 80px);   /* 80 / 1920 */
  white-space: nowrap;
}

.site-nav__link {
  font-family: var(--font-latin);
  font-size: clamp(13px, .8333vw, 16px);   /* 16 / 1920 */
  font-weight: 500;
  line-height: normal;
  color: inherit;
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 우측 글래스 pill: 188x52, radius 100, rgba(255,255,255,.1), blur 5 */
.site-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: clamp(8px, 0.4375vw, 18px);
  block-size: clamp(40px, 2.7083vw, 52px);
  padding-inline: clamp(10px, .9375vw, 18px) clamp(6px, .5208vw, 10px);
  border-radius: 100px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(5px);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: clamp(4px, .3646vw, 7px);
  /* 터치 타깃 44px — 패딩으로 히트 박스를 키우고 같은 크기의 음수 마진으로 레이아웃을 상쇄한다.
     .site-actions 가 align-items:center 라 상하 대칭 음수 마진은 글자 위치를 바꾸지 않는다. */
  padding: 17px 2px;
  margin: -17px -2px;
  border: 0;
  background: none;
  color: var(--vp-shared-chrome-on-dark);
  font-family: var(--font-latin);
  font-size: clamp(12px, .7292vw, 14px);   /* 14 / 1920, 12px 하한은 모바일 가독성 게이트 */
  font-weight: 500;
  /* line-height: 1; */
  cursor: pointer;
}

.lang-toggle__globe {
  inline-size: clamp(12px, .7568vw, 14.53px);
  block-size: auto;
}

.lang-toggle__caret {
  inline-size: clamp(5px, .2706vw, 5.196px);
  block-size: auto;
}

/* 시안의 MENU 는 데스크톱에서도 항상 보이는 흰 pill 이다(햄버거 대체가 아니다). */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 터치 타깃 44px — pill 은 눈에 보이는 면이라 패딩으로 키우면 시안 치수가 커진다.
     box-sizing 을 content-box 로 돌려 inline/block-size 가 '그려지는 pill' 을 뜻하게 하고,
     padding 으로 히트 박스만 44px 이상으로 키운 뒤 background-clip:content-box 로
     채움을 content 박스(=시안 pill)에만 칠한다. 음수 마진이 레이아웃 발자국을 되돌린다. */
  box-sizing: content-box;
  inline-size: clamp(80px, 4.8083vw, 100px);   /* 100 / 1920 */
  block-size: clamp(30px, 1.875vw, 36px);      /* 36 / 1920 */
  /* 상하좌우 같은 값이어야 한다 — content 모서리 반경은 축마다 그 축의 패딩만큼 줄어들므로
     세로에만 패딩을 주면 pill 끝이 타원으로 눌린다(1920 에서 26x18 타원으로 실측). */
  padding: 8px;
  margin: -8px;
  border: 0;
  border-radius: 100px;
  background: #ffffff;
  background-clip: content-box;
  color: var(--vp-shared-chrome-brand);
  font-family: var(--font-latin);
  font-size: clamp(12px, .7292vw, 14px);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.menu-toggle:hover,
.lang-toggle:hover {
  opacity: .82;
}

/* ---- 전체 메뉴 패널 (#38 토글은 같은 버튼으로 열고 닫는다) ---- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  /* 헤더가 위에 떠 있으므로 그 높이만큼 비워 패널 내용이 가리지 않게 한다. */
  padding: calc(var(--vp-shared-header-height-top) + 16px) var(--vp-shared-footer-gutter) 40px;
  background: #ffffff;
  color: var(--vp-shared-chrome-ink);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  /* 닫힌 패널은 화면 전체를 덮는 fixed 레이어다 — 히트 테스트에서 완전히 빠져야 한다. */
  pointer-events: none;
  transition: opacity var(--vp-shared-header-transition), visibility var(--vp-shared-header-transition);
}

.mobile-menu[aria-hidden='false'] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu {
    transition: none;
  }
}

.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu__close {
  inline-size: 44px;
  block-size: 44px;
  border: 0;
  background: none;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu__nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.mobile-nav-link,
.mobile-nav-toggle,
.mobile-nav-sub__link {
  display: block;
  inline-size: 100%;
  padding: 14px 0;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--font-latin);
  font-size: clamp(20px, 1.6667vw, 32px);
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.mobile-nav-sub {
  display: none;
  padding-inline-start: 16px;
}

.mobile-nav-group.is-open .mobile-nav-sub {
  display: block;
}

.mobile-nav-sub__link {
  font-size: clamp(14px, .9375vw, 18px);
  font-weight: 500;
}

.mobile-menu__bottom {
  color: rgba(36, 36, 36, .3);
  font-family: var(--font-ko);
  font-size: clamp(12px, .7292vw, 14px);
}

/* ---- 서브 내비 ---- */
.subnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline: var(--vp-shared-footer-gutter);
  color: var(--vp-shared-chrome-ink);
  font-size: clamp(12px, .7292vw, 14px);
}

.subnav__home,
.subnav__item,
.subnav__link {
  color: inherit;
  text-decoration: none;
}

/* ---- 푸터: 상단 헤어라인 / 좌 로고 / Add·Tel·Fax·E-mail / 저작권 ---- */
.vp-shared-site-footer {
  display: block;
  min-block-size: var(--vp-shared-footer-height);
  padding: 0;
  background: #ffffff;
  border-block-start: 1px solid var(--vp-shared-chrome-hairline);
}

.site-footer {
  border: 0;
  background: transparent;
  color: var(--vp-shared-chrome-ink);
}

/* 로고 left 110 / info 블록 left 432 → 사이 간격 151. 로고 top 100. */
.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(32px, 7.8646vw, 151px);
  /* 상단 100 은 시안의 로고 top 100. 하단은 1920 에서 총높이 322 가 되도록 실측으로 잡은 값이다
     (1 헤어라인 + 100 + 본문 127.6 + 93.4 = 322). */
  padding-block: clamp(48px, 5.2083vw, 100px) clamp(40px, 4.8646vw, 93.4px);
  padding-inline: var(--vp-shared-footer-gutter);
}

/* 터치 타깃 44px — 푸터 그리드는 align-items:start 라 상하 대칭 패딩을 쓰면 로고가 위로 뜬다.
   아래쪽으로만 넓히고 같은 크기의 음수 마진으로 행 높이를 되돌린다. */
.footer-logo {
  padding-block-end: 20px;
  margin-block-end: -20px;
}

.footer-logo__img {
  display: block;
  inline-size: clamp(120px, 8.9063vw, 171px);   /* 171 / 1920 */
  block-size: auto;
}

/* 행 간격은 각 행이 소유한다 — grid gap 을 함께 쓰면 저작권의 44 에 gap 10 이 더해져
   시안 리듬(2행 하단 162 → 저작권 206)이 54 로 벌어지고 푸터가 322 를 넘긴다. */
.footer-body {
  display: grid;
  gap: 0;
  font-family: var(--font-ko);
  font-size: clamp(13px, .8333vw, 16px);   /* 16 / 1920 */
  line-height: 1.6;
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(12px, 2.9688vw, 57px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-info + .footer-info {
  margin-block-start: clamp(8px, .5208vw, 10px);   /* Add 행 → Tel 행 간격 10 */
}

.footer-info__item {
  display: flex;
  align-items: baseline;
  gap: clamp(8px, 1.4063vw, 27px);   /* 라벨 432 → 값 483 */
}

.footer-info__key {
  font-weight: 700;
  white-space: nowrap;
}

/* 터치 타깃 44px — 인라인 요소의 세로 패딩은 줄 상자 높이를 바꾸지 않으므로
   시안 렌더는 그대로 두고 히트 박스만 커진다(16px 줄 → 46px). */
.footer-info__value a {
  padding-block: 15px;
  color: inherit;
  text-decoration: none;
}

.footer-info__value a:hover {
  text-decoration: underline;
}

/* 저작권: 14px, rgba(36,36,36,.3), info 블록과 같은 좌측 기준선, y 206 (2행 하단 162 + 44) */
.footer-copyright {
  margin: 0;
  margin-block-start: clamp(20px, 2.2917vw, 44px);
  color: rgba(36, 36, 36, .3);
  font-size: clamp(12px, .7292vw, 14px);
}

/* #36 — 좁은 폭에서는 중앙 GNB 를 접고 MENU 로 넘긴다. #35 — 푸터는 행으로 쌓는다. */
@media (max-width: 1180px) {
  .site-nav {
    display: none;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
  }
}

/* INIT_GO:MANAGED-SHARED-COMPONENTS:END */
