/* ═══════════════════════════════════════════════════════════════════
   VowelChord shared header — styles. Markup comes from /scripts/vc_header.js.
   Two bars, like a classic site menu:
     top bar : logo + tagline (left) · page controls (right, VC_TEST only)
     nav bar : grouped dropdown menus — room for new features in each group
   Colours are the VowelChord palette.
   ═══════════════════════════════════════════════════════════════════ */

/* Same scrollbar and reserved scrollbar space on every page, so the header
   sits in exactly the same place whether a page is long or short. */
html { scrollbar-gutter: stable; }
html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb { background: #d1d4df; border-radius: 999px; border: 2px solid #f5f5f8; }
html::-webkit-scrollbar-thumb:hover { background: #b3b6c2; }

.vch {
  --vch-ink: #1a1a2e;
  --vch-muted: #707088;
  --vch-soft: #909098;
  --vch-line: #e0e0e8;
  --vch-bg: #f5f5f8;
  --vch-card: #ffffff;
  --vch-gold: #d08020;
  --vch-gold-deep: #c06010;
  --vch-gold-wash: #fdf5e0;
  position: sticky; top: 0; z-index: 1000;
  display: block; width: 100%; margin: 0; padding: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px; line-height: 1.2; color: var(--vch-ink);
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  text-align: left;
}
.vch *, .vch *::before, .vch *::after { box-sizing: border-box; }
.vch ul { list-style: none; margin: 0; padding: 0; }
.vch a { text-decoration: none; color: inherit; }
.vch .vch-top-item { color: #505068; }
.vch button { font: inherit; color: inherit; background: none; border: 0; margin: 0; cursor: pointer; }

.vch-bar { width: 100%; }
.vch-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 14px;
}

/* ---- top bar ---- */
.vch-top { background: var(--vch-card); border-bottom: 1px solid var(--vch-line); }
.vch-top .vch-inner { height: 54px; }
.vch-logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.vch-word {
  font-size: 21px; font-weight: 700; letter-spacing: -0.4px; line-height: 1;
  background: linear-gradient(135deg, var(--vch-gold), var(--vch-gold-deep));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.vch-wave { width: 56px; height: 22px; overflow: visible; opacity: .85; }
.vch-wave path {
  stroke: var(--vch-gold); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(208,128,32,0.4));
}
.vch-tagline { font-size: 12.5px; color: var(--vch-muted); white-space: nowrap; }
.vch .vch-util { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.vch-util .vch-item {
  display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: var(--vch-muted); white-space: nowrap;
}
.vch-util .vch-item:hover { color: var(--vch-ink); background: var(--vch-bg); }
.vch-util .vch-item.is-current { color: var(--vch-gold-deep); }
.vch-btn {
  margin-left: 6px;
  background: linear-gradient(135deg, var(--vch-gold), #e0a030) !important;
  color: #fff !important; font-weight: 600 !important; padding: 0 16px !important;
  box-shadow: 0 2px 8px rgba(208,128,32,0.22);
}
.vch-btn:hover { box-shadow: 0 4px 12px rgba(208,128,32,0.3); }
.vch-util-mobile { display: none; }

/* ---- nav bar ---- */
.vch-nav {
  background: rgba(245,245,248,0.96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--vch-line);
}
.vch-nav .vch-inner { height: 44px; }
.vch-list { display: flex; align-items: stretch; height: 100%; gap: 2px; flex: 1; }
.vch-group { position: relative; display: flex; align-items: stretch; }
.vch-push { margin-left: auto; }
.vch-push .vch-menu { left: auto; right: 4px; }

.vch-top-item {
  display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 14px;
  font-size: 13.5px; font-weight: 500; color: #505068; white-space: nowrap;
  position: relative;
}
.vch-top-item:hover, .vch-group.open > .vch-top-item { color: var(--vch-ink); }
.vch-caret { width: 9px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.vch-group.open .vch-caret { transform: rotate(180deg); }

/* Current section: ink text + gold bar on the bottom edge */
.vch-group.is-active > .vch-top-item { color: var(--vch-ink); } /* same weight as the others, so no item moves */
.vch-group.is-active > .vch-top-item::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--vch-gold), var(--vch-gold-deep));
}

/* Dropdown panel */
.vch-menu {
  display: none; position: absolute; top: 100%; left: 4px; min-width: 210px;
  padding: 6px; margin-top: 1px;
  background: var(--vch-card); border: 1px solid var(--vch-line); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(26,26,46,0.10), 0 2px 6px rgba(26,26,46,0.05);
}
.vch-group.open > .vch-menu { display: block; }
.vch-menu .vch-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: #3a3a52; white-space: nowrap;
}
.vch-menu .vch-item:hover { background: var(--vch-bg); color: var(--vch-ink); }
.vch-menu .vch-item.is-current { background: var(--vch-gold-wash); color: var(--vch-gold-deep); font-weight: 600; }

.vch-top-item:focus-visible, .vch-item:focus-visible, .vch-burger:focus-visible {
  outline: 2px solid var(--vch-gold); outline-offset: -2px; border-radius: 6px;
}

/* Burger (small screens only) */
.vch-burger { display: none; width: 36px; height: 36px; padding: 9px 8px; border-radius: 8px; flex-shrink: 0; }
.vch-burger span { display: block; height: 2px; margin: 0 0 5px; background: var(--vch-ink); border-radius: 2px; }
.vch-burger span:last-child { margin-bottom: 0; }
.vch-burger:hover { background: var(--vch-bg); }

@media (max-width: 1000px) {
  .vch-tagline { display: none; }
}
@media (max-width: 760px) {
  .vch-burger { display: block; }
  .vch .vch-util { display: none; }
  .vch-push { margin-left: 0; }
  .vch-util-mobile { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 2px; margin-top: 6px; border-top: 1px solid var(--vch-line); }
  .vch-util-mobile .vch-item { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; color: #3a3a52; background: var(--vch-card); border: 1px solid var(--vch-line); }
  .vch-util-mobile .vch-btn { border-color: transparent; }
  .vch-tagline { display: none; }
  .vch-wave { display: none; }
  .vch-nav { display: none; }
  .vch.menu-open .vch-nav { display: block; max-height: calc(100vh - 54px); overflow-y: auto; }
  .vch-nav .vch-inner { height: auto; padding: 8px 16px 14px; flex-direction: column; align-items: stretch; gap: 0; }
  .vch-list { flex-direction: column; height: auto; width: 100%; gap: 0; }
  .vch-group { flex-direction: column; }
  .vch-top-item { height: 40px; padding: 0 4px; justify-content: space-between; width: 100%; }
  .vch-group.is-active > .vch-top-item::after { display: none; }
  .vch-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 0 6px 8px; min-width: 0; margin: 0; background: transparent; }
  .vch-caret { display: none; }
}

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