/* 공통 레이아웃: 유틸 바 · 헤더 · 상단 레이어 · 겹침 섹션 · 푸터 · 드로어 */
:root {
  --util-h: 46px;
  --header-h: 84px;
  --slot-gap: 12px;
  /* 상단 레이어가 뒤로 깔려야 하는 높이 = 유틸 바 + 헤더 영역 */
  --chrome-h: calc(var(--util-h) + var(--slot-gap) + var(--header-h));
  --wave-h: 120px;
}
@media (max-width: 820px) {
  :root { --util-h: 44px; --header-h: 64px; --wave-h: 56px; }
}

/* ── 유틸 바 ── */
.util {
  position: relative;
  z-index: 1;
  height: var(--util-h);
  padding-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-inverse);
}
.pill {
  background: rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  padding: 7px var(--space-5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.pill .sep { margin-inline: 8px; opacity: 0.6; }
.lang { display: flex; gap: 14px; }
.lang a { text-decoration: none; color: rgba(255,255,255,0.72); }
.lang a[aria-current] { color: var(--text-inverse); }

/* ── 헤더 (sticky) ── */
.header-slot {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  padding-top: var(--slot-gap);
}
.header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-header);
  padding: 0 var(--space-5) 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}
.brand { display: block; line-height: 0; }
.brand img { width: 180px; height: auto; }
.gnb { display: flex; gap: var(--space-8); }
.gnb a {
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-decoration: none;
  padding-block: var(--space-3);
}
.gnb a[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
.burger {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-page);
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── 상단 레이어 (가장 뒤) ── */
.hero {
  position: relative;
  z-index: 0;
  margin-top: calc(-1 * var(--chrome-h));
  padding-top: var(--hero-top);
  padding-bottom: calc(var(--hero-bottom) + var(--wave-h) * 0.5);
  color: var(--text-inverse);
  background-color: var(--bg-navy);
  background-image: linear-gradient(var(--overlay-hero), var(--overlay-hero)), url("/img/hero-960.webp");
  background-image: linear-gradient(var(--overlay-hero), var(--overlay-hero)), image-set(url("/img/hero-960.webp") 1x, url("/img/hero-1920.webp") 2x);
  background-size: cover;
  background-position: center;
}
@media (min-width: 961px) {
  .hero { background-image: linear-gradient(var(--overlay-hero), var(--overlay-hero)), url("/img/hero-1920.webp"); }
}
/* 하위 페이지 상단: 홈과 같은 사진+네이비, 왼쪽 정렬, 낮은 높이 */
.hero--sub {
  padding-top: calc(var(--chrome-h) + 64px);
  padding-bottom: calc(var(--section-y) + var(--wave-h) * 0.5);
}
.page-head { max-width: 760px; }
.page-label { color: var(--accent-on-dark); font-size: 16px; line-height: 1.7; margin-bottom: var(--space-3); }
.page-lead { margin-top: var(--space-5); color: rgba(255,255,255,0.92); }
@media (max-width: 820px) {
  .hero--sub { padding-top: calc(var(--chrome-h) + 40px); }
}

.wave {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: var(--wave-h);
}

/* ── 본문 섹션: 위 모서리 라운드로 앞 섹션 위에 겹친다 ── */
.section { position: relative; z-index: 1; background: var(--bg-surface); }
.stack {
  position: relative;
  margin-top: calc(-1 * var(--overlap));
  border-radius: var(--overlap) var(--overlap) 0 0;
  padding-block: var(--section-y) calc(var(--section-y) + var(--overlap));
}
.stack.l2 { z-index: 2; background: var(--bg-page); }
.stack.l3 { z-index: 3; background: var(--bg-surface); }
/* 페이지마다 섹션 배경을 직접 고를 때 (회색·흰색 번갈아) */
.section[data-bg="page"], .stack[data-bg="page"] { background: var(--bg-page); }
.section[data-bg="surface"], .stack[data-bg="surface"] { background: var(--bg-surface); }

/* ── 푸터 ── */
.footer {
  position: relative;
  z-index: 10;
  margin-top: calc(-1 * var(--overlap));
  border-radius: var(--overlap) var(--overlap) 0 0;
  background: var(--bg-navy);
  color: var(--text-inverse);
  padding-block: 88px calc(48px + env(safe-area-inset-bottom, 0px));
}
.footer-logo { width: 180px; height: auto; margin-bottom: var(--space-12); }
.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-8); }
.fgrid p { font-size: 14px; line-height: 1.7; }
.footer .lbl { color: var(--text-inverse-muted); margin-bottom: 10px; }
.footer a { color: inherit; text-decoration: none; }
.footer-yt { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: underline !important; text-underline-offset: 3px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: var(--space-12); }
.footer-nav a { font-size: 14px; font-weight: 600; letter-spacing: 0.075em; display: inline-block; padding-block: 10px; }
.copy { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border-inverse); font-size: 12px; color: var(--text-inverse-muted); }

/* ── 모바일 메뉴: 딤 + 드로어 ──
   항상 렌더링해 두고, 닫힌 상태는 화면 오른쪽 밖(translateX 100%) + visibility hidden.
   열고 닫는 움직임은 css/motion.css */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17,19,24,0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(420px, 100%);
  background: var(--bg-page);
  display: flex;
  visibility: hidden;
  transform: translateX(100%);
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + var(--slot-gap)) max(var(--space-4), env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + var(--space-4)) max(var(--space-4), env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.menu-open { overflow: hidden; }
.menu-open .scrim { opacity: 1; visibility: visible; pointer-events: auto; }
.menu-open .drawer { visibility: visible; transform: none; }
/* PC 폭에서는 드로어·딤을 아예 그리지 않는다 (넓히면 main.js가 닫기도 함) */
@media (min-width: 821px) {
  .scrim, .drawer { display: none; }
}
.drawer-top {
  height: 64px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 0 10px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.drawer-nav { margin-top: 28px; margin-bottom: var(--space-8); padding-inline: var(--space-2); display: flex; flex-direction: column; }
.drawer-nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: 18px;
  border-bottom: 1px solid var(--border-strong);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.drawer-nav a[aria-current="page"] { color: var(--accent); }
.drawer-nav .chev { color: var(--accent); flex-shrink: 0; }
.drawer-info {
  margin-top: auto;
  flex-shrink: 0;
  background: var(--bg-inverse);
  color: var(--text-inverse);
  border-radius: 20px;
  padding: var(--space-6);
}
.drawer-info .lbl { color: var(--text-inverse-muted); margin-bottom: 10px; }
.drawer-info .times { font-size: 15px; line-height: 1.7; }
.drawer-info .btn { margin-top: var(--space-5); }
.drawer-info .lang { margin-top: var(--space-4); justify-content: space-between; }
.drawer-info .lang a { flex: 1; text-align: center; padding: 12px 0; border-radius: var(--radius-pill); color: var(--text-inverse); }
.drawer-info .lang a[aria-current] { background: var(--bg-surface); color: var(--text-primary); }

@media (max-width: 820px) {
  .gnb { display: none; }
  .burger { display: flex; }
  .header { padding: 0 10px 0 18px; }
  .brand img { width: 150px; }
  .footer { padding-block: 56px calc(40px + env(safe-area-inset-bottom, 0px)); }
  .footer-logo { width: 150px; margin-bottom: var(--space-8); }
  .pill { font-size: 11px; padding: 6px 12px; }
  .pill-more { display: none; }
}
