/* ipfacile.it: la rete dietro la telecamera. Un progetto FENIVA. */

@font-face {
  font-family: "Archivo";
  src: url("/wp-content/themes/ipfacile/fonts/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/wp-content/themes/ipfacile/fonts/literata-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("/wp-content/themes/ipfacile/fonts/literata-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* struttura: verde FENIVA profondo */
  --green-950: oklch(0.24 0.055 160);
  --green-900: oklch(0.30 0.068 160);
  --green-800: oklch(0.37 0.08 159);
  --green-700: oklch(0.45 0.095 158);
  --green-200: oklch(0.88 0.045 158);
  --green-100: oklch(0.95 0.02 158);
  --signal: oklch(0.89 0.26 142);        /* il verde del logo FENIVA: solo su fondo scuro */

  --paper: oklch(0.995 0.002 160);
  --paper-2: oklch(0.972 0.006 160);
  --ink: oklch(0.21 0.02 160);
  --ink-2: oklch(0.41 0.02 160);
  --ink-3: oklch(0.53 0.015 160);
  --rule: oklch(0.88 0.01 160);
  --rule-strong: oklch(0.21 0.02 160);
  --on-green: oklch(0.985 0.01 150);
  --on-green-2: oklch(0.86 0.04 155);

  /* gravità: l'unico punto in cui il colore alza la voce */
  --sev-critica: oklch(0.52 0.2 27);
  --sev-alta: oklch(0.7 0.165 52);
  --sev-media: oklch(0.84 0.14 88);
  --sev-bassa: oklch(0.9 0.008 160);
  --sev-critica-ink: oklch(0.99 0 0);
  --sev-alta-ink: oklch(0.2 0.03 50);
  --sev-media-ink: oklch(0.24 0.04 85);
  --sev-bassa-ink: oklch(0.36 0.02 160);

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-ui: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.35rem + 1.4vw, 2.375rem);
  --step-4: clamp(2.125rem, 1.4rem + 2.8vw, 3.5rem);
  --step-5: clamp(2.5rem, 1.35rem + 4.4vw, 5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6.5rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 78rem;
  --measure: 68ch;

  --radius: 3px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --z-sticky: 10;
  --z-menu: 20;
  --z-toast: 40;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
  scrollbar-color: var(--green-700) var(--paper-2);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--signal); color: var(--green-950); }
:focus-visible { outline: 3px solid var(--green-700); outline-offset: 3px; border-radius: 2px; }
input, select, textarea { caret-color: var(--green-700); }

img, svg { display: block; max-width: 100%; }
figure { margin: 0; }
[hidden] { display: none !important; }
svg.ext-icon { display: inline-block; width: 0.8em; height: 0.8em; vertical-align: -0.05em; margin-left: 0.3em; color: var(--ink-3); }
.nowrap { white-space: nowrap; }

a {
  color: var(--green-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in oklch, currentColor 45%, transparent);
  transition: text-decoration-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  word-spacing: 0.04em;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
p { margin: 0; }

.skip {
  position: absolute; left: var(--space-4); top: -4rem;
  background: var(--signal); color: var(--green-950);
  padding: var(--space-3) var(--space-4); font-weight: 700; z-index: var(--z-toast);
  border-radius: var(--radius);
}
.skip:focus { top: var(--space-4); }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- testata ---------- */

.masthead { background: var(--green-900); color: var(--on-green); }
.masthead a { color: inherit; text-decoration: none; }
.masthead__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-5); padding-block: var(--space-5) var(--space-4);
}
.brand { display: flex; align-items: baseline; gap: var(--space-4); min-width: 0; }
.brand__mark {
  font-family: var(--font-display);
  font-stretch: 72%;
  font-weight: 900;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.brand__tag {
  font-size: var(--step--1);
  color: var(--on-green-2);
  white-space: nowrap;
}
.edition-stamp {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--step--1); color: var(--on-green-2); text-align: right;
}
.edition-stamp strong { color: var(--on-green); font-weight: 650; }
.live {
  width: 0.625rem; height: 0.625rem; border-radius: 50%; flex: none;
  background: var(--signal);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--signal) 28%, transparent);
}
.live--stale { background: var(--sev-alta); box-shadow: 0 0 0 3px color-mix(in oklch, var(--sev-alta) 30%, transparent); }

