/* Aurunci · portale
   Colori come token: chiaro di default, scuro da sistema o da interruttore.
   Notizie = terracotta; il blu distingue gli enti pubblici.
   Lo usano anche proponi.html, admin.html e comune.html: le classi di base restano. */

:root {
  color-scheme: light;
  --bg: #F5F2EB;
  --surface: #FBF9F4;
  --surface-2: #F0ECE3;
  --ink: #1F1F1F;
  --heading: #1A2B4C;
  --text-2: #4A4A4A;
  --muted: #6B6B6B;
  --line: rgba(26, 43, 76, .12);
  --line-2: rgba(26, 43, 76, .22);
  --accent: #A8422D;          /* testo e link in evidenza (5.6:1 sulla carta) */
  --accent-bg: #A8422D;
  --on-accent: #FBF9F4;
  --accent-soft: #EBA48F;     /* su blu notte: 7:1 */
  --navy: #1A2B4C;
  --on-navy: #FBF9F4;
  --s-news: #C4553D;
  --ente: #2A78D6;            /* barre e segni degli enti pubblici */
  --ente-ink: #1F63B8;        /* testo blu: 5:1 sulla carta */
  --ente-bg: rgba(42, 120, 214, .10);
  --sea: #DCE5EB;
  --land: #F0ECE3;
  --river: #8DB0CC;
  --grid: #E1DED5;
  --axis: #C3C2B7;
  --ok: #0A7F0A;
  --bad: #C03030;
  --pill: rgba(26, 43, 76, .07);
  --shadow: 0 12px 40px rgba(26, 43, 76, .18);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1360px;
  --gut: clamp(16px, 3vw, 40px);
  --r: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11151B; --surface: #171B22; --surface-2: #1E232C;
    --ink: #ECE8E1; --heading: #F1EDE6; --text-2: #C9C5BE; --muted: #A29E97;
    --line: rgba(255, 255, 255, .10); --line-2: rgba(255, 255, 255, .20);
    --accent: #EBA48F; --accent-bg: #B5492F; --on-accent: #FFF8F4;
    --navy: #2B3C5E; --on-navy: #F1EDE6;
    --s-news: #D9694F; --ente: #3987E5; --ente-ink: #7FB2F0; --ente-bg: rgba(57, 135, 229, .16);
    --sea: #1B2A38; --land: #1A1F27; --river: #3B6585;
    --grid: #2A2F38; --axis: #3A404A;
    --ok: #2FBF2F; --bad: #F06A6A;
    --pill: rgba(255, 255, 255, .08);
    --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11151B; --surface: #171B22; --surface-2: #1E232C;
  --ink: #ECE8E1; --heading: #F1EDE6; --text-2: #C9C5BE; --muted: #A29E97;
  --line: rgba(255, 255, 255, .10); --line-2: rgba(255, 255, 255, .20);
  --accent: #EBA48F; --accent-bg: #B5492F; --on-accent: #FFF8F4;
  --navy: #2B3C5E; --on-navy: #F1EDE6;
  --s-news: #D9694F; --ente: #3987E5; --ente-ink: #7FB2F0; --ente-bg: rgba(57, 135, 229, .16);
  --sea: #1B2A38; --land: #1A1F27; --river: #3B6585;
  --grid: #2A2F38; --axis: #3A404A;
  --ok: #2FBF2F; --bad: #F06A6A;
  --pill: rgba(255, 255, 255, .08);
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { margin: 0; color: var(--heading); line-height: 1.2; }
h2 { font-family: var(--serif); font-weight: 500; font-size: 20px; }
h3 { font-size: 15px; }
p, figure { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--heading); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--s-news); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--navy); color: var(--on-navy); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.kicker { font-size: 12px; line-height: 1.3; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.note, .credit { font-size: 12px; color: var(--muted); margin-top: 10px; }
.credit a { color: inherit; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; }

/* ---------------------------------------------------------------- bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; font-size: 14.5px; font-weight: 600; line-height: 1.2; text-decoration: none; background: none; text-align: center; }
.btn .ico { width: 18px; height: 18px; }
.btn.full { width: 100%; }
.btn-primary { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); color: var(--on-accent); }
.btn-ghost { border-color: var(--line-2); color: var(--heading); background: var(--surface); }
.btn-ghost:hover { border-color: var(--heading); color: var(--heading); }
.btn-light { background: var(--on-navy); color: #1A2B4C; }
.btn-light:hover { color: #1A2B4C; filter: brightness(.96); }
.btn-outline-light { border-color: color-mix(in srgb, var(--on-navy) 45%, transparent); color: var(--on-navy); }
.btn-outline-light:hover { color: var(--on-navy); border-color: var(--on-navy); }
.btn .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--pill); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.btn-propon svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-propon .sm { display: none; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: var(--heading); }
.icon-btn svg { width: 20px; height: 20px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.small { font-size: 13px; }

/* ---------------------------------------------------------------- testata */
.masthead { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.masthead-inner { height: 72px; display: flex; align-items: center; gap: 28px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 25px; font-weight: 600; letter-spacing: -.01em; color: var(--heading); text-decoration: none; white-space: nowrap; }
.wordmark:hover { color: var(--heading); }
.wordmark em { font-style: italic; font-weight: 500; color: var(--accent); }
.wordmark span { color: var(--s-news); }
.wordmark .wm { color: inherit; } /* nome e punto restano un solo elemento: il gap del flex non li separa */
.wordmark .wm span { font-style: italic; font-weight: 500; } /* «.it» in corsivo terracotta */
.wordmark.light .wm span { color: var(--accent-soft); }
.wordmark .logo { width: 32px; height: 32px; flex: 0 0 auto; }
.wordmark.light { color: var(--on-navy); }
.wordmark.light em { color: var(--accent-soft); }
.nav { display: flex; gap: 24px; font-size: 15px; }
.nav a, .nav .link-btn { color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav .link-btn:hover { color: var(--heading); }
.nav a[aria-current="page"] { color: var(--heading); font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 8px; }
.masthead-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.top-search { display: flex; align-items: center; gap: 8px; width: 290px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); }
.top-search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.top-search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; color: var(--ink); outline: none; }
.top-search:focus-within { border-color: var(--heading); }
.mob-only { display: none; }

/* ---------------------------------------------------------------- data e comuni */
.edition { border-bottom: 1px solid var(--line); }
.edition-inner { display: flex; align-items: center; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
.ed-date { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; white-space: nowrap; }
#oggiData { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--heading); }
.ed-upd { font-size: 13px; color: var(--muted); }
.town-chips { display: flex; gap: 8px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.town-chips::-webkit-scrollbar { display: none; }
/* Con il mouse la riga dei comuni mostra una barra sottile: senza, non si capirebbe che continua. */
@media (hover: hover) and (pointer: fine) {
  .town-chips { scrollbar-width: thin; padding-bottom: 4px; }
  .town-chips::-webkit-scrollbar { display: block; height: 6px; }
  .town-chips::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
}
.wt-toggle { margin-top: 6px; font-size: 13.5px; }
.chip { flex: 0 0 auto; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; text-decoration: none; }
.chip:hover { border-color: var(--heading); color: var(--heading); }
.chip[aria-checked="true"], .chip[aria-pressed="true"], .chip.on, .chip[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.chip .sm { display: none; }
.chip-sm { min-height: 36px; font-size: 13.5px; }

/* ---------------------------------------------------------------- allerta */
.lvl { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.lvl::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lvl); flex: 0 0 auto; }
.lvl-verde { --lvl: #0ca30c; color: var(--ok); }
.lvl-gialla { --lvl: #fab219; }
.lvl-arancione { --lvl: #ec835a; }
.lvl-rossa { --lvl: #d03b3b; }
.alert-banner { margin-top: 18px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); border-left: 6px solid var(--lvl); font-size: 15px; color: var(--ink); }
.alert-banner a { font-weight: 600; }

/* ---------------------------------------------------------------- prima pagina: notizia del giorno e meteo */
.hero { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px; padding-top: 26px; }
.hero.solo { grid-template-columns: minmax(0, 1fr); }
.evidenza { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); min-height: 400px; border-radius: 20px; overflow: hidden; background: var(--navy); color: var(--on-navy); }
.evidenza.no-photo, .evidenza.vuota { grid-template-columns: minmax(0, 1fr); }
.ev-text { display: flex; flex-direction: column; gap: 14px; padding: 32px 36px; min-width: 0; }
.ev-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ev-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-soft); }
.ev-why { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--on-navy) 13%, transparent); }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; color: color-mix(in srgb, var(--on-navy) 78%, transparent); }
.ev-cat { font-weight: 600; color: var(--on-navy); }
.ev-title { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.8vw, 40px); line-height: 1.15; color: var(--on-navy); }
.ev-title a { color: inherit; text-decoration: none; }
.ev-title a:hover { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; }
.ev-sum { max-width: 68ch; font-size: 16.5px; line-height: 1.55; color: color-mix(in srgb, var(--on-navy) 86%, transparent); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ev-alt { max-width: 68ch; padding-left: 12px; border-left: 2px solid var(--accent-soft); font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.45; color: color-mix(in srgb, var(--on-navy) 86%, transparent); }
.ev-alt span { font-family: var(--sans); font-style: normal; font-size: 13px; color: color-mix(in srgb, var(--on-navy) 70%, transparent); }
.ev-foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.ev-src { font-size: 13.5px; color: color-mix(in srgb, var(--on-navy) 78%, transparent); }
.ev-fig { position: relative; min-height: 220px; }
.ev-fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-fig figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px; background: rgba(17, 21, 27, .8); color: #F1EDE6; font-size: 11.5px; line-height: 1.4; }
.ev-fig figcaption a { color: inherit; }
.evidenza.vuota { background: var(--surface); color: var(--ink); border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent); min-height: 0; }
.evidenza.vuota .ev-eyebrow { color: var(--accent); }
.evidenza.vuota .ev-title { color: var(--heading); }
.evidenza.vuota .ev-sum { color: var(--text-2); }
.hero-meteo { display: flex; }
.hero-meteo > .w { flex: 1; }

