/* base.css — reset minimale, font self-hosted (OFL, spediti nel tema in assets/fonts/), tipografia e
   accessibilità di base per funeral_services (onoranze funebri, 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:"Cormorant Garamond"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Cormorant Garamond"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/cormorant-garamond-latin-500-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(--t-base);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--avorio);
  -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, e si vede di più fra due bande scure.
   Il gap dei figli DIRETTI di una banda collassa attraverso la banda e la trascina giù: va azzerato
   anche lì, non solo sul contenitore. (Regola 11.) */
.wp-block-post-content > *,
.wp-site-blocks > *,
.hero > *, .section > *, .testa-sezione > *, .banda-scura > *, .cta-bar > *,
.tessere > *, .servizi-righe > *, .recensioni > *, .pilastri > * { margin-block: 0; }

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

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

/* Il focus si VEDE: nel dominio funebre gran parte del traffico arriva da tastiera e lettori di schermo. */
: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(--bruno); 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--crema { background: var(--crema); }
.section--tight { padding-block: calc(var(--section-y) * .62); }

/* 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(20px); transition: transform .7s var(--ease); transition-delay: calc(var(--reveal-i, 0) * 70ms); }
.js .reveal.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal.is-visible { transform: none; transition: none; }
  /* Lo slideshow si ferma sulla prima slide: foto e testo restano quelli, e restano coerenti. */
  .hero--photo .hero__slide, .hero--photo .hero__testo { animation: none; }
  .hero--photo .hero__slide:first-child, .hero--photo .hero__testo:first-child { opacity: 1; }
  .hero--photo .hero__slide:not(:first-child), .hero--photo .hero__testo:not(:first-child) { opacity: 0; }
}
