/* Sito della Scuola dell'infanzia G. Carugati: stile "quaderno a quadretti" (design/bozza1-quaderno.md) */

@font-face {
  font-family: "Shantell Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/shantell-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0152-0153, U+2013-2014, U+2018-201E, U+2022, U+2026, U+20AC, U+2122;
}
@font-face {
  font-family: "Shantell Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(../fonts/shantell-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+A720-A7FF;
}

:root {
  --paper: #fdfdf8;
  --grid: #d3e3f1;
  --margin: #eba7a2;
  --ink: #1f3b8c;          /* biro blu: tutto il testo */
  --ink-soft: #46598f;
  --red: #c93322;
  --yellow: #f6b300;
  --green: #237a37;
  --sq: 28px;              /* lato del quadretto = interlinea */
  --margin-x: clamp(56px, 9vw, 132px);
  --pad-r: clamp(16px, 4vw, 56px);
  font-family: "Shantell Sans", "Comic Sans MS", system-ui, sans-serif;
  font-variation-settings: "INFM" 0, "BNCE" 0;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-size: 18px;
  line-height: var(--sq);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent calc(var(--margin-x) - 1px), var(--margin) calc(var(--margin-x) - 1px), var(--margin) calc(var(--margin-x) + 1px), transparent calc(var(--margin-x) + 1px)),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100% 100%, var(--sq) var(--sq), var(--sq) var(--sq);
  background-attachment: local;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 50; }
.skip:focus { left: 12px; }

.draft-bar {
  margin: 0; padding: 6px var(--margin-x); background: var(--yellow); color: #3a2a00;
  font-size: 14px; line-height: 20px; max-width: none;
}
.draft-bar .tbd { background: #fff6d6; }

/* Segnaposto: evidenziatore giallo, come una nota da controllare */
mark.tbd {
  color: inherit; background: linear-gradient(transparent 12%, rgb(246 179 0 / .55) 12%, rgb(246 179 0 / .55) 88%, transparent 88%);
  padding: 0 3px; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.esempio {
  display: inline-block; margin-top: 4px; font-size: 14px; line-height: 20px; padding: 1px 8px;
  border: 2px dashed var(--yellow); border-radius: 10px 14px 8px 12px; color: #6b4c00; background: #fff8e1;
  font-variation-settings: "INFM" 100;
}

h1, h2, h3, h4 { font-weight: 700; margin: 0; }
h1 {
  font-size: clamp(36px, 4.3vw, 60px);
  line-height: 1.12;
  font-variation-settings: "INFM" 100, "BNCE" 30;
  letter-spacing: -0.01em;
  max-width: 18ch;
  text-wrap: balance;
}
h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: calc(var(--sq) * 2);
  font-variation-settings: "INFM" 100, "BNCE" 40;
  margin-bottom: var(--sq);
  text-wrap: balance;
}
h3, h4 { font-size: 21px; line-height: var(--sq); font-variation-settings: "INFM" 60, "BNCE" 0; }
p, ul, ol, dl { margin: 0 0 var(--sq); }
p, li { max-width: 64ch; }
p, li, dd, figcaption { text-wrap: pretty; overflow-wrap: break-word; }
.intro, .intro p { color: var(--ink-soft); }
.lead, .lead p { font-size: 21px; line-height: 34px; max-width: 40ch; }
.lead { margin-top: var(--sq); }
.lead p:last-child, .intro p:last-child { margin-bottom: 0; }
.intro { margin-bottom: var(--sq); }

/* ------------------------------------------------------------ intestazione */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 22px;
  padding: 10px clamp(16px, 3vw, 40px) 10px calc(var(--margin-x) - 72px);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--grid);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 20px; font-size: 15px; flex: none; }