/* ---------------------------------------------------------------- widget */
.w { display: flex; flex-direction: column; gap: 12px; }
.card.w { padding: 22px 24px; }
.w h2 { font-size: 21px; }
.w-head { display: flex; align-items: center; gap: 10px; }
.w-head .ico { color: var(--ente-ink); }
.w-aside { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.w-src { font-size: 13px; color: var(--muted); }
.w-tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ente-ink); }
.w-title { display: block; margin: 4px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--heading); text-decoration: none; }
a.w-title:hover { color: var(--accent); text-decoration: underline; }
.w-list { list-style: none; margin: 0; padding: 0; }
.w-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.w-more { font-size: 14px; font-weight: 600; }
.w-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.w .credit { margin-top: 0; }

.w-meteo .lvl { font-size: 14px; }
.wt { width: 100%; border-collapse: collapse; font-size: 14px; }
.wt th, .wt td { padding: 7px 0; border-top: 1px solid var(--line); text-align: left; font-weight: 400; }
.wt thead th { border-top: 0; padding-top: 0; font-size: 12px; color: var(--muted); }
.wt tbody th a { color: var(--heading); font-weight: 500; text-decoration: none; }
.wt tbody th a:hover { color: var(--accent); text-decoration: underline; }
.wt .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wt-now { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.wt-now b { color: var(--heading); }
.wx { width: 20px; height: 20px; vertical-align: -4px; color: var(--text-2); flex: 0 0 auto; }
.wx-lg { width: 44px; height: 44px; color: var(--heading); }
.wm-now { display: flex; align-items: center; gap: 14px; }
.wm-temp { font-size: 44px; font-weight: 600; letter-spacing: -.02em; line-height: 1; color: var(--heading); font-variant-numeric: tabular-nums; }
.wm-sky { display: grid; font-size: 13.5px; line-height: 1.35; color: var(--text-2); }
.wm-sky strong { font-size: 15px; color: var(--heading); }
.wm-days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wm-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; border-radius: 12px; background: var(--bg); font-size: 12.5px; color: var(--text-2); text-align: center; }
.wm-day b { font-size: 14.5px; color: var(--heading); font-variant-numeric: tabular-nums; }
.wm-dn { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.wm-rain { font-size: 11.5px; }
.wm-sun { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.wm-sun .ico { width: 18px; height: 18px; color: var(--muted); }
.wm-sun .ico + .ico, .wm-sun .ico:nth-of-type(2) { margin-left: 12px; }

.w-avvisi { padding: 20px 22px; border-radius: var(--r); background: var(--ente-bg); }
.w-avvisi .w-head { color: var(--ente-ink); }

.card.w.w-cdg { padding: 0; overflow: hidden; gap: 0; }
.cdg-fig img { display: block; width: 100%; height: 220px; object-fit: cover; }
.cdg-fig figcaption { margin: 8px 24px 0; }
.cdg-ph { display: flex; align-items: flex-end; height: 150px; padding: 18px 24px; background: var(--navy); }
.cdg-ph span { font-family: var(--serif); font-style: italic; font-size: 34px; line-height: 1; color: color-mix(in srgb, var(--on-navy) 55%, transparent); }
.cdg-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 24px 22px; }
.cdg-name { margin-top: 2px; font-size: 30px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.facts b { display: block; font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.15; color: var(--heading); }
.facts span { font-size: 12px; color: var(--muted); }
.cdg-vedere { padding-top: 14px; border-top: 1px solid var(--line); }
.cdg-vedere ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.cdg-vedere b { font-weight: 600; color: var(--heading); }

.luoghi { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.luogo { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.luogo b { font-size: 15px; line-height: 1.3; color: var(--heading); }
.w-row .luoghi { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-right: calc(var(--gut) * -1); padding-right: var(--gut); }
.w-row .luoghi::-webkit-scrollbar { display: none; }
.w-row .luogo { flex: 0 0 210px; scroll-snap-align: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); align-content: start; }

.w-chi .bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-l { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-2); }
.bar-l b { font-variant-numeric: tabular-nums; color: var(--heading); }
.bar-t { display: block; height: 8px; margin-top: 4px; border-radius: 4px; background: var(--s-news); }
.bar-t.is-ente { background: var(--ente); }
.ente { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--ente-bg); color: var(--ente-ink); font-size: 11px; font-weight: 600; letter-spacing: .02em; vertical-align: 1px; }

.w-trapoco { padding: 22px 20px; border-radius: var(--r); background: var(--navy); color: var(--on-navy); }
.w-trapoco .kicker { color: var(--accent-soft); }
.w-trapoco h2 { font-size: 22px; line-height: 1.25; color: var(--on-navy); }
.w-trapoco .w-src { color: color-mix(in srgb, var(--on-navy) 80%, transparent); }

.w-proponi { padding: 24px; border-radius: var(--r); background: var(--surface-2); }
.w-proponi h2 { font-size: 24px; }
.w-proponi p { font-size: 15px; color: var(--text-2); }
.w-proponi .btn { align-self: flex-start; }

/* ---------------------------------------------------------------- mappa */
.map-box { border-radius: 12px; overflow: hidden; background: var(--land); }
.map { display: block; width: 100%; height: auto; }
.map-town .dot { fill: var(--accent-bg); stroke: var(--surface); stroke-width: 3; }
.map-town.dim .dot { fill: var(--muted); }
.map-town.on .dot { stroke-width: 4; }
.map-label { font: 600 19px var(--sans); fill: var(--heading); paint-order: stroke; stroke: var(--land); stroke-width: 5px; stroke-linejoin: round; }
.map-town.dim .map-label { fill: var(--muted); font-weight: 500; }
.map-town.on .map-label { font-size: 23px; font-weight: 700; }
.map-ref { font: italic 500 17px var(--sans); fill: var(--muted); }
.map a:hover .dot, .map a:focus .dot { fill: var(--heading); }
.map a:hover .map-label { text-decoration: underline; }

/* ---------------------------------------------------------------- sezioni */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 16px; }
.sec-head h2 { font-size: clamp(28px, 3vw, 34px); }
.sec-link { margin-left: auto; font-weight: 600; font-size: 15px; text-decoration: none; }
.sec-link:hover { text-decoration: underline; }
.periodi { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--pill); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.periodi::-webkit-scrollbar { display: none; }
.periodo { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--text-2); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.periodo:hover { color: var(--heading); }
.periodo[aria-pressed="true"] { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 3px rgba(26, 43, 76, .18); }
.periodo .n { font-size: 12px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- agenda */
.agenda-sec { padding-top: 52px; }
.agenda-when { margin: -4px 0 14px; font-size: 15px; color: var(--text-2); }
.agenda-when::first-letter { text-transform: uppercase; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 230px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.wk-h { display: flex; align-items: baseline; gap: 6px; padding: 14px 14px 10px; border-left: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.wk-h:first-child { border-left: 0; }
.wk-h b { font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--heading); }
.wk-h.oggi { background: var(--surface-2); }
.wk-oggi { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--accent-bg); color: var(--on-accent); font-size: 11px; font-weight: 600; }
.wk-later { background: var(--surface-2); }
.wk-h.wk-later strong { font-size: 14px; color: var(--heading); }
.bar { margin: 3px 6px; padding: 7px 12px; border-radius: 10px; background: var(--pill); font-size: 13px; line-height: 1.35; color: var(--text-2); min-width: 0; }
.bar a { color: var(--heading); font-weight: 600; text-decoration: none; }
.bar a:hover { color: var(--accent); text-decoration: underline; }
.bar-ente { background: var(--ente-bg); }
.wk-cell { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 220px; padding: 10px 8px 18px; border-left: 1px solid var(--line); }
.wk-cell.first { border-left: 0; }
.ev { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg); min-width: 0; }
.wk-later .ev { background: var(--surface); }
.ev-h { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.ev a, .ev > span:not(.ev-h):not(.ev-s) { font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--heading); text-decoration: none; overflow-wrap: anywhere; }
.ev a:hover { color: var(--accent); text-decoration: underline; }
.ev-s { font-size: 12px; color: var(--muted); }
.wk-empty { padding: 8px 6px; font-size: 13px; color: var(--muted); }
.wk-later .link-btn { margin-top: auto; padding: 6px; text-align: left; font-size: 14px; }

