/* domani è Natale — prenotazioni. Pagina fissa: tutto in una schermata, prima il telefono.
   Palette e composizione dalla locandina. */
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url(/fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --cielo: #3c568f;
  --palazzo: #192744;
  --inchiostro: #091020;
  --giallo: #ffc94b;
  --crema: #fff6dc;
  --bianco: #ffffff;
  --rosso: #c41218;
  --scritta-tenue: #22355e;
  --f: 'Bricolage', 'Arial Narrow', sans-serif;
  --pad: clamp(14px, 4vw, 40px);
  /* altezza dei controlli: si stringe sugli schermi bassi */
  --h: clamp(42px, 6.4svh, 54px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--palazzo);
  color: var(--inchiostro);
  font-family: var(--f);
  font-stretch: 88%;
  line-height: 1.2;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- la pagina occupa esattamente lo schermo ---------- */
.pagina {
  display: flex; flex-direction: column;
  height: 100vh; height: 100svh;
  min-height: 540px;              /* sotto questa altezza (rarissimo) si scorre */
  background: var(--cielo);
  overflow: hidden;
}

/* ---------- testa ---------- */
.testa {
  flex: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(10px, env(safe-area-inset-top)) var(--pad) 0;
}
.testa__assoc { display: flex; align-items: center; gap: 10px; }
.testa__assoc img { width: auto; height: clamp(50px, 8svh, 96px); }
.testa__testo, .testa__collab {
  margin: 0; font-weight: 800; letter-spacing: -0.035em; line-height: .92;
  font-size: clamp(12px, 1.6vw + 6px, 22px);
}
.testa__kerb { display: flex; align-items: center; gap: 10px; text-decoration: none; text-align: right; }
.testa__kerb img {
  width: clamp(48px, 7.5svh, 92px); aspect-ratio: 1; border-radius: 50%;
  box-shadow: 0 0 0 2.5px var(--inchiostro);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1);
}
.testa__kerb:hover img { transform: rotate(-8deg) scale(1.05); }

/* ---------- cielo: l'illustrazione prende tutto lo spazio libero ---------- */
.cielo {
  flex: 1 1 0; min-height: 0;
  position: relative; overflow: hidden;
  container-type: size;
  /* altezza del disegno: tutto il cielo, ma mai più largo dello schermo */
  --H: min(100cqh, 118cqw);
}
.quadro {
  position: absolute; bottom: 0; left: 50%;
  height: var(--H); aspect-ratio: 2176 / 1676;
  transform: translateX(-49.82%);          /* il centro di NATALE al centro dello schermo */
  container-type: size;
}
.scena { width: 100%; height: 100%; max-width: none; }
/* il tetto: ringhiera e cornicione ripetuti, allineati al disegno */
.tetto {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--H) * .16468);
  background: url(/img/tetto.webp) repeat-x;
  background-size: auto 100%;
  background-position: calc(50% - var(--H) * .16587) 0;
}
.titolo {
  position: absolute; left: 0; right: 0; top: 2.2%;
  margin: 0; text-align: center;
  font-weight: 800; font-stretch: 92%;
  font-size: 21.6cqh; line-height: .8;
  letter-spacing: -0.05em; word-spacing: -0.02em;
  color: var(--inchiostro);
}
.crediti {
  position: absolute; top: 48.6%; margin: 0;
  font-weight: 700; letter-spacing: -0.03em; line-height: 1.02;
  font-size: max(10px, 2.5cqh);
  color: var(--inchiostro);
}
.crediti span { color: var(--scritta-tenue); }
.crediti--regia { left: 19.6%; }
.crediti--scritto { right: 19.4%; text-align: right; }

