/* Relifea - foglio di stile del sito.
   Idea: il quaderno di religione. Carta calda, inchiostro blu, linguette colorate per le sezioni,
   domande numerate ben leggibili. Titoli in Literata, testi in Atkinson Hyperlegible. */

@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonNext-Variable.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/AtkinsonNext-VariableItalic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-Variable.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/Literata-VariableItalic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --paper: #faf7f0;
  --surface: #ffffff;
  --ink: #1a2233;
  --ink2: #4b5565;
  --line: #e2dbca;
  --line2: #c9c0aa;
  --edge: #8a8371;
  --accent: #1f4b99;
  --accent-d: #173a78;
  --accent-soft: #e6edf8;
  --mark: #fff0bf;
  --t0: #2f5fa8;
  --t1: #c0502c;
  --t2: #2c7a67;
  --t3: #a8730f;
  --t4: #7a4a93;
  --t5: #b03a5a;
  --tab: var(--t0);
  --r: 10px;
  --top: 68px;
  --side: 300px;
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
html[data-tema="bosco"] { --accent: #25634d; --accent-d: #1b4a39; --accent-soft: #e4f0ea; }
html[data-tema="terracotta"] { --accent: #a3421f; --accent-d: #7f3217; --accent-soft: #f7e9e2; }
html[data-tema="prugna"] { --accent: #6a3c85; --accent-d: #522d68; --accent-soft: #f0e8f5; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1.09rem; line-height: 1.62; -webkit-font-smoothing: antialiased; }
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; }
.skip:focus { top: 12px; }
[hidden] { display: none !important; }

/* ---------- barra superiore ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; padding: 0 clamp(16px, 3vw, 32px); }
.logo { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 650; font-size: 1.5rem; letter-spacing: -0.01em; flex: none; }
.logo svg { width: 34px; height: 34px; flex: none; }
.top-search { position: relative; margin-left: auto; width: min(380px, 42vw); }
.q { width: 100%; height: 44px; border: 1.5px solid var(--edge); border-radius: 999px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5565' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E") 15px 50% / 18px no-repeat; padding: 0 16px 0 42px; font: inherit; font-size: 1rem; color: var(--ink); }
.q::placeholder { color: #667085; }
.q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background-color: #fff; }
.q-res { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 14px 40px rgba(26, 34, 51, .16); max-height: min(70vh, 520px); overflow: auto; z-index: 50; padding: 6px; text-align: left; }
.q-res a { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; color: var(--ink); }
.q-res a:hover, .q-res a.on { background: var(--accent-soft); }
.q-res b { display: block; font-weight: 700; }
.q-res span { display: block; font-size: .9rem; color: var(--ink2); line-height: 1.4; margin-top: 2px; }
.q-res mark { background: var(--mark); color: inherit; border-radius: 2px; }
.q-res p { margin: 0; padding: 12px; color: var(--ink2); font-size: .95rem; }
.menu-btn { display: none; align-items: center; gap: 9px; height: 44px; padding: 0 14px 0 12px; border: 1.5px solid var(--edge); border-radius: 999px; background: var(--surface); font-weight: 700; font-size: 1rem; cursor: pointer; flex: none; }
.menu-btn i { width: 18px; height: 12px; border-top: 2.2px solid var(--ink); border-bottom: 2.2px solid var(--ink); position: relative; }
.menu-btn i::after { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2.2px solid var(--ink); }

/* ---------- struttura ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); align-items: start; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; overscroll-behavior: contain; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); background: var(--paper); font-size: 1rem; line-height: 1.35; }
.side-h { display: none; }
main { min-width: 0; padding: clamp(22px, 3.2vw, 44px) clamp(16px, 4vw, 56px) 72px; }
.page { max-width: 1080px; margin: 0 auto; }

/* ---------- menu ---------- */
.side ul { list-style: none; margin: 0; padding: 0; }
.nav-home { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 700; margin-bottom: 6px; }
.nav-row { display: flex; align-items: stretch; border-radius: 8px; }
.nav-row a { flex: 1; min-width: 0; padding: 9px 8px 9px 12px; color: var(--ink); text-decoration: none; border-radius: 8px; overflow-wrap: anywhere; }
.nav-l1 > li > .nav-row a { font-weight: 650; position: relative; padding-left: 28px; }
.nav-l1 > li > .nav-row a::before { content: ""; position: absolute; left: 10px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 3px; background: var(--tab); }
.nav-row a:hover, .nav-home:hover { background: #f0ebde; }
.nav-row a[aria-current], .nav-home[aria-current] { background: var(--accent-soft); color: var(--accent-d); font-weight: 700; }
.nav-tog { flex: none; width: 38px; border: 0; background: none; border-radius: 8px; cursor: pointer; position: relative; }
.nav-tog::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -6px 0 0 -4px; border-right: 2.2px solid var(--ink2); border-bottom: 2.2px solid var(--ink2); transform: rotate(45deg); transition: transform .15s; }
.nav-tog[aria-expanded="true"]::before { transform: rotate(-135deg); margin-top: -2px; }
.nav-tog:hover { background: #f0ebde; }
.side li > ul { display: none; margin: 2px 0 6px 16px; padding-left: 8px; border-left: 2px solid var(--line); }
.side li.open > ul { display: block; }
.nav-l2 a, .nav-l3 a, .nav-l4 a { font-size: .97rem; color: #2b3445; }
.nav-flag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--mark); color: #5c4300; font-size: .72rem; font-weight: 700; vertical-align: 1px; }

/* ---------- intestazione di pagina ---------- */
.crumbs ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .93rem; color: var(--ink2); }
.crumbs li + li::before { content: "/"; margin: 0 9px; color: var(--line2); }
.crumbs a { color: var(--ink2); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.ph { margin-bottom: clamp(22px, 3vw, 36px); }
.ph h1 { font-family: var(--serif); font-weight: 620; font-size: clamp(2.05rem, 1.3rem + 2.6vw, 3.25rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.ph h1::before { content: ""; display: block; width: 54px; height: 7px; border-radius: 4px; background: var(--tab); margin-bottom: 16px; }
.lead { font-size: 1.22rem; line-height: 1.5; color: var(--ink2); max-width: 46em; margin: 14px 0 0; text-wrap: pretty; }
.ph-home { padding: clamp(6px, 2vw, 26px) 0 4px; }
.ph-home h1 { font-size: clamp(3.3rem, 2rem + 6.5vw, 6.2rem); font-weight: 640; letter-spacing: -0.035em; line-height: .98; }
.ph-home h1::before { width: 72px; height: 9px; margin-bottom: 20px; background: var(--accent); }
.ph-home .lead { font-size: clamp(1.18rem, 1rem + .7vw, 1.45rem); color: var(--ink); max-width: 34em; }
.hero-search { position: relative; max-width: 560px; margin-top: 24px; }
.hero-search .q { height: 54px; font-size: 1.08rem; background-color: #fff; background-position: 19px 50%; padding-left: 48px; }

/* ---------- blocchi ---------- */
.blocks { container-type: inline-size; }
.blocks > * + * { margin-top: clamp(24px, 3vw, 38px); }
.b { margin: 0; }
.col > * + * { margin-top: 18px; }

.b-text { max-width: 47em; overflow-wrap: break-word; }
.col .b-text { max-width: none; }
.b-text > :first-child { margin-top: 0; }
.b-text > :last-child { margin-bottom: 0; }
.b-text p { margin: 0 0 .85em; text-wrap: pretty; }
.b-text h2 { font-family: var(--serif); font-weight: 620; font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2rem); line-height: 1.18; letter-spacing: -0.012em; margin: 1.3em 0 .5em; text-wrap: balance; }
.b-text h3 { font-family: var(--serif); font-weight: 620; font-size: clamp(1.25rem, 1.1rem + .5vw, 1.45rem); line-height: 1.25; margin: 1.2em 0 .45em; text-wrap: balance; }
.b-text h4 { font-size: 1.09rem; font-weight: 750; margin: 1.1em 0 .35em; }
.b-text .centro { text-align: center; }
.b-text a { color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.b-text a:hover { color: var(--accent-d); text-decoration-thickness: 2.5px; }
.b-text ul { margin: 0 0 1em; padding-left: 1.3em; }
.b-text ul li { margin: .3em 0; }
.b-text ul li::marker { color: var(--tab); }
.b-text ol { list-style: none; counter-reset: n; margin: .2em 0 1em; padding: 0; }
.b-text ol > li { counter-increment: n; position: relative; padding: 3px 0 3px 2.55em; margin: .42em 0; min-height: 2em; }
.b-text ol > li::before { content: counter(n); position: absolute; left: 0; top: .12em; min-width: 1.9em; height: 1.9em; padding: 0 .3em; border-radius: 99px; background: var(--accent-soft); color: var(--accent-d); font-weight: 750; font-size: .9em; line-height: 1.9em; text-align: center; font-variant-numeric: tabular-nums; }
.b-text blockquote { margin: 1em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--tab); font-family: var(--serif); font-size: 1.1em; }
.b-text mark { background: var(--mark); color: inherit; padding: 0 2px; border-radius: 2px; }

.b-image { max-width: 760px; }
.col .b-image { max-width: none; }
.b-image.sz-piccola { max-width: 360px; }
.b-image.sz-larga { max-width: none; }
.b-image img { display: block; width: 100%; border-radius: var(--r); background: #ece6d8; }
.b-image a { display: block; border-radius: var(--r); }
.zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--r); }
.b-image figcaption, .b-video figcaption { font-size: .93rem; color: var(--ink2); margin-top: 8px; }
.b-image figcaption:empty { display: none; }

.b-video { max-width: 860px; }
.col .b-video { max-width: none; }
.vid { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--ink); cursor: pointer; color: #fff; }
.vid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s, opacity .2s; }
.vid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 14, 24, .78), rgba(10, 14, 24, 0) 46%); }
.vid-play { position: absolute; z-index: 2; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: 50%; background: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, .35); transition: transform .18s; }
.vid-play::before { content: ""; position: absolute; left: 27px; top: 21px; border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--accent); }
.vid-t { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 12px; text-align: left; font-weight: 650; font-size: .98rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.vid:hover .vid-play, .vid:focus-visible .vid-play { transform: scale(1.08); }
.vid:hover img { transform: scale(1.03); }
.vid-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; }
.vid-frame iframe, .emb-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid-ext { margin: 7px 0 0; font-size: .88rem; }
.vid-ext a { color: var(--ink2); text-underline-offset: 3px; }
.vid-ext a:hover { color: var(--accent); }
.b-video video { display: block; width: 100%; border-radius: var(--r); background: #000; aspect-ratio: 16 / 9; }

.b-audio { max-width: 620px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.b-audio figcaption { font-weight: 700; margin-bottom: 10px; }
.b-audio audio { display: block; width: 100%; }

.b-file, .b-link { display: flex; align-items: center; gap: 16px; max-width: 620px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.col .b-file, .col .b-link, .col .b-audio { max-width: none; }
.b-file:hover, .b-link:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(26, 34, 51, .09); transform: translateY(-1px); }
.file-ic { flex: none; min-width: 52px; height: 52px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .04em; }
.file-tx { flex: 1; min-width: 0; display: block; }
.file-t { display: block; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.file-s { display: block; font-size: .92rem; color: var(--ink2); margin-top: 2px; overflow-wrap: anywhere; }
.link-go { flex: none; width: 12px; height: 12px; border-top: 2.5px solid var(--accent); border-right: 2.5px solid var(--accent); transform: rotate(45deg); margin-right: 6px; }

.b-btn { margin: 0; }
.b-btn.centro { text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 24px; border-radius: 999px; background: var(--accent); color: #fff; border: 2px solid var(--accent); font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--accent-d); border-color: var(--accent-d); }
.btn-o { background: transparent; color: var(--accent-d); }
.btn-o:hover { background: var(--accent-soft); color: var(--accent-d); border-color: var(--accent); }

.b-call { max-width: 47em; padding: 18px 22px 20px; border-radius: var(--r); background: var(--mark); border: 1px solid #ecd98f; }
.col .b-call { max-width: none; }
.b-call.k-nota { background: var(--accent-soft); border-color: #c5d5ee; }
.b-call.k-importante { background: #fde8e2; border-color: #f0c2b4; }
.call-l { margin: 0 0 6px; font-weight: 800; font-size: .84rem; letter-spacing: .07em; text-transform: uppercase; color: #4a3a00; }
.k-nota .call-l { color: var(--accent-d); }
.k-importante .call-l { color: #84280f; }
.call-l:empty { display: none; }

.b-det { max-width: 47em; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); }
.col .b-det { max-width: none; }
.b-det summary { cursor: pointer; padding: 15px 48px 15px 20px; font-weight: 700; list-style: none; position: relative; }
.b-det summary::-webkit-details-marker { display: none; }
.b-det summary::after { content: ""; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(45deg); transition: transform .15s; }
.b-det[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.det-body { padding: 0 20px 18px; }

.b-hr { border: 0; border-top: 2px solid var(--line); margin-left: 0; margin-right: 0; }

.b-embed { max-width: 860px; }
.emb { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; aspect-ratio: var(--ar, 16 / 9); max-height: 420px; padding: 20px; border: 2px dashed var(--line2); border-radius: var(--r); background: var(--surface); cursor: pointer; text-align: center; }
.emb:hover { border-color: var(--accent); background: var(--accent-soft); }
.emb-t { font-weight: 700; font-size: 1.1rem; }
.emb-s { color: var(--ink2); font-size: .95rem; }
.emb-frame { position: relative; aspect-ratio: var(--ar, 16 / 9); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line2); background: #fff; }

.b-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.b-cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.b-cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .18s, box-shadow .18s, border-color .18s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(26, 34, 51, .12); border-color: var(--line2); }
.card-img { display: block; aspect-ratio: 16 / 10; background: #ece6d8; overflow: hidden; }
.card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-tx { display: block; padding: 14px 18px 17px; border-top: 4px solid var(--tab); flex: 1; }
.card-t { display: block; font-family: var(--serif); font-weight: 620; font-size: 1.22rem; line-height: 1.22; text-wrap: balance; overflow-wrap: anywhere; }
.card-s { display: block; font-size: .95rem; color: var(--ink2); margin-top: 5px; line-height: 1.4; }
.card-s:empty { display: none; }

.b-cols { display: grid; grid-template-columns: var(--cols); gap: clamp(20px, 3vw, 36px); align-items: start; }
.col { min-width: 0; }
@container (max-width: 860px) {
  .b-cols.n3, .b-cols.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .b-cards.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 640px) {
  .b-cols, .b-cols.n3, .b-cols.n4 { grid-template-columns: minmax(0, 1fr); }
  .b-cards, .b-cards.c2, .b-cards.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 520px) {
  .b-cards { gap: 12px; }
  .card-tx { padding: 10px 12px 13px; }
  .card-t { font-size: 1.04rem; }
}
@container (max-width: 300px) {
  .b-cards, .b-cards.c2, .b-cards.c4 { grid-template-columns: minmax(0, 1fr); }
}

.b-empty { padding: 26px; border: 2px dashed var(--line2); border-radius: var(--r); color: var(--ink2); text-align: center; background: var(--surface); }
.vuota { color: var(--ink2); padding: 22px 24px; border: 1px dashed var(--line2); border-radius: var(--r); max-width: 47em; background: var(--surface); }

/* ---------- uscite di pagina ---------- */
.kids { margin-top: 48px; }
.kids h2 { font-family: var(--serif); font-weight: 620; font-size: 1.45rem; margin: 0 0 14px; }
.kids ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.kids a { display: flex; align-items: center; min-height: 54px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line2); border-left: 5px solid var(--tab); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 650; line-height: 1.3; transition: border-color .15s, transform .15s; overflow-wrap: anywhere; }
.kids a:hover { border-color: var(--accent); border-left-color: var(--tab); transform: translateX(3px); }
.pn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 56px; padding-top: 26px; border-top: 2px solid var(--line); }
.pn-a { display: block; padding: 13px 18px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.pn-a:hover { border-color: var(--accent); }
.pn-next { text-align: right; }
.pn-l { display: block; font-size: .84rem; color: var(--ink2); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.pn-t { display: block; font-weight: 700; line-height: 1.3; margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- piede ---------- */
.foot { background: var(--ink); color: #fff; }
.foot-in { max-width: 1400px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 56px); display: flex; flex-wrap: wrap; gap: 14px 40px; align-items: center; justify-content: space-between; }
.foot-name { font-family: var(--serif); font-weight: 620; font-size: 1.3rem; margin: 0; }
.foot-txt { margin: 4px 0 0; color: #d5dae4; font-size: .97rem; max-width: 40em; }
.foot-l { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: .97rem; }
.foot-l a { color: #fff; text-underline-offset: 3px; padding: 6px 0; }

/* ---------- ingrandimento immagini ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(13, 17, 27, .93); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lb img { max-width: 100%; max-height: calc(100vh - 40px); width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb button { position: absolute; top: 14px; right: 14px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; }

/* ---------- pagine di servizio ---------- */
.box-page { max-width: 460px; margin: clamp(30px, 8vh, 90px) auto; padding: 0 18px; }
.box { background: var(--surface); border: 1px solid var(--line2); border-radius: 14px; padding: 30px 28px 32px; }
.box h1 { font-family: var(--serif); font-weight: 620; font-size: 1.9rem; line-height: 1.15; margin: 0 0 8px; }
.box p { margin: 0 0 18px; color: var(--ink2); }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-weight: 700; margin-bottom: 6px; }
.field input { width: 100%; height: 50px; padding: 0 14px; border: 1.5px solid #8c93a1; border-radius: 9px; font: inherit; font-size: 1.05rem; background: #fff; color: var(--ink); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.msg { margin: 0 0 16px; padding: 11px 14px; border-radius: 8px; background: #fde8e2; color: #7a230c; font-weight: 600; }
.box .btn { width: 100%; }

/* ---------- comparsa ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transition: opacity .6s ease; }
  .rv.in { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- schermi stretti ---------- */
@media (max-width: 1023px) {
  :root { --top: 62px; }
  .shell { display: block; }
  .menu-btn { display: inline-flex; }
  .top { gap: 10px; }
  .top-search { width: auto; flex: 1; min-width: 0; margin-left: 4px; }
  .side { position: fixed; inset: 0; z-index: 60; height: auto; border: 0; padding: 0 18px 40px; display: none; font-size: 1.12rem; }
  body.menu-open { overflow: hidden; }
  body.menu-open .side { display: block; }
  .side-h { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; height: 62px; background: var(--paper); border-bottom: 1px solid var(--line); margin: 0 -18px 14px; padding: 0 18px; font-family: var(--serif); font-weight: 650; font-size: 1.3rem; }
  .side-x { width: 46px; height: 46px; border: 1.5px solid var(--edge); border-radius: 50%; background: var(--surface); font-size: 1.5rem; line-height: 1; cursor: pointer; }
  .nav-row a, .nav-home { padding-top: 13px; padding-bottom: 13px; }
  .nav-l2 a, .nav-l3 a, .nav-l4 a { font-size: 1.05rem; }
  .nav-tog { width: 50px; }
}
@media (max-width: 560px) {
  body { font-size: 1.06rem; }
  .logo { font-size: 1.3rem; gap: 8px; }
  .logo svg { width: 30px; height: 30px; }
  .menu-btn b { display: none; }
  .menu-btn { width: 44px; padding: 0; justify-content: center; }
  .pn { grid-template-columns: minmax(0, 1fr); }
  .pn-next { text-align: left; }
  .pn > span { display: none; }
  .foot-in { flex-direction: column; align-items: flex-start; }
}
@media print {
  .top, .side, .foot, .pn, .vid-ext { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
}
