/* Patente a Lodi — foglio di stile unico, scritto a mano. Mobile-first. */

:root {
  --blu: #14284b;        /* titoli, testata */
  --blu-chiaro: #e8edf5; /* fondi tenui */
  --testo: #1f2933;
  --testo-tenue: #4a5563; /* 7.4:1 su bianco */
  --bordo: #d5dbe3;
  --fondo: #ffffff;
  --fondo-alt: #f5f7fa;
  --accento: #c2410c;     /* solo CTA — 5.2:1 con testo bianco */
  --accento-scuro: #9a3412;
  --link: #1d4ed8;        /* 6.7:1 su bianco */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --raggio: 8px;
  --misura: 42rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--testo);
  background: var(--fondo);
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3 { color: var(--blu); line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); margin: 0.5rem 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

.contenitore { width: 100%; max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
main.contenitore { padding-bottom: 3rem; }
main > *:not(.schede-home):not(.hero) { max-width: var(--misura); }

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

/* Testata */
.testata { border-bottom: 1px solid var(--bordo); background: var(--fondo); }
.testata-riga {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1.5rem; padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.logo { text-decoration: none; color: var(--blu); display: flex; flex-direction: column; line-height: 1.15; }
.logo-nome { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.01em; }
.logo-sotto { font-size: 0.85rem; color: var(--testo-tenue); }
.menu { display: flex; gap: 1.25rem; }
.menu a { color: var(--testo); text-decoration: none; font-weight: 600; padding: 0.4rem 0; }
.menu a:hover, .menu a[aria-current="page"] { color: var(--blu); text-decoration: underline; }

/* Briciole */
.briciole { margin-top: 1.25rem; font-size: 0.9rem; color: var(--testo-tenue); }
.briciole ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; }
.briciole li { margin: 0; }
.briciole li + li::before { content: "›"; padding: 0 0.5rem; }

/* Apertura pagina */
.risposta { font-size: 1.15rem; color: var(--testo); }

.in-breve {
  background: var(--blu-chiaro); border-left: 4px solid var(--blu);
  border-radius: var(--raggio); padding: 1rem 1.25rem; margin: 1.5rem 0 2rem;
}
.in-breve h2 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.in-breve ul { margin: 0; padding-left: 1.2rem; }

.nota {
  background: var(--fondo-alt); border: 1px solid var(--bordo);
  border-radius: var(--raggio); padding: 0.9rem 1.1rem; font-size: 0.97rem;
}

/* Tabelle */
.tabella { width: 100%; overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--bordo); vertical-align: top; }
th { color: var(--blu); background: var(--fondo-alt); }

/* Segnaposto dei dati da verificare: devono saltare all'occhio */
mark.segnaposto {
  background: #fff3bf; color: #5c3d00; border: 1px dashed #b7791f;
  padding: 0 0.25em; border-radius: 3px; font-size: 0.92em;
}

/* FAQ */
.faq details { border-bottom: 1px solid var(--bordo); }
.faq summary {
  cursor: pointer; font-weight: 600; padding: 0.85rem 0; color: var(--blu);
  list-style-position: outside; margin-left: 1.1rem;
}
.faq-risposta { padding: 0 0 0.5rem 1.1rem; }

/* CTA */
.cta {
  margin: 2.5rem 0; padding: 1.5rem; border-radius: var(--raggio);
  background: var(--fondo-alt); border: 1px solid var(--bordo);
}
.cta h2 { margin-top: 0; font-size: 1.25rem; }
.cta-azione { margin: 0; }
.bottone, .cta-azione a {
  display: inline-block; background: var(--accento); color: #fff; font-weight: 700;
  text-decoration: none; padding: 0.75rem 1.25rem; border-radius: var(--raggio);
}
.bottone:hover, .cta-azione a:hover { background: var(--accento-scuro); }
.cta-azione mark { display: inline-block; margin-top: 0.5rem; }

/* Schede (home e guide collegate) */
.schede { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.schede li { margin: 0; }
.schede a {
  display: flex; flex-direction: column; gap: 0.25rem; height: 100%;
  padding: 1rem 1.1rem; border: 1px solid var(--bordo); border-radius: var(--raggio);
  text-decoration: none; color: var(--testo); background: var(--fondo);
}
.schede a:hover { border-color: var(--blu); box-shadow: 0 2px 8px rgb(20 40 75 / 0.08); }
.schede strong { color: var(--blu); font-size: 1.05rem; }
.schede span { color: var(--testo-tenue); font-size: 0.95rem; }
.schede svg { width: 28px; height: 28px; color: var(--blu); margin-bottom: 0.25rem; }

.hero { padding: 2rem 0 1rem; max-width: var(--misura); }
.hero p { font-size: 1.15rem; }
.gruppo-titolo { margin-top: 2rem; }

/* Foto opzionali */
.foto { margin: 1.5rem 0; }
.foto img { border-radius: var(--raggio); }
.foto figcaption { font-size: 0.9rem; color: var(--testo-tenue); margin-top: 0.4rem; }

.firma { margin-top: 2.5rem; font-size: 0.92rem; color: var(--testo-tenue); border-top: 1px solid var(--bordo); padding-top: 1rem; }

/* Piede */
.piede { background: var(--blu); color: #e6ebf2; padding: 2.5rem 0 2rem; font-size: 0.95rem; }
.piede h2 { color: #fff; font-size: 1rem; margin: 0 0 0.75rem; }
.piede a { color: #fff; }
.piede ul { list-style: none; padding: 0; }
.piede-colonne { display: grid; gap: 1.5rem; }
.piede-azienda { border-top: 1px solid rgb(255 255 255 / 0.2); padding-top: 1rem; margin: 1rem 0 0; }
.piede mark.segnaposto { color: #5c3d00; }

@media (min-width: 40rem) {
  .schede { grid-template-columns: repeat(2, 1fr); }
  .piede-colonne { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 60rem) {
  .schede-home .schede { grid-template-columns: repeat(3, 1fr); }
}

@media print {
  .testata .menu, .piede, .cta, .correlate, .salta { display: none; }
}