/* ---------- palazzo ---------- */
.palazzo {
  flex: none; position: relative;
  background: var(--palazzo); color: var(--bianco);
  margin-top: -1px;
  padding-bottom: env(safe-area-inset-bottom);
}
.lucine { display: block; width: 100%; height: clamp(26px, 4.4svh, 46px); }
.lucine path { fill: none; stroke: var(--cielo); stroke-width: 2; }
.lucine-punti { position: absolute; left: 0; right: 0; top: 0; height: clamp(26px, 4.4svh, 46px); }
.lucine-punti i {
  position: absolute; width: clamp(8px, 1.3svh, 13px); aspect-ratio: 1; border-radius: 50%;
  background: var(--giallo); transform: translate(-50%, -50%);
  animation: brilla 3.2s ease-in-out infinite;
}
.lucine-punti i:nth-child(2n) { animation-delay: -1.1s; }
.lucine-punti i:nth-child(3n) { animation-delay: -2.2s; }
@keyframes brilla { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

.palazzo__in {
  display: grid; grid-template-columns: 1fr;
  gap: clamp(8px, 1.6svh, 16px);
  padding: 0 var(--pad);
  max-width: 520px; margin: 0 auto;
}

/* data e luogo */
.quando { text-align: center; }
.quando p { margin: 0; }
.quando__data { font-weight: 800; letter-spacing: -0.05em; line-height: .95; font-size: clamp(24px, 4svh, 36px); }
.quando__data span { color: var(--giallo); margin-left: .15em; }
.quando__luogo { font-weight: 800; letter-spacing: -0.035em; font-size: clamp(15px, 2.3svh, 20px); color: var(--giallo); margin-top: 2px !important; }
.quando__via { font-weight: 600; letter-spacing: -0.015em; font-size: clamp(12px, 1.75svh, 15px); color: #c9d3ea; }
.arrivo-gruppo { white-space: nowrap; margin-left: .35em; }
.quando__via a { color: var(--giallo); font-weight: 800; text-underline-offset: 2px; white-space: nowrap; }

/* ---------- finestra = modulo ---------- */
.finestra {
  position: relative; background: var(--giallo); color: var(--inchiostro);
  padding: clamp(12px, 2svh, 22px) clamp(14px, 2svh, 22px) clamp(10px, 1.6svh, 16px);
}
.js .finestra { animation: accendi 1s steps(1, end) both; animation-delay: .35s; }
@keyframes accendi {
  0% { background: #0f1a33; }
  18% { background: var(--giallo); }
  28% { background: #0f1a33; }
  42%, 100% { background: var(--giallo); }
}
.finestra[data-stato="carico"] .modulo { visibility: hidden; }

.modulo__testa { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: clamp(6px, 1.2svh, 12px); }
.finestra__titolo { margin: 0; font-weight: 800; letter-spacing: -0.055em; line-height: .92; font-size: clamp(24px, 3.6svh, 34px); }
.ultimi { margin: 0; font-weight: 800; color: var(--rosso); letter-spacing: -0.02em; font-size: 15px; white-space: nowrap; }

.campo { display: block; margin-bottom: clamp(6px, 1.1svh, 10px); }
.campo > span { display: block; font-weight: 700; font-size: 13px; letter-spacing: -0.005em; margin-bottom: 3px; }
.campo input {
  width: 100%; height: var(--h); padding: 0 12px;
  border: 2.5px solid var(--inchiostro); border-radius: 0; background: var(--crema);
  font-size: 17px; font-weight: 600; font-stretch: 95%;
  outline: none; -webkit-appearance: none; appearance: none;
}
.campo input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--inchiostro); }
.campo input[aria-invalid="true"] { border-color: var(--rosso); box-shadow: inset 0 0 0 2px var(--rosso); }

.riga-invio { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: clamp(8px, 1.4svh, 14px); }
.contapersone { display: grid; grid-template-columns: var(--h) auto var(--h); height: calc(var(--h) + 4px); border: 2.5px solid var(--inchiostro); background: var(--crema); }
.contapersone__b {
  border: 0; background: var(--inchiostro); color: var(--giallo); cursor: pointer;
  font-size: 26px; font-weight: 700; line-height: 1; touch-action: manipulation;
}
.contapersone__b:disabled { opacity: .3; cursor: default; }
.contapersone__n { display: grid; place-items: center; align-content: center; min-width: 58px; padding: 0 4px; }
.contapersone output { font-size: 24px; font-weight: 800; line-height: .9; letter-spacing: -0.04em; }
.contapersone small { font-size: 11px; font-weight: 700; line-height: 1; }
.trappola { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
/* Turnstile in modalità invisibile: non occupa spazio */
.verifica { position: absolute; width: 0; height: 0; overflow: hidden; }

.avviso { margin: 2px 0 4px; padding: 8px 10px; background: var(--inchiostro); color: var(--giallo); font-weight: 700; font-size: 14px; line-height: 1.2; }
.bottone-prenota {
  height: calc(var(--h) + 4px); border: 0; background: var(--inchiostro); color: var(--giallo); cursor: pointer;
  font-size: 22px; font-weight: 800; letter-spacing: -0.04em;
  transition: transform .12s ease;
}
.bottone-prenota:hover { background: #000; }
.bottone-prenota:active { transform: translateY(2px); }
.bottone-prenota[disabled] { opacity: .6; cursor: wait; }
.nota { margin: clamp(6px, 1svh, 10px) 0 0; font-size: 12px; font-weight: 700; text-align: center; }

/* esiti: stessa finestra, l'albero della locandina */
.esito { display: grid; grid-template-columns: 34% 1fr; gap: 14px; align-items: end; }
.esito[hidden] { display: none; }
.albero { width: 100%; height: auto; margin-bottom: calc(-1 * clamp(10px, 1.6svh, 16px)); }
.esito__testo { align-self: center; padding: 6px 0; }
.esito__testo .finestra__titolo { margin-bottom: 8px; }
.esito__chi { margin: 0 0 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; line-height: 1.1; }
.esito__nota { margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 1.25; }
.esito__nota a { font-weight: 800; font-size: 17px; }
.link-bottone { padding: 0; border: 0; background: none; font-weight: 800; text-decoration: underline; cursor: pointer; font-size: 14px; }
.soldout { margin: 0 0 8px; font-weight: 800; letter-spacing: -0.07em; line-height: .85; font-size: clamp(46px, 7svh, 72px); color: var(--rosso); }

/* cast: solo dove c'è spazio */
.cast { display: none; }

/* ---------- piede ---------- */
.piede {
  display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 16px;
  padding: clamp(8px, 1.4svh, 14px) var(--pad) clamp(8px, 1.4svh, 12px);
  font-size: 12px; font-weight: 600; color: #aab6d3;
}
.piede a { color: #c9d3ea; text-underline-offset: 2px; }
.piede__tel { font-weight: 800; color: var(--giallo) !important; text-decoration: none; }
.meraki { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.meraki img { height: 14px; width: auto; }

/* ---------- privacy ---------- */
.foglio { border: 0; padding: 0; max-width: 620px; width: calc(100% - 24px); max-height: calc(100svh - 24px); background: var(--giallo); color: var(--inchiostro); }
.foglio::backdrop { background: rgba(9, 16, 32, .75); }
.foglio__in { position: relative; padding: 26px 22px 20px; font-size: 15px; font-weight: 500; line-height: 1.4; }
.foglio h2 { margin: 0 0 14px; font-weight: 800; letter-spacing: -0.05em; font-size: 30px; line-height: 1; }
.foglio p { margin: 0 0 10px; }
.foglio__chiudi { position: absolute; top: 6px; right: 8px; width: 44px; height: 44px; border: 0; background: none; font-size: 32px; cursor: pointer; }
.dacompletare { background: var(--inchiostro); color: var(--giallo); padding: 0 4px; }

/* ---------- schermi larghi: come la locandina (data a sinistra, finestra, cast a destra) ---------- */
@media (min-width: 900px) {
  .palazzo__in {
    max-width: 1180px;
    grid-template-columns: auto 380px; justify-content: center; align-items: center;
    gap: clamp(24px, 4vw, 64px);
    padding-top: clamp(4px, 1svh, 12px);
  }
  .quando { text-align: left; }
  .quando__data { font-size: clamp(40px, 5.4svh, 64px); line-height: .9; }
  .quando__data span { display: block; margin: 0; font-size: .78em; }
  .quando__luogo { font-size: clamp(20px, 2.8svh, 28px); margin-top: clamp(10px, 2svh, 22px) !important; }
  .quando__via { font-size: 15px; margin-top: 4px; }
  .quando__via a { display: inline-block; margin-top: 10px; padding: 7px 12px; border: 2px solid var(--giallo); text-decoration: none; }
  .quando__via a:hover { background: var(--giallo); color: var(--inchiostro); }
  .cast { display: block; text-align: right; }
  .cast__con { margin: 0 0 2px; font-weight: 800; color: #8fa1c9; font-size: 17px; letter-spacing: -0.03em; }
  .cast__con:not(:first-child) { margin-top: clamp(6px, 1.2svh, 12px); }
  .cast__nome { margin: 0; font-weight: 800; letter-spacing: -0.04em; line-height: 1.06; font-size: clamp(15px, 2.1svh, 20px); }
  .cast ul { list-style: none; margin: 0; padding: 0; }
  .quando__via .sep { display: none; }
  .quando__via a { display: table; }
  .testa__kerb img { width: clamp(64px, 9.5svh, 104px); }
  .testa__assoc img { height: clamp(66px, 10svh, 112px); }
  .cast li { font-weight: 800; letter-spacing: -0.04em; line-height: 1.06; font-size: clamp(15px, 2.1svh, 20px); }
  .piede { font-size: 13px; }
  .meraki img { height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .lucine-punti i, .js .finestra { animation: none !important; }
}

/* crediti sotto NATALE solo quando il disegno è abbastanza grande da leggerli */
@container (max-width: 520px) {
  .crediti { display: none; }
}