.brand b { font-size: 20px; font-variation-settings: "INFM" 100; }
.brand img { width: 60px; height: 60px; }
.top nav { margin-left: auto; }
.top ul { list-style: none; display: flex; gap: 4px 18px; flex-wrap: wrap; margin: 0; padding: 0; }
.top nav a {
  display: inline-block; text-decoration: none; padding: 6px 2px; font-size: 17px;
  background: linear-gradient(var(--yellow), var(--yellow)) 0 88% / 0 8px no-repeat; transition: background-size .25s;
}
.top nav a:hover, .top nav a[aria-current="page"] { background-size: 100% 8px; }
.top nav a[aria-current="page"] { font-weight: 700; }

/* sottomenu: lo apre sito.js (clic, e passaggio del mouse sui computer); senza script vedi senza-js.css */
.top nav > ul { align-items: baseline; }
.top nav > ul > li { position: relative; }
.apri-sotto {
  font: inherit; font-size: 17px; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 6px 2px;
  background: linear-gradient(var(--yellow), var(--yellow)) 0 88% / 0 8px no-repeat; transition: background-size .25s;
}
.apri-sotto::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 2px 4px 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s;
}
.apri-sotto[aria-expanded="true"]::after { transform: translateY(3px) rotate(225deg); }
.apri-sotto:hover, .voce-gruppo.attiva > .apri-sotto { background-size: 100% 8px; }
.voce-gruppo.attiva > .apri-sotto { font-weight: 700; }
.top .sotto {
  display: none; flex-direction: column; flex-wrap: nowrap; gap: 0; position: absolute; top: 100%; left: -16px; z-index: 25;
  min-width: 250px; padding: 10px 16px 12px; background: var(--paper); border: 2px solid var(--grid);
  border-radius: 10px 14px 12px 16px; box-shadow: 0 14px 24px -14px rgb(31 59 140 / .45);
}
.top .voce-gruppo.is-open > .sotto { display: flex; }
.top nav .sotto a { display: block; padding: 6px 2px; font-size: 16px; white-space: nowrap; }
/* nel sottomenu le pagine sono in grassetto, le loro sezioni rientrate sotto con una linea, come in un indice */
.top nav .sotto a.pagina { font-weight: 700; }
.top .sotto > li + li { margin-top: 4px; }
.top .sezioni { flex-direction: column; gap: 0; margin: 0 0 4px 4px; padding-left: 12px; border-left: 2px solid var(--grid); }
.top nav .sezioni a { padding: 4px 2px; font-size: 15px; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font: inherit; font-weight: 700; cursor: pointer;
  padding: 10px 20px; line-height: 24px; border: 2px solid var(--red);
  color: #fff; background: var(--red);
  border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;   /* bordo storto, fatto a mano */
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-wa { background: var(--green); border-color: var(--green); }
.btn-top { white-space: nowrap; flex: none; }
.more { font-weight: 700; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: var(--sq); }

/* ------------------------------------------------------------ impaginazione: il testo parte dopo il margine rosso */
main > section, main > header, main > article, main > nav, main > p.sezione {
  padding: calc(var(--sq) * 2) var(--pad-r) var(--sq) calc(var(--margin-x) + 24px);
}
main > p.sezione { padding-top: 0; }

.briciole { padding-top: 18px !important; padding-bottom: 0 !important; font-size: 15px; line-height: 22px; }
.briciole ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; color: var(--ink-soft); }
.briciole li { max-width: none; }
.briciole li + li::before { content: "/"; margin: 0 8px; color: var(--margin); font-weight: 700; }
.briciole [aria-current] { color: var(--ink); }

/* testata delle pagine interne */
.testata { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; padding-top: calc(var(--sq) * 1.5) !important; }
.testata.con-disegno { grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); }
.testata-art { width: auto; max-width: min(100%, 340px); max-height: 280px; transform: rotate(-3deg); justify-self: center; }
.testata .lead { margin-bottom: 0; }

/* indice della pagina */
.indice { padding-top: 0 !important; }
.indice-titolo { margin: 0; font-size: 15px; color: var(--ink-soft); font-variation-settings: "INFM" 100; }
.indice ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 0; margin: 0; }
.indice a { font-weight: 700; }

