/* ════════════════════════════════════════════════════════════════════════
   SITE-WIDE TOP NAV BAR — LinkedIn-style horizontal nav
   Used on every page across imran.theamanuensis.com.
   ════════════════════════════════════════════════════════════════════════ */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Opaque dark background so a light host page (Intelligensicus cream + hero
     image) can't bleed through and wash the bar grey. Reads identically dark
     on every page — matches how it looked over the dark homepage. */
  background: #12161c;
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0;
  height: 52px;
  display: flex;
  align-items: center;
  /* Pin the nav's own font so it stays identical on every page, even ones
     (Apoplexy, Intelligensicus) whose page CSS overrides body to a serif.
     Uses the EXACT homepage body stack (--ic-font default) INCLUDING the
     symbol/emoji fallbacks — without those, the nav-link icon glyphs
     (◐ ◆ ☷ ⌂ ⌥ ✎) resolve to a different font and drift vs homepage. */
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Fira Sans', Ubuntu, Oxygen, 'Oxygen Sans', Cantarell, 'Droid Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lucida Grande', Helvetica, Arial, sans-serif;
  /* Pin line-height to the browser default the nav was designed against, so a
     host page's body line-height (e.g. Apoplexy's 1.7) can't inflate the
     icon-to-label gap. The nav is a SHARED site-wide feature — it must render
     identically on every Amanuensis page and inherit nothing from the page. */
  line-height: normal;
}
.site-nav,
.site-nav * {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Fira Sans', Ubuntu, Oxygen, 'Oxygen Sans', Cantarell, 'Droid Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lucida Grande', Helvetica, Arial, sans-serif;
  line-height: normal;
}

/* Holographic hairline under the nav — the site-wide signature accent. */
.site-nav::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.5px;
  background: linear-gradient(90deg,
    #7fe9ff, var(--ic-accent, #70b5f9), #b89cff, #f3a9d8, #e8c47e, #8fe3b0, #7fe9ff);
  background-size: 200% 100%;
  animation: site-nav-holo 16s linear infinite;
  pointer-events: none;
}

@keyframes site-nav-holo {
  to { background-position: -200% center; }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav::after { animation: none; }
}

.site-nav-inner {
  max-width: 1128px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.site-nav-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #06b6d4 0%, #4f46e5 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.site-nav-search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.site-nav-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.92);
  /* Form controls do NOT inherit font-family by default, so the placeholder
     text drifts per page. Pin it explicitly (same nav stack) so the search
     field reads identically on every page. */
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Fira Sans', Ubuntu, Oxygen, 'Oxygen Sans', Cantarell, 'Droid Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lucida Grande', Helvetica, Arial, sans-serif;
  font-size: 13px;
  line-height: normal;
  outline: none;
}

.site-nav-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-family: -apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Fira Sans', Ubuntu, Oxygen, 'Oxygen Sans', Cantarell, 'Droid Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Lucida Grande', Helvetica, Arial, sans-serif;
  font-size: 13px;
}

.site-nav-search input:focus {
  border-color: var(--ic-accent, #70b5f9);
  background: rgba(255, 255, 255, 0.08);
}

.site-nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 12px;
  font-weight: 400;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
  position: relative;
  top: 1px;
}

.site-nav-link:hover {
  color: rgba(255, 255, 255, 0.92);
}

.site-nav-link.active {
  color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.95);
}

.site-nav-link-icon {
  /* Lock the icon glyphs so they render pixel-identically on EVERY page,
     regardless of which stylesheets that page loads. The icons are Unicode
     symbols (⌂ ⌥ ◐ ◆ ✎ ☷); without a pinned symbol-font + fixed metrics they
     resolve through per-page font-fallback and drift in size/weight.
     'Segoe UI Symbol' is the Windows font that carries these glyphs. */
  font-family: 'Segoe UI Symbol', 'Segoe UI', 'Apple Symbols', 'Noto Sans Symbols', sans-serif !important;
  font-size: 18px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  font-style: normal !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.site-nav-link-label {
  font-size: 11px;
  /* Pin the label colour so it can't inherit a host page's body colour
     (Apoplexy/Intelligensicus set a dark body colour that washed the labels
     out). It must read at the nav's own colour on every page. */
  color: rgba(255, 255, 255, 0.62);
}
.site-nav-link:hover .site-nav-link-label { color: rgba(255, 255, 255, 0.92); }
.site-nav-link.active .site-nav-link-label { color: rgba(255, 255, 255, 0.95); }

@media (max-width: 768px) {
  .site-nav-search { display: none; }
  .site-nav-link-label { display: none; }
  .site-nav-link { padding: 6px 8px; }
  .site-nav-inner { gap: 12px; }
}

/* Adjust page-container top padding so the sticky nav doesn't cover content */
body { padding-top: 0; }
.page-container { padding-top: 24px; }

/* Three-col layout natural placement: aside.left-sidebar (col 1), main.layout-main (col 2), aside.right-rail (col 3). */
/* On narrow viewports, books.css collapses to 2-col then 1-col responsive. */
.layout-3col > .layout-main {
  min-width: 0;
}

/* Override the legacy .books-nav so it doesn't collide with .site-nav */
.books-nav { display: none; }

/* ─── Nav search results dropdown ─────────────────────────────────────── */

.site-nav-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 64vh;
  overflow-y: auto;
  padding: 4px;
  background: rgba(20, 24, 31, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 200;
}

.site-nav-search-results[hidden] { display: none; }

.site-nav-search-result {
  display: block;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
}

.site-nav-search-result:hover,
.site-nav-search-result.active {
  background: rgba(var(--ic-accent-rgb, 112, 181, 249), 0.14);
}

.site-nav-search-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
}

.site-nav-search-section {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(var(--ic-accent-rgb, 112, 181, 249), 0.9);
  border: 1px solid rgba(var(--ic-accent-rgb, 112, 181, 249), 0.35);
  border-radius: 3px;
  padding: 1px 5px;
}

.site-nav-search-desc {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.55);
}

.site-nav-search-empty {
  padding: 12px 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}
