/* Sito pubblico. Token di design (docs/DESIGN.md), tema "classico" coordinato con i colori del logo GDG:
   inchiostro #2B2E22 · oliva #5B6142 (--leaf) · lavanda #A88FB9 (--accent) · salvia chiara #F1F2EA (--mist)
   lavanda scura #6E5884 (--deep) · carta #FFFFFF
   Titoli: Young Serif (font locale). Testo: Figtree (font locale). Nessuna risorsa esterna. */

@font-face { font-family: "Young Serif"; src: url("/assets/fonts/young-serif-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #2B2E22; --leaf: #5B6142; --accent: #A88FB9; --mist: #F1F2EA; --deep: #6E5884; --paper: #FFFFFF;
  --muted: #5F6354; --line: #DCDDD0; --on-leaf: #E6DCEF; /* testo chiaro su fondo oliva */
  --serif: "Young Serif", Georgia, serif; --sans: "Figtree", system-ui, sans-serif;
  --w: 72rem; --pad: clamp(1.25rem, 4vw, 3rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--sans); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--leaf); text-underline-offset: .18em; }
a:hover { color: var(--deep); }
:focus-visible { outline: 3px solid var(--deep); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 5.6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 66ch; }
.small { font-size: .9rem; color: var(--muted); }
.opt { font-weight: 400; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.empty { padding: 1.5rem; background: var(--mist); border-radius: 12px; }

/* --- testata --- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--w); margin: 0 auto; padding: 1.25rem var(--pad); flex-wrap: wrap; }
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .75rem; line-height: 1.1; }
.brand-logo { width: 68px; height: 68px; flex: none; }
.brand-text { display: grid; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; }
.brand-role { font-size: .85rem; color: var(--muted); }
.top nav { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 1.75rem); flex-wrap: wrap; }
.top nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:not(.btn):hover { color: var(--leaf); text-decoration: underline; }

/* --- pulsanti --- */
.btn { display: inline-block; font: 600 1rem/1 var(--sans); color: var(--paper); background: var(--leaf); border: 0; border-radius: 999px; padding: .95rem 1.5rem; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-small { padding: .6rem 1.1rem; font-size: .95rem; }
.btn-danger { background: var(--deep); }
.btn-ghost { background: none; border: 1px solid var(--line); border-radius: 999px; width: 2.5rem; height: 2.5rem; font-size: 1.3rem; cursor: pointer; color: var(--ink); flex: none; }
.btn-ghost:hover { border-color: var(--leaf); }

/* --- sezioni: tutte con la stessa larghezza utile; il ritmo verticale è definito solo qui --- */
main > section { max-width: var(--w); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--pad); }
.narrow { max-width: 44rem !important; }

/* --- apertura: il "piatto" (foto tonda con disco limone) è l'unico gesto grafico forte del sito --- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-top: clamp(1.5rem, 4vw, 3rem) !important; }
.hero h1 { max-width: 14ch; }
.lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--muted); max-width: 40ch; }
.hero-actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: 2rem; }
.next-slot { margin: 0; font-size: .95rem; color: var(--leaf); }
.next-slot strong { font-weight: 600; }
.plate { position: relative; margin: 0; aspect-ratio: 1; }
.plate img { position: relative; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; box-shadow: 0 0 0 clamp(10px, 1.6vw, 18px) var(--paper), 0 0 0 calc(clamp(10px, 1.6vw, 18px) + 1px) var(--line); }
.plate-disc { position: absolute; inset: 8% -6% -6% 8%; border-radius: 50%; background: var(--accent); animation: disc 900ms cubic-bezier(.2,.8,.2,1) both 150ms; }
@keyframes disc { from { transform: translate(-6%, -6%) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .plate-disc { animation: none; } html { scroll-behavior: auto; } }

/* --- splash d'ingresso (public/assets/splash.js) --- */
.splash-screen { display: none; }
html.splash .brand-logo { visibility: hidden; }
html.splash .splash-screen {
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 100;
  animation: splash-safety 0s 6s forwards; /* se splash.js non parte, dopo 6 s la splash sparisce comunque */
}
/* Fondo bianco in uno strato separato: il ritaglio a cerchio (--clip, da splash.js) non deve tagliare il logo. */
html.splash .splash-screen::before { content: ""; position: fixed; inset: 0; background: var(--paper); clip-path: var(--clip, none); }
html.splash .splash-screen img { position: relative; width: min(72vw, 340px); opacity: 0; }
/* Entrata: il logo si apre a cerchio dal centro, con un quarto di giro di assestamento. */
html.splash-ready .splash-screen img { opacity: 1; animation: splash-in 1s cubic-bezier(.16, 1, .3, 1) both; }
/* Uscita (clip-path impostato da splash.js): 1) diaframma che si chiude sull'anello del logo; 2) logo e dischetto volano
   insieme in testata con la stessa curva e durata, così il disco resta esattamente dietro il logo. */
html.splash-go .splash-screen { pointer-events: none; }
html.splash-go .splash-screen::before { transition: clip-path .35s cubic-bezier(.5, 0, .2, 1); }
html.splash-go .splash-screen img { transform-origin: 0 0; }
html.splash-fly .splash-screen::before { transition: clip-path .8s cubic-bezier(.7, 0, .2, 1); }
html.splash-fly .splash-screen img { transition: transform .8s cubic-bezier(.7, 0, .2, 1); }
@keyframes splash-in { from { clip-path: circle(0% at 50% 50%); rotate: -12deg; } to { clip-path: circle(72% at 50% 50%); rotate: 0deg; } }
@keyframes splash-safety { to { visibility: hidden; pointer-events: none; } }

.hero > *, .about > *, .contact > *, .area-list > * { min-width: 0; }

/* --- chi sono --- */
.about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.about:not(:has(.about-img)) { grid-template-columns: 1fr; }
.about-img { border-radius: 12px 12px 200px 12px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.credentials { list-style: none; padding: 1.25rem 0 0; margin: 1.5rem 0 0; border-top: 1px solid var(--line); }
.credentials li { padding: .3rem 0 .3rem 1.4rem; position: relative; }
.credentials li::before { content: ""; position: absolute; left: 0; top: .85em; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); }

/* --- di cosa mi occupo: elenco a due colonne, ogni titolo porta alla sua pagina --- */
.area-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 2rem 3rem; }
.area-list li { border-top: 1px solid var(--line); padding-top: 1rem; }
.area-list h3 { margin-bottom: .4rem; }
.area-list h3 a { color: var(--ink); text-decoration-color: var(--line); text-decoration-thickness: 2px; }
.area-list h3 a:hover { color: var(--leaf); text-decoration-color: currentColor; }
.area-list p { color: var(--muted); margin: 0; }