.masthead__nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  border-top: 1px solid color-mix(in oklch, var(--on-green) 18%, transparent);
}
.nav { display: flex; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.nav a {
  display: block; padding: var(--space-3) var(--space-3);
  font-weight: 600; font-stretch: 92%; letter-spacing: 0.005em;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.nav a:hover { border-bottom-color: color-mix(in oklch, var(--signal) 55%, transparent); }
.nav a[aria-current="page"] { border-bottom-color: var(--signal); }
.nav li:first-child a { padding-left: 0; }
.by-feniva { font-size: var(--step--1); color: var(--on-green-2); padding-block: var(--space-3); }
.by-feniva a { color: var(--on-green); font-weight: 650; text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: color-mix(in oklch, var(--on-green) 40%, transparent); }

.menu-toggle {
  display: none;
  font: inherit; font-weight: 650; color: var(--on-green);
  background: transparent; border: 1px solid color-mix(in oklch, var(--on-green) 35%, transparent);
  border-radius: var(--radius); padding: var(--space-2) var(--space-4); min-height: 44px;
  cursor: pointer;
}

@media (max-width: 52rem) {
  .brand__tag { display: none; }
  .masthead__top { padding-block: var(--space-4) var(--space-3); }
  .menu-toggle { display: inline-flex; align-items: center; gap: var(--space-2); }
  .masthead__nav { flex-direction: column; align-items: stretch; gap: 0; display: none; }
  .masthead[data-open="true"] .masthead__nav { display: flex; }
  .nav { flex-direction: column; }
  .nav a, .nav li:first-child a { padding: var(--space-3) 0; min-height: 44px; border-bottom: 1px solid color-mix(in oklch, var(--on-green) 14%, transparent); }
  .nav a[aria-current="page"] { border-bottom-color: var(--signal); }
  .masthead .edition-strip { display: flex; }
  .masthead__top .edition-stamp { display: none; }
}
.edition-strip {
  display: none; align-items: center; gap: var(--space-3);
  background: var(--green-950); color: var(--on-green-2);
  font-size: var(--step--1); padding-block: var(--space-2);
}
.edition-strip strong { color: var(--on-green); font-weight: 650; }

/* ---------- gravità ---------- */

.sev {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.8125rem; line-height: 1;
  padding: 0.45em 0.7em 0.42em; border-radius: var(--radius);
  white-space: nowrap; letter-spacing: 0.01em;
}
.sev b { font-weight: 800; }
.sev--critica { background: var(--sev-critica); color: var(--sev-critica-ink); }
.sev--alta { background: var(--sev-alta); color: var(--sev-alta-ink); }
.sev--media { background: var(--sev-media); color: var(--sev-media-ink); }
.sev--bassa { background: var(--sev-bassa); color: var(--sev-bassa-ink); }
.sev--valutazione { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--rule); }
.kev {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-weight: 700; font-size: 0.8125rem; line-height: 1;
  padding: 0.38em 0.6em 0.36em; border-radius: var(--radius);
  background: var(--ink); color: var(--paper); white-space: nowrap;
}
.kev::before { content: ""; width: 0.45em; height: 0.45em; border-radius: 50%; background: var(--sev-critica); box-shadow: 0 0 0 2px color-mix(in oklch, var(--sev-critica) 35%, transparent); }

.cve {
  font-family: var(--font-ui); font-weight: 600; font-stretch: 88%;
  color: var(--ink-2); white-space: nowrap;
}
.copy-id {
  font: inherit; color: inherit; background: none; border: 0; padding: 0.15em 0.3em; margin: -0.15em -0.3em;
  border-radius: var(--radius); cursor: copy;
}
.copy-id:hover { background: var(--paper-2); }
.copy-id[data-copied="true"] { background: var(--green-100); color: var(--green-800); }

/* priorità operativa: volutamente diversa dai colori della gravità, perché è un'altra misura */
.prio {
  display: inline-flex; align-items: center; font-weight: 700; font-size: 0.8125rem; line-height: 1;
  padding: 0.42em 0.7em 0.4em; border-radius: 2rem; white-space: nowrap;
  box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink);
}
.prio--alta { background: var(--green-900); color: var(--on-green); box-shadow: none; }
.prio--media { box-shadow: inset 0 0 0 1.5px var(--green-800); color: var(--green-900); }
.prio__why { display: block; margin-top: 0.35rem; font-size: 0.8125rem; font-weight: 500; line-height: 1.4; color: var(--ink-2); }

/* ---------- apertura (home) ---------- */

.intro { padding-block: var(--space-6) var(--space-4); border-bottom: 1px solid var(--rule); }
.intro h1 { font-size: var(--step-3); font-stretch: 80%; font-weight: 820; line-height: 1.02; text-wrap: balance; }
.intro p { color: var(--ink-2); max-width: 74ch; margin-top: var(--space-2); text-wrap: pretty; }
.intro__links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); font-size: var(--step--1); font-weight: 650; }
.intro__links a { min-height: 44px; display: inline-flex; align-items: center; }

