/* ════════════════════════════════════════════════════════════════════
   legal.css — PAGINE LEGALI (Privacy Policy, Cookie Policy)
   ─────────────────────────────────────────────────────────────────────
   Impaginazione da "documento": colonna di lettura stretta, tipografia
   calma, tabella riepilogativa dei cookie. Usa solo i token del sito.

   Bilinguismo: il corpo del testo è scritto due volte nel markup, in due
   blocchi [data-lang="it"] / [data-lang="en"]. Il selettore di lingua del
   sito aggiorna <html lang>, e le regole qui sotto mostrano solo il blocco
   giusto. Così il testo si modifica direttamente nell'HTML (comodo) e la
   pagina resta leggibile anche senza JavaScript (mostra l'italiano).
   ════════════════════════════════════════════════════════════════════ */

/* ── commutazione lingua (default: italiano) ─────────────────────────── */
/* Nascondo l'inglese finché <html lang> non diventa "en" (lo imposta
   i18n.js). display:revert ripristina il display naturale del tag
   (block per i div, inline per gli span), evitando rotture di layout. */
[data-lang='en'] { display: none; }
html[lang='en'] [data-lang='it'] { display: none; }
html[lang='en'] [data-lang='en'] { display: revert; }

/* ── impaginato ──────────────────────────────────────────────────────── */
.legal-page {
  padding-top: calc(var(--header-h) + var(--space-lg));
  padding-bottom: var(--space-2xl);
  background: var(--clr-cream);
  background-image: var(--bg-grid);
}

.legal-doc {
  max-width: 48rem;
  margin-inline: auto;
}

/* barra di ritorno */
.legal-page__bar { margin-bottom: var(--space-md); }

/* testata */
.legal-hero { margin-bottom: var(--space-lg); }
.legal-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--clr-blueprint);
}
.legal-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  color: var(--clr-forest-deep);
  margin-top: var(--space-2xs);
}
.legal-hero__updated {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: var(--space-sm);
}
.legal-hero__lead {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
  color: var(--clr-text-muted);
  margin-top: var(--space-md);
}

/* sezioni */
.legal-section { margin-top: var(--space-lg); }
.legal-section > h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  color: var(--clr-forest-deep);
  padding-bottom: var(--space-2xs);
  border-bottom: var(--border-hairline);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}
.legal-section > h2 .legal-section__n {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--clr-amber);
  font-weight: 400;
}
.legal-section h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--clr-text);
  margin-top: var(--space-md);
}

.legal-section p,
.legal-section li {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--clr-text);
}
.legal-section p { margin-top: var(--space-sm); }
.legal-section ul { margin-top: var(--space-sm); padding-left: 1.2em; }
.legal-section li { margin-top: var(--space-2xs); }
.legal-section li::marker { color: var(--clr-leaf); }

.legal-section a {
  color: var(--clr-forest);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.legal-section a:hover,
.legal-section a:focus-visible { color: var(--clr-forest-deep); }

.legal-section strong { color: var(--clr-forest-deep); }

/* callout (es. "il sito non profila") */
.legal-note {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--clr-blueprint-soft);
  border-left: 3px solid var(--clr-blueprint);
  border-radius: var(--radius-soft);
}
.legal-note p { margin-top: 0; }

/* ── tabella cookie ──────────────────────────────────────────────────── */
.legal-table-wrap {
  margin-top: var(--space-md);
  overflow-x: auto;
  border-radius: var(--radius-soft);
  border: var(--border-hairline);
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  background: var(--clr-paper);
  min-width: 34rem;
}
.legal-table th,
.legal-table td {
  text-align: left;
  padding: var(--space-xs) var(--space-sm);
  border-bottom: var(--border-hairline);
  vertical-align: top;
  line-height: var(--leading-snug);
}
.legal-table thead th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-text-on-dark);
  background: var(--clr-forest);
  border-bottom: none;
}
.legal-table tbody tr:nth-child(even) td { background: rgba(2, 89, 151, 0.035); }
.legal-table tbody tr:last-child td { border-bottom: none; }
.legal-table code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--clr-blueprint-deep);
}
:root[data-theme='night'] .legal-table code { color: var(--clr-blueprint); }

/* ── modalità notte ──────────────────────────────────────────────────
   --clr-forest-deep resta scuro (è un colore di SUPERFICIE): usato come
   testo su fondi scuri diventa illeggibile. Nei titoli e nei testi in
   evidenza passo ai verdi schiariti. */
:root[data-theme='night'] .legal-hero h1,
:root[data-theme='night'] .legal-section > h2 { color: var(--clr-leaf); }
:root[data-theme='night'] .legal-section strong { color: var(--clr-leaf); }
