/* Anteprima 2 · Mosaico
   Il Piazzale delle Corporazioni di Ostia antica: ogni ufficio aveva il suo mosaico.
   Una forma sola, la tessera quadrata, regge tutta la pagina. */

:root {
  --bg: #000000;
  --surface: #121212;
  --ink: #ffffff;
  --muted: #a6a6a6;
  --accent: #93f1f7;        /* pulsante */
  --accent-ink: #000000;

  /* Un colore per giorno, sempre a tinta piena dietro i titoli */
  --lun: #9ae187;
  --mar: #93f1f7;
  --mer: #f3ea7a;
  --gio: #fbb65c;
  --ven: #b9c8ff;

  --font: "Hanken Grotesk", system-ui, sans-serif;

  --step-small: clamp(0.875rem, 0.84rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.2rem + 3.4vw, 4.25rem);
  --step-hero: clamp(2.75rem, 1rem + 4.6vw, 5.5rem);

  --tessera: 28px;          /* il modulo della pagina */
  --margin: 12px;
  --gap: clamp(96px, 12vw, 200px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-body)/1.45 var(--font); letter-spacing: -0.005em;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; letter-spacing: -0.05em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Pulsante: quadrato come una tessera */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 24px;
  background: var(--accent); color: var(--accent-ink);
  font: 600 var(--step-body)/1 var(--font); text-decoration: none; border: 0; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s ease;
}
.btn::after { content: ""; width: 10px; height: 10px; background: currentColor; transition: transform .3s var(--ease-out); }
.btn:hover::after { transform: translateX(4px) rotate(45deg); }
.btn:active { transform: scale(.97); }
.btn-dark { background: #000; color: #fff; }
.btn-small { min-height: 44px; padding: 0 18px; font-size: var(--step-small); }

/* Primo schermo: la scheda a sinistra, il mosaico a destra */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: var(--margin); min-height: 100svh; }
.hero-card { background: var(--lun); color: #000; display: flex; flex-direction: column; min-height: calc(100svh - 24px); }
.tessere { display: flex; height: 56px; flex: none; overflow: hidden; min-width: 0; }
.tessere i { flex: 0 0 var(--tessera); height: 100%; background: #000; }
.tessere i:nth-child(even) { background: transparent; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px clamp(20px, 3vw, 40px) 0; }
.wordmark { font: 600 var(--step-lead)/1 var(--font); letter-spacing: -0.03em; }
.nav-prog { font-weight: 600; font-size: max(19px, var(--step-body)); white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.nav-prog span { background: #000; color: var(--lun); min-width: 30px; height: 30px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-prog:hover { text-decoration: underline; text-underline-offset: 4px; }
.hero-card-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 28px; padding: 40px clamp(24px, 4vw, 64px); }
.hero-card h1 { font-size: var(--step-hero); line-height: 0.92; }
.hero-lede { max-width: 36ch; font-size: var(--step-lead); line-height: 1.3; }
.hero-card .btn { background: #000; color: #fff; }
/* La legenda dei giorni: cinque tessere colorate in fondo alla scheda */
.hero-chiave { padding: 0 clamp(20px, 3vw, 40px) clamp(20px, 3vw, 40px); display: grid; gap: 14px; }
.chiave { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: #000; padding: 4px; }
.chiave a {
  display: grid; gap: 2px; height: 100%; padding: 14px 12px;
  background: var(--c); color: #000; text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.chiave a:hover, .chiave a:focus-visible { background: #000; color: var(--c); }
.chiave a:active { transform: scale(.97); }
.chiave a:focus-visible { outline: 3px solid var(--c); outline-offset: -3px; }
.giorno { scroll-margin-top: 24px; }
.chiave b { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.chiave span { font-size: var(--step-small); }
.hero-chiave p { font-weight: 500; text-align: center; }

.hero-room { margin: 0; position: sticky; top: var(--margin); height: calc(100svh - 24px); overflow: hidden; background: #111; }
.hero-room img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 70%; opacity: 0; }
.hero-room img.on { opacity: 1; }
.hero-room figcaption {
  position: absolute; left: 0; bottom: 0; max-width: 34ch;
  background: #000; color: #fff; padding: 14px 18px; font-size: var(--step-small);
}

/* Catalogo: un blocco per giorno */
.corsi { padding: var(--gap) var(--margin) 0; max-width: 1440px; margin: 0 auto; }
.corsi-intro { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 16px; padding: 0 clamp(0px, 2vw, 32px); }
.corsi-intro h2 { grid-column: 1 / 6; font-size: var(--step-head); line-height: .9; }
.corsi-intro p { grid-column: 7 / 13; font-size: var(--step-lead); line-height: 1.35; }

.giorno { padding: 0 clamp(0px, 2vw, 32px); }
.giorno-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 112px 0 40px; }
.giorno-head h3 {
  display: inline-block; color: #000; background: var(--c);
  font-size: clamp(2rem, 1rem + 2.6vw, 3.25rem); line-height: 1; padding: 10px 16px 14px;
}
.giorno-head span { font-size: var(--step-body); color: var(--muted); }
.voci { display: grid; grid-template-columns: 1fr 1fr; column-gap: 64px; row-gap: 48px; list-style: none; margin: 0; padding: 0; }
.voce a { display: grid; grid-template-columns: 148px 1fr; gap: 24px; text-decoration: none; }
.voce-img { width: 148px; height: 148px; overflow: hidden; background: var(--c); }
.voce-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); mix-blend-mode: multiply; transition: transform .5s var(--ease-out), filter .3s ease; }
.voce a:hover .voce-img img, .voce a:focus-visible .voce-img img { transform: scale(1.08); filter: grayscale(0); mix-blend-mode: normal; }
.voce-top { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.voce-nome { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.03em; transition: color .2s ease; }
.voce a:hover .voce-nome { color: var(--c); }
.voce-ora { font-size: var(--step-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.voce-testo { margin-top: 6px; max-width: 44ch; font-size: var(--step-body); }
.voce-meta { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: var(--step-body); color: var(--muted); }
.voce-meta .liberi { color: var(--c); font-weight: 600; }

/* Le tessere dei posti: piccole nel catalogo, grandi nella scheda */
.tessere-posti { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 12px; max-width: 44ch; }
.tessere-posti i { width: 9px; height: 9px; background: #2a2a2a; }
.tessere-posti i.preso { background: #d9d9d9; }
.tessere-posti i.mio { background: var(--c); }
.tessere-posti.grandi { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; max-width: 520px; margin: 0; }
.tessere-posti.grandi i { width: auto; height: auto; aspect-ratio: 1; }
.tessere-posti.grandi i.preso { background: #fff; }

/* Il tuo programma: cinque colonne di giorni, due turni ciascuna */
.programma-sez { padding: var(--gap) calc(var(--margin) + clamp(0px, 2vw, 32px)) 0; max-width: 1440px; margin: 0 auto; }
.programma-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 16px; align-items: end; margin-bottom: 48px; }
.programma-head h2 { grid-column: 1 / 7; font-size: var(--step-head); line-height: .92; }
.programma-head p { grid-column: 8 / 13; font-size: var(--step-lead); line-height: 1.35; }
.settimana { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.sett-giorno { display: grid; gap: 12px; align-content: start; }
.sett-giorno h3 { font-size: var(--step-lead); letter-spacing: -0.03em; padding-bottom: 4px; color: var(--c); }
.casella { min-height: 180px; padding: 18px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; background: var(--surface); transition: transform .3s var(--ease-out), background-color .2s ease; }
.casella .ora { font-size: var(--step-small); font-variant-numeric: tabular-nums; }
.casella b { font-size: var(--step-lead); letter-spacing: -0.03em; margin-top: auto; }
.casella span:last-child { color: var(--muted); }
.casella:hover { transform: translateY(-4px); background: #1e1e1e; }
.casella.piena { background: var(--c); color: #000; }
.casella.piena span:last-child { color: #000; }
.conflitto { max-width: 46ch; }
.posti-azione a { font-weight: 500; }

/* Come funziona */
.come { padding: clamp(96px, 9vw, 150px) calc(var(--margin) + clamp(0px, 2vw, 32px)); max-width: 1440px; margin: 0 auto; }
.come-head { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: 16px; }
.come-head h2 { grid-column: 1 / 7; font-size: var(--step-head); line-height: .92; }
.come-head p { grid-column: 8 / 13; align-self: end; }
.flusso { width: 100%; height: auto; margin: 72px 0 40px; display: block; }
.flusso rect { transform-box: fill-box; transform-origin: center; }
.come-cols { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 32px; }
.come-cols h3 { font-size: var(--step-lead); letter-spacing: -0.03em; margin-bottom: 8px; }
.come-cols p { max-width: 34ch; }

/* Riga di tessere finale */
.tiles { display: grid; grid-template-columns: 1fr 4fr 1fr; gap: 12px; height: 380px; margin: 0 0 12px; }
.tile { overflow: hidden; }
.tile-photo video { width: 100%; height: 100%; object-fit: cover; }
.tile-main { background: var(--accent); color: #000; padding: 40px clamp(24px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto; align-content: center; align-items: end; gap: 18px 48px; }
.tile-main h2, .tile-main p { grid-column: 1; }
.tile-main .btn { grid-column: 2; grid-row: 1 / 3; }
.tile-main h2 { font-size: clamp(2rem, 1rem + 2.4vw, 3rem); line-height: 1; }
.tile-main p { max-width: 46ch; }
.tile-flat { background: var(--mer); }

/* Piè di pagina: il nome costruito a blocchi */
.footer { background: var(--surface); padding: 56px calc(var(--margin) + clamp(0px, 2vw, 32px)) 28px; }
.marchio { display: flex; align-items: flex-end; gap: 4px; height: 28svh; min-height: 200px; }
.marchio span {
  flex: 1; display: flex; align-items: flex-end; justify-content: center;
  color: #000; font-weight: 600; font-size: clamp(2rem, 7vw, 7.5rem); line-height: .8;
  letter-spacing: -0.05em; padding-bottom: 8px; transform-origin: bottom;
}
.marchio span.spazio { flex: .35; background: none !important; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px; margin-top: 56px; font-size: var(--step-body); }
.foot-h { font-size: var(--step-body); letter-spacing: -0.01em; font-weight: 600; margin-bottom: 6px; }
.crediti summary { cursor: pointer; font-weight: 600; }
.crediti ul { list-style: none; padding: 10px 0 0; margin: 0; display: grid; gap: 4px; font-size: var(--step-small); }
.foot-last { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 56px; font-size: var(--step-small); }

/* Scheda corso */
.scheda { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: var(--margin); min-height: 100svh; }
.scheda-media { position: sticky; top: var(--margin); height: calc(100svh - 24px); margin: 0; overflow: hidden; background: var(--c); }
.scheda-media img { width: 100%; height: 100%; object-fit: cover; }
.scheda-media figcaption { position: absolute; left: 0; bottom: 0; background: #000; padding: 12px 16px; font-size: var(--step-small); max-width: 40ch; }
.scheda-body { padding: 32px clamp(16px, 4vw, 64px) 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-content: start; min-width: 0; }
.scheda-back { font-size: var(--step-body); }
.scheda-titolo { background: var(--c); color: #000; padding: 28px 28px 32px; display: grid; gap: 14px; }
.scheda-titolo h1 { font-size: clamp(2.75rem, 1rem + 4.4vw, 5.5rem); line-height: .9; }
.scheda-titolo p { font-size: var(--step-lead); line-height: 1.25; }
.fatti { display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; margin: 0; }
.fatti dt { color: var(--muted); }
.fatti dd { margin: 0; font-weight: 500; }
.scheda-body h2 { font-size: var(--step-lead); letter-spacing: -0.03em; margin-bottom: 12px; }
.programma { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.programma li { display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: baseline; }
.programma li::before { content: ""; width: 10px; height: 10px; background: var(--c); }

.posti-num { font-size: var(--step-lead); font-weight: 500; font-variant-numeric: tabular-nums; }
.posti-azione { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.btn-annulla { background: #fff; color: #000; }

[hidden] { display: none !important; }

@media (max-width: 900px) {
  .voci { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; grid-template-rows: auto 160px; height: auto; }
  .tile-main { grid-column: 1 / -1; grid-row: 1; padding: 40px 32px; }
  .corsi-intro, .come-head { display: block; }
  .corsi-intro p, .come-head p { margin-top: 20px; }
  .come-cols { grid-template-columns: 1fr; gap: 28px; }
  .foot-grid { grid-template-columns: 1fr; }
  .programma-head { display: block; }
  .programma-head p { margin-top: 20px; }
  .settimana { grid-template-columns: 1fr; }
  .sett-giorno { grid-template-columns: 1fr 1fr; }
  .sett-giorno h3 { grid-column: 1 / -1; }
  .casella { min-height: 120px; }
}
@media (max-width: 760px) {
  .hero { display: flex; flex-direction: column-reverse; }
  .hero-room { position: relative; top: 0; height: 48svh; }
  .hero-room figcaption { display: none; }
  .hero-card { min-height: auto; margin-top: -36px; position: relative; z-index: 2; width: calc(100% - 24px); align-self: center; }
  .tessere { height: 40px; }
  .hero-top .wordmark { font-size: 19px; }
  .solo-ampio { display: none; }
  .chiave { grid-template-columns: repeat(5, 1fr); }
  .chiave a { padding: 10px 6px; min-height: 44px; }
  .chiave b { font-size: var(--step-body); }
  .chiave span { display: none; }
  .hero-card h1 { font-size: 10.5vw; }
  .voce a { grid-template-columns: 72px 1fr; gap: 16px; }
  .voce-img { width: 72px; height: 72px; }
  .voce-top { display: block; }
  .voce-ora { display: block; margin-top: 2px; }
  .giorno-head { margin-top: 80px; }
  .tiles { grid-template-columns: 1fr 1fr; grid-template-rows: auto 120px; height: auto; }
  .tile-main { grid-column: 1 / -1; grid-row: 1; padding: 32px 24px; grid-template-columns: 1fr; }
  .tile-main .btn { grid-column: 1; grid-row: auto; }
  .tile-main .btn { width: 100%; }
  .marchio { height: 22svh; min-height: 140px; }
  .marchio span { font-size: 8.4vw; }
  .scheda { display: block; }
  .scheda-media { position: relative; top: 0; height: 52svh; }
  .scheda-body { padding: 28px 4px 72px; }
}

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