/* The navigation (Claude Design, "ניווט מעודכן", 20.11.2026; js/nav.js): the header in navy in both themes ("a header
   that changes colour on every move confuses, and on Maccabi's yellow white text fails"), "שלי" and the sports in its
   middle, "חי עכשיו" and the search at its end; under it the reader's leagues of the sport, then the screens bar. */
html.nav-on {
  --nav-hdr: #0F2247;
  --nav-hdr-line: #0F2247;
  --nav-hdr-ink: #F6F4F0;
  --nav-hdr-ink2: #9DA8C2;
  --nav-on-ink: var(--ds-card);
  --nav-live-dot: #FF5C70;
}
html.nav-on[data-theme="dark"] { --nav-hdr-line: #2A3B66; --nav-hdr-ink: #F1ECE2; --nav-hdr-ink2: #8E9AB8; }

/* ── Level 1: the header ── */
html.nav-on[data-theme] .app-header,
html.nav-on[data-theme] body.team-themed .app-header {
  background: var(--nav-hdr) !important;
  border-bottom: 1px solid var(--nav-hdr-line);
  color: var(--nav-hdr-ink);
}
html.nav-on[data-theme] .app-header .logo-title,
html.nav-on[data-theme] .app-header .header-search-btn,
html.nav-on[data-theme] .app-header .header-settings-btn { color: var(--nav-hdr-ink) !important; }
html.nav-on[data-theme] .app-header .header-search-btn:hover,
html.nav-on[data-theme] .app-header .header-settings-btn:hover { background: rgba(255, 255, 255, .08); }
html.nav-on[data-theme] .app-header .live-pill { display: none; }        /* the date lives in the day row below */
/* One layer above the leagues row, which is one above the pages (home.css: .stub-screen, 100): the header's own menu
   hangs over the row, and the row's lists hang over the page. */
html.nav-on[data-theme] .app-header { position: relative; z-index: 102; }

.nav-sports { display: flex; height: 44px; border: 1.5px solid var(--nav-hdr-ink2); box-sizing: border-box; flex: none; }
.nav-sp {
  display: flex; align-items: center; gap: 7px; padding: 0 16px; height: 100%;
  border: 0; border-inline-start: 1.5px solid var(--nav-hdr-ink2); border-radius: 0;
  background: transparent; color: var(--nav-hdr-ink); font: 600 15px/1 var(--ds-font); white-space: nowrap; cursor: pointer;
}
.nav-sp:first-child { border-inline-start: 0; }
.nav-sp.is-on { background: var(--nav-hdr-ink); color: var(--nav-hdr); font-weight: 800; }
.nav-sp:focus-visible, .nav-live:focus-visible { outline: 2px solid var(--nav-hdr-ink); outline-offset: 2px; }
.nav-live {
  display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 1.5px solid var(--nav-hdr-ink2); border-radius: 0; background: transparent; color: var(--nav-hdr-ink);
  font: 800 14px/1 var(--ds-font); white-space: nowrap; cursor: pointer; flex: none;
}
.nav-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--nav-live-dot); flex: none; }
.nav-live b { font: 700 18px/1 var(--ds-font-num); font-variant-numeric: tabular-nums; }
.nav-live.is-on { background: var(--nav-hdr-ink); color: var(--nav-hdr); }
.nav-search-ph { display: none; }