/* --- pagina di un'area --- */
.crumbs { margin-bottom: 1.5rem; }
.area-page h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
.area-page .lead { margin-bottom: 2rem; }
.area-cta { margin: 2.5rem 0; }
.area-cta h2 { margin-top: 0 !important; }
.area-cta .btn { margin-right: 1rem; }

/* --- contatti: avviso di apertura e mappe --- */
.opening { display: inline-block; background: var(--mist); border-left: 4px solid var(--accent); padding: .6rem 1rem; border-radius: 0 8px 8px 0; font-weight: 600; }
.map-links { font-size: .95rem; }

/* --- consulenze: impaginate come un menù (nome, puntini, prezzo) --- */
/* Fascia a tutta larghezza: il contenuto resta allineato alle altre sezioni grazie al padding laterale calcolato
   (prima i figli usavano margin auto, che .menu annullava: tariffe spostate a sinistra rispetto al titolo). */
.services { background: var(--mist); max-width: none !important; padding-inline: max(var(--pad), calc((100% - var(--w)) / 2 + var(--pad))) !important; }
.section-head p { color: var(--muted); }
.menu { list-style: none; padding: 0; margin: 2.5rem 0; display: grid; gap: 2.25rem; max-width: 48rem; }
.menu-line { display: flex; align-items: baseline; gap: .75rem; }
.menu-line h3 { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.leader { flex: 1; border-bottom: 2px dotted #9DB0A3; transform: translateY(-.3em); min-width: 2rem; }
.price { font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); white-space: nowrap; }
.menu-meta { margin: .3rem 0 .4rem; color: var(--leaf); font-weight: 600; font-size: .95rem; }
.menu-desc { margin: 0 0 .5rem; color: var(--muted); }
.menu-book { font-weight: 600; }

/* --- come funziona: è davvero una sequenza, quindi numerata --- */
.steps { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2.5rem; counter-reset: s; }
.step-n { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--accent); font-family: var(--serif); font-size: 1.25rem; margin-bottom: 1rem; }
.steps p { color: var(--muted); }

