/* shared.css — the site nav (all pages) + the landing page. */
:root {
  --nav-bg: #081109;
  --nav-ink: #eaf2ec;
  --nav-muted: #8fb0a0;
  --nav-accent: #3ea06a;
}
* { box-sizing: border-box; }

/* ---- skip-to-content link (WCAG 2.4.1): hidden until keyboard-focused ---- */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 300;
  background: var(--nav-accent); color: #04120a; font-weight: 800;
  padding: 8px 14px; border-radius: 8px; text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 8px; outline: none; }
#main:focus { outline: none; } /* skip target is programmatic-focus only, no visible ring */

/* ---- visible keyboard-focus ring on all interactive controls (WCAG 2.4.7) ---- */
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--nav-accent); outline-offset: 2px; border-radius: 4px;
}

/* ---- top nav (on every page) ---- */
.site-nav {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  /* env() insets keep the brand/links clear of the notch in landscape; they resolve
     to 0 on non-notched devices, so desktop is unchanged. */
  padding: 8px calc(16px + env(safe-area-inset-right)) 8px calc(16px + env(safe-area-inset-left));
  background: var(--nav-bg); border-bottom: 1px solid #1c3b28;
  position: sticky; top: 0; z-index: 200;
}
.site-nav .site-brand { color: var(--nav-ink); font-weight: 800; text-decoration: none; font-size: 15px; letter-spacing: 0.2px; }
.site-nav .site-links { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.site-nav .site-links a {
  color: var(--nav-muted); text-decoration: none; font-size: 13px; font-weight: 700;
  padding: 6px 11px; border-radius: 8px; border: 1px solid transparent; white-space: nowrap;
}
.site-nav .site-links a:hover { color: var(--nav-ink); background: #10271a; }
.site-nav .site-links a.active { color: #06140b; background: var(--nav-accent); }
.site-nav .site-links a.soon { opacity: 0.5; pointer-events: none; }

/* "International Soccer" folder — a native <details> dropdown in the nav */
.nav-folder { position: relative; }
.nav-folder > summary {
  color: var(--nav-muted); font-size: 13px; font-weight: 700; cursor: pointer;
  padding: 6px 11px; border-radius: 8px; border: 1px solid transparent; white-space: nowrap;
  list-style: none;
}
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary::after { content: " ▾"; opacity: 0.7; }
.nav-folder > summary:hover { color: var(--nav-ink); background: #10271a; }
.nav-folder > summary.active { color: #06140b; background: var(--nav-accent); }
.nav-folder[open] > summary { color: var(--nav-ink); background: #10271a; }
.nav-folder-menu {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 190px; z-index: 250;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--nav-bg); border: 1px solid #2c5c3d; border-radius: 10px; box-shadow: 0 10px 28px #000a;
}
.nav-folder-menu a { color: var(--nav-muted); text-decoration: none; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 7px; white-space: nowrap; }
.nav-folder-menu a:hover { color: var(--nav-ink); background: #123522; }
.nav-folder-menu a.active { color: #06140b; background: var(--nav-accent); }

/* "back to all sports" link on each sport page */
.back-link { display: inline-block; margin: 14px 0 2px; color: #7fd4a1; text-decoration: none; font-size: 13px; font-weight: 700; }
.back-link:hover { color: #eaf2ec; }

/* ---- landing page ---- */
body.landing {
  margin: 0; color: var(--nav-ink); min-height: 100vh; min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #12331f, #0b1f12);
}
.landing-hero { max-width: 900px; margin: 0 auto; padding: 46px 20px 10px; text-align: center; }
.landing-hero h1 { font-size: 34px; margin: 0 0 10px; }
.landing-hero p { color: var(--nav-muted); font-size: 15px; margin: 0 auto; max-width: 560px; line-height: 1.5; }
.sport-grid { max-width: 900px; margin: 26px auto 30px; padding: 0 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
/* ---- "Recently viewed" strip (deep-links back to a sport's saved matchup) ---- */
/* nav.js fills this in and unhides it only when at least one sport has saved state. */
.resume-strip { max-width: 900px; margin: 18px auto 0; padding: 0 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.resume-strip[hidden] { display: none; }
.resume-strip .resume-label { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--nav-muted); }
.resume-card {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--nav-ink); background: #0f2a1a; border: 1px solid #1c3b28;
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 700;
  transition: transform 0.08s ease, background 0.12s ease;
}
.resume-card:hover { transform: translateY(-1px); background: #123522; }
.section-title { max-width: 900px; margin: 30px auto 0; padding: 0 20px; font-size: 20px; color: var(--nav-ink); border-top: 1px solid #1c3b28; padding-top: 26px; }
.sport-card {
  display: block; text-decoration: none; color: var(--nav-ink);
  background: #0f2a1a; border: 1px solid #1c3b28; border-top: 4px solid var(--card, #3ea06a);
  border-radius: 14px; padding: 22px 18px; transition: transform 0.08s ease, box-shadow 0.12s ease;
}
.sport-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px #0007; }
.sport-card .emoji { font-size: 34px; }
.sport-card h2 { margin: 8px 0 4px; font-size: 20px; }
.sport-card p { margin: 0; color: var(--nav-muted); font-size: 13px; line-height: 1.45; }
.sport-card.soon { opacity: 0.55; pointer-events: none; }
.sport-card .tag { display: inline-block; margin-top: 10px; font-size: 11px; font-weight: 800; color: #06140b; background: var(--card, #3ea06a); padding: 2px 8px; border-radius: 999px; }
/* Per-sport card accent, keyed by route. Was an inline style="--card:..." on each card,
   but our CSP (style-src 'self', no unsafe-inline) blocks inline style attributes, so the
   colors never applied and every card fell back to green. Static rules apply cleanly. */
.sport-card[href="/nfl"] { --card: #00338d; }
.sport-card[href="/mlb"] { --card: #d1533f; }
.sport-card[href="/nba"] { --card: #c8102e; }
.sport-card[href="/nhl"] { --card: #00468b; }
.sport-card[href="/mls"] { --card: #1f7a43; }
.sport-card[href="/wnba"] { --card: #c9518f; }
.sport-card[href="/cfb"] { --card: #8a6d3b; }
.sport-card[href="/cbb"] { --card: #b1562f; }
.sport-card[href="/mch"] { --card: #4a90d9; }
.sport-card[href="/epl"] { --card: #3d195b; }
.sport-card[href="/laliga"] { --card: #ee8707; }
.sport-card[href="/bundesliga"] { --card: #d20515; }
.sport-card[href="/seriea"] { --card: #0468b1; }
.sport-card[href="/ligue1"] { --card: #091c3e; }
.sport-card[href="/ligamx"] { --card: #006847; }
.sport-card[href="/nwsl"] { --card: #1a2b5e; }
.sport-card[href="/ucl"] { --card: #1b1464; }
.landing-foot { text-align: center; color: var(--nav-muted); font-size: 12px; padding-bottom: 40px; }

/* ---- Display ads (AdSense) — experience-first ------------------------------------ */
/* A slot is invisible until ads.js reserves it (adds .ad-on) after consent, so when ads
   are OFF or declined there is zero footprint. Reserved min-height prevents layout shift
   when the ad fills. Slots are clearly labeled and never overlap the interactive area. */
.ad-slot { display: none; }
.ad-slot.ad-on {
  display: block; position: relative; box-sizing: border-box;
  max-width: 728px; margin: 16px auto; padding: 16px 8px 4px;
  min-height: 116px; /* reserve space up front → no CLS when the ad arrives */
  background: #0c1f14; border: 1px solid #16351f; border-radius: 12px; overflow: hidden;
}
.ad-slot.ad-on .adsbygoogle { display: block; }
.ad-label { position: absolute; top: 4px; left: 10px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--nav-muted); opacity: 0.65; }
@media (min-width: 768px) { .ad-slot.ad-on { min-height: 140px; } }
@media (prefers-reduced-motion: reduce) { .ad-slot .adsbygoogle { animation: none !important; } }

/* First-party consent banner (only shown when ads are enabled and no choice made yet). */
.ad-consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 400; max-width: 660px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: #10261a; border: 1px solid #2c5c3d; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 8px 30px #0009; color: #eaf2ec; font-size: 13px;
}
.ad-consent-msg { flex: 1 1 220px; line-height: 1.4; }
.ad-consent-btn { border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid #2c5c3d; }
.ad-consent-btn.accept { background: #3ea06a; color: #06140b; border-color: #3ea06a; }
.ad-consent-btn.decline { background: transparent; color: #a9c3b3; }

/* Search no-match / count message (announced via role=status aria-live in the shells). */
.search-empty { max-width: 900px; margin: 4px auto; padding: 0 16px; color: var(--nav-muted, #9fb0a4); font-size: 13px; text-align: center; }
.legend-sep { opacity: 0.4; }

/* Print / Save-as-PDF: strip the chrome, go ink-light, and show the List view (the useful
   printable form) — the app JS builds #list-view on 'beforeprint' so it's populated. */
@media print {
  .site-nav, .skip-link, .ad-slot, .ad-consent, .backdrop, .popover, .compare-drawer,
  .view-toggle-row, .controls, .legend, .scroll-hint, .field-scroll, .surface-scroll,
  #st-view, #stale-banner, #status, #search-empty { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .topbar { background: #fff !important; border: 0 !important; }
  h1, .tagline, .back-link, .list-group, .list-meta { color: #000 !important; }
  #list-view { display: block !important; } /* overrides .hidden {display:none!important} */
  .list-row, .list-section, .list-team { break-inside: avoid; box-shadow: none !important; }
}
