/* Gold navigation chrome. Token fallbacks so this file renders without the look branch.
   Icons inherit color (currentColor). Do not set stroke here. */
:root {
  --alg-nav-bg: #0B0B0C;
  --alg-nav-card: #1A1A1C;
  --alg-nav-border: #2A2A2D;
  --alg-nav-gold: #C9A86A;
  --alg-nav-text: #F2F0EB;
  --alg-nav-muted: #A8A6A1;
  --alg-nav-tap: 48px;
}
html[data-theme="sunlight"] {
  --alg-nav-bg: #FFFFFF;
  --alg-nav-card: #F2F3F5;
  --alg-nav-border: #0A0D14;
  --alg-nav-gold: #6B5420;
  --alg-nav-text: #0A0D14;
  --alg-nav-muted: #3D4250;
}

body.alg-nav-on { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
body.alg-nav-on header.top { background: var(--alg-nav-bg); color: var(--alg-nav-text); border-bottom: 1px solid var(--alg-nav-border); }
body.alg-modal { overflow: hidden; }

.alg-iconbtn, .alg-textbtn, .alg-fab, .alg-row, .alg-bottomnav a, .alg-menu-list a, .alg-av {
  -webkit-tap-highlight-color: transparent;
}
.alg-iconbtn, .alg-textbtn {
  min-width: var(--alg-nav-tap); min-height: var(--alg-nav-tap);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 12px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer;
}
.alg-iconbtn { color: var(--alg-nav-gold); }
.alg-textbtn { color: var(--alg-nav-gold); border-color: var(--alg-nav-gold); font-size: var(--alg-fs-label); }
.alg-iconbtn svg, .alg-fab svg, .alg-row svg, .alg-bottomnav svg, .alg-menu-list svg, .alg-av svg {
  width: 22px; height: 22px; display: block; flex: none;
}
#algNavOpen:focus-visible, #algMenuOpen:focus-visible,
#algNavRoot a:focus-visible, #algNavRoot button:focus-visible,
.alg-sidenav a:focus-visible, .alg-sidenav button:focus-visible,
.pm-tabs.alg-tabs a:focus-visible, nav.tabs.alg-tabs a:focus-visible {
  outline: 3px solid var(--alg-nav-gold); outline-offset: 2px;
}
html[data-theme="sunlight"] .alg-iconbtn:focus-visible,
html[data-theme="sunlight"] .alg-textbtn:focus-visible,
html[data-theme="sunlight"] .alg-fab:focus-visible,
html[data-theme="sunlight"] .alg-row:focus-visible,
html[data-theme="sunlight"] .alg-bottomnav a:focus-visible,
html[data-theme="sunlight"] .alg-menu-list a:focus-visible,
html[data-theme="sunlight"] .alg-drawer__edit:focus-visible,
html[data-theme="sunlight"] .alg-av:focus-visible {
  outline-color: #0A0D14;
}

.alg-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .62); }
.alg-scrim[hidden] { display: none; }