.lead {
  display: grid; grid-template-columns: minmax(0, 13fr) minmax(0, 11fr);
  gap: var(--space-7); align-items: start;
  padding-block: var(--space-5) var(--space-5);
  border-bottom: 1px solid var(--rule-strong);
}
.lead + .section { padding-top: var(--space-4); }
.lead + .section .section__head { margin-bottom: var(--space-3); }
.lead__story h1, .lead__story h2 {
  font-size: var(--step-5);
  font-stretch: 74%;
  font-weight: 820;
  line-height: 0.97;
  letter-spacing: -0.012em;
  word-spacing: 0.06em;
}
.lead__story--long h2 { font-size: var(--step-4); line-height: 1; }
.lead__story h1 a, .lead__story h2 a { color: inherit; text-decoration: none; }
.lead__story h1 a:hover, .lead__story h2 a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--green-700); }
.lead__dek {
  font-family: var(--font-read); font-size: var(--step-1); line-height: 1.55;
  color: var(--ink-2); max-width: 46ch; margin-top: var(--space-5);
}
.meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  margin-top: var(--space-5); font-size: var(--step--1); color: var(--ink-2);
}
.meta-row time { color: var(--ink-2); }
.lead__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.7em 1.15em;
  font-family: var(--font-ui); font-weight: 700; font-size: var(--step-0); line-height: 1.1;
  border-radius: var(--radius); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--green-900);
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn--solid { background: var(--green-900); color: var(--on-green); }
.btn--solid:hover { background: var(--green-800); }
.btn--line { background: transparent; color: var(--green-900); }
.btn--line:hover { background: var(--green-100); }
.btn--signal { background: var(--signal); color: var(--green-950); border-color: var(--signal); }
.btn--signal:hover { background: color-mix(in oklch, var(--signal) 82%, white); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* radar */
.radar { position: relative; }
.radar__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.radar__head h2 { font-size: var(--step-1); font-stretch: 90%; font-weight: 750; }
.radar__head p { font-size: var(--step--1); color: var(--ink-3); }
.radar__note { font-size: 0.8125rem; color: var(--ink-2); margin-top: var(--space-2); }
.radar > svg { width: 100%; height: auto; margin-top: var(--space-3); overflow: visible; }
.radar .link-line { stroke: var(--green-200); stroke-width: 2; fill: none; }
.radar .node-box { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.radar .is-worst .node-box { stroke-width: 3; }
.radar .node-icon { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.radar .node-count { font-family: var(--font-display); font-stretch: 75%; font-weight: 820; font-size: 34px; fill: var(--ink); }
.radar .node-label { font-family: var(--font-display); font-stretch: 88%; font-size: 16.5px; font-weight: 720; fill: var(--ink); }
.radar .node-sub { font-family: var(--font-ui); font-size: 13.5px; font-weight: 500; fill: var(--ink-2); }
.radar .node-bar { stroke-width: 0; }
.radar .node--critica .node-bar { fill: var(--sev-critica); }
.radar .node--alta .node-bar { fill: var(--sev-alta); }
.radar .node--media .node-bar { fill: var(--sev-media); }
.radar .node--bassa .node-bar, .radar .node--nessuna .node-bar { fill: var(--sev-bassa); }
.radar .node--nessuna .node-count { fill: var(--ink-3); }
.radar .cloud { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 4; }
.radar .cloud-label { font-family: var(--font-ui); font-size: 14px; fill: var(--ink-2); font-weight: 600; }
.radar__list { display: none; list-style: none; margin: var(--space-3) 0 0; padding: 0; border-top: 2px solid var(--rule-strong); }
.radar__list li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); }
.radar__list svg { width: 1.5rem; height: 1.5rem; color: var(--ink); }
.radar__list strong { display: block; font-family: var(--font-display); font-stretch: 88%; font-weight: 720; font-size: var(--step-1); line-height: 1.15; }
.radar__list span { font-size: var(--step--1); color: var(--ink-2); }
.radar__list b { font-family: var(--font-display); font-stretch: 75%; font-weight: 820; font-size: var(--step-3); line-height: 1; text-align: right; }
.radar__list .sev-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05em; }
.radar__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); padding: 0; list-style: none; font-size: 0.8125rem; color: var(--ink-2); }
.radar__legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.radar__legend i { width: 0.75rem; height: 0.75rem; border-radius: 2px; display: inline-block; }
@media (max-width: 40rem) {
  .radar > svg, .radar__legend { display: none; }
  .radar__list { display: block; }
  .radar__head { flex-direction: column; gap: var(--space-1); }
}

/* ---------- sezioni ---------- */

.section { padding-block: var(--space-8) var(--space-6); }
.section + .section { border-top: 1px solid var(--rule); }
.section__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-5);
}
.section__head h2 { font-size: var(--step-3); font-stretch: 80%; font-weight: 800; line-height: 1.02; }
.section__head p, .section__head a { font-size: var(--step--1); }
.section__head .more { font-weight: 650; white-space: nowrap; max-width: 100%; }
@media (max-width: 30rem) { .section__head .more { white-space: normal; } }
.section__intro { color: var(--ink-2); max-width: 60ch; margin-top: calc(-1 * var(--space-3)); margin-bottom: var(--space-5); }

