/* TEMA-V8 per le pagine su base.html (fonti, privacy, MetWiki, app, offline,
   notizie vecchie, 404...). site51.

   Si carica DOPO style.css e ne riallinea i token alla grafica di site50
   (fondo azzurro-grigio, schede bianche, blu #2f62e0, titoli sans pieni).
   style.css resta com'e': e' un foglio a strati (5 regole body, piu' blocchi
   :root che si sovrascrivono), e riscriverlo vorrebbe dire ripassare ogni
   pagina. Qui si vince con html body (0,1,2) sulle regole body.sky-* (0,1,1).

   I caratteri ora sono quelli ospitati dal sito: base.html non chiama piu'
   fonts.googleapis.com. Il file di Figtree e' variabile (un solo woff2 per
   tutti i pesi). La famiglia 'Fraunces', scritta a mano in 31 regole di
   style.css, viene fatta puntare a Figtree: i titoli diventano sans come nel
   resto del sito senza toccare quelle 31 regole. */

/* latin-ext */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/font/_Xms-HUzqDCFdgfMm4q9DbZs.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* latin */
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/font/_Xms-HUzqDCFdgfMm4S9DQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/font/_Xms-HUzqDCFdgfMm4q9DbZs.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url(/static/font/_Xms-HUzqDCFdgfMm4S9DQ.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* --- token: gli stessi valori di v2.css TEMA-V8 ---------------------------- */
html:root {
  --brand: #2f62e0; --brand-deep: #13307a; --brand-soft: #e8f0ff;
  --accent: #ffb81f;
  --ink: #0f1d36; --ink-soft: #5a6b86; --ink-faint: #7a8aa3;
  --paper: #e4ecf6; --card: #ffffff; --line: #dfe6f0;
  --sky: #2f62e0; --sky-deep: #1f4fc4;
  --sun: #ffb81f; --sun-deep: #b8791a; --rain: #2f8bff;
  --font-display: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --e-1: 0 1px 2px rgba(15, 29, 54, .05);
  --e-2: 0 1px 2px rgba(15, 29, 54, .04), 0 10px 28px -18px rgba(15, 29, 54, .22);
  --shadow: var(--e-2); --shadow-soft: var(--e-1);
  --sup1-ombra: var(--e-2); --sup1-raggio: 20px;
  --r-lg: 20px;
}
html[data-theme="dark"]:root {
  --brand: #7fa6ff; --brand-deep: #b9cffb; --brand-soft: #16284a;
  --ink: #eef3fb; --ink-soft: #9aa9c2; --ink-faint: #7a8aa3;
  --paper: #0b1424; --card: #142035; --line: #23314a;
  --sky: #7fa6ff; --sky-deep: #9dbcff;
  --sun: #ffc24d; --sun-deep: #e0a94a; --rain: #8fb2f8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 30px -16px rgba(0, 0, 0, .7);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .4);
}

/* --- fondo piatto azzurro-grigio, niente cieli e bagliori a strati -------- */
html body, html body[class] {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
}
html body::before, html body::after { display: none; }

/* --- testata: bianca, marchio nuovo, "oggi" blu --------------------------- */
html body .brand { display: flex; align-items: center; gap: 10px; }
html body .brand .mark, html body .mark { width: 42px; height: 42px; border-radius: 12px; }
html body .brand .word, html body .word {
  font-family: var(--font-ui); font-weight: 700; letter-spacing: -.035em; color: var(--ink);
  font-size: 23px; background: none; -webkit-text-fill-color: currentColor; text-shadow: none;
}
html body .brand .word .q, html body .word .q { color: var(--brand); -webkit-text-fill-color: currentColor; }
html body .mainnav {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--e-1);
}
html body .mainnav a { border-radius: 12px; color: var(--ink); }
html body .mainnav a:hover { background: var(--brand-soft); color: var(--sky-deep); }
html body .themetoggle { width: 44px; height: 44px; }        /* tocco >= 44 px */
html body .tagline {
  background: var(--card); border-color: var(--line); color: var(--sky-deep); animation: none; opacity: 1;
}
html body .tagline i { background: var(--sun); }

/* --- schede e titoli -------------------------------------------------------- */
html body :is(h1, h2, h3) { font-family: var(--font-display); letter-spacing: -.03em; }

/* --- lo "skin" a cielo di style.css (body.sky-sun/sky-cloud ... !important) --
   style.css dipinge schede, ricerca e chip con gradienti crema e bordi sabbia
   usando !important (righe ~3062-3120, e ~3972 per il tema scuro). Qui la
   sola via e' un !important con specificita' maggiore: html:root body[class]
   vale (0,2,2) + la classe, contro body.sky-sun (0,1,1) + la classe. */
