/* Base derivata da nv-portal (src/styles/global.css, commit 6784a53 del 2026-10-30, sola lettura):
   reset, tipografia, :focus-visible, .sr-only, [hidden], .btn, .badge. Cambiano solo i font:
   sono self-hosted in ../fonts/ (sottoinsieme latino) con @font-face locali, senza CDN.
   Non modificare qui i token: aggiornarli dal portal. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/bricolage-grotesque-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url('../fonts/figtree-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url('../fonts/figtree-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url('../fonts/figtree-latin-700-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Unica deviazione dai token del portal: --text-muted del portal ha contrasto 4,45:1 su --surface-page
   e 4,25:1 su --surface-sunken, sotto il 4,5:1 di WCAG 2.2 AA. Scurito qui (5,3:1); da riportare nel
   portal, poi questa riga si toglie. */
:root { --text-muted: #5f6a7a; }

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` vince sempre sulle regole display dei componenti. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-body);
  background: var(--surface-page);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-strong);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 0;
}

p, dl, dd { margin: 0; }

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--brand-hover); text-decoration: underline; }

/* Le immagini mantengono le proporzioni originali: mai ritagliate o deformate. */
img { display: block; max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection { background: var(--blue-200); color: var(--neutral-950); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-title { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-title { font-size: clamp(1.15rem, 2.2vw, 1.5rem); }
.lead { font-size: var(--text-md); line-height: var(--leading-relaxed); max-width: 62ch; }

.label {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--slate-700);
}

/* Badge di stato: sempre con testo (mai solo colore). */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--slate-100);
  color: var(--slate-900);
}
.badge[data-state='demo'] { background: var(--brand); color: var(--brand-on); }
.badge[data-state='soon'] { background: var(--copper-wash); color: var(--copper-700); }

/* ---- Pulsanti (stile del sito: rettangolari, raggio 10px) ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px; /* bersaglio di tocco >= 44 px */
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-md);
  padding: 12px 24px;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition-colors), var(--transition-transform);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:disabled,
.btn[aria-disabled='true'] { cursor: default; opacity: 0.6; transform: none; }
.btn--primary { color: var(--brand-on); background: var(--brand); border-color: var(--brand); }
.btn--primary:hover { color: var(--brand-on); background: var(--brand-hover); border-color: var(--brand-hover); }
.btn--secondary { color: var(--slate-900); background: transparent; border-color: var(--slate-700); }
.btn--secondary:hover { color: var(--brand-on); background: var(--slate-700); }
.btn--small { min-height: 44px; padding: 8px 16px; font-size: var(--text-sm); }

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

/* Il focus dato dal router a h1/main (tabindex -1) non serve un anello: e' solo la destinazione. */
[tabindex="-1"]:focus { outline: none; }

/* Testi lunghi senza spazi (codici, nomi) vanno a capo invece di allargare la pagina. */
body { overflow-wrap: anywhere; }

/* Link dentro il testo: distinguibili anche senza colore (WCAG 1.4.1). */
:where(main li, main p, main td, main dd) a:not(.btn):not(.kpi) { text-decoration: underline; text-underline-offset: 2px; }