/* tabellone */
.board { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule-strong); }
.board__row {
  display: grid;
  grid-template-columns: 4.5rem minmax(7rem, 9rem) minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-5); align-items: center;
  padding: var(--space-3) 0; border-bottom: 1px solid var(--rule);
}
.board--nobrand .board__row { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
.board__time { font-weight: 700; font-stretch: 88%; color: var(--ink); font-size: var(--step-0); line-height: 1.2; }
.board__time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 0.75rem; }
.board__brand { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: var(--step-1); line-height: 1.1; }
.board__brand a { color: inherit; text-decoration: none; }
.board__brand a:hover { text-decoration: underline; }
.board__what a { color: var(--ink); text-decoration: none; font-weight: 600; }
.board__what a:hover { color: var(--green-700); text-decoration: underline; }
.board__what p { font-size: var(--step--1); color: var(--ink-2); margin-top: 0.15rem; }
.board__tags { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.board__empty {
  padding: var(--space-6) 0; border-bottom: 1px solid var(--rule);
  display: grid; gap: var(--space-2);
}
.board__empty strong { font-family: var(--font-display); font-stretch: 85%; font-size: var(--step-2); font-weight: 750; }
.board__empty p { color: var(--ink-2); max-width: 60ch; }
.board[data-collapsed="true"] .board__row:nth-child(n + 9) { display: none; }
/* voci dello stesso prodotto nello stesso giorno: una riga, le singole CVE dentro */
.board__group summary {
  cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem var(--space-3);
  min-height: 44px; align-content: center;
}
.board__group summary::-webkit-details-marker { display: none; }
.board__group summary::before {
  content: ""; flex: none; width: 0.5em; height: 0.5em; margin-right: 0.15em;
  border-right: 2px solid var(--green-800); border-bottom: 2px solid var(--green-800);
  transform: translateY(-0.12em) rotate(-45deg); transition: transform 200ms var(--ease-out);
}
.board__group[open] summary::before { transform: translateY(-0.2em) rotate(45deg); }
.board__group-title { font-weight: 650; color: var(--ink); }
.board__group summary:hover .board__group-title { color: var(--green-700); text-decoration: underline; }
.board__group-mix { font-size: var(--step--1); color: var(--ink-2); }
.board__sub {
  list-style: none; margin: var(--space-3) 0 var(--space-1); padding: var(--space-2) var(--space-4);
  background: var(--paper-2); border-radius: var(--radius); display: grid; gap: var(--space-2);
}
.board__sub li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem var(--space-2); font-size: var(--step--1); padding-block: 0.2rem; }
.board__sub li + li { border-top: 1px solid var(--rule); padding-top: var(--space-2); }
.board__sub a { color: var(--ink); font-weight: 600; text-decoration: none; }
.board__sub a:hover { color: var(--green-700); text-decoration: underline; }
.board__sub .cve { color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .board__group summary::before { transition: none; } }
.board-more { margin-top: var(--space-4); }

@media (max-width: 46rem) {
  .board__row, .board--nobrand .board__row { grid-template-columns: 3.75rem minmax(0, 1fr); gap: var(--space-1) var(--space-3); }
  .board__time { grid-row: span 3; align-self: start; }
  .board__tags { justify-content: flex-start; }
}

/* indice marchi */
.brand-index {
  columns: 4 13rem; column-gap: var(--space-6);
  list-style: none; margin: 0; padding: 0;
  border-top: 2px solid var(--rule-strong); padding-top: var(--space-4);
}
.brand-index li { break-inside: avoid; border-bottom: 1px solid var(--rule); }
.brand-index a {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3);
  padding: var(--space-3) 0; text-decoration: none; color: var(--ink); min-height: 44px;
}
.brand-index__count { margin-left: auto; }
.brand-index a:hover .brand-index__name { color: var(--green-700); text-decoration: underline; text-decoration-thickness: 2px; }
.brand-index__name { font-family: var(--font-display); font-stretch: 78%; font-weight: 780; font-size: var(--step-2); line-height: 1.05; }
.brand-index__count { font-size: var(--step--1); color: var(--ink-2); text-align: right; white-space: nowrap; }
.brand-index__count b { color: var(--ink); font-weight: 750; }
.brand-index__hot { color: var(--sev-critica); font-weight: 700; }