html:root body[class] { background: var(--paper) !important; }
html:root body[class] :is(.mainnav,.tagline,.search,.card,.radarcard,.advice,.pushbox,.pushbox-premium,.days,.activityscore,.meteo-brief,.attention-panel,.riskbox,.nowcast,.home-live,.home-city,.home-radar-preview,.home-seo,.seotext,.seoquestions,.metriccard,.severe-gates,.desk-card,.desk-panel,.desk-sources,.desk-empty,.dashitem,.regionrow,.sourcerow,.plan,.proofitem) {
  background: var(--card) !important;
  border-color: var(--line) !important;
  box-shadow: var(--e-2) !important;
}
html:root body[class] .tagline { color: var(--sky-deep) !important; box-shadow: none !important; }
html:root body[class] .search button, html:root body[class] .pushbox-premium button {
  background: var(--brand) !important; color: #fff !important;
}
html:root body[class] :is(.geobtn,.chip,.anchor,.conf) {
  background: var(--brand-soft) !important; border-color: var(--line) !important; color: var(--sky-deep) !important;
}
html:root body[class] :is(.home-city,.home-seo-grid a) { background: var(--card) !important; }
html:root body[class] :is(.nowcast,.nowcast .drop) { background: var(--brand-soft) !important; border-color: var(--line) !important; }
html:root body[class] :is(.attention-item.medium,.hr:first-child) { background: #fff2d6 !important; }
html:root[data-theme="dark"] body[class] :is(.mainnav,.tagline,.search,.card,.radarcard,.advice,.pushbox,.pushbox-premium,.days,.activityscore,.meteo-brief,.attention-panel,.riskbox,.nowcast,.home-live,.home-city,.home-radar-preview,.home-seo,.seotext,.seoquestions,.metriccard,.severe-gates,.desk-card,.desk-panel,.desk-sources,.desk-empty,.dashitem,.regionrow,.sourcerow,.plan,.proofitem) {
  background: var(--card) !important; box-shadow: var(--shadow) !important;
}
html:root[data-theme="dark"] body[class] :is(.geobtn,.chip,.anchor,.conf,.nowcast,.nowcast .drop) { background: var(--brand-soft) !important; }
html:root[data-theme="dark"] body[class] :is(.attention-item.medium,.hr:first-child) { background: #33270f !important; }
html:root[data-theme="dark"] body[class] .search button { color: #0b1424 !important; }

/* --- testi e riquadri con colori scritti a mano in style.css -------------
   (#55707b, rgba bianchi al 76%, verdi #2f9e6b): al buio restavano chiari su
   chiaro o grigi su scuro. Tornano ai token, che cambiano col tema. */
html:root body[class] :is(.mainnav a, .homesub, .loc, .day .dc, .sourcep, .seotext p, .metriccard p, .trust, .sourcepolicy) { color: var(--ink-soft); }
html:root body[class] .mainnav a { color: var(--ink); }
html:root body[class] :is(.riskbox, .hr, .day, .sourceaction, .metricempty, .regionnote) {
  background: var(--card); border-color: var(--line); color: var(--ink);
}
html:root body[class] :is(.sourcestatus.attivo, .sourcestatus.usable_with_attribution, .sourcestatus.usable_with_attribution_daily_only, .regionstatus.ok, .regionstatus.vendibile) { background: #e3f6ec; color: #0e7a47; }
html:root body[class] :is(.sourcestatus.ritardo, .sourcestatus.usable_with_caution, .regionstatus.partial, .regionstatus.quasi) { background: #fff2d6; color: #8a5800; }
html:root body[class] :is(.sourcestatus.fermo, .sourcestatus.assente, .sourcestatus.illeggibile, .sourcestatus.paused_compliance_review) { background: #fdeceb; color: #a1281f; }
html:root body[class] :is(.sourcestatus.non_in_uso, .sourcestatus.ignoto) { background: var(--brand-soft); color: var(--ink-soft); }
/* link dentro i testi: blu del tema (al buio i link delle attribuzioni erano 1,6:1) */
/* SITE58-A11Y: link-in-text-block (Lighthouse 05/10): non solo il colore */
html:root body[class] main :is(p, li, td, dd, .sourceaction, .sourcemeta, .sourcepolicy) a { color: var(--sky-deep); text-decoration: underline; text-underline-offset: .15em; }
/* piede: #7f8c92 e link #6a634d scritti a mano davano 2,9:1 */
html:root body[class] .foot { color: var(--ink-soft); }
html:root body[class] .foot a { color: var(--ink); }
/* link-pillola delle fonti e schede MetWiki: al buio partivano da un fondo quasi bianco */
html:root body[class] .sourcelinks a { background: var(--brand-soft); border-color: var(--line); color: var(--sky-deep); }
html:root body[class] .mw-card { background: var(--card); border-color: var(--line); }
html:root:not([data-theme="dark"]) body[class] .sourcep { color: #47566f; }   /* su fondo tinto era 4,4:1 */
