/* Header v2 - styled to match the site's existing .nav aesthetic.
   Reuses global tokens: --font-display, --font-label, --text-dim,
   --text-secondary, --ease-premium. Tiny uppercase tracking, muted
   colors, subtle gold gradient underlines on hover. */

.site-header-v2 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  background: transparent;
  transition: background 0.5s var(--ease-premium), padding 0.5s var(--ease-premium), box-shadow 0.5s var(--ease-premium), border-color 0.5s var(--ease-premium);
  border-bottom: 1px solid transparent;
}

.site-header-v2.is-scrolled {
  background: rgba(6, 6, 8, 0.94);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  padding: 0.65rem 2.5rem;
  border-bottom-color: rgba(212,176,96,0.06);
  box-shadow: 0 4px 24px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.02) inset;
}

.hv2-inner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

/* Brand - matches .nav-brand */
.hv2-logo {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.35s var(--ease-premium);
  white-space: nowrap;
}
.hv2-logo:hover { color: var(--text-secondary); }

.hv2-spacer { flex: 1; }

/* Centered nav - matches .nav-links */
.hv2-nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.hv2-trigger,
.hv2-link {
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0 0 4px;
  text-decoration: none;
  transition: color 0.35s var(--ease-premium);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hv2-trigger:hover,
.hv2-link:hover,
.hv2-trigger[aria-expanded="true"],
.hv2-trigger.is-current,
.hv2-link.is-current {
  color: var(--text-secondary);
}

/* Gold gradient underline - matches .nav-link::before */
.hv2-trigger::before,
.hv2-link::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,176,96,0.4), transparent);
  transition: width 0.4s var(--ease-premium), left 0.4s var(--ease-premium);
}
.hv2-trigger:hover::before,
.hv2-link:hover::before,
.hv2-trigger[aria-expanded="true"]::before,
.hv2-trigger.is-current::before,
.hv2-link.is-current::before {
  width: 100%;
  left: 0;
}

.hv2-caret {
  font-size: 0.5rem;
  opacity: 0.6;
  transition: transform 0.25s var(--ease-premium);
}
.hv2-trigger[aria-expanded="true"] .hv2-caret { transform: rotate(180deg); }

/* ── Mega-menu panels ──────────────────────────────────────── */
.hv2-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: 720px;
  max-width: calc(100vw - 32px);
  background: rgba(10, 11, 15, 0.96);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-top: 1px solid rgba(212,176,96,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-premium), transform 200ms var(--ease-premium);
  z-index: 99;
}
.hv2-menu.is-open {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.hv2-menu-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  padding: 1.75rem 2rem;
}

.hv2-menu-col { display: flex; flex-direction: column; gap: 0.25rem; }

.hv2-menu-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  grid-template-rows: auto auto;
  grid-template-areas: "icon label" "icon desc";
  gap: 0.15rem 0.9rem;
  padding: 0.65rem 0.5rem;
  text-decoration: none;
  position: relative;
  transition: background 0.25s var(--ease-premium);
}

.hv2-menu-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, transparent, rgba(212,176,96,0.5), transparent);
  transition: height 0.3s var(--ease-premium), top 0.3s var(--ease-premium);
}
.hv2-menu-row:hover::before,
.hv2-menu-row.is-current::before {
  height: 60%;
  top: 20%;
}
.hv2-menu-row:hover,
.hv2-menu-row.is-current { background: rgba(212,176,96,0.03); }

.hv2-menu-icon {
  grid-area: icon;
  color: rgba(212,176,96,0.55);
  font-size: 14px;
  align-self: center;
  text-align: center;
}
.hv2-menu-label {
  grid-area: label;
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hv2-menu-desc {
  grid-area: desc;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
}

.hv2-menu-col--featured {
  border-left: 1px solid rgba(255,255,255,0.04);
  padding-left: 1.5rem;
}
.hv2-menu-label-sm {
  font-family: var(--font-label);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0.5rem 0 0.4rem;
}

.hv2-featured-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  padding: 0.5rem;
  transition: background 0.25s var(--ease-premium);
}
.hv2-featured-card:hover { background: rgba(212,176,96,0.03); }
.hv2-featured-img {
  width: 100%;
  height: 72px;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s var(--ease-premium);
}
.hv2-featured-card:hover .hv2-featured-img { opacity: 1; }
.hv2-featured-title {
  font-family: var(--font-label);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.hv2-featured-meta {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ── Search / Language / User ──────────────────────────────── */
.hv2-search { position: relative; }
.hv2-search-input {
  width: 140px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  transition: width 0.3s var(--ease-premium), border-color 0.3s var(--ease-premium), background 0.3s var(--ease-premium);
}
.hv2-search-input::placeholder { color: var(--text-dim); font-style: italic; }
.hv2-search-input:focus {
  width: 260px;
  border-color: rgba(212,176,96,0.25);
  background: rgba(0,0,0,0.3);
  outline: none;
}
.hv2-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: rgba(10, 11, 15, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212,176,96,0.1);
  max-height: 380px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-premium);
}
.hv2-search-results.is-open { opacity: 1; pointer-events: auto; }
.hv2-search-item {
  display: block;
  padding: 0.6rem 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s var(--ease-premium), color 0.2s var(--ease-premium);
}
.hv2-search-item:last-child { border-bottom: none; }
.hv2-search-item:hover { background: rgba(212,176,96,0.04); color: #fff; }
.hv2-search-item--all {
  font-family: var(--font-label);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(212,176,96,0.65);
}

.hv2-lang, .hv2-user { position: relative; }
.hv2-lang-trigger, .hv2-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.25s var(--ease-premium);
}
.hv2-lang-trigger:hover, .hv2-user-trigger:hover { color: var(--text-secondary); }
.hv2-lang-flag { font-size: 0.95rem; }
.hv2-lang-code {
  font-family: var(--font-label);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.hv2-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(212,176,96,0.15);
}
.hv2-user-avatar--blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  color: var(--text-dim);
  font-size: 10px;
}

