/* base.css — reset minimale, font self-hosted (OFL, spediti nel tema in assets/fonts/), tipografia e
   accessibilità di base per furniture_showroom (showroom di arredamento con catalogo per categoria).
   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:"EB Garamond"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"EB Garamond"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"EB Garamond"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/eb-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Alegreya Sans"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Alegreya Sans"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Alegreya Sans"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/alegreya-sans-latin-700-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 ---
   I titoli stanno in tono-frase con tracciamento minimo: il MAIUSCOLO molto spaziato è riservato a
   occhielli ed etichette, dove le stringhe sono corte e il tracciamento le rende leggibili.
   ⚠ Peso 400 sul serif: a queste scale il 600 di EB Garamond impasta (la stessa lezione del serif di
   health_professional). Il 500/600 resta per i titoli piccoli. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-snug);
  color: var(--brand-dark);
  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); font-weight: 500; }
h4 { font-size: 1.05rem; font-weight: 600; }

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

/* --- Occhiello: il solo posto dove vive il maiuscoletto spaziato del marchio.
   ⚠ Colore --gold-ink, MAI --gold: su carta l'oro pieno dà 2,18. --- */
.eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: var(--space-3);
}
/* ⚠ Su fondo scuro l'oro pieno regge (6,56) e quello SCURITO no (2,32): ogni banda scura deve
   rimappare l'occhiello. Dimenticarne una lascia un testo a 2,32 che axe trova ma il DOM non denuncia. */
.on-dark .eyebrow, .hero .eyebrow, .site-footer .eyebrow,
.contatti .eyebrow, .page-head .eyebrow, .section--dark .eyebrow,
.section--notte .eyebrow, .photoband .eyebrow { color: var(--gold); }

/* --- Accessibilità --- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.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; } }