/* A computer: the sports in the header's middle, the search as a field. */
@media (min-width: 900px) {
  html.nav-on .nav-sports { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
  html.nav-on[data-theme] .app-header .header-search-btn {
    inline-size: 280px; justify-content: flex-start; gap: 8px; padding: 0 12px; box-sizing: border-box;
    display: inline-flex; align-items: center; border: 1.5px solid var(--nav-hdr-ink2);
  }
  html.nav-on .nav-search-ph { display: inline; font: 500 14px/1 var(--ds-font); color: var(--nav-hdr-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* A narrow phone: no room for the settings button in the header; the bar's sixth tab opens them there (owner, 27.11.2026:
   a friend's Galaxy S21 FE "has no settings button"; the header keeps its look), as does the Professor's menu (the
   design's Account board). A wider screen keeps the header's gear and no such tab. */
@media (max-width: 480px) {
  html.nav-on[data-theme] .app-header .header-settings-btn { display: none; }
}
@media (min-width: 481px) {
  html[data-theme] .sn-tab.sn-settings { display: none; }
}
/* A header that does not fit (js/nav.js fitHeader, 27.11.2026): the sport on screen keeps its glyph alone, as the other
   sports on a phone, its name for screen readers; then "חי"/"Live" keeps its dot and number and the sides close in. */
html.nav-tight .nav-sp.is-on:not([data-nav-sport="mine"]) { padding: 0 10px; }
html.nav-tight .nav-sp.is-on:not([data-nav-sport="mine"]) span { position: absolute; inline-size: 1px; block-size: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html.nav-tighter .nav-live::after { content: none; }
html.nav-tighter[data-theme] .app-header .header-inner { padding-inline: 60px 8px; }
html.nav-tighter .nav-sp,
html.nav-tighter .nav-sp:not(.is-on):not([data-nav-sport="mine"]),
html.nav-tight.nav-tighter .nav-sp.is-on:not([data-nav-sport="mine"]) { padding: 0 7px; }
html.nav-tighter .nav-live { padding: 0 6px; }
/* Six tabs on the narrowest phones (320 px, an iPhone SE): a size smaller, so "Standings" stays inside its tab. */
@media (max-width: 340px) {
  html[data-theme] .sn-tab { font-size: 11px; }
}
/* A phone: no room for the word beside the logo; "חי" alone on the live button. */
@media (max-width: 899px) {
  html.nav-on[data-theme] .app-header .logo-title { display: none; }
  html.nav-on .header-inner { gap: 6px; }
  .nav-sp { padding: 0 11px; gap: 5px; }
  .nav-live span { display: none; }
  .nav-live { padding: 0 10px; gap: 6px; }
  .nav-live::after { content: "חי"; order: 1; }
  html[dir="ltr"] .nav-live::after { content: "Live"; }
  .nav-live b { order: 2; }
}
/* Two live sports on a phone (football joined, 24.11.2026): a sport not on screen shows its glyph alone, its name kept
   for screen readers, and the header's spaces close a little, so it still fits a 375px phone with two-digit live games. */
@media (max-width: 520px) {
  html.nav-on .header-inner { gap: 4px; padding-inline-end: 10px; }
  .nav-sp { padding: 0 8px; gap: 4px; }
  .nav-live { padding: 0 8px; gap: 4px; }
  .nav-sp:not(.is-on):not([data-nav-sport="mine"]) { padding: 0 10px; }
  .nav-sp:not(.is-on):not([data-nav-sport="mine"]) span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; }
}

/* ── Level 2: the reader's leagues of the sport ── */
/* Above the screens bar (sticky, 99) and above every page that covers the screen (.stub-screen: fixed, 100, and later in
   the document, so an equal layer lost to it), so "עוד" and "כל הליגות" open over them; under the header (102).
   At 100 the list was cut where the page began: football's league page, the table, the injuries (owner, 25.11.2026:
   "the leagues are hidden", and on a phone, where the list hangs wholly over the page, "nothing shows at all"). */
.league-row { position: relative; z-index: 101; background: var(--ds-card); border-bottom: 1px solid var(--ds-line); }
.league-row[hidden] { display: none; }
.nav-row-in { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 40px; box-sizing: border-box; max-width: 1440px; margin: 0 auto; }
.nav-row-k { font: 800 13px/1 var(--ds-font); color: var(--ds-ink2); white-space: nowrap; flex: none; }
/* The chips take their own width and shrink when the row is short, so "עוד" and "כל הליגות" sit right after them. */
.nav-chips { display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
.nav-chip, .nav-more, .nav-all {
  display: flex; align-items: center; gap: 8px; height: 44px; box-sizing: border-box; flex: none;
  border: 1.5px solid var(--ds-line); border-radius: 0; background: transparent; color: var(--ds-ink);
  font: 700 15px/1 var(--ds-font); white-space: nowrap; cursor: pointer;
}
.nav-chip { padding-inline: 10px 14px; }
.nav-chip[hidden], .nav-more[hidden] { display: none; }
.nav-chip.is-on { background: var(--ds-ink); color: var(--ds-card); border-color: var(--ds-ink); font-weight: 800; }
.nav-chip:hover:not(.is-on) { background: var(--ds-soft); }
.nav-mk { display: grid; place-items: center; flex: none; }
.nav-more { padding: 0 12px; gap: 6px; border-color: var(--ds-ink); font-weight: 800; }
.nav-more[aria-expanded="true"] { background: var(--ds-ink); color: var(--ds-card); }
.nav-more-wrap, .nav-all-wrap { position: relative; flex: none; }
.nav-sep { flex: none; width: 1px; height: 28px; margin-inline: 4px; background: var(--ds-line); }
.nav-all { padding: 0 14px; border-color: var(--ds-ink); font-weight: 800; }
/* Lit while open, and while the league on screen is one he opened from it rather than one of his row. */
.nav-all.is-on, .nav-all.is-cur { background: var(--ds-ink); color: var(--ds-card); }
.nav-chip:focus-visible, .nav-more:focus-visible, .nav-all:focus-visible { outline: 2px solid var(--ds-ink); outline-offset: 2px; }

/* Both lists hang from the button's outer edge and open back over the chips, so they never leave the row. */
.nav-drop {
  position: absolute; top: 52px; inset-inline-end: 0; width: 300px; z-index: 40;
  display: flex; flex-direction: column; background: var(--ds-card); border: 1.5px solid var(--ds-ink);
  box-shadow: 0 18px 44px rgba(15, 34, 71, .3);
}
.nav-drop[hidden] { display: none; }
.nav-drop-it {
  display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 14px; border: 0; border-top: 1px solid var(--ds-line);
  background: transparent; color: var(--ds-ink); font: 700 15px/1.2 var(--ds-font); text-align: start; cursor: pointer;
}
.nav-drop-it:first-child { border-top: 0; }
.nav-drop-it:hover { background: var(--ds-soft); }
.nav-drop-order { border-top: 1.5px solid var(--ds-ink); font-size: 14px; font-weight: 800; }

/* "כל הליגות": every league of the sport in one plain list, with today's games under each name. */
.nav-alllist { width: 340px; max-height: min(70vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.nav-al-it { min-height: 58px; }
.nav-al-it.is-on { background: var(--ds-soft); }
.nav-al-it > svg { flex: none; margin-inline-start: auto; }
.nav-al-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav-al-t b { font: 800 15px/1.2 var(--ds-font); }
.nav-al-t span { font: 500 12px/1.3 var(--ds-font); color: var(--ds-ink2); }
/* The follow button by a league's name on its own page. */
.nav-pl-f {
  display: flex; align-items: center; justify-content: center; gap: 5px; height: 44px; min-width: 86px; padding: 0 10px; box-sizing: border-box; flex: none;
  border: 1.5px solid var(--ds-ink); border-radius: 0; background: transparent; color: var(--ds-ink); font: 800 14px/1 var(--ds-font); cursor: pointer;
}
.nav-pl-f.is-on { background: var(--ds-ink); color: var(--ds-card); }

/* ── A league's own page: its heading over the one-league board ── */
.nav-lghead { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 4px 0 4px; }
.nav-lghead[hidden] { display: none; }
.nav-lghead h1 { margin: 0; font: 900 30px/1 var(--ds-font); color: var(--ds-ink); }
.nav-lghead-sub { font: 600 14px/1.3 var(--ds-font); color: var(--ds-ink2); padding-top: 6px; }
.nav-lghead .nav-pl-f { margin-inline-start: auto; }
/* The leagues row is the league picker now: the board's own select row and the league bar step aside; "שלי" and "הכל"
   moved to the header and to "כל הליגות", so the home's own toggle bar goes too. */
html.nav-on #hs-bar,
html.nav-on #home-grid .dn-bar2,
html.nav-on.nav-league #league-bar { display: none !important; }

/* "שלי" mixes every league: the side shows the Professor's analyses of his games and his teams' news (nav.js), and leaves
   out one league's table, leaders and news. */
html.nav-on.nav-mine #home-table,
html.nav-on.nav-mine #home-leaders,
html.nav-on.nav-mine #home-news { display: none !important; }
/* A league's page names the league, its phase and round in its heading: the games card keeps only its count. */
html.nav-on.nav-league #games-meta { display: none !important; }

.nav-mine-side { display: flex; flex-direction: column; gap: 16px; }
.nav-mine-side[hidden] { display: none; }
/* A phone lays the home out in one column by `order` (home_board.css). His teams' news comes right after "שלי"'s games
   (#hs-body, order 4), before the fantasy card: not above everything (owner, 20.11: "why did the news move to the
   top?"), and not a sixth button in the bottom bar (owner: "do as you recommended"). "שלי" hides the one-league
   table and leaders (5, 6), so nothing else stands between. */
@media (max-width: 559px) { #nav-mine-side { order: 5; } }
.nav-side-card { background: var(--ds-card); border: 1px solid var(--ds-line); }

/* ── The results strip: on a computer, inside a league, off its games screen (the design's answer 2) ── */
html.nav-on:not(.nav-strip) #dash-strip-bar { display: none !important; }

/* ── A phone: the row scrolls under the finger, "כל הליגות" right after the chips; its list drops the whole width ── */
@media (max-width: 719px) {
  .nav-row-in { height: 60px; padding: 0; gap: 0; }
  .nav-row-k { padding-inline-start: 12px; }
  .nav-chips { overflow-x: auto; scrollbar-width: none; padding: 0 12px; gap: 6px; height: 60px; }
  .nav-chips::-webkit-scrollbar { display: none; }
  .nav-chip { height: 44px; padding-inline: 10px 12px; gap: 7px; font-size: 14px; }
  .nav-sep { display: none; }
  .nav-all-wrap { position: static; }
  .nav-all { height: 60px; margin: 0; padding: 0 12px; gap: 6px; border: 0; border-inline-start: 1px solid var(--ds-line); font-size: 13px; background: var(--ds-card); }
  .nav-all > svg:last-child { display: none; }
  .nav-alllist { top: 60px; left: 0; right: 0; width: auto; max-height: calc(100vh - 150px); border-inline: 0; }
  .nav-lghead h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: no-preference) {
  .nav-chip, .nav-sp, .nav-pl-f { transition: background-color .15s ease, color .15s ease; }
}
