/* ---------------------------------------------------------
   2. Reset / base
   --------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Type roles (docs/ui/DESIGN_CONTRACT.md §3): page h1, card/widget h3 and
   section h2 headings use the Registro display face. Low-specificity element
   selector so classed titles (.page-header__title, .card__title, etc.) and
   unclassed headings (guida.html, impostazioni cards) get it for free; a
   component can still override font-family for a specific case (KPI values
   use <p>, never a heading tag, so they are unaffected). */
h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover { color: var(--color-primary-dk); text-decoration: underline; }

/* Global focus ring — never leave outline:none without this replacement. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-2);
  z-index: 200;
  transform: translateY(-150%);
  /* Inverted surface (like the toast, §2): background is the ink tone,
     text is the ground tone, so it stays readable in both themes without a
     literal color (was a bare #fff that went unreadable on the light-ink
     background dark mode produces for --color-text). */
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
}
.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
}

