/* Presidio IA: sito pubblico (home e guida all'AI Act)
   Usa gli stessi token dell'app (tokens.css): petrolio, Titillium Web, Lora per la lettura lunga,
   Roboto Mono solo per i riferimenti normativi. Nessuna animazione d'ingresso. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

/* ---------- Testata ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand:hover { color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15.5px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav .btn { color: var(--accent-ink); }
@media (max-width: 820px) {
  .site-nav .nav-link { display: none; }
  .site-nav { gap: 10px; }
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--r-md);
  font: inherit; font-weight: 700; font-size: 16px; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Home: apertura ---------- */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.2vw, 50px); letter-spacing: -0.015em; }
.hero .lead { margin-top: 18px; font-size: 19px; color: var(--ink-2); max-width: 34em; }
.hero .actions { margin-top: 28px; }
.hero .note { margin-top: 14px; font-size: 14.5px; color: var(--muted); }
.shot { border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.shot-lift { box-shadow: var(--shadow-lg); }
.shot img { width: 100%; }
@media (max-width: 960px) {
  .hero { padding: 40px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Sezioni ---------- */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--surface); }
.section h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.01em; }
.section .intro { margin-top: 12px; font-size: 18px; color: var(--ink-2); max-width: 44em; }
.section-body { margin-top: 32px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; gap: 28px; } .section { padding: 44px 0; } }

/* ---------- Calendario come registro a righe ---------- */
.ledger { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ledger thead th { font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface-2); }
.ledger tbody tr:last-child td { border-bottom: 0; }
.ledger .when { white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; width: 11em; }
.ledger .what strong { display: block; }
.ledger .what span { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.ledger .who { color: var(--ink-2); font-size: 15px; width: 14em; }
.state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13.5px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--ink-2); }
.state-on { background: var(--ok-soft); color: var(--ok); }
.state-next { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 720px) {
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .ledger tbody tr:last-child { border-bottom: 0; }
  .ledger td { padding: 0; border: 0; width: auto; }
  .ledger .what, .ledger .who { grid-column: 1 / -1; }
}
.ledger-foot { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* ---------- Passi del percorso: sono davvero una sequenza ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; gap: 26px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 16px; }
.steps li::before {
  content: counter(step); width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 2px solid var(--accent); color: var(--accent);
}
.steps h3 { font-size: 20px; margin-top: 4px; }
.steps p { margin-top: 6px; color: var(--ink-2); }

/* ---------- Per chi ---------- */
.audience { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 48px; margin: 0; }
.audience dt { font-weight: 700; font-size: 19px; }
.audience dd { margin: 6px 0 0; color: var(--ink-2); }
@media (max-width: 720px) { .audience { grid-template-columns: 1fr; } }

.plain-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.ref { font-family: var(--font-mono); font-size: 0.82em; background: var(--surface-3); color: var(--ink-2); padding: 1px 6px; border-radius: 4px; white-space: nowrap; }

/* ---------- Domande frequenti ---------- */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 52em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 36px 18px 0; font-weight: 700; font-size: 18.5px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font-size: 24px; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 0 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 10px; max-width: 46em; }

/* ---------- Chiusura ---------- */
.closing { padding: 56px 0; border-top: 1px solid var(--line); }
.closing-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.closing h2 { font-size: clamp(24px, 2.6vw, 30px); max-width: 22em; }

/* ---------- Piede ---------- */
.site-foot { background: var(--surface-2); border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: 15px; color: var(--muted); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: 32px; }
.foot-grid h2 { font-size: 15px; color: var(--ink); margin-bottom: 10px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.foot-grid a { color: var(--ink-2); text-decoration: none; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-note { margin-top: 10px; max-width: 36em; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- Guida: pagine di lettura ---------- */
.crumbs { padding-top: 28px; font-size: 14.5px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); }
.article { max-width: 760px; padding: 20px 0 64px; }
.article h1 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.015em; }
.article .meta { margin-top: 12px; font-size: 15px; color: var(--muted); }
.article .standfirst { margin-top: 18px; font-size: 20px; color: var(--ink-2); }
.summary { margin-top: 28px; padding: 20px 24px; background: var(--accent-soft); border-radius: var(--r-lg); }
.summary h2 { font-size: 17px; margin-bottom: 8px; }
.summary ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.toc { margin-top: 28px; font-size: 16px; }
.toc h2 { font-size: 16px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.prose { margin-top: 12px; font-family: var(--font-doc); font-size: 18px; line-height: 1.7; }
.prose h2 { font-family: var(--font-ui); font-size: 27px; margin: 44px 0 12px; letter-spacing: -0.01em; }
.prose h3 { font-family: var(--font-ui); font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose .ref { font-size: 0.72em; }
.prose dl { margin: 0 0 16px; }
.prose dt { font-family: var(--font-ui); font-size: 20px; font-weight: 700; margin-top: 28px; scroll-margin-top: 24px; }
.prose dd { margin: 6px 0 0; }
.prose dd + dd { margin-top: 10px; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 22px; font-family: var(--font-ui); font-size: 16px; line-height: 1.45; background: var(--surface); }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.prose thead th { background: var(--surface-2); font-weight: 700; }
.prose td.nowrap { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.table-scroll { overflow-x: auto; margin: 0 0 22px; }
.table-scroll table { min-width: 560px; margin: 0; }
.callout { margin: 22px 0; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-family: var(--font-ui); font-size: 16.5px; line-height: 1.55; }
.cta-box { margin-top: 44px; padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.cta-box h2 { font-size: 21px; }
.sources { margin-top: 44px; font-size: 15.5px; }
.sources h2 { font-size: 19px; margin-bottom: 10px; }
.sources ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.related { margin-top: 36px; }
.related h2 { font-size: 19px; margin-bottom: 10px; }
.related ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.disclaimer { margin-top: 36px; font-size: 14.5px; color: var(--muted); }

/* Indice della guida */
.guide-list { list-style: none; margin: 28px 0 0; padding: 0; border-top: 1px solid var(--line); }
.guide-list li { border-bottom: 1px solid var(--line); padding: 18px 0; }
.guide-list a { font-weight: 700; font-size: 20px; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list p { margin-top: 4px; color: var(--ink-2); }

@media print {
  .site-head, .site-foot, .cta-box, .skip { display: none; }
  body { background: #fff; }
}
