/* base.css — reset minimale, font self-hosted (OFL, spediti nel tema in assets/fonts/), tipografia
   clinica moderna (Jost display + Inter testo), accessibilità base. specialist_practice.
   I token vivono in tokens.css: qui si consumano, non si ridichiarano colori. */

/* --- Font self-hosted (no Google Fonts, zero-live). I woff2 OFL sono spediti nel tema (assets/fonts/).
   theme.json dichiara le stesse famiglie/pesi: le due dichiarazioni puntano agli stessi file. --- */
@font-face { font-family:"Jost"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Jost"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Jost"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/inter-latin-600-normal.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

img, svg, picture { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }

/* Il piè non deve «salire» sulle pagine più corte della finestra: la colonna tiene l'altezza e il main
   cresce (si vede solo sulle pagine brevi — qui la Privacy). */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > main { flex: 1 0 auto; }

/* Le bande full-bleed sono figlie del post-content, che ha il block-gap WP: senza questo si vedono
   strisce del fondo body fra una banda e l'altra (regola 11). */
.wp-block-post-content > * { margin-block: 0; }
/* ⚠ Non basta azzerare le bande: il block-gap che WP mette sui loro figli DIRETTI COLLASSA attraverso la
   banda — che non ha né padding-top né border-top — e la trascina giù, scoprendo una striscia di fondo
   sopra l'header. Si azzerano i figli diretti; i margini INTERNI restano quelli voluti. */
.hero > *, .section > *, .cta-band > *, .page-head > *, .cta-bar > *, .contact-band > *,
.presenta > *, .esami > *, .curriculum > *, .focus > *, .notfound > * { margin-block: 0; }

/* --- Tipografia display: Jost, peso 500. Titoli in tono-frase: nella categoria il maiuscolo martellante
   appartiene a un altro registro.
   ⚠ Il peso è 500, NON 700: il display grande e leggero è ciò che separa il moderno dall'istituzionale,
   ed è il peso del riferimento. --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: pretty;
  color: inherit;
}
h1 { font-size: var(--text-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.008em; }
h4 { font-size: var(--text-base); font-weight: 600; letter-spacing: 0; }

p { text-wrap: pretty; }

/* ⚠ La misura di lettura sta sul PARAGRAFO, MAI sul contenitore: messa sul contenitore strozza i display
   grandi sul font del CORPO. La misura ottimale è per viewport: più stretta sullo schermo piccolo. */
.prose p, .lead, .section-intro p { max-width: 66ch; }
@media (max-width: 599.98px) { .prose p, .lead, .section-intro p { max-width: 44ch; } }

.lead { font-size: var(--text-md); color: var(--ink-muted); }

/* Occhiello: maiuscoletto tracciato nell'accento che PORTA TESTO su chiaro (8,09), mai nel blu di marca,
   che a 3,33 non è leggibile. Su fondo scuro passa a --brand-mark (4,75), dove invece regge. */
.eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--space-3);
}

/* --- Accessibilità: focus sempre visibile, skip link primo focalizzabile. --- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #FFFFFF;
  padding: var(--space-3) var(--space-5); border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Scroll-reveal (regola 2): il reveal MUOVE, NON SFUMA.
   ⚠⚠ L'opacità di partenza è 1, non 0. È la lezione pagata su clinical_center e artisan_atelier, e ha
   DUE ragioni indipendenti: (a) durante una dissolvenza un testo vicino alla soglia AA la attraversa, e
   axe lo coglie solo a metà transizione — un difetto che appare e sparisce; (b) un elemento a opacity:0
   non scarica le immagini che contiene, e il crawl le conta rotte.
   Fail-visible: senza JS (nessun .js sull'html) tutto è già visibile. --- */
.js .reveal { transform: translateY(22px); }
.js .reveal.is-visible {
  transform: none;
  transition: transform var(--dur) var(--ease);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.is-visible { transform: none; transition: none; }
}

/* ⚠ `overflow-x: clip`, MAI `hidden`: hidden romperebbe lo sticky dell'header. */
.section, .hero { overflow-x: clip; }
