/* Tema scuro, pensato per il telefono. I colori sono tutti qui in cima. */
:root {
  --sfondo: #0f1115;
  --superficie: #181b21;
  --superficie-2: #20242c;
  --bordo: #2a2f38;
  --testo: #e8e9ec;
  --testo-tenue: #9aa0aa;
  --accento: #f2a93b;
  --accento-scuro: #3a2c14;
  --letto: #6b717c;
  --raggio: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sfondo);
  color: var(--testo);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--accento); }

button { font: inherit; color: inherit; }

/* ---------- testata fissa con le sezioni ---------- */

.testata {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 17, 21, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--bordo);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 0;
}

.riga-titolo { display: flex; align-items: center; justify-content: space-between; }

h1 { font-size: 20px; margin: 0; letter-spacing: -0.01em; }

.bottone-icona {
  background: none;
  border: 0;
  font-size: 22px;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  cursor: pointer;
  color: var(--testo-tenue);
}

.aggiornato { margin: 0 0 8px; font-size: 13px; color: var(--testo-tenue); }
.aggiornato.vecchio { color: var(--accento); }

.schede {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
}
.schede::-webkit-scrollbar { display: none; }

.scheda {
  flex: none;
  border: 1px solid var(--bordo);
  background: var(--superficie);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.scheda.attiva { background: var(--accento); border-color: var(--accento); color: #111; font-weight: 600; }

/* ---------- contenuto ---------- */

.contenuto { max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; }

.messaggio { color: var(--testo-tenue); text-align: center; padding: 40px 0; }

.titolo-sezione { font-size: 26px; margin: 4px 0 2px; }
.sottotitolo { color: var(--testo-tenue); margin: 0 0 16px; font-size: 14px; }

.elenco { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.scheda-notizia {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--superficie);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: 14px 16px;
  cursor: pointer;
}
.scheda-notizia:active { background: var(--superficie-2); }
.scheda-notizia h3 { font-size: 17px; line-height: 1.35; margin: 6px 0 6px; }
.scheda-notizia p { margin: 0; color: var(--testo-tenue); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.scheda-notizia.letta h3 { color: var(--letto); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 13px; color: var(--testo-tenue); }
.fonte { color: var(--testo); font-weight: 600; }
.etichetta {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--superficie-2);
  color: var(--testo-tenue);
}
.etichetta.calda { background: var(--accento-scuro); color: var(--accento); }

/* ---------- articolo ---------- */

.articolo h2 { font-size: 26px; line-height: 1.25; margin: 10px 0 10px; letter-spacing: -0.01em; }
.articolo .testo p { font-size: 18px; line-height: 1.65; margin: 0 0 1em; }
.avviso {
  background: var(--superficie);
  border-left: 3px solid var(--accento);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--testo-tenue);
  font-size: 14px;
  margin: 16px 0;
}
.sommario { font-size: 18px; line-height: 1.6; }

.altre-fonti { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--bordo); font-size: 14px; color: var(--testo-tenue); }
.altre-fonti ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.altre-fonti a { display: inline-block; padding: 6px 12px; border: 1px solid var(--bordo); border-radius: 999px; text-decoration: none; color: var(--testo); }

/* ---------- pulsanti di navigazione ---------- */

.pulsante {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: var(--raggio);
  border: 1px solid var(--bordo);
  background: var(--superficie);
  color: var(--testo);
  font-weight: 600;
  cursor: pointer;
}
.pulsante.principale { background: var(--accento); border-color: var(--accento); color: #111; }
.navigazione { display: grid; gap: 10px; margin-top: 28px; }

/* ---------- accadde oggi ---------- */

.evento { display: flex; gap: 14px; background: var(--superficie); border: 1px solid var(--bordo);
  border-radius: var(--raggio); padding: 14px 16px; text-decoration: none; color: var(--testo); }
.evento .anno { flex: none; width: 56px; font-weight: 700; color: var(--accento); font-variant-numeric: tabular-nums; }
.evento p { margin: 0; }
.evento img { flex: none; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--superficie-2); margin-left: auto; }
.attribuzione { font-size: 13px; color: var(--testo-tenue); margin-top: 16px; }

/* ---------- hai finito ---------- */

.fine { text-align: center; padding: 48px 8px 16px; }
.fine .simbolo { font-size: 56px; line-height: 1; }
.fine h2 { font-size: 28px; margin: 16px 0 8px; }
.fine p { color: var(--testo-tenue); margin: 0 0 6px; }
