/* Tasto giusto – foglio di stile delle guide
   Sistema: inchiostro blu notte su bianco, un solo accento giallo segnale.
   Il giallo indica sempre un'azione: il numero del passaggio nella pagina
   e l'elemento da toccare nelle illustrazioni. */

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-hyperlegible-latin-700-italic.woff2") format("woff2");
  font-weight: 700; font-style: italic; font-display: swap;
}

:root {
  --ink: #172338;
  --muted: #536279;
  --paper: #ffffff;
  --mist: #eef2f6;
  --rule: #d3dae3;
  --signal: #ffcb2e;
  --signal-soft: #fff4cc;
  --link: #1d5fd1;
  --measure: 44rem;
  --wide: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }

.salta {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 10;
}
.salta:focus { left: 1rem; top: 1rem; }

.contenitore { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
.contenitore-largo { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.nascosto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Testata */
.testata { border-bottom: 1px solid var(--rule); }
.testata .contenitore-largo {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 3.75rem;
}
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.menu a {
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1rem;
  padding: 0.35rem 0; border-bottom: 3px solid transparent;
}
.menu a:hover { border-bottom-color: var(--rule); }
.menu a[aria-current="page"] { border-bottom-color: var(--signal); }
.marchio {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none;
}
.marchio::before {
  content: ""; width: 0.95rem; height: 0.95rem;
  background: var(--signal); border: 2px solid var(--ink); border-bottom-width: 4px; border-radius: 4px;
}

/* Intestazione della guida */
.briciole ol {
  list-style: none; margin: 1.75rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem;
  font-size: 0.95rem; color: var(--muted);
}
.briciole li + li::before { content: "›"; margin-right: 0.5rem; }

h1 {
  font-size: clamp(2rem, 1.35rem + 2.6vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0.75rem 0 0.5rem;
  text-wrap: balance;
}
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.75rem 0 1rem; text-wrap: balance; }

.aggiornata { color: var(--muted); font-size: 0.95rem; margin: 0 0 1.75rem; }

.in-breve {
  background: var(--signal-soft);
  border-left: 6px solid var(--signal);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
}
.in-breve h2 { font-size: 1rem; margin: 0 0 0.35rem; }
.in-breve p { margin: 0; }

.indice h2 { font-size: 1rem; margin: 2rem 0 0.4rem; }
.indice ul { margin: 0; padding-left: 1.1rem; }
.indice li { margin: 0.2rem 0; }

/* Passaggi: numeri gialli uniti da una linea, come nelle illustrazioni */
ol.passi { list-style: none; counter-reset: passo; margin: 0; padding: 0; }
ol.passi > li {
  counter-increment: passo;
  position: relative;
  min-height: 2.25rem;
  padding: 0.05rem 0 1.25rem 3.25rem;
}
ol.passi > li::before {
  content: counter(passo);
  position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  background: var(--signal);
  border: 2px solid var(--ink);
  border-radius: 7px;
  font-weight: 700; font-size: 1.05rem; line-height: 1;
}
ol.passi > li::after {
  content: "";
  position: absolute; left: calc(1.05rem - 1px); top: 2.1rem; bottom: 0;
  width: 2px; background: var(--ink);
}
ol.passi > li:last-child { padding-bottom: 0; }
ol.passi > li:last-child::after { display: none; }

/* Nomi di pulsanti e menu */
.ui {
  font-weight: 700;
  background: var(--mist);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0 0.3em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
kbd {
  font: inherit; font-weight: 700; font-size: 0.9em;
  background: var(--paper);
  border: 1px solid var(--ink); border-bottom-width: 3px; border-radius: 5px;
  padding: 0 0.35em;
}

.dopo { margin: 1.1rem 0 0; }

figure { margin: 1.75rem 0 0; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--mist);
}
figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 0.5rem; }

/* Se non funziona */
.problemi dl { margin: 0; }
.problemi dt { font-weight: 700; margin-top: 1rem; }
.problemi dt:first-child { margin-top: 0; }
.problemi dd { margin: 0.2rem 0 0; }

/* Fonti */
.fonti { font-size: 1rem; }
.fonti p { color: var(--muted); margin: 0 0 0.5rem; }
.fonti ul { margin: 0; padding-left: 1.1rem; }
.fonti li { margin: 0.35rem 0; }

/* Piede */
.piede { margin-top: 5rem; background: var(--mist); color: var(--muted); font-size: 0.95rem; }
.piede-griglia {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.75rem 2.5rem;
  padding-top: 2.5rem; padding-bottom: 2.75rem;
}
.piede p { margin: 0.6rem 0 0; max-width: 22rem; }
.piede h2 { font-size: 1rem; color: var(--ink); margin: 0 0 0.6rem; }
.piede ul { list-style: none; margin: 0; padding: 0; }
.piede li { margin: 0.3rem 0; }
.piede nav a { color: var(--muted); }
.piede nav a:hover { color: var(--ink); }

/* Pagine di testo: Chi siamo, Privacy. :where() azzera la specificità, così i componenti vincono */
:where(.pagina) > h2 { font-size: 1.2rem; margin: 2.25rem 0 0.6rem; }
:where(.pagina) > p { margin: 0 0 0.9rem; }
:where(.pagina) > ul { margin: 0 0 0.9rem; padding-left: 1.1rem; }
:where(.pagina) > ul > li { margin: 0.35rem 0; }

/* Elenchi di guide */
.elenco-guide { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: var(--measure); }
.elenco-guide li { border-top: 1px solid var(--rule); padding: 1.1rem 0; }
.elenco-guide li:last-child { border-bottom: 1px solid var(--rule); }
.elenco-guide h2, .elenco-guide h3 { font-size: 1.2rem; line-height: 1.3; margin: 0; }
.elenco-guide h2 a, .elenco-guide h3 a { font-weight: 700; }
.elenco-guide p { margin: 0.3rem 0 0; color: var(--muted); }
.elenco-guide .elenco-argomento { font-size: 0.95rem; margin-top: 0.4rem; }
.elenco-argomento a { color: var(--muted); }
.elenco-guide.compatto li { padding: 0.8rem 0; }
.elenco-guide.compatto h2, .elenco-guide.compatto h3 { font-size: 1.08rem; }
.elenco-guide.compatto p { font-size: 1rem; }

/* Home: apertura */
.apertura { padding: 3rem 0 0; }
.apertura + .sezione-home { margin-top: 2.25rem; }
:where(.pagina) > h1:first-child { margin-top: 2.25rem; }
.apertura h1 {
  font-size: clamp(2.75rem, 1.5rem + 5.2vw, 4.6rem);
  line-height: 1.02; letter-spacing: -0.03em;
  margin: 0 0 1rem; max-width: 13ch;
}
.apertura-testo { font-size: 1.25rem; line-height: 1.5; max-width: 36rem; margin: 0 0 1.75rem; }

/* Ricerca */
.cerca { max-width: 40rem; margin: 0; }
.cerca-riga { display: flex; gap: 0.6rem; align-items: stretch; }
.cerca input {
  flex: 1; min-width: 0; height: 3.5rem;
  font: inherit; font-size: 1.1rem; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
  padding: 0 1rem;
}
.cerca input::placeholder { color: var(--muted); }
.cerca input:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.tasto-cerca {
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
  background: var(--signal); border: 2px solid var(--ink); border-bottom-width: 5px; border-radius: 10px;
  padding: 0 1.3rem; height: 3.5rem;
  transition: transform 80ms ease-out, border-bottom-width 80ms ease-out;
}
.tasto-cerca:active { transform: translateY(2px); border-bottom-width: 3px; }
.cerca-stato { color: var(--muted); font-size: 1rem; margin: 0.6rem 0 0; min-height: 1.5em; }
.cerca-risultati { list-style: none; margin: 0.25rem 0 0; padding: 0; }
.cerca-risultati li { border-top: 1px solid var(--rule); }
.cerca-risultati li:last-child { border-bottom: 1px solid var(--rule); }
.cerca-risultati a { display: block; padding: 0.7rem 0; text-decoration: none; }
.cerca-risultati strong { display: block; color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; }
.cerca-risultati span { display: block; color: var(--muted); font-size: 0.95rem; }

/* Tastiera degli argomenti: ogni argomento è un tasto.
   Bianco a riposo; quando lo premi, o quando sei nella sua pagina, diventa giallo e scende. */
.sezione-home { margin-top: 4rem; }
.sezione-home > h2 { margin: 0 0 1rem; }
.tastiera {
  list-style: none; margin: 0; padding: 0.85rem;
  background: var(--mist); border-radius: 16px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 0.75rem;
}
.tasto {
  display: flex; flex-direction: column; height: 100%; min-height: 8.25rem;
  padding: 0.95rem 1rem 0.85rem;
  background: var(--paper); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-bottom-width: 6px; border-radius: 12px;
  transition: transform 80ms ease-out, border-bottom-width 80ms ease-out, background-color 120ms;
}
.tasto .icona { width: 2rem; height: 2rem; }
.tasto-nome { margin-top: auto; font-weight: 700; font-size: 1.1rem; line-height: 1.25; }
.tasto-conta { color: var(--muted); font-size: 0.95rem; }
.tasto:hover, .tasto:focus-visible, .tasto[aria-current="page"] {
  background: var(--signal); transform: translateY(3px); border-bottom-width: 3px;
}
.tasto:hover .tasto-conta, .tasto:focus-visible .tasto-conta, .tasto[aria-current="page"] .tasto-conta { color: var(--ink); }
.tasto:focus-visible { outline-offset: 3px; }

/* Home: come scriviamo le guide */
.metodo-punti {
  list-style: none; margin: 0 0 1.25rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.25rem 2rem;
}
.metodo-punti li { border-top: 3px solid var(--ink); padding-top: 0.8rem; }
.metodo-punti strong { display: block; margin-bottom: 0.25rem; }

/* Pagine degli argomenti */
.argomento-testa { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 1rem; }
.argomento-testa h1 { margin-top: 0.1rem; }
.argomento-testa .apertura-testo { margin-bottom: 0; }
.tasto-grande {
  flex: none; display: grid; place-items: center; width: 4.75rem; height: 4.75rem;
  background: var(--signal); border: 2px solid var(--ink); border-bottom-width: 6px; border-radius: 14px;
}
.tasto-grande .icona { width: 2.6rem; height: 2.6rem; }
.argomento-conta { color: var(--muted); margin: 2rem 0 0; }
.gruppi { margin-top: 1rem; }
.gruppo { margin-top: 2.75rem; }
.gruppo h2 { font-size: 1.35rem; margin: 0; }
.gruppo h2 a { color: var(--ink); }

/* Guide: altre guide */
.correlate { margin-top: 3.5rem; padding-top: 0.25rem; border-top: 3px solid var(--ink); }
.correlate h2 { font-size: 1.2rem; margin: 1rem 0 0; }
.correlate .tutti { margin: 1rem 0 0; font-size: 1rem; }

@media (max-width: 40rem) {
  .menu ul { gap: 1rem; }
  .apertura { padding-top: 2rem; }
  .tastiera { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0.6rem; gap: 0.6rem; }
  .tasto { min-height: 7.25rem; padding: 0.8rem 0.85rem 0.75rem; }
  .argomento-testa { flex-direction: column; gap: 0.9rem; }
  .tasto-grande { width: 3.75rem; height: 3.75rem; }
  .tasto-grande .icona { width: 2.1rem; height: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tasto, .tasto-cerca { transition: none; }
  .tasto:hover, .tasto:focus-visible, .tasto[aria-current="page"], .tasto-cerca:active { transform: none; }
}

@media print {
  .testata, .piede, .salta, .indice, .cerca, .correlate { display: none; }
  a { color: inherit; }
  figure { break-inside: avoid; }
}