/* --- domande --- */
.faq details { border-top: 1px solid var(--line); padding: 1.1rem 0; max-width: 48rem; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-family: var(--serif); font-size: 1.5rem; line-height: 1; color: var(--leaf); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: .8rem 0 0; color: var(--muted); }

/* --- contatti e moduli --- */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.addr { font-size: 1.15rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: clamp(1.25rem, 3vw, 2rem); }
.form h2 { font-size: 1.8rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; margin-bottom: 1rem; }
input, textarea, select { font: inherit; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid #B9C6BD; border-radius: 10px; padding: .75rem .9rem; width: 100%; }
input:focus, textarea:focus { border-color: var(--leaf); outline: 2px solid var(--leaf); outline-offset: 0; }
label.check { display: flex; align-items: flex-start; gap: .6rem; font-weight: 400; }
label.check input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: none; accent-color: var(--leaf); }
.cf-turnstile { margin: .5rem 0 1rem; min-height: 65px; }
.form-msg { margin: 1rem 0 0; font-weight: 600; }
.form-msg.ok { color: var(--leaf); }
.form-msg.err { color: var(--deep); }

.newsletter { background: var(--leaf); color: var(--paper); max-width: none !important; }
.nl-form { max-width: 44rem; margin: 0 auto; }
.nl-form a { color: var(--on-leaf); }
.nl-form p { color: #E4E6D8; }
.nl-row { display: flex; gap: .75rem; margin: 1.5rem 0 1rem; }
.nl-row input { border-color: transparent; }
.nl-row .btn { background: var(--accent); color: var(--ink); }
.nl-row .btn:hover { background: var(--paper); }
.newsletter .form-msg.ok { color: var(--on-leaf); }
.newsletter .form-msg.err { color: #FFD9EA; }

/* --- prenotazione --- */
.booking { max-width: 52rem !important; }
.bk-step { border: 0; padding: 0; margin: 0 0 2.5rem; }
.bk-step legend { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 1rem; padding: 0; }
.type-list { display: grid; gap: .75rem; }
.type-opt { display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.1rem; cursor: pointer; margin: 0; font-weight: 400; }
.type-opt:has(input:checked) { border-color: var(--leaf); background: var(--mist); box-shadow: inset 4px 0 0 var(--leaf); }
.type-opt input { width: 1.15rem; height: 1.15rem; accent-color: var(--leaf); grid-row: span 2; }
.type-name { font-weight: 600; font-size: 1.05rem; }
.type-meta { color: var(--muted); font-size: .95rem; }
.days-nav { display: flex; align-items: center; gap: .5rem; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; flex: 1; }
.day { font: inherit; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: .55rem .2rem; cursor: pointer; display: grid; gap: .1rem; text-align: center; color: var(--ink); }
.day small { font-size: .78rem; color: var(--muted); }
.day strong { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.day[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: var(--paper); }
.day[aria-pressed="true"] small { color: #DCE7DF; }
.day:disabled { opacity: .4; cursor: default; }
.slots { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; min-height: 3rem; }
.slot { font: 600 1rem/1 var(--sans); border: 1px solid var(--leaf); color: var(--leaf); background: var(--paper); border-radius: 999px; padding: .65rem 1rem; cursor: pointer; }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.bk-summary:not(:empty) { background: var(--mist); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.25rem; }

/* --- piede --- */
.foot { border-top: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.foot-inner { max-width: var(--w); margin: 0 auto; padding: 2.5rem var(--pad); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.foot a { color: var(--muted); }
.prose h2 { font-size: 1.5rem; margin-top: 2rem; }

/* --- elementi del tema Erbario, nascosti negli altri temi --- */
.tape, .specimen-label { display: none; }

/* =====================================================================================================
   Tema "Erbario" (docs/DESIGN.md): la foto è un foglio d'erbario, fissata con due strisce di carta gommata
   e con il cartellino dell'esemplare. Solo token e pochi componenti: la struttura delle pagine non cambia.
   ===================================================================================================== */
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
[data-theme="erbario"] {
  --ink: #1E2340; --leaf: #4F6B4A; --accent: #E8CF7A; --mist: #E7EBE1; --deep: #9E2B4B; --paper: #F4F5EF; --on-leaf: #E8CF7A;
  --muted: #4D5266; --line: #C9CEC0;
  --serif: "Newsreader", Georgia, serif;
}
[data-theme="erbario"] h1, [data-theme="erbario"] h2 { font-weight: 500; letter-spacing: -.02em; font-variation-settings: "opsz" 72; }
[data-theme="erbario"] h1 { line-height: 1.02; }
[data-theme="erbario"] .btn { border-radius: 4px; }
[data-theme="erbario"] .btn:hover { background: var(--ink); }
[data-theme="erbario"] .plate { aspect-ratio: 4 / 5; transform: rotate(-1.5deg); }
[data-theme="erbario"] .plate-disc { display: none; }
[data-theme="erbario"] .plate img { border-radius: 2px; box-shadow: 0 0 0 14px #FBFBF7, 0 0 0 15px var(--line), 0 18px 30px -18px rgba(30, 35, 64, .45); }
[data-theme="erbario"] .tape { display: block; position: absolute; z-index: 1; width: 34%; height: 2.1rem; background: rgba(232, 207, 122, .78); }
[data-theme="erbario"] .tape-a { top: -1.4rem; left: -1.2rem; transform: rotate(-32deg); }
[data-theme="erbario"] .tape-b { bottom: 14%; right: -1.6rem; transform: rotate(-38deg); }
[data-theme="erbario"] .specimen-label {
  display: grid; position: absolute; z-index: 2; right: -1.5rem; bottom: -2.25rem; transform: rotate(1.5deg);
  background: #FBFBF7; border: 1px solid var(--ink); outline: 1px solid var(--ink); outline-offset: 3px;
  padding: .8rem 1.1rem; max-width: 18rem; font-size: .85rem; line-height: 1.35; color: var(--ink);
}
[data-theme="erbario"] .specimen-label span:first-child { font-family: var(--serif); font-size: 1.2rem; }
[data-theme="erbario"] .specimen-label span + span { border-top: 1px dotted var(--line); padding-top: .2rem; margin-top: .2rem; }
[data-theme="erbario"] .about-img { border-radius: 2px; }
[data-theme="erbario"] .credentials li::before { width: .8rem; height: 1px; top: .8em; border-radius: 0; background: var(--deep); }
[data-theme="erbario"] .leader { border-bottom: 1px solid var(--line); transform: translateY(-.35em); }
[data-theme="erbario"] .menu-meta { color: var(--deep); }
[data-theme="erbario"] .step-n { background: none; border: 1px solid var(--ink); }
[data-theme="erbario"] .card { border-radius: 4px; }
[data-theme="erbario"] input, [data-theme="erbario"] textarea, [data-theme="erbario"] select { border-radius: 4px; border-color: #B7BDAE; }
[data-theme="erbario"] .newsletter { background: var(--ink); }
[data-theme="erbario"] .nl-form p { color: #D6D9E6; }
[data-theme="erbario"] .day[aria-pressed="true"] small { color: #E7EBE1; }

@media (max-width: 860px) {
  .hero, .about, .contact { grid-template-columns: 1fr; }
  .plate { max-width: 26rem; margin: 0 auto; width: 85%; }
  .hero { padding-bottom: 2rem !important; }
  .foot-inner { grid-template-columns: 1fr; }
  .nl-row { flex-direction: column; }
  .days { grid-template-columns: repeat(4, 1fr); }
  [data-theme="erbario"] .plate { width: 78%; margin-bottom: 2.5rem; }
  [data-theme="erbario"] .specimen-label { right: -1rem; }
}
