/* ============================================================================
   shared/nav.css — the transformers.tv global header, ported 1:1 from the
   tv-header system in src/layouts/TVLayout.astro so the forum
   (forums.transformers.tv) wears the EXACT same nav as the Astro site:
   Hero80 Network strip + faction ribbon + split nav around a centered
   wordmark + Autobot/Decepticon faction toggle.

   Loaded ONLY by the forum (the site uses TVLayout's inline <style>). nav.js
   injects the markup; this file styles it. If TVLayout's header changes,
   regenerate both. Bump the ?v= token in the Discourse theme head_tag to
   flush the immutable CDN cache.
   ============================================================================ */

/* ── Faction design tokens (copied from TVLayout :root + decepticon) ──────── */
:root {
  --shell-red: #e8141c;
  --shell-red-glow: rgba(232,20,28,0.45);
  --shell-purple: #7c3aed;
  --shell-purple-hi: #a855f7;
  --shell-purple-glow: rgba(168,85,247,0.45);
  --shell-gold: #f0c34a;
  --shell-fg-bone: #f3eede;

  --line: rgba(80,180,255,0.18);
  --line-hi: rgba(80,180,255,0.36);
  --accent: #3fd8ff;
  --accent-lo: #1a8aad;
  --accent-hi: #9be9ff;
  --accent-glow: rgba(63,216,255,0.50);
  --fg-1: #dde6f0;
  --fg-2: #8c9fb8;
  --fg-3: #4c5d74;
  --fg-4: #2f3c50;
  --font-display: 'Orbitron', 'Inter Tight', system-ui, sans-serif;
  --font-display-style: normal;
  --font-body: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --nav-letter: 0.18em;
}
html[data-faction="decepticon"] {
  --line: rgba(168,85,247,0.20);
  --line-hi: rgba(168,85,247,0.45);
  --accent: #a855f7;
  --accent-lo: #6b21a8;
  --accent-hi: #cda7ff;
  --accent-glow: rgba(168,85,247,0.50);
  --fg-1: #ebe6f0;
  --fg-2: #a094b0;
  --fg-3: #5e526c;
  --fg-4: #3a3346;
  --font-display: 'Chakra Petch', 'Share Tech Mono', system-ui, sans-serif;
  --font-display-style: italic;
  --font-mono: 'Share Tech Mono', 'JetBrains Mono', ui-monospace, monospace;
  --nav-letter: 0.08em;
}

/* ── Host fixes: pin the injected chrome, push Discourse content below it ─── */
.tv-shared-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9000;
}
html.tv-shared-host body { padding-top: var(--tv-top-h, 96px) !important; }
/* belt-and-suspenders: native Discourse header stays hidden under the shared nav */
html.tv-shared-host .d-header-wrap,
html.tv-shared-host .d-header { display: none !important; }
html.tv-shared-host { --header-offset: 0px !important; }