/* guide */
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 var(--space-6); border-top: 2px solid var(--rule-strong); }
.guide-list li { border-bottom: 1px solid var(--rule); padding: var(--space-5) 0 var(--space-5); }
.guide-list h3 { font-size: var(--step-2); font-stretch: 82%; font-weight: 780; line-height: 1.08; }
.guide-list h3 a { color: var(--ink); text-decoration: none; }
.guide-list h3 a:hover { color: var(--green-700); text-decoration: underline; }
.guide-list p { font-family: var(--font-read); color: var(--ink-2); margin-top: var(--space-3); line-height: 1.55; }
.guide-list .reading { display: block; margin-top: var(--space-3); font-size: var(--step--1); color: var(--ink-3); }

/* strumento inline */
.tool {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-7);
  border-top: 2px solid var(--rule-strong); padding-top: var(--space-5);
}
.tool h3 { font-size: var(--step-3); font-stretch: 80%; font-weight: 800; line-height: 1.02; }
.tool p { color: var(--ink-2); margin-top: var(--space-3); max-width: 46ch; }
.tool { align-items: start; }
.calc { display: grid; gap: var(--space-4); align-content: start; }
.field { display: grid; gap: var(--space-2); align-content: start; }
.fields-2 { align-items: start; }
.field label { font-weight: 650; font-size: var(--step--1); }
.field .hint { font-size: 0.8125rem; color: var(--ink-3); }
.field input, .field select {
  font: inherit; font-size: var(--step-0); color: var(--ink);
  block-size: 2.875rem; padding: 0 0.75em;
  background: var(--paper); border: 1.5px solid var(--ink-3); border-radius: var(--radius);
}
.field input:hover, .field select:hover { border-color: var(--ink); }
.field input:focus-visible, .field select:focus-visible { outline-offset: 1px; border-color: var(--green-700); }
.field input[aria-invalid="true"] { border-color: var(--sev-critica); }
.field .error { color: var(--sev-critica); font-size: 0.8125rem; font-weight: 600; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.result {
  background: var(--green-900); color: var(--on-green); border-radius: var(--radius);
  padding: var(--space-5); display: grid; gap: var(--space-2);
}
.result .result__value { color: var(--on-green); font-family: var(--font-display); font-stretch: 75%; font-weight: 850; font-size: var(--step-5); line-height: 0.95; }
.result__value small { font-size: max(0.4em, 1rem); font-weight: 700; font-stretch: 90%; margin-left: 0.15em; }
.result p { color: var(--on-green-2); font-size: var(--step--1); max-width: none; margin: 0; }
.result .result__label { color: var(--on-green); font-weight: 650; }
.result a { color: var(--signal); }

@media (max-width: 52rem) {
  .lead, .tool { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .lead { padding-block: var(--space-6); }
}
@media (max-width: 30rem) { .fields-2 { grid-template-columns: 1fr; } }

/* fascia avvisi in prima pagina */
.section--band, .section--band + .section { border-top: 0; }
.section--band { padding-block: var(--space-4); }
.alert-band {
  background: var(--green-950); color: var(--on-green); border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-5) var(--space-7); align-items: center;
  padding: var(--space-6) var(--space-7);
}
.alert-band h2 { color: var(--on-green); font-size: var(--step-3); font-stretch: 80%; font-weight: 820; line-height: 1.05; text-wrap: balance; }
.alert-band h2 svg { display: inline-block; width: 0.9em; height: 0.9em; color: var(--signal); vertical-align: -0.08em; margin-right: 0.2em; }
.alert-band p { color: var(--on-green-2); margin-top: var(--space-3); max-width: 56ch; }
.alert-band__actions { display: flex; flex-direction: column; gap: var(--space-3); }
.alert-band :focus-visible { outline-color: var(--signal); }
.btn--on-dark { background: transparent; color: var(--on-green); border-color: color-mix(in oklch, var(--on-green) 45%, transparent); }
.btn--on-dark:hover { background: color-mix(in oklch, var(--on-green) 10%, transparent); }
@media (max-width: 52rem) {
  .alert-band { grid-template-columns: minmax(0, 1fr); padding: var(--space-5); }
  .alert-band__actions { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 30rem) { .alert-band__actions .btn { width: 100%; } }

/* banda FENIVA */
.feniva-band { background: var(--green-900); color: var(--on-green); margin-top: var(--space-8); }
.feniva-band__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-7); padding-block: var(--space-8); }
.feniva-band h2 { color: var(--on-green); font-size: var(--step-4); font-stretch: 76%; font-weight: 820; line-height: 1; }
.feniva-band p { color: var(--on-green-2); margin-top: var(--space-4); max-width: 44ch; }
.feniva-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid color-mix(in oklch, var(--on-green) 25%, transparent); }
.feniva-links li { border-bottom: 1px solid color-mix(in oklch, var(--on-green) 18%, transparent); }
.feniva-links a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-4); align-items: center;
  padding: var(--space-4) 0; color: var(--on-green); text-decoration: none; min-height: 44px;
}
.feniva-links strong { font-family: var(--font-display); font-stretch: 85%; font-weight: 760; font-size: var(--step-2); line-height: 1.1; }
.feniva-links span { grid-column: 1; color: var(--on-green-2); font-size: var(--step--1); }
.feniva-links svg { grid-column: 2; grid-row: 1 / span 2; width: 1.5rem; height: 1.5rem; transition: transform 220ms var(--ease-out); }
.feniva-links a:hover strong { text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.feniva-links a:hover svg { transform: translateX(4px); }
@media (max-width: 52rem) { .feniva-band__in { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding-block: var(--space-7); } }

/* piè di pagina */
.footer { background: var(--green-950); color: var(--on-green-2); font-size: var(--step--1); }
.feniva-band + .footer { margin-top: 0; }
.footer a { color: var(--on-green); }
.footer__in { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--space-6); padding-block: var(--space-7) var(--space-6); }
.footer h2 { color: var(--on-green); font-size: var(--step-0); font-weight: 700; margin-bottom: var(--space-3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.footer__mark { font-family: var(--font-display); font-stretch: 72%; font-weight: 900; font-size: 2rem; line-height: 1; color: var(--on-green); }
.footer__legal { border-top: 1px solid color-mix(in oklch, var(--on-green) 16%, transparent); padding-block: var(--space-4) var(--space-6); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); }
@media (max-width: 52rem) { .footer__in { grid-template-columns: 1fr 1fr; } .footer__in > :first-child { grid-column: 1 / -1; } }

/* ---------- pagine interne ---------- */

.page-head { padding-block: var(--space-7) var(--space-6); border-bottom: 2px solid var(--rule-strong); }
.page-head h1 { font-size: var(--step-4); font-stretch: 76%; font-weight: 820; line-height: 1; max-width: 22ch; }
.page-head h1.is-long { font-size: clamp(1.875rem, 1.3rem + 1.9vw, 2.75rem); line-height: 1.04; max-width: 30ch; }
.page-head .dek { font-family: var(--font-read); font-size: var(--step-1); color: var(--ink-2); margin-top: var(--space-4); max-width: 60ch; line-height: 1.55; }
.crumbs { font-size: var(--step--1); color: var(--ink-3); margin-bottom: var(--space-4); }
.crumbs a { color: var(--ink-2); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--rule); }

