/* base.css — reset minimale, font self-hosted (OFL), tipografia, accessibilità base. */

/* --- Font self-hosted (no Google Fonts, zero-live) --- */
/* Instrument Sans (display grottesco contemporaneo): titoli, numerali tecnici, indice dei reparti. */
@font-face { font-family:"Instrument Sans"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Instrument Sans"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Instrument Sans"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Instrument Sans"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/instrument-sans-latin-700-normal.woff2") format("woff2"); }
/* Inter (testo): corpo neutro e leggibile, mai sotto 17px. */
@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"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/inter-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;
}

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

/* Display: Instrument Sans, tracking stretto, angoli vivi nel resto del sistema.
   ⚠ `text-wrap: balance` sta SOLO sui titoli. Sugli introduttivi distribuisce le righe e lascia vuota
   la metà destra della riga: è il difetto «spazi vuoti» già pagato su un altro sito della flotta.
   Il corpo del testo usa `pretty`, che lavora sull'ultima riga e non accorcia la misura. */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight);
  font-weight: 700; letter-spacing: var(--tracking-display); text-wrap: balance; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); line-height: var(--lh-snug); letter-spacing: -0.01em; }
p { text-wrap: pretty; }

/* Accessibilità: focus visibile coerente */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip link */
.skip-link {
  position: absolute; left: 0; top: -100%;
  background: var(--brand); color: var(--on-dark);
  padding: var(--space-3) var(--space-5); z-index: 100;
}
.skip-link:focus { top: 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;
}

/* Layout primitives */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }
/* ⚠ Una sezione senza fondo è TRASPARENTE: il bianco che si vede è quello del corpo, e per chi
   guarda la pagina (o la misura) quella banda non esiste come superficie. Si dichiara. */
.section { padding-block: var(--section-y); background: var(--paper); }
.section.alt { background: var(--surface); }

/* Le sezioni sono bande di colore a tutta larghezza contigue: azzero lo stacco del flow-layout di
   WordPress (block-gap 24px fra i figli del post-content), altrimenti fra una banda e l'altra compare
   una striscia bianca. ⚠ Il gap dei figli DIRETTI di una banda collassa attraverso la banda e la
   trascina giù: va azzerato anche lì, non solo sul post-content. */
.wp-block-post-content > * { margin-block: 0; }
.hero > *, .section > *, .cta-bar > *, .page-head > *, .band > * { margin-block: 0; }

.stack > * + * { margin-top: var(--space-4); }
.prose > * + * { margin-top: var(--space-5); }

/* ⚠ La misura di lettura sta sui CAPOVERSI, mai sul contenitore né sulla riga di una griglia: un
   telaio stretto lascia la metà destra bianca a ogni larghezza, e a 1920 si vede. Una sezione SENZA
   foto cambia telaio (v. `.band--full` e `.prose--wide` in components.css), non tiene lo stesso
   telaio con una metà vuota. */
.prose p, .prose li { color: var(--ink-muted); max-width: var(--misura-prosa); }
.prose--wide p, .prose--wide li { max-width: none; }
