/* Layout and rhythm. Colours and components live in assets/tema.css (--tema-* variables).
   DESIGN SYSTEM (identical on every page):
   1. Container: max 1100px (--larghezza); side margin 16px < 30em, 24px >= 30em, 32px >= 64em.
   2. Type scale: body 17px/1.65; small text never below 16px; h3 18, h2 24 (28 on desktop),
      page h1 clamp(30px..44px), hero h1 clamp(32px..52px).
   3. Spacing scale (only these): 4, 8, 16, 24, 32, 48 px = --s1..--s6.
   4. Vertical rhythm: 32px between cards on phones, 48px between page blocks on desktop.
   5. One radius for cards/buttons (--tema-raggio, 18px), one for small chips/badges (12px).
   6. One shadow (--tema-ombra) for every raised surface.
   7. Breakpoints: 30em (phone wide), 48em (tablet: 2 columns, inline menu), 64em (desktop: 3 columns, 2-col hero).
   8. Touch targets >= 44px; interactive elements never wider than the viewport. */
:root {
  --larghezza: 68.75rem;
  --margine: 1rem;
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 1rem;
  --s4: 1.5rem;
  --s5: 2rem;
  --s6: 3rem;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--tema-font, system-ui, sans-serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--tema-testo, #1f2a1e);
  background: var(--tema-sfondo, #f1f6ee);
  overflow-wrap: break-word;
}

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

a {
  color: var(--tema-verde-scuro);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--tema-verde-profondo);
}

:focus-visible {
  outline: 3px solid var(--tema-accento-freddo);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  margin: 0 0 var(--s3);
  color: var(--tema-verde-profondo);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem);
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.125rem;
}

p {
  margin: 0 0 var(--s3);
}

/* Container shared by title, hero, main: same edges as the header and footer content. */
.titolo-pagina,
.hero,
main {
  width: min(100% - 2 * var(--margine), var(--larghezza));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.sito-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--s2) max(var(--margine), calc((100% - var(--larghezza)) / 2));
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--tema-neutro-medio);
  box-shadow: 0 2px 12px rgba(18, 56, 26, 0.06);
}

.sito-header-barra {
  display: flex;
  align-items: center;
  gap: var(--s2);
}

.marchio {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-right: auto;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  color: var(--tema-verde-profondo);
  text-decoration: none;
}

.marchio-punto {
  color: #2a7a17;
}

.btn-prenota {
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border-bottom-width: 4px;
  box-shadow: none;
}

/* The "Menu" button exists only for the phone/tablet layout and only when JavaScript runs (.js on <html>). */
.menu-bottone {
  display: none;
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-weight: 700;
  color: var(--tema-verde-profondo);
  background: #ffffff;
  border: 2px solid var(--tema-neutro-medio);
  border-radius: 12px;
  cursor: pointer;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: var(--s1);
}

.menu a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
  color: var(--tema-testo);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.menu a:hover,
.menu a:focus {
  color: var(--tema-verde-scuro);
  border-bottom-color: var(--tema-verde);
}

.menu a[aria-current="page"] {
  color: var(--tema-verde-scuro);
  border-bottom-color: var(--tema-verde);
}

/* Phones: with JavaScript the menu collapses behind the "Menu" button; without it the links stay visible. */
@media (max-width: 47.99em) {
  .js .menu-bottone {
    display: inline-flex;
    align-items: center;
  }

  .js .menu:not(.aperto) {
    display: none;
  }
}

@media (max-width: 22.5em) {
  :root {
    --margine: 0.75rem;
  }

  .marchio {
    font-size: 1rem;
    letter-spacing: -0.03em;
  }

  .sito-header-barra {
    gap: 0.375rem;
  }

  .btn-prenota {
    padding-inline: 0.75rem;
  }

  .menu-bottone {
    padding-inline: 0.65rem;
  }
}

/* ---------- Page title ---------- */
.titolo-pagina {
  padding: var(--s5) 0 var(--s3);
}

.titolo-pagina p {
  margin: 0 0 var(--s2);
  color: var(--tema-testo-attenuato);
}

.etichetta {
  margin: 0 0 var(--s1);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tema-verde-scuro);
}