.article { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: var(--space-8); padding-block: var(--space-7); }
.article--wide { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 60rem) { .article { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); } }

.prose { font-family: var(--font-read); font-size: 1.0625rem; line-height: 1.65; max-width: var(--measure); color: var(--ink); }
.prose > * + * { margin-top: 1.05em; }
.prose > :first-child { margin-top: 0; }
.prose .num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.prose th:first-child, .prose td:first-child { white-space: nowrap; }
@media (max-width: 46rem) { .prose table { display: block; overflow-x: auto; } }
.prose .sources { padding-left: 0; }
.prose h2 { font-family: var(--font-display); font-size: var(--step-3); font-stretch: 80%; font-weight: 800; line-height: 1.05; margin-top: 2.1em; }
.prose h3 { font-family: var(--font-display); font-size: var(--step-2); font-stretch: 88%; font-weight: 750; line-height: 1.15; margin-top: 1.8em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.6em; }
.prose p { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--green-700); }
.prose strong { font-weight: 650; }
.prose blockquote { margin: 1.5em 0; padding: 0 0 0 1em; border-left: 1px solid var(--ink); font-style: italic; color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: var(--step--1); }
.prose th, .prose td { text-align: left; padding: 0.6em 0.75em 0.6em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 700; border-bottom: 2px solid var(--rule-strong); }
.prose .note {
  font-family: var(--font-ui); font-size: var(--step--1); line-height: 1.55;
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4) var(--space-5); color: var(--ink-2);
}
.prose .callout {
  font-family: var(--font-ui); background: var(--green-100); border-radius: var(--radius);
  padding: var(--space-5); line-height: 1.55;
}
.prose .callout strong { display: block; font-family: var(--font-display); font-stretch: 88%; font-size: var(--step-1); font-weight: 760; margin-bottom: var(--space-2); }

