/* Archivo ospitato in proprio (licenza OFL): un'unica famiglia, larghezza variabile.
   Titoli stretti e neri come sulle maglie e sui tabelloni, testo in larghezza normale. */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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: "Archivo";
  src: url("fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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;
}

:root {
  --paper: #f2f4f7;
  --surface: #ffffff;
  --ink: #151a21;
  --muted: #5d6673;
  --line: #dce1e8;
  --azzurro: #1f4fa0;
  --azzurro-soft: #e3eaf6;
  --chart: #1f4fa0;
  --scarf-edge: rgba(21, 26, 33, 0.12);
  --banner: #fff4d6;
  --banner-ink: #5a4300;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e131a;
    --surface: #151c25;
    --ink: #e7ecf2;
    --muted: #98a3b1;
    --line: #263040;
    --azzurro: #86aeff;
    --azzurro-soft: #1a2638;
    --chart: #5f8ae6; /* validato per i grafici sul fondo scuro */
    --scarf-edge: rgba(231, 236, 242, 0.18);
    --banner: #33290d;
    --banner-ink: #f0d98f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  font-stretch: 100%;
}
a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--azzurro);
  outline-offset: 3px;
  border-radius: 4px;
}

.test-banner {
  margin: 0;
  padding: 8px 16px;
  background: var(--banner);
  color: var(--banner-ink);
  font-size: 14px;
  text-align: center;
}

/* Testata: nome stretto e nero a sinistra, sezioni che restano visibili scorrendo. */
.masthead-inner, .tabs, .page, .site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}
.masthead-inner { padding-top: 32px; padding-bottom: 12px; }
.brand {
  font-size: 44px;
  line-height: 1;
  font-weight: 860;
  font-stretch: 62%;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.tagline { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs a {
  padding: 12px 0 10px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--azzurro); }

.page { padding-top: 8px; padding-bottom: 24px; }
.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 820;
  font-stretch: 70%;
}
.title-scarf {
  flex: none;
  width: 10px;
  height: 34px;
  border-radius: 5px;
  background: var(--scarf);
  box-shadow: inset 0 0 0 1px var(--scarf-edge);
}
.empty { color: var(--muted); margin-top: 32px; }