/* ---------- Hero (home) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s5);
  margin-top: var(--s4);
  padding: var(--s5) var(--s4);
  background:
    radial-gradient(circle at 100% 0, rgba(46, 139, 26, 0.14), transparent 55%),
    linear-gradient(160deg, #ffffff 0%, var(--tema-verde-chiaro) 100%);
  border: 1px solid var(--tema-neutro-medio);
  border-radius: 28px;
  box-shadow: var(--tema-ombra);
}

.hero-etichetta {
  margin: 0 0 var(--s3);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tema-verde-scuro);
}

.hero h1 {
  font-size: clamp(2rem, 1.1rem + 2.4vw, 3.25rem);
  line-height: 1.1;
  margin-bottom: var(--s3);
}

.hero-sotto {
  max-width: 34rem;
  margin: 0 0 var(--s4);
  font-size: 1.1875rem;
  color: var(--tema-testo-attenuato);
}

.hero-azioni {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0 0 var(--s4);
}

.hero-badge {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-badge .badge {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.hero-badge .badge a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
}

.hero-badge {
  margin-bottom: var(--s4);
}

.hero .hero-badge {
  margin-bottom: 0;
}

.hero-riquadri {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s2);
  align-content: center;
}

.hero-riquadri .card-tema {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  padding: var(--s2);
  font-size: 1.0625rem;
  font-weight: 800;
  text-align: center;
  color: var(--tema-verde-scuro);
}

.hero-mascotte {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s3);
}

.hero-mascotte .mascotte {
  width: 120px;
}

/* ---------- Main blocks: one vertical rhythm ---------- */
main {
  display: block;
  padding: var(--s4) 0 var(--s5);
}

main > section,
main > .griglia-materie,
main > .livelli,
main > .contatti-griglia {
  margin-bottom: var(--s4);
}

section {
  padding: var(--s4);
  background: #ffffff;
  border: 1px solid var(--tema-neutro-medio);
  border-radius: 18px;
  box-shadow: var(--tema-ombra);
}

section > :last-child {
  margin-bottom: 0;
}

section > p,
section > ul:not([class]),
section > ol:not([class]) {
  max-width: 46rem;
}

section ul:not([class]),
section ol:not([class]) {
  padding-left: var(--s4);
}

section li::marker {
  color: var(--tema-verde);
}

h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: var(--s2);
  background: var(--tema-verde);
  border-radius: 2px;
}

.card-tema h2::after,
.tappe h2::after {
  display: none;
}

/* Plain figure: a readable fact, no decoration. */
.dato {
  padding: var(--s3);
  font-weight: 600;
  background: var(--tema-verde-chiaro);
  border-left: 5px solid var(--tema-verde);
  border-radius: 12px;
}

/* ---------- Home grid: pairs side by side from 48em, equal heights ---------- */
.pagina-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  column-gap: var(--s4);
}

.pagina-home > section {
  margin-bottom: var(--s4);
}

/* ---------- Materie ---------- */
.griglia-materie,
.livelli {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
}

.griglia-materie > .card-tema,
.livelli > .card-tema {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.livelli > .card-tema > p:last-child {
  margin-top: auto;
  margin-bottom: 0;
}

.numero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin: 0 0 var(--s3);
  font-size: 1.125rem;
  font-weight: 800;
  color: #ffffff;
  background: #b45309; /* white on it: 5:1 */
  border-bottom: 4px solid rgba(0, 0, 0, 0.22);
  border-radius: 14px;
}

.griglia-materie > .card-tema:nth-child(1) {
  border-bottom-color: var(--tema-accento-caldo);
}

.griglia-materie > .card-tema:nth-child(2) {
  border-bottom-color: var(--tema-accento-freddo);
}

.griglia-materie > .card-tema:nth-child(2) .numero {
  background: #1f78b8;
}

.griglia-materie > .card-tema:nth-child(3) {
  border-bottom-color: var(--tema-verde);
}

.griglia-materie > .card-tema:nth-child(3) .numero {
  background: var(--tema-bottone-sfondo);
}

.griglia-materie > .card-tema:nth-child(2) .numero,
.griglia-materie > .card-tema:nth-child(3) .numero {
  color: #ffffff;
}

.chip-elenco {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s3);
  padding: 0;
  list-style: none;
}