.facts { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--rule-strong); }
.facts div { display: grid; gap: var(--space-1); padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 0.8125rem; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.aside { display: grid; gap: var(--space-6); align-content: start; }
.aside .btn { width: 100%; }
.aside__box { border-top: 2px solid var(--rule-strong); padding-top: var(--space-4); display: grid; gap: var(--space-3); }
.aside__box h2 { font-size: var(--step-1); font-stretch: 90%; font-weight: 760; }
.aside__box p { font-size: var(--step--1); color: var(--ink-2); }
.aside__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.howto__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 18rem)); gap: var(--space-6); }
.howto__item { margin: 0; }
.howto__item video { display: block; inline-size: 100%; block-size: auto; aspect-ratio: 9 / 16; border-radius: var(--radius); background: var(--green-950); }
.howto__item figcaption { margin-top: var(--space-3); font-size: var(--step--1); color: var(--ink-2); max-width: 36ch; }
.howto__item figcaption strong { display: block; color: var(--ink); font-size: var(--step-0); margin-bottom: var(--space-1); }
.week-link { margin-top: var(--space-4); }
.week-link .btn svg { order: 2; }
.week-link--end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-6); padding-top: var(--space-5); border-top: 2px solid var(--rule-strong); }
.week-link--end span { font-size: var(--step--1); color: var(--ink-2); }
.count-note { font-size: var(--step--1); color: var(--ink-2); max-width: 70ch; margin-top: var(--space-3); }
.prose .note { font-size: var(--step--1); color: var(--ink-2); }
.feniva-band .feniva-band__note { font-size: var(--step--1); margin-top: var(--space-3); }
.filters .field--search { flex: 1 1 19rem; }
.filters .field--search input { inline-size: 100%; }

/* bollettino: selezione motivata e risultati dallo storico */
.pick { padding-block: var(--space-5) var(--space-3); border-bottom: 1px solid var(--rule); }
.pick h2 { font-size: var(--step-2); font-stretch: 82%; font-weight: 800; line-height: 1.1; }
.pick .section__intro { margin-top: var(--space-2); margin-bottom: var(--space-3); }
.pick__list { list-style: none; margin: 0; padding: 0; counter-reset: pick; }
.pick__list li {
  counter-increment: pick; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr) auto; gap: 0.15rem var(--space-3);
  align-items: baseline; padding-block: var(--space-3); border-top: 1px solid var(--rule);
}
.pick__list li::before { content: counter(pick); grid-row: span 2; font-family: var(--font-display); font-stretch: 75%; font-weight: 850; font-size: var(--step-2); color: var(--green-800); line-height: 1; }
.pick__list li > a { font-weight: 700; color: var(--ink); text-decoration: none; }
.pick__list li > a:hover { color: var(--green-700); text-decoration: underline; }
.pick__list li > .sev, .pick__list li > .kev { grid-column: 3; justify-self: end; }
.pick__list p { grid-column: 2 / -1; font-size: var(--step--1); color: var(--ink-2); }
.archive { margin-top: var(--space-6); }
.archive h2 { font-size: var(--step-2); font-stretch: 82%; font-weight: 800; }
.archive .section__intro { margin-top: var(--space-2); margin-bottom: var(--space-3); }
@media (max-width: 52rem) {
  .pick__list li { grid-template-columns: 2rem minmax(0, 1fr); }
  .pick__list li > .sev, .pick__list li > .kev { grid-column: 2; justify-self: start; }
}
@media (min-width: 60rem) { .aside--sticky { position: sticky; top: var(--space-5); } }

.sources { list-style: none; margin: 0; padding: 0; font-family: var(--font-ui); font-size: var(--step--1); }
.sources li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.method-note { font-family: var(--font-ui); font-size: 0.8125rem; color: var(--ink-3); border-top: 1px solid var(--rule); padding-top: var(--space-4); max-width: var(--measure); }

/* filtri archivio */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: end; padding-block: var(--space-5); }
.filters .field { min-width: 12rem; }
.toggle { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 46px; font-weight: 600; font-size: var(--step--1); cursor: pointer; }
.toggle input { width: 1.15rem; height: 1.15rem; accent-color: var(--green-800); }
.filters__count { margin-left: auto; font-size: var(--step--1); color: var(--ink-2); padding-bottom: var(--space-3); }

/* grafico marca */
.chart { margin-top: var(--space-3); }
.chart svg { width: 100%; max-width: 64rem; height: auto; overflow: visible; }
.chart .axis { font-family: var(--font-ui); font-size: 14px; fill: var(--ink-2); }
.chart .total { font-family: var(--font-display); font-stretch: 80%; font-weight: 760; font-size: 16px; fill: var(--ink); }
.chart .total--peak { font-size: 20px; font-weight: 850; }
.chart .kev-dot { fill: var(--ink); stroke: var(--sev-critica); stroke-width: 3; }
.chart .radar__legend { margin-top: var(--space-3); }
.kev-key { background: var(--ink); border-radius: 50% !important; box-shadow: 0 0 0 2px var(--sev-critica); }
.new-tag {
  display: inline-flex; align-items: center; font-weight: 700; font-size: 0.8125rem; line-height: 1;
  padding: 0.45em 0.7em 0.42em; border-radius: var(--radius);
  color: var(--green-800); box-shadow: inset 0 0 0 1.5px var(--green-700);
}
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .bar-critica { fill: var(--sev-critica); }
.chart .bar-alta { fill: var(--sev-alta); }
.chart .bar-media { fill: var(--sev-media); }
.chart .bar-bassa, .chart .bar-valutazione { fill: var(--sev-bassa); }

