/* base.css — reset minimale, font self-hosted (OFL, spediti nel tema in assets/fonts/), tipografia e
   accessibilità di base per refrigeration_service (refrigerazione industriale, sito a pagina unica).
   I token vivono in tokens.css: qui si consumano, non si ridichiarano. */

/* --- Font self-hosted (no Google Fonts, zero-live). theme.json dichiara le stesse famiglie/pesi:
   le due dichiarazioni puntano agli stessi file. --- */
@font-face { font-family:"Chivo"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/chivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Chivo"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/chivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family:"Chivo"; font-style:normal; font-weight:800; font-display:swap;
  src:url("../assets/fonts/chivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family:"Red Hat Text"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/red-hat-text-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Red Hat Text"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/red-hat-text-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Red Hat Text"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/red-hat-text-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Red Hat Text"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/red-hat-text-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; } }

/* ⚠ Sito a PAGINA UNICA: ogni voce di menu è un'ancora, e senza questo margine il titolo della sezione
   finisce SOTTO la testata fissa. Il valore segue l'altezza dichiarata dell'header, non le metriche
   del font (che cambiano se si tocca il marchio). */
[id] { scroll-margin-top: 84px; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--ink);
  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, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
:where(input, textarea, select) { font: inherit; color: inherit; }

/* Il piè non deve «salire» sulle pagine più corte della finestra (qui: la Privacy). */
body { min-height: 100vh; display: flex; flex-direction: column; }
.wp-site-blocks { flex: 1 0 auto; display: flex; flex-direction: column; }
.wp-block-post-content { flex: 1 0 auto; }

/* ⚠ Il flow-layout di WordPress mette un block-gap di 24px fra i figli: su un sito a bande piene non
   è aria, è una riga del fondo del body che TAGLIA la pagina. Il gap dei figli DIRETTI di una banda
   collassa attraverso la banda e la trascina giù: va azzerato anche lì, non solo sul contenitore. */
.wp-block-post-content > *,
.wp-site-blocks > *,
.hero > *, .section > *, .banda > *, .cta-bar > *, .page-head > *,
.mosaico > *, .tessere > *, .interventi > *, .contatti > * { margin-block: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-heading);
  color: var(--brand);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
p { text-wrap: pretty; }
p + p { margin-top: var(--space-3); }

strong, b { font-weight: 700; color: var(--brand); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Salto al contenuto: primo elemento focalizzabile della pagina. */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-dark); padding: var(--space-2) var(--space-3);
}
.skip-link:focus { left: 0; }

.container { width: min(var(--container), 100% - var(--gutter) * 2); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--ghiaccio { background: var(--surface); }
.section--tight { padding-block: calc(var(--section-y) * .64); }

/* Screen-reader only: le etichette che servono a chi non vede, non a chi guarda. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ⚠ La rivelazione MUOVE, non sfuma: un'opacità intermedia porta il testo sotto AA durante la
   transizione, e un elemento a opacity:0 non fa nemmeno scaricare le immagini che contiene.
   Fail-visible: la classe `.js` la mette reveal.js — senza JavaScript nulla resta nascosto. */
.js .reveal { transform: translateY(18px); transition: transform .62s var(--ease); transition-delay: calc(var(--reveal-i, 0) * 65ms); }
.js .reveal.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.is-visible { transform: none; transition: none; }
  /* Lo slideshow delle tessere si ferma sulla prima foto: resta un mosaico fermo e coerente. */
  .mosaico__slide { animation: none; }
  .mosaico__slide:first-child { opacity: 1; }
  .mosaico__slide:not(:first-child) { opacity: 0; }
}