.giorni { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; scroll-behavior: smooth; }
.giorni::-webkit-scrollbar { display: none; }
.giorno { flex: 0 0 auto; width: 58px; min-height: 68px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 0; color: var(--text-2); }
.giorno:hover { border-color: var(--heading); }
.giorno.in { background: color-mix(in srgb, var(--navy) 9%, var(--surface)); }
.g-sem { font-size: 11.5px; font-weight: 500; }
.g-num { font-family: var(--serif); font-size: 21px; line-height: 1.1; color: var(--heading); }
.g-n { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.giorno.oggi .g-sem { color: var(--accent); font-weight: 700; }
.giorno.vuoto .g-num { color: color-mix(in srgb, var(--heading) 35%, transparent); }
.giorno[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); }
.giorno[aria-pressed="true"] .g-sem, .giorno[aria-pressed="true"] .g-num, .giorno[aria-pressed="true"] .g-n { color: var(--on-navy); }

.ag-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 0 32px; }
.ag-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ag-when { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.35; padding-top: 2px; }
.ag-row a, .ag-row p > span:first-child { font-size: 15.5px; line-height: 1.35; font-weight: 600; color: var(--heading); text-decoration: none; }
.ag-row a:hover { color: var(--accent); text-decoration: underline; }
.ag-src { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.ag-more { margin-top: 12px; margin-right: 8px; }
.ag-empty { margin-top: 16px; padding: 16px; border-radius: var(--r); border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, transparent); display: grid; gap: 14px; }
.ag-empty > p { color: var(--text-2); }
.ag-empty > p a { font-weight: 600; }
.ag-sempre ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.ag-sempre a { color: var(--heading); font-weight: 600; text-decoration: none; }
.ag-sempre a:hover { color: var(--accent); text-decoration: underline; }