.hv2-lang-menu, .hv2-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: rgba(10, 11, 15, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(212,176,96,0.1);
  padding: 0.35rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.2s var(--ease-premium), transform 0.2s var(--ease-premium);
  z-index: 99;
}
.hv2-lang-menu.is-open, .hv2-user-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.hv2-lang-menu a, .hv2-user-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.2s var(--ease-premium), background 0.2s var(--ease-premium);
}
.hv2-lang-menu a:hover, .hv2-user-menu a:hover {
  color: var(--text-secondary);
  background: rgba(212,176,96,0.03);
}
.hv2-lang-menu a.is-current { color: rgba(212,176,96,0.8); }

.hv2-link--cta {
  padding: 6px 14px;
  border: 1px solid rgba(212,176,96,0.25);
  border-radius: 2px;
}
.hv2-link--cta::before { display: none; }
.hv2-link--cta:hover { background: rgba(212,176,96,0.08); }

/* ── Hamburger + mobile ────────────────────────────────────── */
.hv2-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}
.hv2-hamburger span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--text-dim);
  margin: 0 auto;
  transition: transform 0.2s var(--ease-premium), background 0.2s var(--ease-premium);
}
.hv2-hamburger:hover span { background: var(--text-secondary); }

.hv2-mobile, .hv2-mobile-backdrop { display: none; }

@media (max-width: 900px) {
  .site-header-v2 { padding: 0.8rem 1rem; }
  .hv2-nav, .hv2-search, .hv2-lang { display: none; }
  .hv2-hamburger { display: flex; order: -1; }
  .hv2-logo { flex: 1; text-align: center; }

  .hv2-mobile-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 8, 0.85);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-premium);
    z-index: 1100;
  }
  .hv2-mobile-backdrop.is-open { opacity: 1; pointer-events: auto; }

  .hv2-mobile {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85vw;
    max-width: 380px;
    background: rgba(10, 11, 15, 0.98);
    backdrop-filter: blur(24px);
    border-right: 1px solid rgba(212,176,96,0.1);
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-premium);
    z-index: 1101;
    overflow-y: auto;
  }
  .hv2-mobile.is-open { transform: translateX(0); }

  .hv2-mobile-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .hv2-mobile-search {
    flex: 1;
    padding: 0.5rem 0.9rem;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
  }
  .hv2-mobile-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
  }

  .hv2-mobile-body { flex: 1; padding: 1rem 0; }
  .hv2-mobile-section { margin-bottom: 1.25rem; }
  .hv2-mobile-section-title {
    font-family: var(--font-label);
    font-size: 0.55rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(212,176,96,0.6);
    padding: 0 1.25rem;
    margin-bottom: 0.4rem;
  }
  .hv2-mobile-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1.25rem;
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-label);
    font-size: 0.65rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    transition: background 0.2s var(--ease-premium), color 0.2s var(--ease-premium);
  }
  .hv2-mobile-row:hover {
    background: rgba(212,176,96,0.04);
    color: var(--text-secondary);
  }
  .hv2-mobile-row--standalone {
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 0.5rem;
    padding-top: 1rem;
  }

  .hv2-mobile-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.04);
  }
  .hv2-mobile-langs {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
  }
  .hv2-mobile-lang {
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-label);
    font-size: 0.55rem;
    letter-spacing: 0.2em;
  }
  .hv2-mobile-lang.is-current {
    color: rgba(212,176,96,0.9);
    border-color: rgba(212,176,96,0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header-v2, .hv2-menu, .hv2-mobile, .hv2-mobile-backdrop, .hv2-search-input, .hv2-featured-card {
    transition: opacity 100ms linear !important;
    transform: none !important;
  }
}

/* ── A11y: skip link + focus rings ─────────────────────────── */
.hv2-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 14px;
  background: rgba(212,176,96,0.9);
  color: #0a0b0f;
  font-family: var(--font-label);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 2000;
}
.hv2-skip:focus { left: 8px; }

.site-header-v2 a:focus-visible,
.site-header-v2 button:focus-visible,
.site-header-v2 input:focus-visible {
  outline: 1px solid rgba(212,176,96,0.5);
  outline-offset: 3px;
}