/* Feed: a sinistra la "sciarpa" con i colori delle squadre, a destra le tacche delle conferme. */
.feed { list-style: none; margin: 0; padding: 0; }
.day h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}
.day h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.item {
  display: grid;
  grid-template-columns: 6px 1fr;
  gap: 16px;
  padding: 16px 0;
}
.item + .item { border-top: 1px solid var(--line); }
.scarf {
  border-radius: 3px;
  background: var(--scarf, var(--line));
  box-shadow: inset 0 0 0 1px var(--scarf-edge);
}
.item-main { min-width: 0; }
.item-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--muted);
}
.item-top time { font-variant-numeric: tabular-nums; }
.item-teams { color: var(--ink); font-weight: 650; }
.item-title {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 760;
  font-stretch: 78%;
  text-decoration: none;
  text-wrap: pretty;
}
.item-title:hover { color: var(--azzurro); }
.item-sources { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.item-sources a { text-decoration: none; }
.item-sources a:hover { color: var(--azzurro); text-decoration: underline; }

.confirm {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
}
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { display: block; width: 4px; border-radius: 1px; background: var(--line); }
.bars i:nth-child(1) { height: 6px; }
.bars i:nth-child(2) { height: 8px; }
.bars i:nth-child(3) { height: 10px; }
.bars i:nth-child(4) { height: 12px; }
.bars i:nth-child(5) { height: 14px; }
.bars i.on { background: var(--azzurro); }

/* Notizia */
.article { max-width: 680px; padding: 24px 0 8px; }
.back { color: var(--muted); font-size: 15px; text-decoration: none; }
.back::before { content: "‹ "; }
.back:hover { color: var(--azzurro); }
.article-scarf {
  display: block;
  width: 72px;
  height: 10px;
  margin-top: 24px;
  border-radius: 5px;
  background: var(--scarf);
  box-shadow: inset 0 0 0 1px var(--scarf-edge);
}
.article h1 {
  margin: 16px 0 0;
  font-size: 36px;
  line-height: 1.1;
  font-weight: 820;
  font-stretch: 72%;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.article-meta .confirm { margin-left: 0; }

/* Bollino delle notizie con una fonte ufficiale (club o federazione). */
.official {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  background: var(--azzurro-soft);
  color: var(--azzurro);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
.official svg { flex: none; }
.official-tag { color: var(--muted); font-size: 14px; }
.team-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.team-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.team-links a:hover { border-color: var(--azzurro); }
.dot-scarf {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--scarf);
  box-shadow: inset 0 0 0 1px var(--scarf-edge);
}
.body { margin: 24px 0 0; font-size: 19px; line-height: 1.65; max-width: 64ch; }
.sources-title { margin: 32px 0 8px; font-size: 17px; font-weight: 750; font-stretch: 85%; }
.sources { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.sources a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--azzurro-soft);
  color: var(--azzurro);
  font-size: 15px;
  font-weight: 650;
  text-decoration: none;
}
.sources a:hover { text-decoration: underline; }
.disclosure {
  margin: 32px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.disclosure a { color: var(--azzurro); }

.prose h2 { margin: 32px 0 4px; font-size: 24px; line-height: 1.2; font-weight: 780; font-stretch: 78%; }
.prose p { margin: 8px 0; max-width: 64ch; }

/* Squadre */
.team-grid {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.team-grid a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.team-grid a:hover .team-name { color: var(--azzurro); }
.team-scarf {
  flex: none;
  width: 8px;
  height: 28px;
  border-radius: 4px;
  background: var(--scarf);
  box-shadow: inset 0 0 0 1px var(--scarf-edge);
}
.team-name { font-size: 19px; font-weight: 760; font-stretch: 78%; }
.count { margin-left: auto; color: var(--muted); font-size: 14px; }

.site-footer {
  margin-top: 40px;
  padding-top: 24px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { margin: 4px 0; }
.site-footer a, .site-footer .link-button { margin-right: 16px; }
.fine { font-size: 13px; }
.prose code { font-size: 0.9em; }

/* Pulsante che si presenta come un link (preferenze cookie). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Riquadro dei cookie: in basso, non copre la lettura, Accetta e Rifiuta con lo stesso peso
   (come chiedono le linee guida del Garante), la X chiude senza accettare. */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  max-width: 440px;
  margin-left: auto;
  padding: 16px 44px 16px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(21, 26, 33, 0.18);
  font-size: 15px;
  line-height: 1.45;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 8px; }
.consent-title { font-weight: 750; font-size: 16px; }
.consent a { color: var(--azzurro); }
.consent-actions { display: flex; gap: 8px; margin-top: 12px; }
.consent-actions button {
  flex: 1;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--azzurro);
  border-radius: 8px;
  background: var(--azzurro);
  color: var(--surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.consent-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.consent-close:hover { color: var(--ink); }
.consent button:focus-visible { outline: 2px solid var(--azzurro); outline-offset: 2px; }

@media (max-width: 520px) {
  .brand { font-size: 38px; }
  .item { gap: 12px; }
  .item-title { font-size: 20px; }
  .article h1 { font-size: 30px; }
  .body { font-size: 18px; }
  .team-grid { grid-template-columns: 1fr; }
}

/* Pagina di statistiche (riservata) */
.stats .masthead-inner { padding-top: 24px; }
.stats .brand { font-size: 32px; }
.stats-page { max-width: 960px; }
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.tile {
  padding: 16px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.tile p { margin: 0; }
.tile-label { font-size: 14px; color: var(--muted); }
.tile-value {
  margin-top: 4px !important;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 820;
  font-stretch: 72%;
  font-variant-numeric: tabular-nums;
}
.tile-note { margin-top: 4px !important; font-size: 13px; color: var(--muted); }
.block { margin-top: 40px; }
.block h2 { margin: 0 0 12px; font-size: 22px; font-weight: 780; font-stretch: 78%; }
.muted { color: var(--muted); font-size: 14px; }

.hbar-chart { position: relative; padding-left: 28px; }
.chart-max { position: absolute; left: 0; top: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars-row {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  align-items: end;
  height: 160px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat;
}
.bar-col { position: relative; display: flex; align-items: flex-end; height: 100%; cursor: default; }
.bar {
  width: 100%;
  min-height: 0;
  border-radius: 4px 4px 0 0;
  background: var(--chart);
}
.bar-col:hover .bar { opacity: 0.75; }
.bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.numbers { margin-top: 32px; font-size: 14px; }
.numbers summary { cursor: pointer; color: var(--azzurro); }

.table-scroll { overflow-x: auto; }
.stats table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats th, .stats td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.stats th { color: var(--muted); font-weight: 650; }
.stats .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats .nowrap { white-space: nowrap; }
.stats td.problem { color: var(--ink); font-weight: 650; }

.meter { margin: 12px 0; font-size: 14px; }
.meter p { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 4px; }
.meter p span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.meter-track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: var(--chart); }

@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
}
