/* ==========================================================================
   BASE — reset leggero, tipografia, utilità comuni a tutte le pagine
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altezza-header) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--biscotto);
  color: var(--testo);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* clip e non hidden: non blocca position: sticky */
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Titoli: corsivo largo e pesante, come il logotipo */
h1,
h2,
h3 {
  font-weight: 800;
  font-style: italic;
  font-stretch: 118%;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h2 {
  font-size: var(--t-titolo);
}

h3 {
  font-size: var(--t-grande);
}

p {
  max-width: 62ch;
  text-wrap: pretty;
}

::selection {
  background: var(--accento);
  color: var(--su-accento);
}

/* Focus visibile per chi naviga da tastiera */
:focus-visible {
  outline: 2px solid var(--accento-testo);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Utilità --- */
.contenitore {
  width: 100%;
  max-width: var(--larghezza-max);
  margin-inline: auto;
  padding-inline: var(--margine-lato);
}

.sezione {
  padding-block: var(--s-6);
}

.testo-tenue {
  color: var(--testo-tenue);
}

/* Testo leggibile solo dagli screen reader */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Link "salta al contenuto" visibile solo con il focus */
.salta {
  position: absolute;
  top: -100px;
  left: var(--margine-lato);
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accento);
  color: var(--su-accento);
  font-weight: 700;
  border-radius: var(--raggio);
}

.salta:focus {
  top: 0.75rem;
}

/* Chi preferisce meno movimento: niente animazioni */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