.stat-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-6); margin-top: var(--space-5); font-size: var(--step--1); color: var(--ink-2); }
.stat-line b { font-family: var(--font-display); font-stretch: 80%; font-size: var(--step-2); color: var(--ink); font-weight: 800; margin-right: 0.25em; }

/* web app avvisi */
.app-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
@media (max-width: 60rem) { .app-layout { grid-template-columns: minmax(0, 1fr); } }
.alert-app { display: grid; gap: var(--space-6); align-content: start; max-width: 46rem; }
.app-block { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-3); border-top: 2px solid var(--rule-strong); padding-top: var(--space-4); }
.app-block legend { float: left; width: 100%; padding: 0; margin-bottom: var(--space-2); font-family: var(--font-display); font-stretch: 82%; font-weight: 800; font-size: var(--step-2); line-height: 1.1; }
.app-hint { color: var(--ink-2); font-size: var(--step--1); }
.app-hint-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.app-hint-row .app-hint { flex: 1 1 18rem; margin: 0; }
.app-all { font-size: var(--step--1); padding-inline: 0.9em; }
.switch { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: var(--space-4); align-items: start; padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__ui { width: 3rem; height: 1.75rem; border-radius: 1rem; background: var(--sev-bassa); box-shadow: inset 0 0 0 1.5px var(--ink-3); position: relative; transition: background-color 200ms var(--ease-out); margin-top: 0.1rem; }
.switch__ui::after { content: ""; position: absolute; top: 0.25rem; left: 0.25rem; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--paper); box-shadow: 0 1px 2px color-mix(in oklch, var(--ink) 30%, transparent); transition: transform 220ms var(--ease-out); }
.switch input:checked + .switch__ui { background: var(--green-800); box-shadow: none; }
.switch input:checked + .switch__ui::after { transform: translateX(1.25rem); }
.switch input:focus-visible + .switch__ui { outline: 3px solid var(--green-700); outline-offset: 3px; }
.switch strong { display: block; font-weight: 700; }
.switch small { display: block; color: var(--ink-2); font-size: var(--step--1); margin-top: 0.15rem; }
.chip-group { display: grid; gap: var(--space-2); margin-top: var(--space-2); }
.chip-group__label { font-size: 0.8125rem; font-weight: 700; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4); border-radius: 2rem; box-shadow: inset 0 0 0 1.5px var(--rule); font-weight: 600; cursor: pointer; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), color 160ms var(--ease-out); }
.chip span:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.chip input:checked + span { background: var(--green-900); color: var(--on-green); box-shadow: none; }
.chip input:focus-visible + span { outline: 3px solid var(--green-700); outline-offset: 2px; }
.app-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.app-status { min-height: 1.5em; font-weight: 600; }
.app-status[data-kind="ok"] { color: var(--green-800); }
.app-status[data-kind="err"] { color: var(--sev-critica); }
.app-ios { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--space-4) var(--space-5); font-size: var(--step--1); }
.app-ios ol { margin: var(--space-2) 0 0; padding-left: 1.2em; display: grid; gap: var(--space-1); }
.alert-feed { list-style: none; margin: 0; padding: 0; }
.alert-feed li { border-bottom: 1px solid var(--rule); padding: var(--space-3) 0; }
.alert-feed a { display: grid; gap: 0.15rem; color: var(--ink); text-decoration: none; }
.alert-feed a:hover strong { color: var(--green-700); text-decoration: underline; }
.alert-feed strong { font-weight: 700; font-size: var(--step--1); }
.alert-feed span { font-size: var(--step--1); color: var(--ink-2); }
.alert-feed__meta { display: flex; gap: var(--space-2); align-items: center; margin-top: var(--space-2); font-size: 0.8125rem; color: var(--ink-3); }
.alert-type { font-weight: 700; font-size: 0.8125rem; color: var(--green-800); box-shadow: inset 0 0 0 1.5px var(--green-700); border-radius: var(--radius); padding: 0.4em 0.6em; line-height: 1; }

.toast {
  position: fixed; left: 50%; bottom: var(--space-5); transform: translate(-50%, 1rem); opacity: 0;
  background: var(--ink); color: var(--paper); padding: var(--space-3) var(--space-5); border-radius: var(--radius);
  font-weight: 600; font-size: var(--step--1); z-index: var(--z-toast); pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-out);
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
  .masthead__nav, .menu-toggle, .feniva-band, .footer, .filters, .lead__actions, .aside .btn { display: none !important; }
  .masthead { background: none; color: var(--ink); }
  body { font-size: 11pt; }
}
