/* base.css — reset minimale, font self-hosted (OFL, spediti nel tema in assets/fonts/), tipografia e
   accessibilità di base per joinery_workshop (falegnameria che restaura e vernicia serramenti in legno).
   I token vivono in tokens.css: qui si consumano, non si ridichiarano. */

/* --- Font self-hosted (no Google Fonts, zero-live). I woff2 OFL sono spediti nel tema.
   theme.json dichiara le stesse famiglie/pesi: le due dichiarazioni puntano agli stessi file. --- */
@font-face { font-family:"Prompt"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/prompt-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Prompt"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/prompt-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Prompt"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/prompt-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"Hind"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/hind-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Hind"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/hind-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Hind"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/hind-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;
  font-variant-ligatures: common-ligatures contextual;
}

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è di pagina non deve «salire» sulle pagine più corte della finestra (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. */
.hero > *, .section > *, .cta-band > *, .page-head > *, .cta-bar > * { margin-block: 0; }

/* ⚠ WordPress avvolge ogni parte di template in un <div>, che diventerebbe il contenitore dello sticky
   ed è alto quanto l'intestazione: senza questo la testata «dichiarata sticky» scorre via. */
.wp-block-template-part { display: contents; }

/* --- Tipografia display ---
   ⚠ Peso 600, non 700: il sito attuale del cliente porta Prompt a 700 fino a 80px, e a quelle scale il
   nero grida e chiude le contro-forme. Il registro di riferimento è arioso. Il 700 resta per i numeri
   degli indici, dove la massa serve. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-snug);
  color: var(--brand);
  text-wrap: balance;
  text-wrap: pretty;
}
h1 { font-size: var(--text-2xl); line-height: var(--lh-tight); }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: 1.05rem; }

p { max-width: var(--container-narrow); }

/* --- Occhiello: il solo posto dove vive il maiuscoletto spaziato.
   ⚠ Colore --accent-ink, MAI --accent: su carta il verde foglia pieno dà 1,90. --- */
.eyebrow {
  display: block;
  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-bottom: var(--space-3);
}
/* ⚠ Su fondo navy il verde PIENO regge (5,46) e quello scurito no (1,74): ogni banda scura deve
   rimappare l'occhiello. Dimenticarne una lascia un testo illeggibile che il DOM non denuncia — è il
   difetto pagato su furniture_showroom, dove la guardia era scritta in un verso solo. */
.on-dark .eyebrow, .hero .eyebrow, .site-footer .eyebrow,
.section--dark .eyebrow, .cta-band .eyebrow, .page-head--dark .eyebrow { color: var(--accent-lt); }

/* --- Accessibilità --- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.on-dark :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible,
.site-footer :where(a, button, summary, [tabindex]):focus-visible { outline-color: var(--accent-lt); }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand-dark); color: var(--on-dark);
  padding: var(--space-3) var(--space-5);
}
.skip-link:focus { left: 0; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- Scroll-reveal (reveal.js, IntersectionObserver). Fail-visible: senza JS tutto è già visibile.
   ⚠ Il reveal MUOVE e non SFUMA: un testo vicino alla soglia AA scende sotto durante una dissolvenza,
   e un elemento a opacity:0 non fa nemmeno scaricare le immagini che contiene. --- */
.js .reveal { transform: translateY(22px); transition: transform var(--dur) var(--ease); transition-delay: calc(var(--reveal-i, 0) * 70ms); }
.js .reveal.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { transform: none; transition: none; } }
