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

/* --- Font self-hosted (no Google Fonts, zero-live) --- */
/* Poppins (display geometrico): titoli grossi del registro officina. */
@font-face { font-family:"Poppins"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Poppins"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Poppins"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/poppins-latin-600-normal.woff2") format("woff2"); }
/* Inter (testo e blocchi-dati): corpo neutro, numeri leggibili in piccolo. */
@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 geometrico: Poppins 600, tracking stretto sui corpi grandi. */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-tight);
  font-weight: 600; letter-spacing: -0.02em; 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; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Skip link */
.skip-link {
  position: absolute; left: 0; top: -100%;
  background: var(--accent); color: var(--paper);
  padding: var(--space-3) var(--space-5); z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.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); }
.section { padding-block: var(--section-y); }
/* I tre gradi del ritmo: gli episodi che devono respirare, il passo normale, gli elenchi densi. */
.section--wide { padding-block: var(--section-y-lg); }
.section--tight { padding-block: var(--section-y-sm); }
/* Il grado si assegna per RUOLO della banda, non pattern per pattern: così vale anche per le pagine di
   progetto, che non passano dai pattern del verticale. Le bande piene (marca, superficie alternata) sono
   gli episodi e respirano; le bande chiare sono gli elenchi densi e stringono. */
.section.alt, .story.section { padding-block: var(--section-y-lg); }
.section--light { padding-block: var(--section-y-sm); }

/* Le bande CHIARE sono gli episodi densi (usato, marchi, gallery): il testo lì cambia ruolo. */
.section--light { background: var(--sage-tint); color: var(--ink-on-light); }
.section--light h1, .section--light h2, .section--light h3 { color: var(--ink-on-light); }
.section--light .prose p { color: var(--sage); }
.section--brand { background: var(--brand); color: var(--on-dark); }
.section.alt { background: var(--surface); }

/* Il block-gap del flow-layout WP (24px) va azzerato sui figli del post-content E su quelli di ogni
   banda: il margine dei figli diretti COLLASSA attraverso la banda e la trascina giù, aprendo una
   striscia del fondo pagina fra una sezione e l'altra. Azzerare solo il post-content non basta. */
.wp-block-post-content > * { margin-block: 0; }
.hero > *, .section > *, .cta-band > *, .page-head > *, .contact-band > * { margin-block: 0; }

.stack > * + * { margin-top: var(--space-4); }
.prose > * + * { margin-top: var(--space-5); }
.prose p { color: var(--ink-muted); max-width: 68ch; }