.chip {
  padding: var(--s1) 0.8rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--tema-verde-scuro);
  background: var(--tema-verde-chiaro);
  border-bottom: 3px solid var(--tema-verde);
  border-radius: 12px;
}

/* Sub pages (superiori, università): cards in a responsive grid. */
.elenco-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
}

.elenco-card > section.card-tema {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.elenco-card > section.card-tema > p:last-child {
  margin-top: auto;
  padding-top: var(--s2);
}

.elenco-card > p {
  grid-column: 1 / -1;
  margin: 0;
}

/* ---------- Come funziona ---------- */
.sezione-passi {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.tappe h2 {
  margin: 0 0 var(--s1);
  font-size: 1.125rem;
}

.tappe p {
  margin: 0;
}

.tappe-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
}

.tappe.tappe-card > li {
  min-height: 0;
  margin: 0;
  padding: calc(var(--s4) + 2.75rem + var(--s2)) var(--s4) var(--s4);
  background: #ffffff;
  border: 1px solid var(--tema-neutro-medio);
  border-radius: 18px;
  box-shadow: var(--tema-ombra);
}

.tappe.tappe-card > li {
  padding-top: calc(var(--s4) + 2.75rem + var(--s3));
}

.tappe.tappe-card > li::before {
  top: var(--s4);
  left: var(--s4);
}

.prezzo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s2) var(--s5);
  align-items: center;
}

.prezzo-riga {
  margin: 0;
}

.prezzo-importo {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--tema-verde-scuro);
}

.prezzo-unita {
  font-size: 1.25rem;
  font-weight: 700;
}

.prezzo-modalita {
  margin: 0 0 var(--s3);
  padding-left: var(--s4);
}

.prezzo > p:last-child {
  margin: var(--s2) 0 0;
}

/* ---------- Chi sono / Contatti ---------- */
.fumetti {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3);
}

.fumetti .card-tema p {
  margin: 0 0 var(--s2);
}

.riquadri-contatti {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s3);
}

.riquadri-contatti .card-tema p {
  margin: 0;
}

.contatti-griglia {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
}

.contatti-griglia > section {
  margin-bottom: 0;
}

.contatti-diretti {
  display: flex;
  flex-direction: column;
}

.azioni-contatto {
  display: grid;
  gap: var(--s3);
  margin: var(--s3) 0 0;
  padding: 0;
  list-style: none;
}

.azioni-contatto a {
  width: 100%;
  min-height: 3.25rem;
  overflow-wrap: anywhere;
}

.nota-contatti {
  margin: auto 0 0;
  padding-top: var(--s4);
  font-weight: 600;
  color: var(--tema-testo-attenuato);
}

.contatti-modulo form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.contatti-modulo form p {
  margin: 0;
}

.mappa-riquadro {
  margin-bottom: var(--s3);
  overflow: hidden;
  background: var(--tema-verde-chiaro);
  border-radius: 18px;
}

.mappa {
  display: block;
  width: 100%;
  height: auto;
  max-height: 20rem;
  overflow: visible;
}

.mappa-terra {
  fill: var(--tema-verde-chiaro);
}

.mappa-mare {
  fill: var(--tema-accento-freddo);
  opacity: 0.35;
}

.mappa-punto {
  fill: var(--tema-accento-caldo);
  stroke: var(--tema-neutro-scuro);
  stroke-width: 2;
}

.mappa-punto-principale {
  fill: var(--tema-verde);
}

.mappa-nome {
  font-size: 15px;
  font-weight: 700;
  fill: var(--tema-neutro-scuro);
  stroke: #ffffff;
  stroke-width: 3px;
  paint-order: stroke;
}

.mappa-nome-mare {
  font-style: italic;
  fill: #1a5a8c;
}

/* ---------- Form ---------- */
form label {
  display: block;
  font-weight: 600;
}

input,
textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: var(--s2);
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--tema-testo);
  background: #ffffff;
  border: 2px solid var(--tema-neutro-medio);
  border-radius: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--tema-verde);
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

form button[type="submit"] {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1.6rem;
  font: inherit;
  font-weight: 700;
  color: var(--tema-bottone-testo);
  background: var(--tema-bottone-sfondo);
  border: 0;
  border-bottom: 4px solid var(--tema-bottone-bordo);
  border-radius: 14px;
  cursor: pointer;
}