/* ── Hero80 Network bar ───────────────────────────────────────────────────── */
.hero80 {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 6px 32px;
  background: #04060c;
  border-bottom: 1px solid rgba(243,238,222,0.08);
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.18em; text-transform: uppercase;
  flex-wrap: wrap;
}
.hero80-label { color: rgba(243,238,222,0.45); }
.hero80 a {
  color: rgba(243,238,222,0.55);
  padding: 3px 8px;
  transition: color 140ms ease, background 140ms ease;
  border-radius: 2px;
}
.hero80 a:hover { color: var(--shell-fg-bone); background: rgba(255,255,255,0.04); }
.hero80 a[data-current="true"] {
  color: var(--shell-fg-bone);
  background: linear-gradient(180deg, rgba(232,20,28,0.18), rgba(168,85,247,0.18));
  border: 1px solid rgba(243,238,222,0.18);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.tv-header {
  position: static;
  background: rgba(6,7,13,0.96); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tv-header-ribbon { height: 2px; box-shadow: 0 0 12px var(--shell-red-glow); }
html[data-faction="autobot"] .tv-header-ribbon {
  background: linear-gradient(90deg, var(--shell-red) 0%, var(--shell-red) 70%,
    var(--shell-gold) 72% 73%, var(--shell-purple-hi) 75%, var(--shell-purple-hi) 100%);
  box-shadow: 0 0 12px var(--shell-red-glow);
}
html[data-faction="decepticon"] .tv-header-ribbon {
  background: linear-gradient(90deg, var(--shell-red) 0%, var(--shell-red) 30%,
    var(--shell-gold) 28% 27%, var(--shell-purple-hi) 25%, var(--shell-purple-hi) 100%);
  box-shadow: 0 0 12px var(--shell-purple-glow);
}

.tv-header-row {
  max-width: 1360px; margin: 0 auto; padding: 14px 32px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px;
}
.tv-nav { display: flex; gap: 2px; align-items: center; }
.tv-nav-right { justify-content: flex-end; }
.tv-nav-link {
  font-family: var(--font-body); font-weight: 600; font-size: 11px;
  letter-spacing: var(--nav-letter); text-transform: uppercase;
  color: var(--fg-2); padding: 8px 12px;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
html[data-faction="decepticon"] .tv-nav-link { font-family: var(--font-mono); }
.tv-nav-link:hover { color: var(--fg-1); }
.tv-nav-link[data-active="true"] {
  color: var(--fg-1);
  border-bottom-color: var(--accent);
}

.tv-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tv-brand-wordmark {
  font-family: var(--font-display);
  font-weight: 900; font-style: var(--font-display-style);
  font-size: 22px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--shell-fg-bone);
  display: flex; align-items: baseline; gap: 6px;
}
.tv-brand-wordmark .dot { color: var(--accent); }
.tv-brand-wordmark .ext { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.15em; color: var(--fg-3); }

/* Faction toggle pill */
.faction-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(243,238,222,0.18);
  border-radius: 999px;
  padding: 2px;
  box-shadow: 0 0 18px var(--shell-red-glow);
}
html[data-faction="decepticon"] .faction-toggle { box-shadow: 0 0 18px var(--shell-purple-glow); }
.ft-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(243,238,222,0.6); background: transparent;
  border: 0; padding: 5px 12px; border-radius: 999px;
  transition: all 220ms cubic-bezier(0.2,0.7,0.1,1);
}
html[data-faction="autobot"] .ft-btn[data-faction="autobot"] {
  color: #fff; background: var(--shell-red); box-shadow: 0 0 16px var(--shell-red-glow);
}
html[data-faction="decepticon"] .ft-btn[data-faction="decepticon"] {
  color: #fff; background: var(--shell-purple); box-shadow: 0 0 16px var(--shell-purple-glow);
}
.ft-mark { width: 12px; height: 12px; }

/* ── Auth control (forum only — keeps the bar usable for sign-in) ──────────── */
.tv-auth { display: inline-flex; align-items: center; margin-left: 10px; }
.tv-signin {
  font-family: var(--font-body); font-weight: 700; font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); padding: 6px 14px; white-space: nowrap;
  border: 1px solid var(--line-hi); border-radius: 999px;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.tv-signin:hover { color: var(--fg-1); border-color: var(--accent); background: var(--accent-glow); }
.tv-user-menu { position: relative; display: inline-flex; }
.tv-user-btn { background: transparent; border: 0; padding: 0; display: inline-flex; }
.tv-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}
.tv-user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 190px;
  list-style: none; margin: 0; padding: 6px;
  background: rgba(10,15,26,0.98); border: 1px solid var(--line-hi);
  border-radius: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  display: none; z-index: 9100;
}
.tv-user-dropdown.tc-user-open { display: block; }
.tv-user-link {
  display: block; padding: 8px 12px; border-radius: 4px;
  font-family: var(--font-body); font-size: 12.5px; color: var(--fg-2);
}
.tv-user-link:hover { color: var(--fg-1); background: rgba(255,255,255,0.05); }

/* ── Mobile menu toggle (shown when the side navs collapse) ────────────────── */
.tv-menu-toggle { display: none; background: transparent; border: 0; padding: 8px; flex-direction: column; gap: 4px; }
.tv-menu-toggle .bar { width: 22px; height: 2px; background: var(--fg-1); display: block; }
.tv-mobile-nav { display: none; }

/* ── Responsive: collapse the split navs into a centered wrap ──────────────── */
@media (max-width: 980px) {
  .tv-header-row { grid-template-columns: 1fr; justify-items: center; gap: 12px; padding: 12px 18px; }
  .tv-nav { flex-wrap: wrap; justify-content: center; }
  .tv-nav-right { justify-content: center; }
  .hero80 { font-size: 9.5px; gap: 6px; padding: 6px 12px; }
}
@media (max-width: 560px) {
  .tv-nav-link { padding: 7px 9px; font-size: 10px; }
  .tv-brand-wordmark { font-size: 18px; }
}