/* sezioni delle pagine fisse */
.sezione.con-disegno { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 40px; align-items: start; }
.sezione-art { width: auto; max-width: min(100%, 300px); max-height: 260px; margin-top: 72px; justify-self: center; }
.sezione:nth-of-type(even) .sezione-art { transform: rotate(3deg); }
.sezione:nth-of-type(odd) .sezione-art { transform: rotate(-2deg); }
.sezione-testo > ul, .testo ul, .faq-risposta ul { padding-left: 22px; }
.sezione-testo li, .testo li { margin-bottom: 4px; }
.sezione-testo h3, .testo h3 { margin-top: var(--sq); margin-bottom: 4px; }

/* ------------------------------------------------------------ home */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center;
  padding-top: calc(var(--sq) * 2) !important;
}
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 34ch; }
.hero-art { margin: 0; }

.openday { position: relative; margin: calc(var(--sq) * 1.5) 0; padding: 40px 60px 40px; max-width: 500px; }
.scribble { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.scribble path { fill: none; stroke: var(--red); stroke-width: 5; stroke-linecap: round; opacity: .85; stroke-dasharray: 1; stroke-dashoffset: 0; }
.openday-label { margin: 0; font-size: 30px; line-height: 40px; font-weight: 800; color: var(--red); font-variation-settings: "INFM" 100, "BNCE" 60; }
.openday-date { margin: 0 0 8px; font-size: 22px; font-weight: 700; }
.openday-date a { text-decoration: none; }
.openday-date a:hover { text-decoration: underline; }
.openday-note { font-size: 16px; color: var(--ink-soft); margin-bottom: 0; white-space: pre-line; }
.openday-nessuno { margin: var(--sq) 0; max-width: 46ch; }
.iscrizioni-aperte { font-weight: 700; max-width: 46ch; }
.cal-indirizzo code { font: inherit; font-size: 15px; overflow-wrap: anywhere; background: #fff; padding: 2px 6px; border: 1px solid var(--grid); border-radius: 6px; }
.btn-piccolo { font-size: 15px; padding: 4px 12px; margin-left: 6px; vertical-align: middle; min-height: 44px; }
.nota-piccola { font-size: 15px; color: var(--ink-soft); }
.iscrizioni-aperte span { background: linear-gradient(transparent 62%, rgb(246 179 0 / .45) 62%); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.openday-label-piccolo { margin: 0; font-size: 22px; font-weight: 700; color: var(--red); font-variation-settings: "INFM" 100; }
@media (prefers-reduced-motion: no-preference) {
  .scribble path { stroke-dashoffset: 1; animation: draw 1.4s .5s cubic-bezier(.6, .1, .3, 1) forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

/* orari e date nel margine del quaderno */
.margine {
  position: absolute; right: calc(100% + 38px); top: 0;
  font-weight: 700; color: var(--red); font-size: 16px; white-space: nowrap; text-align: right;
  font-variation-settings: "INFM" 100;
}
.orario { list-style: none; margin: 0; padding: 0; max-width: 760px; }
.orario li { position: relative; display: block; padding-bottom: var(--sq); }
.orario .margine { font-size: 18px; right: calc(100% + 38px); }
.orario p { margin: 0; }
.orario li::before { content: ""; position: absolute; left: -20px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.giornata-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 40px; align-items: center; }
.giornata-lato { justify-self: center; width: min(100%, 300px); }
.giornata-art { margin: 0; }
.giornata-art img { transform: rotate(-3deg); }
.giornata-art figcaption { font-size: 15px; text-align: center; color: var(--ink-soft); font-variation-settings: "INFM" 100; }
.pranzo-oggi { margin-top: var(--sq); background: color-mix(in srgb, var(--yellow) 45%, var(--paper)); padding: 10px 16px 14px; box-shadow: 0 1px 2px rgb(31 59 140 / .25), 0 8px 18px -10px rgb(31 59 140 / .35); transform: rotate(1.2deg); }
.pranzo-quando { margin: 0 0 4px; font-weight: 700; }
.pranzo-oggi ul { list-style: none; padding: 0; margin: 0 0 6px; }
.pranzo-oggi li { margin: 0; }
.pranzo-oggi .more { display: inline-block; padding: 10px 0; margin-bottom: -10px; }

/* laboratori */
.lab-list { list-style: none; margin: 0 0 var(--sq); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sq) 28px; }
.lab { max-width: none; }
.lab-link { display: block; text-decoration: none; }
.lab-link img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 4px; transition: transform .2s; }
.lab-link:hover h3, .lab-link:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.lab-list-grande h2, .lab-list-grande h3 { font-size: 24px; line-height: var(--sq); margin: 0; }
.lab h2, .lab h3 { hyphens: auto; overflow-wrap: break-word; }
.lab p { font-size: 16px; color: var(--ink-soft); margin: 4px 0 0; overflow-wrap: break-word; hyphens: auto; }
.lab:nth-child(even) .lab-link img { transform: rotate(3deg); }
.lab:nth-child(odd) .lab-link img { transform: rotate(-2deg); }
.lab-list-piccola { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.lab-list-piccola h3 { font-size: 18px; }
.lab-list-piccola p { display: none; }

/* foto con gli angolini da album */
.foto { margin: 0; background: #fff; padding: 12px 12px 4px; box-shadow: 0 1px 2px rgb(31 59 140 / .25), 0 8px 18px -10px rgb(31 59 140 / .35); position: relative; }
.foto img { width: 100%; }
.foto figcaption { font-size: 15px; line-height: 22px; padding: 7px 0 7px; font-variation-settings: "INFM" 100; }
.foto::before, .foto::after { content: ""; position: absolute; width: 34px; height: 34px; background: #2a2a2a; opacity: .82; pointer-events: none; }
.foto::before { top: -6px; left: -6px; clip-path: polygon(0 0, 100% 0, 0 100%); }
.foto::after { bottom: -6px; right: -6px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.foto:not(:has(figcaption)) { padding-bottom: 12px; }

.album-home { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 40px; align-items: start; max-width: 1000px; margin-bottom: var(--sq); }
.album-home .foto img { aspect-ratio: 4 / 3; object-fit: cover; }
.album-home .f1 { transform: rotate(-1.8deg); }
.album-home .f2 { transform: rotate(1.4deg); }
.album-home .f3 { transform: rotate(1deg); }
.album-home .f4 { transform: rotate(-1.2deg); }

.album { list-style: none; padding: 0; margin: 0 0 var(--sq); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 40px 32px; max-width: 1180px; }
.album li { max-width: none; }
.album .foto img { aspect-ratio: 4 / 3; object-fit: cover; }
.album li:nth-child(3n+1) .foto { transform: rotate(-1.6deg); }
.album li:nth-child(3n+2) .foto { transform: rotate(1.2deg); }
.album li:nth-child(3n) .foto { transform: rotate(-0.6deg); }
.album a { display: block; cursor: zoom-in; }
.album-quattro { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1000px; }
.foto-attesa .foto-vuota {
  aspect-ratio: 4 / 3; display: grid; place-items: center; border: 2px dashed var(--ink-soft);
  background: repeating-linear-gradient(-45deg, transparent 0 12px, rgb(211 227 241 / .5) 12px 14px);
  color: var(--ink-soft); font-variation-settings: "INFM" 100; text-align: center; padding: 12px;
}

/* chi siamo */
.chi { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 40px; align-items: center; }
.chi-sole { width: auto; max-width: min(100%, 300px); max-height: 260px; justify-self: center; }

/* righe con la data nel margine (notizie, eventi) */
.righe { list-style: none; margin: 0 0 var(--sq); padding: 0; max-width: 760px; }
.riga { position: relative; padding-bottom: var(--sq); }
.riga h3 a, .riga h4 a, .modulo-titolo a { text-decoration-thickness: 2px; text-underline-offset: 5px; }
.riga p { margin: 0; color: var(--ink-soft); }
.riga .riga-meta, .riga-meta { color: var(--ink); font-size: 16px; }
.pill { display: inline-block; font-size: 14px; line-height: 20px; padding: 0 8px; color: #fff; background: var(--red); border-radius: 10px 12px 8px 12px; vertical-align: 3px; font-variation-settings: "INFM" 100; }
.due-colonne { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; max-width: 1180px; }
.due-colonne > div + div .margine { position: static; display: block; text-align: left; }
.colonna-titolo { color: var(--ink-soft); margin-bottom: var(--sq); font-size: 18px; font-variation-settings: "INFM" 100; }
.passati .riga h3 { font-size: 19px; }
.vuoto { color: var(--ink-soft); }

/* articolo (notizia, evento) */
.articolo { max-width: calc(760px + var(--margin-x) + 24px + var(--pad-r)); }
.articolo-testa { position: relative; margin-bottom: var(--sq); }
.data-grande { font-size: 18px; line-height: 24px; }
.data-grande span { font-weight: 400; }
.articolo .testo { max-width: 68ch; }
.foto-articolo { max-width: 720px; margin-bottom: calc(var(--sq) * 1.5); transform: rotate(-.8deg); }
.locandine { list-style: none; padding: 0; margin: var(--sq) 0 calc(var(--sq) * 1.5); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 40px 36px; }
.locandine li { max-width: none; }
.foto-locandina { transform: rotate(1deg); }
.locandine li:nth-child(even) .foto-locandina { transform: rotate(-1.2deg); }
.locandine a, .album-home a { display: block; cursor: zoom-in; }
.collegati { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.avviso-passato { font-weight: 700; color: var(--red); }
.sfoglia { display: flex; flex-wrap: wrap; gap: 16px 48px; justify-content: space-between; border-top: 2px dashed var(--grid); max-width: 900px; }
.sfoglia a { display: block; max-width: 36ch; font-weight: 700; text-decoration: none; }
.sfoglia a:hover { text-decoration: underline; }
.sfoglia span { display: block; font-weight: 400; font-size: 15px; color: var(--ink-soft); }

/* fatti in breve (laboratorio, evento) */
.fatti { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sq) 32px; max-width: 900px; margin: 0 0 calc(var(--sq) * 2); }
.fatti div { background: color-mix(in srgb, var(--yellow) 45%, var(--paper)); padding: 12px 16px 16px; box-shadow: 0 1px 2px rgb(31 59 140 / .25), 0 8px 18px -10px rgb(31 59 140 / .35); transform: rotate(-1.2deg); }
.fatti div:nth-child(2n) { transform: rotate(1deg); }
.fatti div:nth-child(3n) { transform: rotate(-.5deg); }
.fatti dt { font-size: 15px; color: var(--ink-soft); font-variation-settings: "INFM" 100; }
.fatti dd { margin: 0; font-weight: 700; }
.scheda-corpo { padding: 0; }
.scheda-corpo .testo { max-width: 68ch; }
.altri h2 { font-size: 28px; }

/* contatti */
.contatti { padding-bottom: calc(var(--sq) * 3) !important; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(220px, 1fr); gap: 40px; align-items: center; }
.contatti-art { width: auto; max-width: min(100%, 300px); max-height: 260px; justify-self: center; transform: rotate(3deg); }
dt { font-size: 15px; color: var(--ink-soft); }
dd { margin: 0 0 var(--sq); }
.contact-grid dd { font-weight: 700; font-size: 20px; overflow-wrap: anywhere; }
.contact-grid .dd-link { font-size: 17px; }
.orari { max-width: 760px; }
.orari div { display: grid; grid-template-columns: minmax(130px, 220px) 1fr; gap: 0 24px; border-bottom: 1px solid var(--grid); padding: 6px 0; }
.orari dt { font-size: 18px; color: var(--ink); font-weight: 700; }
.orari dd { margin: 0; }
.orari .nota { display: block; font-size: 15px; color: var(--ink-soft); line-height: 22px; }

/* elenco documenti in evidenza */
.doc-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.doc { display: inline-block; text-decoration: none; padding: 8px 16px; border: 2px solid var(--ink); background: var(--paper); border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px; box-shadow: 3px 3px 0 var(--ink); }
.doc:hover { box-shadow: 5px 5px 0 var(--ink); transform: translate(-1px, -1px); }
.doc-titolo { font-weight: 700; }
.doc-tipo { font-size: 14px; color: var(--ink-soft); }

/* ------------------------------------------------------------ modulistica */
.cerca { max-width: 760px; margin-bottom: calc(var(--sq) * 1.5); }
.cerca-label { display: block; font-weight: 700; font-size: 21px; font-variation-settings: "INFM" 100; margin-bottom: 4px; }
.cerca-riga {
  width: 100%; font: inherit; font-size: 22px; line-height: var(--sq); color: var(--ink); background: transparent;
  border: 0; border-bottom: 3px solid var(--ink); border-radius: 0; padding: 6px 2px; margin-bottom: var(--sq);
  -webkit-appearance: none; appearance: none;
}
.cerca-riga::placeholder { color: var(--ink-soft); opacity: .85; }
.cerca-riga:focus { outline: none; border-bottom-color: var(--red); background: rgb(246 179 0 / .12); }
.filtri { border: 0; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.filtri legend { padding: 0; margin-bottom: 8px; font-size: 15px; color: var(--ink-soft); font-variation-settings: "INFM" 100; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border: 2px solid var(--ink); border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px; background: var(--paper); cursor: pointer; font-size: 16px; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip:has(input:checked) { background: var(--ink); color: #fff; }
.chip:has(input:focus-visible) { outline: 3px solid var(--red); outline-offset: 3px; }
.anno-filtro { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; }
.anno-filtro select { font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 2px 6px; }
.cerca-esito { font-size: 15px; color: var(--ink-soft); margin: 12px 0 0; min-height: 22px; }
.moduli { list-style: none; padding: 0; margin: 0 0 var(--sq); max-width: 760px; }
.modulo { position: relative; padding-bottom: var(--sq); }
.modulo-titolo { font-size: 21px; line-height: var(--sq); margin: 0; font-variation-settings: "INFM" 60; }
.modulo-meta { margin: 0; font-size: 15px; color: var(--ink-soft); }
.modulo p { margin: 0; }
.modulo-tipo { font-size: 15px; }
.modulo-archivio .modulo-titolo { font-weight: 600; }

/* ------------------------------------------------------------ galleria */
.album-elenco { list-style: none; padding: 0; margin: 0 0 var(--sq); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 44px 36px; max-width: 1180px; }
.album-elenco li { max-width: none; }
.album-scheda { display: block; text-decoration: none; }
.album-scheda .foto { margin-bottom: 14px; }
.album-scheda .foto img { aspect-ratio: 4 / 3; object-fit: cover; }
.album-elenco li:nth-child(odd) .foto { transform: rotate(-1.4deg); }
.album-elenco li:nth-child(even) .foto { transform: rotate(1.2deg); }
.album-scheda h2 { font-size: 24px; line-height: var(--sq); margin: 0; }
.album-scheda:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.lightbox { border: 0; padding: 16px; background: var(--paper); color: var(--ink); max-width: min(96vw, 1200px); max-height: 96vh; border-radius: 6px; box-shadow: 0 10px 40px rgb(0 0 0 / .4); }
.lightbox::backdrop { background: rgb(20 30 60 / .75); }
.lightbox-foto img { max-height: calc(96vh - 140px); width: auto; margin: 0 auto; }
.lightbox-didascalia { text-align: center; margin: 8px 0; min-height: 28px; }
.lightbox-comandi { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* domande frequenti */
.faq { max-width: 760px; margin-bottom: var(--sq); }
.faq details { border-bottom: 2px dashed var(--grid); }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style-position: outside; margin-left: 20px; }
.faq summary::marker { color: var(--red); }
.faq-risposta { padding: 0 0 6px 20px; }

/* menù della mensa */
.mensa-sfoglia { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 520px; margin-bottom: 14px; }
.mensa-sfoglia .btn { margin-left: 0; min-width: 44px; }
.mensa-sfoglia .btn[disabled] { opacity: .35; cursor: default; transform: none; box-shadow: none; }
.mensa-data { min-height: 44px; padding: 4px 10px; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px; }
.mensa-oggi { max-width: 520px; margin-bottom: var(--sq); background: color-mix(in srgb, var(--yellow) 45%, var(--paper)); padding: 12px 20px 16px; box-shadow: 0 1px 2px rgb(31 59 140 / .25), 0 8px 18px -10px rgb(31 59 140 / .35); transform: rotate(-1deg); }
.mensa-quando { margin: 0 0 4px; font-weight: 700; }
.mensa-quale { margin: 4px 0 0; font-size: 15px; color: var(--ink-soft); }
.mensa { margin-bottom: calc(var(--sq) * 2); }
.mensa > h3 { margin-bottom: 8px; }
.mensa-settimana { border-bottom: 2px dashed var(--grid); }
.mensa-settimana summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style-position: outside; margin-left: 20px; }
.mensa-settimana summary::marker { color: var(--red); }
.mensa-giorni { list-style: none; padding: 0 0 var(--sq); margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: var(--sq) 28px; }
.mensa-giorno { margin: 0; }
.mensa-giorno h4 { border-bottom: 2px solid var(--ink); padding-bottom: 2px; margin-bottom: 6px; }
.mensa-giorno-oggi h4 { border-bottom-color: var(--red); }
.mensa-etichetta { margin: 0; font-size: 15px; color: var(--ink-soft); font-variation-settings: "INFM" 100; }
.mensa-piatti ul { list-style: none; padding: 0; margin: 0 0 6px; }
.sezione-testo .mensa-piatti li { margin-bottom: 2px; }
.allergeni { display: block; font-size: 14px; line-height: 20px; font-style: italic; color: var(--ink-soft); }

.team { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 4px 32px; max-width: 900px; }
.team li { border-bottom: 1px solid var(--grid); padding: 6px 0; }
.team-ruolo { font-weight: 700; }
.team-nome { display: block; color: var(--ink-soft); }

/* ------------------------------------------------------------ piede */
.foot {
  display: flex; flex-wrap: wrap; gap: 24px 64px; align-items: flex-start;
  padding: 32px var(--pad-r) 96px calc(var(--margin-x) + 24px);
  border-top: 2px dashed var(--ink); font-size: 15px; line-height: 22px;
}
.foot-scuola { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.foot p { margin: 0; }
.foot-link ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 40px; }
.foot-link li { padding: 3px 0; }
.foot-firma { flex-basis: 100%; font-size: 13px; color: var(--ink-soft); }

.menu-btn {
  display: none; align-items: center; gap: 10px; font: inherit; font-weight: 700; color: var(--ink);
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px 16px 10px 18px / 16px 10px 18px 12px;
  padding: 8px 14px; cursor: pointer;
}
.menu-ico { position: relative; width: 20px; height: 2px; background: currentColor; border-radius: 2px; }
.menu-ico::before, .menu-ico::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s; }
.menu-ico::before { top: -6px; }
.menu-ico::after { top: 6px; }
.menu-btn[aria-expanded="true"] .menu-ico { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-ico::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-ico::after { transform: translateY(-6px) rotate(-45deg); }
.dock { display: none; }

/* ------------------------------------------------------------ schermi più stretti */
@media (max-width: 1240px) {
  .top nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    background: var(--paper); border-bottom: 2px solid var(--grid); box-shadow: 0 14px 24px -18px rgb(31 59 140 / .5);
    padding: 6px 0 14px calc(var(--margin-x) + 10px);
  }
  .top.is-open nav { display: block; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }
  .top ul { flex-direction: column; gap: 0; }
  .top nav a { display: inline-block; padding: 9px 2px; font-size: 22px; font-weight: 700; font-variation-settings: "INFM" 100; }
  .top nav a:not([aria-current]) { background-size: 0 0; }
  .apri-sotto { padding: 9px 2px; font-size: 22px; font-weight: 700; font-variation-settings: "INFM" 100; }
  .apri-sotto:not(:hover) { background-size: 0 0; }
  .top .sotto { position: static; min-width: 0; padding: 0 0 8px 18px; border: 0; box-shadow: none; background: none; }
  .top nav .sotto a { font-size: 19px; font-weight: 400; padding: 7px 2px; white-space: normal; }
  .top nav .sotto a.pagina { font-weight: 700; }
  .top nav .sezioni a { font-size: 17px; padding: 6px 2px; }
  .menu-btn { display: inline-flex; }
  .btn-top { margin-left: auto; }
}
@media (max-width: 1000px) {
  .margine, .orario .margine { position: static; display: block; text-align: left; }
  .orario li::before { left: -20px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 560px; }
  .giornata-grid { grid-template-columns: 1fr; }
  .giornata-lato { width: min(100%, 300px); justify-self: start; }
  .giornata-art { width: 220px; }
  .due-colonne { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 760px) {
  .testata.con-disegno, .sezione.con-disegno { grid-template-columns: minmax(0, 1fr); }
  .testata-art { order: -1; max-width: 220px; justify-self: start; }
  .sezione-art { max-width: 170px; max-height: 170px; margin-top: 0; justify-self: start; order: -1; }
  .testata-art { max-height: 200px; }
}
@media (max-width: 640px) {
  .album-quattro { grid-template-columns: 1fr; }
  /* link da toccare con il dito: almeno 44 px di altezza */
  .contact-grid dd a, .foot-link a, .foot-scuola a, .foot-firma a { display: inline-block; padding: 9px 0; line-height: 26px; }
  .foot-link li { padding: 0; }
  .foot-link ul { columns: 2; column-gap: 20px; }
  :root { --margin-x: 44px; --sq: 26px; }
  body { font-size: 17px; }
  .brand { gap: 10px; font-size: 13px; line-height: 17px; min-width: 0; flex: 0 1 auto; }
  .brand b { font-size: 18px; line-height: 22px; }
  .brand img { width: 50px; height: 50px; flex: none; }
  .top { gap: 10px; padding-left: 12px; }
  .draft-bar { padding-left: 12px; padding-right: 12px; }
  .btn-top { display: none; }
  .menu-btn { margin-left: auto; flex: none; }
  .lab-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
  .lab h3, .lab-list-grande h2 { font-size: 18px; }
  main > section, main > header, main > article, main > nav, main > p.sezione { padding-left: calc(var(--margin-x) + 14px); padding-right: 16px; }
  .openday { padding: 46px 44px 40px; }
  .openday-label { font-size: 26px; line-height: 34px; }
  .openday-date { font-size: 19px; line-height: 26px; }
  .openday-note { font-size: 15px; line-height: 22px; }
  .lead, .lead p { font-size: 19px; line-height: 30px; }
  .foot { padding-bottom: 110px; padding-left: calc(var(--margin-x) + 14px); }
  .orario li::before { left: calc(-1 * (14px + 6px)); }
  .chi, .contact-grid { grid-template-columns: 1fr; }
  .chi-sole, .contatti-art { max-width: 160px; max-height: 160px; justify-self: start; }
  .album-home { grid-template-columns: 1fr; gap: 28px; }
  .orari div { grid-template-columns: 1fr; }
  .dock { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; }
  .dock a { text-align: center; text-decoration: none; font-weight: 700; padding: 12px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: 0 6px 16px -6px rgb(0 0 0 / .4); }
  .dock a + a { background: var(--green); }
}
@media (max-width: 359px) {
  .menu-btn { padding: 10px 12px; min-height: 44px; }
  .mensa-data { order: -1; flex-basis: 100%; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

@media print {
  body { background: #fff; font-size: 11pt; line-height: 1.45; }
  .top nav, .menu-btn, .btn-top, .dock, .skip, .draft-bar, .cta-row, .cerca, .mensa-sfoglia, .lightbox, .foot-link { display: none !important; }
  .top { position: static; border: 0; }
  main > section, main > header, main > article, main > nav, main > p.sezione, .foot { padding: 12px 0 !important; }
  .margine { position: static; display: block; text-align: left; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
  .foto { box-shadow: none; border: 1px solid #ccc; transform: none !important; }
}
