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

/* --- Font self-hosted (no Google Fonts, zero-live) --- */
/* IBM Plex Sans (display + testo): registro tecnico-preciso, istituzionale. */
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:600; font-display:swap;
  src:url("../assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Sans"; font-style:normal; font-weight:700; font-display:swap;
  src:url("../assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); }
/* IBM Plex Mono: micro-label, numerali, codici "scheda tecnica". */
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:400; font-display:swap;
  src:url("../assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"IBM Plex Mono"; font-style:normal; font-weight:500; font-display:swap;
  src:url("../assets/fonts/ibm-plex-mono-latin-500-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-sans);
  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; }

h1, h2, h3, h4 { line-height: var(--lh-tight); font-weight: 700; letter-spacing: -0.01em; 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; }
p { text-wrap: pretty; }

/* Accessibilità: focus visibile coerente */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
: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; 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); }
.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 tra i figli del post-content), altrimenti tra una banda e l'altra compare una striscia bianca. */
.wp-block-post-content > * { margin-block: 0; }
.stack > * + * { margin-top: var(--space-4); }
.prose > * + * { margin-top: var(--space-5); }
.prose p { color: var(--ink-muted); max-width: 68ch; }