.alg-drawer, .alg-menu, .alg-sheet, .alg-sidenav, .alg-bottomnav, .alg-fab,
#algNavOpen, #algMenuOpen {
  font-family: var(--alg-font-sans);
}
.alg-drawer, .alg-menu, .alg-sheet {
  color: var(--alg-nav-text); background: var(--alg-nav-bg);
  visibility: hidden; pointer-events: none;
}
.alg-drawer.is-open, .alg-menu.is-open, .alg-sheet.is-open { visibility: visible; pointer-events: auto; }
.alg-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 80;
  width: min(88vw, 380px); overflow: auto; padding: 20px 16px 28px;
  border-right: 1px solid var(--alg-nav-border);
  transform: translateX(-105%);
  transition: transform .2s ease, visibility .2s;
}
.alg-drawer.is-open { transform: none; }
.alg-drawer__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.alg-drawer__name {
  margin: 0; font-family: var(--alg-font-serif); font-size: var(--alg-fs-section);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; font-optical-sizing: auto; color: var(--alg-nav-text);
}
.alg-drawer__edit { color: var(--alg-nav-muted); text-decoration: none; font-size: var(--alg-fs-desc); min-height: 48px; min-width: 48px; display: inline-flex; align-items: center; }
.alg-medal {
  width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--alg-nav-gold);
  display: grid; place-items: center; flex: none; overflow: hidden;
}
.alg-medal img { width: 70%; height: auto; display: block; }
.alg-brand { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; min-height: 48px; font-family: var(--alg-font-serif); }
.alg-brand__name { margin: 0; font-weight: 400; font-size: var(--alg-fs-section); line-height: 1.15; letter-spacing: -0.01em; font-optical-sizing: auto; color: var(--alg-nav-text); }
.alg-brand__sub { margin: 2px 0 0; font-size: var(--alg-fs-desc); font-weight: 400; line-height: 1.3; letter-spacing: 0; text-transform: uppercase; color: var(--alg-nav-muted); }
.alg-menu > .alg-brand { padding: 4px 16px 8px; }
.alg-drawer__rule, .alg-sheet__rule {
  height: 1px; margin: 16px 0; border: 0;
  background: linear-gradient(90deg, transparent, var(--alg-nav-gold), transparent);
}
.alg-card {
  background: var(--alg-nav-card); border: 1px solid var(--alg-nav-border);
  border-radius: 16px; overflow: hidden; margin: 0 0 12px;
}
.alg-row {
  width: 100%; min-height: var(--alg-nav-tap); display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border: 0; border-bottom: 1px solid var(--alg-nav-border);
  background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.alg-card .alg-row:last-child { border-bottom: 0; }
.alg-row__ic { color: var(--alg-nav-gold); display: inline-flex; }
.alg-row__tx { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.alg-row__label { font-size: var(--alg-fs-item); font-weight: 600; letter-spacing: 0; color: var(--alg-nav-text); }
.alg-row__go { color: var(--alg-nav-muted); display: inline-flex; }
.alg-row[aria-current="page"],
.alg-menu-list a[aria-current="page"] {
  box-shadow: inset 4px 0 0 var(--alg-nav-gold);
  background: color-mix(in srgb, var(--alg-nav-gold) 16%, transparent);
}
.alg-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 48px; box-sizing: border-box;
  font-size: var(--alg-fs-label); font-weight: 500; letter-spacing: 0; color: var(--alg-nav-gold);
  border: 1px solid var(--alg-nav-gold); border-radius: 999px; padding: 0 10px; line-height: 1.2;
}

.alg-menu {
  position: fixed; inset: 0; z-index: 85; overflow: auto;
  transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
  opacity: 0;
}
.alg-menu.is-open { opacity: 1; transform: none; }
.alg-menu__bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px 4px; position: sticky; top: 0; background: var(--alg-nav-bg); }
.alg-menu__title { flex: 1; margin: 0; font-family: var(--alg-font-sans); font-size: var(--alg-fs-title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; color: var(--alg-nav-text); }
.alg-av {
  width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--alg-nav-gold);
  display: grid; place-items: center; color: var(--alg-nav-gold); text-decoration: none; font-weight: 600; position: relative;
}
.alg-menu-list { list-style: none; margin: 0; padding: 8px 8px 32px; }
.alg-menu-list a {
  display: flex; align-items: flex-start; gap: 12px; min-height: 48px;
  padding: 12px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--alg-nav-border); box-sizing: border-box;
}
.alg-menu-list__ic { color: var(--alg-nav-gold); padding-top: 2px; }
.alg-menu-list__title { display: block; color: var(--alg-nav-text); font-weight: 600; font-size: var(--alg-fs-item); letter-spacing: 0; }
.alg-menu-list__desc { display: block; color: var(--alg-nav-muted); font-size: var(--alg-fs-desc); font-weight: 400; margin-top: 2px; line-height: 1.35; letter-spacing: 0; }

.alg-bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: stretch; justify-content: space-around;
  min-height: 72px; padding: 6px 72px calc(6px + env(safe-area-inset-bottom)) 4px;
  background: var(--alg-nav-bg); border-top: 1px solid var(--alg-nav-border);
}
.alg-bottomnav a {
  flex: 1 1 0; min-width: 48px; min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--alg-nav-muted); text-decoration: none; font-size: var(--alg-fs-label); font-weight: 500; letter-spacing: 0; line-height: 1.15; text-align: center;
}
.alg-bottomnav a[aria-current="page"] { color: var(--alg-nav-gold); }
.alg-bottomnav__tx { max-width: 100%; font-size: var(--alg-fs-label); line-height: 1.15; }

.alg-fab {
  position: fixed; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--alg-nav-gold);
  background: var(--alg-nav-card); color: var(--alg-nav-gold);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.alg-fab[hidden] { display: none; }
