/* ════════════════════════════════════════════════════════════════════
   Windrose unified site-nav stylesheet — loaded automatically by
   site-nav.js so EVERY page (at any depth: root, <lang>/, manuals/*)
   renders the canonical header/nav identically, without depending on the
   page's own styles.css.

   Only contains the nav block (mirrors styles.css lines 25–117). Page
   stylesheets, if linked, are appended after this <link> in document
   order, so they still win on conflicts.
   ════════════════════════════════════════════════════════════════════ */

/* Nav-scoped variable fallbacks so the bar is styled even on pages that
   define no :root of their own. */
#topbar, #lang-row, nav {
  --muted: #aebfdc; --border: rgba(74,158,255,0.12);
  --accent-dark: #1a6abf; --off-white: #f0f4ff;
  --display: "Barlow Condensed","Noto Sans SC",sans-serif;
  --body: "DM Sans","Noto Sans SC",sans-serif;
}
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 203;
  height: 44px; background: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  padding: 0 2rem; box-sizing: border-box;
}
#topbar span { font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.1em; color: #fff; }
#topbar a {
  font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase;
  background: #fff; color: var(--accent-dark); text-decoration: none; padding: 0.3rem 1.1rem; white-space: nowrap;
}
#lang-row { position: fixed; top: 38px; left: 0; right: 0; z-index: 202; height: 36px; display: none; }
/* Site-header nav only — content navs like the onepager .langbar must NOT be fixed */
nav:not(.langbar) {
  position: fixed; top: 44px; left: 0; right: 0; z-index: 200;
  height: 44px; background: rgba(6,15,30,0.97);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch;
  overflow-x: auto; overflow-y: visible !important;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  box-sizing: border-box;
}
.logo {
  font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.08em;
  color: var(--accent); text-decoration: none;
  display: flex; align-items: center; padding: 0 1.5rem;
  border-right: 1px solid var(--border); white-space: nowrap; flex-shrink: 0;
}
.nav-links { display: flex; list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links li { flex: 1 1 0; display: flex; min-width: 7rem; position: relative; }
.nav-links a {
  font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 0;
  border-right: 1px solid var(--border); white-space: nowrap;
  transition: color 0.2s, background 0.2s, font-size 0.15s;
}
.nav-links li:last-child a { border-right: none; }
.nav-links a:hover { background: rgba(74,158,255,0.08); color: var(--off-white); font-size: 1rem; letter-spacing: 0.02em; }
.nav-links a.active { color: var(--accent); }
.nav-dropdown {
  display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 180px; background: #060f1e; border: 1px solid var(--border);
  border-top: 2px solid var(--accent); border-radius: 0 0 8px 8px;
  padding: 0.4rem 0; list-style: none; z-index: 9999;
  box-shadow: 0 12px 32px rgba(0,0,0,0.7); white-space: nowrap;
}
.nav-dropdown li { flex: none; min-width: 0; display: block; }
.nav-dropdown a {
  display: block !important; width: auto !important; height: auto !important;
  padding: 0.5rem 1.1rem !important; font-family: var(--display);
  font-size: 0.875rem !important; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted) !important; text-decoration: none; border-right: none !important;
  justify-content: flex-start !important; background: transparent !important;
  transition: color 0.15s, background 0.15s !important; white-space: nowrap;
}
.nav-dropdown a:hover { color: var(--accent) !important; background: rgba(74,158,255,0.06) !important; }
.nav-links li:hover > .nav-dropdown, .nav-links li:focus-within > .nav-dropdown, .nav-links li.nav-open > .nav-dropdown { display: block; }
@media (max-width: 900px) { .nav-dropdown { display: none !important; } .nav-links li { min-width: 8rem; } .nav-links li.nav-open > .nav-dropdown { display: block !important; } }
#topbar, nav:not(.langbar) { transition: transform 0.3s ease, opacity 0.3s ease; }
body.scrolled-down #topbar { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.scrolled-down nav:not(.langbar) { transform: translateY(-44px); }
body.scrolled-down { padding-top: 44px !important; }

/* ── Search overlay (part of the canonical nav) ───────────────────── */
.search-toggle { font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.06em; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0 1.2rem; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; transition: color 0.15s; flex-shrink: 0; }
.search-toggle:hover { color: var(--off-white); }
.search-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(4,8,18,0.95); backdrop-filter: blur(16px); align-items: flex-start; justify-content: center; }
.search-overlay.open { display: flex; }
.search-box { width: 100%; max-width: 680px; margin-top: 130px; padding: 0 2rem; }
.search-input-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.search-input { flex: 1; background: none; border: none; border-bottom: 2px solid #4a9eff; font-family: var(--display); font-size: 1.25rem; letter-spacing: 0.04em; color: #f0f4ff; padding: 0.4rem 0; outline: none; }
.search-input::placeholder { color: rgba(240,244,255,0.7); }
.search-close { background: none; border: 1px solid rgba(74,158,255,0.12); color: #aebfdc; font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.12em; padding: 0.35rem 0.9rem; cursor: pointer; text-transform: uppercase; transition: color 0.2s, border-color 0.2s; }
.search-close:hover { color: #f0f4ff; border-color: #4a9eff; }
.search-results { list-style: none; max-height: 55vh; overflow-y: auto; }
.search-results li { border-bottom: 1px solid rgba(74,158,255,0.12); }
.search-results a { display: block; padding: 0.8rem 0.5rem; text-decoration: none; transition: background 0.15s; }
.search-results a:hover { background: rgba(74,158,255,0.06); }
.search-results .sr-title { font-family: var(--display); font-size: 0.875rem; color: #f0f4ff; letter-spacing: 0.03em; }
.search-results .sr-page { font-family: var(--display); font-size: 0.875rem; letter-spacing: 0.12em; text-transform: uppercase; color: #4a9eff; margin-top: 0.15rem; }
.search-results .sr-excerpt { font-family: var(--body); font-size: 0.875rem; color: #aebfdc; line-height: 1.5; margin-top: 0.2rem; }
.search-hint { font-family: var(--body); font-size: 0.875rem; color: rgba(122,154,191,0.5); text-align: center; padding: 2rem 0; }

/* ── Shared nav mount placeholder ─────────────────────────────────── */
#site-nav-mount { display: block; }

/* ── Reserve room for the fixed 88px header stack on every page that
      loads this stylesheet. Pages that already set their own body
      padding (appended later in the cascade) keep theirs. ──────────── */
body { padding-top: 88px; }