form button[type="submit"]:hover {
  filter: brightness(1.1);
}

/* ---------- Footer: three tidy blocks ---------- */
.sito-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s4);
  margin-top: var(--s5);
  padding: var(--s5) max(var(--margine), calc((100% - var(--larghezza)) / 2));
  color: #e6f1e1;
  background: var(--tema-verde-profondo);
}

.sito-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 600;
  color: #ffffff;
}

.sito-footer a:hover {
  color: #bfe6b3;
}

.sito-footer-colonne {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.sito-footer-colonne p {
  margin: 0;
}

.footer-menu {
  display: flex;
  flex-direction: column;
}

.miei-siti {
  display: flex;
  flex-direction: column;
}

.miei-siti-titolo {
  display: block;
  padding-bottom: var(--s1);
  font-weight: 700;
  color: #bfe6b3;
}

.miei-siti ul {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- >= 30em: wider margins, buttons side by side ---------- */
@media (min-width: 30em) {
  :root {
    --margine: 1.5rem;
  }

  .hero-azioni {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero {
    padding: var(--s5);
  }
}

/* ---------- >= 48em: tablet, two columns, inline menu ---------- */
@media (min-width: 48em) {
  .sito-header {
    display: flex;
    align-items: center;
    gap: var(--s4);
  }

  .sito-header-barra {
    display: contents;
  }

  .menu {
    flex-direction: row;
    gap: var(--s4);
    margin-top: 0;
    order: 2;
  }

  .btn-prenota {
    order: 3;
  }

  .marchio {
    flex: 0 0 auto;
    margin-right: auto;
  }

  .griglia-materie,
  .elenco-card,
  .tappe-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .livelli,
  .fumetti {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .riquadri-contatti {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pagina-home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contatti-griglia {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mappa {
    height: 20rem;
  }

  .prezzo {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .prezzo > p:last-child {
    margin: 0;
  }

  .titolo-pagina {
    padding-top: var(--s6);
  }

  .hero-riquadri .card-tema {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  section,
  main > section.card-tema {
    padding: var(--s5);
  }

  .sito-footer {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}

/* ---------- >= 64em: desktop ---------- */
@media (min-width: 64em) {
  :root {
    --margine: 2rem;
  }

  .hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: center;
    gap: var(--s6);
    padding: var(--s6) var(--s5);
  }

  .hero-riquadri {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s3);
  }

  .hero-riquadri .card-tema {
    min-height: 5.5rem;
    font-size: 1.6rem;
  }

  .griglia-materie,
  .elenco-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tappe-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  main {
    padding-top: var(--s5);
  }
}

/* ---------- Floating WhatsApp button ----------
   Selector is `.sito-footer a.whatsapp-float` on purpose: `.sito-footer a` (inline-flex, min-height)
   would otherwise win over a plain class and push the icon to the left of the circle. */
.sito-footer a.whatsapp-float {
  position: fixed;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #25d366;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sito-footer a.whatsapp-float:hover {
  background: #20bd5a;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sito-footer a.whatsapp-float:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.sito-footer a.whatsapp-float .icona {
  display: block;
  width: 28px;
  height: 28px;
  max-width: none;
  margin: 0;
  color: #ffffff;
  transform: none;
}

/* leave room under the footer so the button never sits on the last line of text */
.sito-footer {
  padding-bottom: calc(var(--s5) + 4.5rem);
}

/* Credit line: same look as the Garage27 digital menu (small light-grey text + tone-on-tone wordmark). */
.sito-footer .cred {
  margin: 0;
  font-size: 1rem;
  color: #c9d1c6;
  opacity: 0.85;
}

.sito-footer .cred a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 400;
  color: inherit;
}

.sito-footer .cred a:hover {
  color: #ffffff;
}

.wm-pikobit .wm-occhio {
  stroke: #9ad8f3;
}

.wm-pikobit {
  display: inline-block;
  height: 14px;
  width: auto;
  max-width: none;
  margin-left: 0.4rem;
  vertical-align: -2px;
}

/* home pairs: cards keep their own height (no empty strip at the bottom of the shorter one) */
@media (min-width: 48em) {
  .pagina-home {
    align-items: start;
  }
}

/* readable line length inside cards */
.card-tema p {
  max-width: 68ch;
}