/* ---------------------------------------------------------------- notizie e colonna */
.news-sec { padding: 60px 0 72px; }
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }
.rail { display: flex; flex-direction: column; gap: 24px; }
.rail:empty { display: none; }
.feed-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 8px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ente); }
.feed-filters .check { margin-left: auto; }
.field select, .field input { height: 40px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); padding: 0 14px; font-size: 14.5px; }
.field.search { position: relative; flex: 1 1 220px; max-width: 380px; display: block; }
.field.search input { width: 100%; padding-left: 38px; height: 44px; }
.field.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.day-head { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; color: var(--heading); padding: 28px 0 4px; }
.item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
.item-t { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 3px; }
.item-b { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.item-tag { display: flex; align-items: baseline; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.item-tm { display: none; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.item h3 { font-size: 18px; font-weight: 600; line-height: 1.35; max-width: 760px; }
.item h3 a { color: var(--heading); text-decoration: none; }
.item h3 a:hover { color: var(--accent); text-decoration: underline; }
.item .sum { max-width: 760px; color: var(--text-2); font-size: 15px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.item-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.item-ag { color: var(--accent); font-weight: 600; }
.src { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--text-2); }
.kind { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--pill); color: var(--muted); }
.kind.ente { background: var(--ente-bg); color: var(--ente-ink); }
.kind.redazione, .kind.lettori { background: color-mix(in srgb, var(--accent-bg) 12%, transparent); color: var(--accent); }
.more-src { font-size: 13px; }
.more-src summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
.more-src summary::-webkit-details-marker { display: none; }
.more-src ul { margin: 8px 0 0; padding: 0 0 0 14px; display: grid; gap: 4px; }
.feed-end { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.feed-end:empty { display: none; }
.feed-note { font-size: 14px; color: var(--muted); }
.feed-end > .blk { width: 100%; margin: 8px 0 0; }
.blk { margin: 14px 0 22px; }
.empty { padding: 36px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r); margin-top: 12px; color: var(--text-2); display: grid; gap: 12px; justify-items: center; }
.loading { opacity: .5; transition: opacity .2s; }

/* ---------------------------------------------------------------- schede (card) e tabelle */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table-wrap td.num { text-align: right; font-variant-numeric: tabular-nums; }
.fonti-summary { font-size: 14px; color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--bad); }

/* ---------------------------------------------------------------- finestre */
dialog.sheet { border: 0; padding: 0; width: min(640px, 100vw - 24px); max-height: 88vh; border-radius: 20px; background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
dialog.sheet.wide { width: min(900px, 100vw - 24px); }
dialog.sheet::backdrop { background: rgba(17, 21, 27, .55); backdrop-filter: blur(3px); }
.sheet-body { padding: 22px var(--gut) 26px; display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 24px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.sheet h3 { margin-top: 8px; }
.menu-sheet { margin-right: 0; margin-top: 0; height: 100vh; max-height: 100vh; width: min(360px, 100vw); border-radius: 20px 0 0 20px; }
.menu-nav { display: grid; gap: 4px; }
.menu-nav a, .menu-nav .link-btn { display: flex; align-items: center; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--heading); text-decoration: none; text-align: left; }
.menu-comuni { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.menu-comuni a { display: flex; align-items: center; min-height: 44px; color: var(--heading); font-weight: 500; text-decoration: none; }
.method { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; color: var(--text-2); }
.form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.form input, .form select, .form textarea { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 10px 12px; font-size: 15px; font-weight: 400; color: var(--ink); }
.form .hp { position: absolute; left: -9999px; }
.form-msg { font-size: 14px; min-height: 1.2em; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--ok); }
.dn-meta { display: grid; gap: 0; margin: 4px 0 0; border-top: 1px solid var(--line); }
.dn-meta div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.dn-meta dt { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding-top: 2px; }
.dn-meta dd { margin: 0; color: var(--heading); font-weight: 500; }

/* ---------------------------------------------------------------- piè di pagina */
.footer { background: var(--navy); color: color-mix(in srgb, var(--on-navy) 82%, transparent); padding: 44px 0 40px; }
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; font-size: 14px; }
.footer p { margin-top: 10px; max-width: 46ch; }
.footer .wordmark { font-size: 24px; margin-top: 0; }
.footer h3 { color: var(--on-navy); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; opacity: .75; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer a { color: var(--on-navy); }
.footer a:hover { color: var(--accent-soft); }
.footer a.footer-propon { color: var(--accent-soft); font-weight: 600; text-decoration: none; }
.footer a.footer-propon:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- larghezze intermedie */
@media (max-width: 1199px) {
  .top-search { display: none; }
  .news-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 36px; }
  .hero { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
  .evidenza { grid-template-columns: minmax(0, 1fr); }
  .ev-fig { min-height: 0; aspect-ratio: 16 / 7; order: -1; }
}
@media (min-width: 1200px) {
  .mob-search { display: none !important; }
}
@media (max-width: 1099px) {
  .nav, .desk-only { display: none; }
  .mob-only { display: inline-flex; }
}

/* ---------------------------------------------------------------- telefono e tablet stretto: una colonna */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .news-layout { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .edition-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .town-chips { margin-left: calc(var(--gut) * -1); margin-right: calc(var(--gut) * -1); padding: 0 var(--gut); }
  .agenda-sec { padding-top: 36px; }
  .news-sec { padding-top: 40px; }
}
@media (max-width: 560px) {
  html { scroll-padding-top: 70px; }
  .masthead-inner { height: 60px; gap: 8px; }
  .wordmark { font-size: 22px; gap: 8px; }
  .wordmark .logo { width: 28px; height: 28px; }
  .masthead-actions { gap: 8px; }
  .btn-propon { padding: 0 14px; }
  .btn-propon .lg { display: none; }
  .btn-propon .sm { display: inline; }
  .chip .lg { display: none; }
  .chip .sm { display: inline; }
  .edition-inner { flex-direction: column-reverse; padding-top: 10px; padding-bottom: 10px; }
  .ed-date { justify-content: space-between; }
  .evidenza { border-radius: 18px; }
  .ev-fig { aspect-ratio: 16 / 9; }
  .ev-text { padding: 18px 18px 20px; gap: 12px; }
  .ev-title { font-size: 26px; }
  .ev-sum { font-size: 15px; -webkit-line-clamp: 4; }
  .ev-foot .btn { width: 100%; }
  .sec-head { gap: 10px 16px; }
  .sec-head h2 { font-size: 27px; }
  .agenda-tabs { display: none; }
  .agenda-sec .sec-link { font-size: 14px; }
  .ag-row { grid-template-columns: 60px minmax(0, 1fr); }
  .ag-more { width: 100%; margin-right: 0; }
  #periodi { display: flex; width: 100%; }
  #periodi .periodo { flex: 1; justify-content: center; padding: 0 6px; gap: 5px; }
  .feed-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cat-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: calc(var(--gut) * -1); padding-right: var(--gut); }
  .cat-chips::-webkit-scrollbar { display: none; }
  .field.search { max-width: none; }
  .feed-filters .check { margin-left: 0; }
  .item { grid-template-columns: minmax(0, 1fr); padding: 16px 0; }
  .item-t { display: none; }
  .item-tm { display: inline; }
  .item h3 { font-size: 17px; }
  .item .sum { font-size: 14.5px; -webkit-line-clamp: 2; }
  .day-head { font-size: 20px; padding-top: 22px; }
  .card.w { padding: 18px; }
  .wm-days { gap: 4px; }
  .w-proponi, .w-avvisi { padding: 20px 18px; }
  .feed-end .btn { width: 100%; }
  .footer-inner { gap: 24px; }
}
@media (max-width: 374px) {
  .masthead-inner { gap: 6px; }
  .wordmark { font-size: 20px; }
  .wordmark .logo { display: none; }
  .masthead-actions { gap: 6px; }
  .btn-propon { padding: 0 12px; font-size: 14px; }
  .btn-propon svg { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