@media (max-width: 1279px) {
  .alg-fab { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

.alg-sheet {
  position: fixed; left: 16px; right: 16px; z-index: 80;
  bottom: calc(148px + env(safe-area-inset-bottom));
  max-width: 440px; margin-left: auto;
  background: var(--alg-nav-card); border: 1px solid var(--alg-nav-border);
  border-radius: 28px; padding: 8px 0; max-height: min(60vh, 480px); overflow: auto;
  transform: translateY(12px); opacity: 0; transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.alg-sheet.is-open { opacity: 1; transform: none; }
.alg-sheet .alg-row { background: transparent; }
.alg-sheet__group .alg-row:last-child { border-bottom: 0; }

.alg-sidenav {
  display: none; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
  width: 272px; overflow: auto; padding: 16px 12px 24px;
  background: var(--alg-nav-bg); color: var(--alg-nav-text);
  border-right: 1px solid var(--alg-nav-border);
}
.alg-sidenav[hidden] { display: none !important; }
@media (min-width: 1280px) {
  body.alg-nav-on { padding-bottom: 0; padding-left: 272px; }
  .alg-bottomnav { display: none; }
  body.alg-nav-on .alg-sidenav { display: block; }
  .alg-fab { bottom: 24px; }
  .alg-sheet { bottom: 96px; }
}
body.alg-modal:has(#algMenu.is-open) .alg-fab,
body.alg-modal:has(#algDrawer.is-open) .alg-fab { visibility: hidden; pointer-events: none; }

.pm-tabs.alg-tabs, nav.tabs.alg-tabs {
  display: flex; gap: 8px; overflow-x: auto; border-bottom: 0; margin: 0 0 12px; padding: 8px 4px;
  scrollbar-width: thin;
}
.pm-tabs.alg-tabs a, nav.tabs.alg-tabs a {
  border: 1px solid var(--alg-border, #C9CCD3); border-radius: 999px; border-bottom-width: 1px;
  background: transparent; color: var(--alg-ink, #1A1D24);
  min-height: 48px; padding: 0 14px; box-sizing: border-box; font-size: var(--alg-fs-item);
}
.pm-tabs.alg-tabs a.on, nav.tabs.alg-tabs a.on {
  background: transparent; color: var(--alg-ink, #1A1D24); font-weight: 650;
  border-color: var(--alg-nav-gold); box-shadow: inset 0 0 0 1px var(--alg-nav-gold);
}

html[data-theme="sunlight"] body.alg-nav-on header.top,
html[data-theme="sunlight"] body.alg-nav-on header.top .nav a,
html[data-theme="sunlight"] body.alg-nav-on header.top .albas,
html[data-theme="sunlight"] body.alg-nav-on header.top .brand,
html[data-theme="sunlight"] body.alg-nav-on header.top .theme-btn,
html[data-theme="sunlight"] body.alg-nav-on header.top .proj-slot,
html[data-theme="sunlight"] body.alg-nav-on .alg-iconbtn,
html[data-theme="sunlight"] body.alg-nav-on header.top select {
  color: #0A0D14;
}
html[data-theme="sunlight"] body.alg-nav-on header.top {
  background: #FFFFFF; border-bottom: 2px solid #0A0D14;
}
html[data-theme="sunlight"] body.alg-nav-on header.top select {
  background: #FFFFFF; border-color: #0A0D14; color-scheme: light;
}
html[data-theme="sunlight"] body.alg-nav-on .alg-textbtn { color: #6B5420; border-color: #6B5420; }

@media (prefers-reduced-motion: reduce) {
  .alg-drawer, .alg-menu, .alg-sheet, .alg-scrim, .alg-fab { transition: none; }
}
@media print {
  #algNavRoot, #algNavOpen, #algMenuOpen { display: none !important; }
  body.alg-nav-on { padding: 0 !important; }
}

/* MFA/email-link sign-in: the empty bottom nav is hidden while signed out.
   Author display:flex overrides the HTML hidden attribute unless explicitly restored. */
.alg-bottomnav[hidden] { display: none; }

/* Compact phone header (News/Sports spec 2026-11-15 §1.6 "chrome crowding"): one 56 px row with the logo, Menu and the
   avatar, on the News and Sports pages (body.ns-page, set by news.js). Theme and language stay one tap away in the Menu sheet (nav_shell.js themes/langs), so the header copies hide here. */
@media (max-width:600px){
  body.alg-nav-on.ns-page header.top .albas,
  body.alg-nav-on.ns-page header.top .top-tools .theme,
  body.alg-nav-on.ns-page header.top .top-tools #lang{display:none}
  body.alg-nav-on.ns-page header.top .topbar{flex-wrap:nowrap;min-height:56px;padding:4px 12px}
  body.alg-nav-on.ns-page header.top .brand-lock{min-width:0}
}
