/* Edicola – stessi colori dell'app Android: inchiostro blu, carta, verde per aggiornare */
:root {
  --inchiostro: #13213A;
  --carta: #F6F4EF;
  --bordo: #E4E1D8;
  --grigio: #6B7280;
  --testo: #1B1F27;
  --verde: #3DDC84;
  --rosso: #E11D48;
  --scala: 1;
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--carta); color: var(--testo); }
body { font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.vista { display: none; min-height: 100%; }
.vista.attiva { display: block; }

/* Testata blu */
.testata { background: var(--inchiostro); color: #fff; padding: calc(var(--top) + 6px) 4px 10px 16px; position: sticky; top: 0; z-index: 5; }
.testata-riga { display: flex; align-items: center; gap: 2px; }
.logo { flex: 1; min-width: 0; }
.logo h1 { margin: 0; font: 700 28px/1.1 Georgia, "Times New Roman", serif; }
.logo p { margin: 2px 0 0; font-size: 12px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: #fff; }
.ico:active { background: rgba(255,255,255,.12); }
.ico.scuro { color: var(--testo); }
.ico.scuro:active { background: rgba(0,0,0,.06); }
.ico.verde { color: var(--verde); }
.ico.verde svg { width: 27px; height: 27px; }
.gira svg { animation: giro .9s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gira svg { animation: none; } }

.ricerca { display: flex; gap: 6px; margin: 8px 12px 0 0; }
.ricerca input { flex: 1; height: 42px; border-radius: 12px; border: 0; padding: 0 14px; font-size: 16px; }
.ricerca .chiudi { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; }

/* Categorie */
.etichette { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--bordo); }
.etichetta { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; min-height: 34px; border-radius: 999px; background: #fff; border: 1px solid var(--bordo); font-size: 13.5px; font-weight: 600; color: var(--testo); }
.etichetta.on { background: var(--inchiostro); border-color: var(--inchiostro); color: #fff; }
.punto { width: 7px; height: 7px; border-radius: 50%; background: var(--rosso); }

.tira { height: 0; overflow: hidden; text-align: center; font-size: 13px; color: var(--grigio); transition: height .15s; }
.tira.vis { height: 34px; line-height: 34px; }

/* Lista */
.lista { padding: 0 14px calc(var(--bottom) + 24px); }
.notizia { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--bordo); cursor: pointer; }
.notizia .corpo { flex: 1; min-width: 0; }
.notizia h3 { margin: 5px 0 0; font: 700 16.5px/1.28 Georgia, "Times New Roman", serif; color: var(--testo); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.notizia p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--grigio); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notizia img { width: 86px; height: 86px; object-fit: cover; border-radius: 8px; background: var(--bordo); flex: none; }
.notizia.grande { display: block; padding: 14px 0; }
.notizia.grande img { width: 100%; height: 200px; border-radius: 10px; margin-bottom: 10px; }
.notizia.grande h3 { font-size: 21px; line-height: 1.24; -webkit-line-clamp: 5; margin-top: 6px; }
.notizia.grande p { font-size: 14px; color: #4B5563; -webkit-line-clamp: 3; margin-top: 6px; }
.tag { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--grigio); white-space: nowrap; overflow: hidden; }
.fonte { color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; flex: none; }
.vuoto { text-align: center; color: var(--grigio); padding: 60px 24px; white-space: pre-line; }

/* Barre delle schermate interne */
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 2px; background: rgba(246,244,239,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: calc(var(--top) + 4px) 6px 4px; border-bottom: 1px solid var(--bordo); }
.barra h2 { margin: 0; font: 700 20px/1.2 Georgia, serif; }
.spazio { flex: 1; }
.testo-btn { min-width: 44px; height: 44px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.testo-btn:active { background: rgba(0,0,0,.06); }
#b-stella.on { color: #D97706; }
#b-stella.on svg { fill: #D97706; }

/* Articolo in modalità lettura */
.articolo { max-width: 720px; margin: 0 auto; padding: 18px 20px calc(var(--bottom) + 40px); }
.articolo h1 { font: 700 calc(25px * var(--scala))/1.22 Georgia, serif; margin: 10px 0 0; }
.articolo .sotto { font-size: calc(17px * var(--scala)); line-height: 1.45; color: #374151; margin: 10px 0 0; }
.articolo .foto { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: 16px; background: var(--bordo); }
.articolo p { font: calc(17.5px * var(--scala))/1.62 Georgia, "Times New Roman", serif; margin: 16px 0 0; }
.articolo h3 { font: 700 calc(19px * var(--scala))/1.3 -apple-system, sans-serif; margin: 24px 0 0; }
.articolo blockquote { font: italic calc(17.5px * var(--scala))/1.55 Georgia, serif; color: #374151; margin: 18px 0 0; padding-left: 14px; border-left: 3px solid var(--bordo); }
.originale { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 28px; height: 48px; border-radius: 12px; background: var(--inchiostro); color: #fff; text-decoration: none; font-weight: 600; }
.nota { font-size: 12px; color: var(--grigio); margin-top: 16px; }
.caricamento { padding: 80px 0; text-align: center; color: var(--grigio); }

/* Impostazioni */
.impostazioni { padding: 8px 16px calc(var(--bottom) + 40px); max-width: 720px; margin: 0 auto; }
.impostazioni h3 { font-size: 13px; color: var(--grigio); font-weight: 600; margin: 22px 4px 8px; }
.scheda { background: #fff; border: 1px solid var(--bordo); border-radius: 16px; overflow: hidden; }
.voce { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--bordo); min-height: 52px; }
.voce:last-child { border-bottom: 0; }
.voce .nome { flex: 1; min-width: 0; }
.voce small { display: block; color: var(--grigio); font-size: 12.5px; }
.interruttore { position: relative; width: 51px; height: 31px; flex: none; }
.interruttore input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; z-index: 1; cursor: pointer; }
.interruttore span { position: absolute; inset: 0; border-radius: 99px; background: #D1D5DB; transition: background .15s; }
.interruttore span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.interruttore input:checked + span { background: #34C759; }
.interruttore input:checked + span::after { transform: translateX(20px); }
.cestino { width: 40px; height: 40px; border-radius: 10px; color: #B42318; display: grid; place-items: center; }
.campo { display: block; margin-top: 10px; }
.campo span { display: block; font-size: 13px; color: var(--grigio); margin-bottom: 4px; }
.campo input, .campo select { width: 100%; height: 46px; border-radius: 12px; border: 1px solid var(--bordo); padding: 0 12px; font-size: 16px; background: #fff; color: var(--testo); }
.colori { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.colori button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; }
.colori button.on { border-color: var(--testo); }
.principale { margin-top: 14px; width: 100%; height: 48px; border-radius: 12px; background: var(--inchiostro); color: #fff; font-weight: 600; }
.principale:disabled { opacity: .5; }
.errore { color: #B42318; font-size: 13px; margin-top: 10px; }
.info { font-size: 13px; color: var(--grigio); line-height: 1.5; margin: 18px 4px 0; }

.avviso { position: fixed; left: 50%; bottom: calc(var(--bottom) + 18px); transform: translate(-50%, 30px); background: #1F2937; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; max-width: 90vw; z-index: 20; }
.avviso.vis { opacity: 1; transform: translate(-50%, 0); }
