/* Pierino e il lupo · stili condivisi della web app */

:root {
  --navy: #1B2438;
  --navy-2: #26314A;
  --paper: #F4F2EC;
  --card: #FBFAF6;
  --desk: #E7E3D8;
  --ink: #1E2229;
  --muted: #4A4F58;
  --line: #E2DED3;
  --gold: #E3A82B;
  --moon: #E9E4D6;
  --archi: #B8371F;
  --legni: #2F7A5C;
  --ottoni: #E3A82B;
  --percussioni: #3B57A6;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  font-family: Nunito, Verdana, sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
a { color: inherit; }

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  font: 700 16px/1.2 Nunito, Verdana, sans-serif;
  color: var(--ink); background: #FFFFFF;
  border: 2px solid var(--line); border-radius: 999px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; border-color: var(--line); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); }
.btn-dark { background: transparent; color: #FFFFFF; border-color: rgba(255,255,255,.35); }
.btn-dark:hover { border-color: #FFFFFF; }
.btn-audio.is-playing { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }

/* Barra in alto */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; background: var(--navy); color: #FFFFFF;
}
.bar-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-weight: 800; text-decoration: none; color: #FFFFFF;
}
.bar-back svg { width: 20px; height: 20px; }
.bar-title {
  flex: 1; min-width: 0;
  font: 700 15px/1.2 Unbounded, Verdana, sans-serif; letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Riga dell'audio sotto la barra */
.audio-row { display: flex; justify-content: center; padding: 12px 16px 0; }
.audio-slot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.audio-note { font-size: 14px; color: var(--muted); }
.reveal { font-weight: 800; font-size: 18px; padding: 0 8px; }

/* Lettore che compare in basso mentre suona */
.player {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px;
  width: min(560px, calc(100% - 32px));
  padding: 10px 10px 10px 18px;
  background: var(--navy); color: #FFFFFF;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.player-label { flex: 1; min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-track { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); overflow: hidden; }
.player-fill { height: 100%; width: 0; background: var(--gold); }

/* Pagine A4 (schede e glossario) */
.page-sheets { background: var(--desk); }
.sheets { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 16px 16px 32px; }
.sheet-frame { width: 100%; max-width: 794px; }
.sheet { width: 794px; height: 1123px; background: #FFFFFF; box-shadow: 0 4px 20px rgba(0,0,0,.15); overflow: hidden; }
.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 826px; margin: 0 auto; padding: 0 16px 40px; }
.pager a { font-weight: 800; text-decoration: none; padding: 10px 0; }

/* Presentazione */
.page-deck { background: #0F1524; }
.deck { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.deck-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.deck-canvas { width: 1920px; height: 1080px; flex-shrink: 0; position: relative; }
.slide { position: absolute; inset: 0; width: 1920px; height: 1080px; overflow: hidden; }
.slide:not(.active) { display: none !important; }
.slide p, .slide h1, .slide h2, .slide h3 { margin: 0; }
.slide aside { display: none; }
.deck-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--navy); color: #FFFFFF;
}
.deck-controls .btn { background: transparent; color: #FFFFFF; border-color: rgba(255,255,255,.35); }
.deck-controls .btn:hover { border-color: #FFFFFF; }
.deck-controls .btn-audio.is-playing { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.deck-controls .audio-note { color: #C9D1E0; }
.deck-counter { min-width: 72px; text-align: center; font-weight: 800; }
.deck-notes {
  max-height: 28vh; overflow-y: auto; padding: 12px 20px 16px;
  background: var(--paper); color: var(--ink); font-size: 17px; line-height: 1.5;
}
.deck-notes b { display: block; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.deck-notes p { margin: 4px 0 0; max-width: 900px; }
.deck:fullscreen .bar { display: none; }

/* Pagine normali (home, schede, spettacolo) */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.hero { background: var(--navy); color: #FFFFFF; }
.hero-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 32px; padding: 48px 0; }
.hero-text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: var(--gold); }
.hero h1 { margin: 0; font: 800 clamp(40px, 7vw, 72px)/1.05 Unbounded, Verdana, sans-serif; }
.hero p.lead { margin: 0; font-size: 19px; line-height: 1.5; color: #C9D1E0; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-art { flex: 0 1 340px; position: relative; aspect-ratio: 1; max-width: 340px; width: 100%; margin: 0 auto; }
.hero-art .moon { position: absolute; inset: 6%; border-radius: 50%; background: var(--moon); }
.hero-art .wolf { position: absolute; right: 0; top: 0; width: 70%; }
.hero-art .kid { position: absolute; left: 0; bottom: 0; width: 54%; }

.section { padding: 40px 0; scroll-margin-top: 64px; }
.section h2 { margin: 0 0 20px; font: 800 26px/1.2 Unbounded, Verdana, sans-serif; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 20px;
  background: #FFFFFF; border: 2px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.tile:hover { border-color: var(--ink); }
.tile img { width: 120px; height: 120px; object-fit: contain; align-self: center; }
.tile h3 { margin: 4px 0 0; font: 800 20px/1.2 Unbounded, Verdana, sans-serif; }
.tile p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--muted); }
.chip {
  align-self: flex-start; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: #FFFFFF;
}
.chip-archi { background: var(--archi); }
.chip-legni { background: var(--legni); }
.chip-ottoni { background: var(--ottoni); color: var(--ink); }
.chip-percussioni { background: var(--percussioni); }

.panel { background: #FFFFFF; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { margin: 0 0 8px; font: 800 18px/1.3 Unbounded, Verdana, sans-serif; }
.panel p { margin: 0 0 12px; font-size: 16px; line-height: 1.5; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.status { font-size: 15px; color: var(--muted); }

.todo { background: #FFF3C4; border-bottom: 2px dashed #B9861C; padding: 0 4px; }

/* Modulo di richiesta dello spettacolo */
.form { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 20px; }
.field label { display: block; margin-bottom: 6px; font-weight: 800; font-size: 16px; }
.field input:not([type="checkbox"]), .field textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  font: 16px/1.4 Nunito, Verdana, sans-serif; color: var(--ink);
  background: #FFFFFF; border: 2px solid var(--line); border-radius: 12px;
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; border-color: var(--ink); }
.field-wide { grid-column: 1 / -1; }
.check { display: flex; gap: 12px; align-items: flex-start; }
.check input { width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: var(--navy); }
.check label { margin: 0; font-weight: 700; line-height: 1.4; }
.privacy-note { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-actions .status { margin: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.footer { padding: 32px 0 48px; font-size: 14px; line-height: 1.6; color: var(--muted); border-top: 2px solid var(--line); }

/* Stampa: solo i fogli, a grandezza A4 */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #FFFFFF !important; }
  .no-print, .bar, .pager, .audio-row, .player { display: none !important; }
  .sheets { padding: 0; gap: 0; display: block; }
  .sheet-frame { max-width: none; }
  .sheet { zoom: 1 !important; box-shadow: none; break-after: page; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
