/*
 * Base — Reset minimo + variabili di layout.
 * Colori/superfici: tokens.css (fonte unica, D9) importata qui.
 * Font: self-hosted da /assets/fonts/ (D10 aggiornata), nessuna richiesta esterna.
 */

@import url("./fonts.css");
@import url("./tokens.css");

/* === Layout tokens === */
:root {
  /* Spaziature */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Larghezze, ritoccate per gradini di larghezza finestra (@media in
     layout.css, sezione "Setup per larghezza finestra"). Il corpo del testo
     NON cambia: e' fisso a 1.25rem in typography.css. */
  --content-width: 42rem;
  --article-width: 37rem;   /* ~592px a 20px ⇒ ~75 caratteri per riga (§6.2) */
  --page-width: var(--content-width);

  /* Radius */
  --radius: 0.375rem;

  /* Transizioni */
  --transition: 150ms ease;
}

/* === Reset minimo === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  /* Inter per l'interfaccia, Source Serif 4 per la lettura (D10 aggiornata) */
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis-weight: none;
}

/* Selezione: discreta, con l'accento del brand */
::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

/* === Accessibilità base === */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link — versione base (a11y.css la raffina) */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  z-index: 200;
}

.skip-link:focus {
  top: var(--space-2);
}

/* === Stampa === */
@media print {
  body { background: white; color: black; }
  a { color: inherit; text-decoration: underline; }
  nav, footer, .search-trigger, .theme-toggle { display: none; }
  article { page-break-inside: avoid; }
}
