/* 🧭 상단 메뉴 — nav.js 가 그리는 메뉴의 모양. 모든 페이지가 같이 써요.
   index.html 은 style.css 의 헤더 위에 드롭다운만 얹고,
   다른 페이지는 .탑바 로 바 전체를 그려요. */

/* ── 서브 페이지용 바 ─────────────────────────────────────── */
body { padding-top: 0 !important; }

.탑바 {
  position: sticky; top: 0; z-index: 999;
  width: 100vw; margin: 0 0 0 calc(50% - 50vw); box-sizing: border-box;
  display: grid; grid-template-columns: auto auto 1fr auto auto; align-items: center; gap: 16px;
  min-height: 60px; padding: 8px clamp(14px, 3vw, 40px);
  color: #fff;
  background: rgba(10, 14, 32, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  font-family: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  text-align: left;
}
@supports not (backdrop-filter: blur(4px)) { .탑바 { background: rgba(10, 14, 32, 0.95); } }

.탑바-뒤로 {
  display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  font-size: 13px; font-weight: 800; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.탑바-뒤로:hover { background: rgba(255,255,255,.24); }
.탑바-브랜드 { color: #fff; font-weight: 900; font-size: 15px; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.탑바-브랜드 strong { color: #62e6ff; }

.탑바 .main-nav { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 2vw, 28px); }
.탑바 .nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 4px; padding: 10px 0;
  color: #aab4d3; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-decoration: none; white-space: nowrap;
}
.탑바 .nav-link span { display: none; }
.탑바 .nav-link::after { position: absolute; right: 50%; bottom: 0; left: 50%; height: 2px; background: #62e6ff; content: ""; transition: inset .2s; }
.탑바 .nav-link:hover, .탑바 .nav-link.is-active { color: #fff; }
.탑바 .nav-link:hover::after, .탑바 .nav-link.is-active::after { right: 0; left: 0; }
.탑바 .menu-toggle { display: none; padding: 6px 10px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; font-size: 18px; cursor: pointer; }

/* ── 🎵 배경음악 토글 (nav.js 가 만들어요) ─────────────────── */
.탑바-음악 {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  font-size: 18px; line-height: 1; cursor: pointer; transition: background .15s, opacity .15s;
}
.탑바-음악:hover { background: rgba(98,230,255,.2); border-color: #62e6ff; }
.탑바-음악.꺼짐 { opacity: .55; }
.site-header { grid-template-columns: auto 1fr auto auto; }   /* 홈: 🎵 칸 하나 더 */
.site-header > .탑바-음악 { margin-right: -12px; }          /* 언어 버튼에 바짝 */
@media (max-width: 860px) { .site-header > .탑바-음악 { grid-column: 2; justify-self: end; margin-right: 0; } }

/* ── 드롭다운 (index 포함 공통) ───────────────────────────── */
.nav-item { position: relative; }
.nav-caret { font-style: normal; font-size: 10px; opacity: .7; margin-left: 2px; }
.nav-sub {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  display: none; flex-direction: column; min-width: 210px; margin-top: 6px; padding: 8px;
  background: #111834; border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  text-align: left;
}
/* 메뉴 글자에서 아래 상자로 마우스가 건너갈 때 닫히지 않게 */
.nav-sub::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.nav-sub a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: #dfe5ff; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.nav-sub a:hover { background: rgba(98,230,255,.12); color: #fff; }
.nav-sub a.is-here { color: #62e6ff; background: rgba(98,230,255,.08); }

@media (hover: hover) and (min-width: 861px) {
  .has-sub:hover .nav-sub, .has-sub:focus-within .nav-sub { display: flex; }
}
.has-sub.is-open .nav-sub { display: flex; }

/* ── 좁은 화면: 햄버거 + 세로 메뉴 ───────────────────────── */
@media (max-width: 860px) {
  .탑바 { grid-template-columns: auto 1fr auto auto; }
  .탑바-브랜드 { font-size: 13px; }
  .탑바 .menu-toggle { display: block; }
  .탑바 .main-nav {
    position: absolute; top: calc(100% + 6px); right: 12px; left: 12px;
    display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 10px;
    background: #111834; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.4);
  }
  .탑바 .main-nav.is-open { display: flex; }
  .탑바 .nav-link { display: flex; justify-content: space-between; padding: 12px; border-radius: 8px; }
  .탑바 .nav-link span { display: block; color: #7984a5; font-weight: 600; margin-left: auto; }
  .탑바 .nav-link::after { display: none; }
  .탑바 .nav-link:hover, .탑바 .nav-link.is-active { background: rgba(98,230,255,.08); }

  /* 모바일에선 드롭다운이 메뉴 아래로 펼쳐지는 목록 */
  .main-nav .nav-sub {
    position: static; transform: none; min-width: 0; margin: 0 0 4px 12px; padding: 4px 0 4px 10px;
    border: 0; border-left: 2px solid rgba(98,230,255,.35); border-radius: 0; background: transparent; box-shadow: none;
  }
}
