/* ==========================================================
   Stile dei documenti legali.
   Token identici a index.html (a loro volta allineati a
   src/theme/preset.ts del FE): stessa carta, stesso inchiostro,
   stesso clay. Cambia solo il layout — la home e' una schermata
   fissa con overflow:hidden, qui serve una colonna che scorre.

   Questo file e' condiviso da TUTTE le versioni dei documenti:
   e' presentazione, non contenuto. I testi sono immutabili una
   volta pubblicati, l'impaginazione puo' evolvere.
   ========================================================== */

:root {
  --paper:        #f7f4ef;
  --surface-0:    #ffffff;
  --ink:          #3e3629;
  --muted:        #6b5f52;
  --rule:         #e5dfd4;
  --clay:         #c15f3c;
  --clay-hover:   #9e4a2e;
  --clay-50:      #fbf1eb;

  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;

  --measure: 40rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

html {
  background: var(--paper);
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
}

::selection { background: #f6e1d2; color: var(--ink); }

.doc {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5rem) clamp(1.5rem, 6vw, 3rem) clamp(4rem, 12vh, 7rem);
  animation: fade 400ms var(--ease) both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

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

.back {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 180ms var(--ease);
}

.back:hover { color: var(--clay); }

.doc-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: clamp(1.5rem, 4vh, 2.2rem);
}

/* Versione e data di entrata in vigore: sono l'identita' del documento,
   non un dettaglio editoriale. Questa e' la versione che il BFF registra
   nel consenso dell'utente, quindi deve essere sempre visibile. */
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  font-size: 13px;
  color: var(--muted);
}

.doc-meta strong {
  font-weight: 600;
  color: var(--ink);
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: clamp(1.6rem, 4vh, 2.4rem) 0;
}

.lede {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---- corpo ---- */

.doc h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.4rem, 3.4vw, 1.8rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-top: clamp(2.2rem, 5.5vh, 3rem);
}

.doc h2 .num {
  color: var(--clay);
  font-style: italic;
  margin-right: 0.4em;
}

.doc h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 1.6rem;
}

.doc p { margin-top: 0.9rem; text-wrap: pretty; }

.doc ul, .doc ol {
  margin-top: 0.9rem;
  padding-left: 1.3rem;
}

.doc li { margin-top: 0.45rem; text-wrap: pretty; }

.doc li::marker { color: var(--clay); }

.doc a {
  color: var(--clay);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 180ms var(--ease);
}

.doc a:hover { color: var(--clay-hover); }

.doc strong { font-weight: 600; }

/* Riquadro per i richiami importanti (revoca, diritti, contatti):
   velatura clay, nessun bordo pesante — coerente con la landing,
   che non usa card. */
.callout {
  margin-top: 1.4rem;
  padding: 1.1rem 1.3rem;
  background: var(--clay-50);
  border-left: 2px solid var(--clay);
  border-radius: 0 4px 4px 0;
}

.callout p:first-child { margin-top: 0; }

/* Tabelle (sub-responsabili, categorie di dati): niente griglia piena,
   solo filetti orizzontali. Scorrono da sole su schermo stretto. */
.table-wrap {
  margin-top: 1.2rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 30rem;
}

th, td {
  text-align: left;
  padding: 0.7rem 1rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

td:last-child, th:last-child { padding-right: 0; }

/* ---- chiusura ---- */

.colophon {
  margin-top: clamp(3rem, 8vh, 4.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}

.colophon a { color: var(--muted); }
.colophon a:hover { color: var(--clay); }

@media (max-width: 640px) {
  body { line-height: 1.6; }
  .doc { padding-top: 2rem; }
}
