/* LivingMoments: pagina dei ricordi e pagine del sito.
   Design system "Rilievo" (sessione "Nome e logo del marchio", 21/11/2026): i colori del pezzo stampato.
   Gesso del PLA opaco, grafite del sigillo, pietra delle curve, rovere della cornice, velo per le superfici.
   Caratteri serviti dal sito stesso (risorse/caratteri/): nessuna richiesta a terzi. */

@font-face {
  font-family: "Italiana";
  src: url("caratteri/italiana-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Karla";
  src: url("caratteri/karla-variabile.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("caratteri/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* token di docs/brand.md (direzione "Rilievo") */
  --gesso: #f1f1ee;          /* fondo */
  --velo: #e2e1dc;           /* fasce, riquadri secondari, lettore della nota vocale */
  --carta: #ffffff;          /* scheda in primo piano sopra gesso */
  --grafite: #2e3034;        /* testo e simbolo (11,7:1 su gesso) */
  --grafite-tenue: #5c5e63;  /* testo secondario (almeno 5:1) */
  --pietra: #9fa19c;         /* solo decoro, mai testo: curve di livello */
  --rovere: #c4a27a;         /* accento: il punto del ricordo */
  --on-rovere: #2e3034;
  --rovere-scuro: #7a5a37;   /* link */
  --anello: #2e3034;         /* fuoco della tastiera */
  --simbolo: #2e3034;        /* nel tema scuro diventa gesso */
  --ombra-carta: 0 1px 0 rgba(46, 48, 52, 0.06), 0 8px 24px rgba(46, 48, 52, 0.08);
  /* derivati per la pagina dei ricordi */
  --pietra-forte: #858882;   /* curve direttrici, un po' più scure */
  --filo: #d8d8d3;           /* filetti */

  --titoli: "Italiana", "Didot", "Bodoni 72", serif;
  --testo: "Karla", "Helvetica Neue", Arial, sans-serif;
  --dati: "IBM Plex Mono", Menlo, Consolas, monospace;

  --colonna: 38rem;
  --margine: 1rem;           /* 16 px sul telefono */
  --raggio-foto: 10px;
  --testata-altezza: min(56svh, 32rem);
  color-scheme: light dark;
}

/* Varianti: "auto" segue il telefono; "chiara", "scura" e "sera" le sceglie chi prepara la pagina.
   Le pagine del sito (fonti, privacy) non hanno classe e seguono il telefono. */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema]):not(:has(body.v-chiara)):not(:has(body.v-sera)) {
    --gesso: #1d1e21;
    --velo: #28292d;
    --carta: #232428;
    --grafite: #ecece8;
    --grafite-tenue: #a9aba6;
    --pietra: #6e716c;
    --rovere-scuro: #d6b88f;
    --anello: #d6b88f;
    --simbolo: #f1f1ee;
    --ombra-carta: none;
    --pietra-forte: #7b7e79;
    --filo: #34363a;
    color-scheme: dark;
  }
}
/* scura, oppure "scuro" scelto con il pulsante (data-tema su <html>, da tema.js) */
:root:not([data-tema="chiaro"]):has(body.v-scura),
:root[data-tema="scuro"]:not(:has(body.v-sera)) {
    --gesso: #1d1e21;
    --velo: #28292d;
    --carta: #232428;
    --grafite: #ecece8;
    --grafite-tenue: #a9aba6;
    --pietra: #6e716c;
    --rovere-scuro: #d6b88f;
    --anello: #d6b88f;
    --simbolo: #f1f1ee;
    --ombra-carta: none;
    --pietra-forte: #7b7e79;
    --filo: #34363a;
    color-scheme: dark;
}
:root:has(body.v-chiara), :root[data-tema="chiaro"] { color-scheme: light; }
/* Sera: grafite azzurrata e luce calda, come la mappa sotto una lampada */
:root:not([data-tema="chiaro"]):has(body.v-sera) {
    --gesso: #262a31;
    --velo: #31363f;
    --carta: #2d323a;
    --grafite: #efe9df;
    --grafite-tenue: #b9b2a7;
    --pietra: #5d646e;
    --pietra-forte: #7e8691;
    --rovere: #d1ad80;
    --rovere-scuro: #e2c49c;
    --anello: #e2c49c;
    --simbolo: #efe9df;
    --ombra-carta: none;
    --filo: #3b414b;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--gesso);
  color: var(--grafite);
  font-family: var(--testo);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--rovere-scuro); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--anello); outline-offset: 2px; }

.colonna { width: min(100% - 2 * var(--margine), var(--colonna)); margin-inline: auto; }

.solo-lettori {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* La parola del marchio: Italiana maiuscola, spaziata 0,16em */
.parola {
  font-family: var(--titoli);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  line-height: 1;
}

/* ── Testata: le curve di livello vere del luogo ───────────────────────── */

.testata { position: relative; padding-top: max(1rem, env(safe-area-inset-top)); }

/* Pulsante chiaro/scuro: lo mostra pagina.js; senza script la pagina resta nel suo tema */
.tema {
  position: absolute;
  top: max(0.25rem, calc(env(safe-area-inset-top) - 0.75rem));
  right: max(0.25rem, env(safe-area-inset-right));
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grafite-tenue);
  cursor: pointer;
}
.tema:hover { color: var(--grafite); background: var(--velo); }
.tema:focus-visible { outline: 2px solid var(--anello); outline-offset: 2px; }
.tema svg { width: 18px; height: 18px; }
.tema .icona-luna { fill: currentColor; }
.tema .icona-sole { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.tema .icona-sole circle { fill: currentColor; stroke: none; }
.tema[data-attivo="scuro"] .icona-luna, .tema:not([data-attivo="scuro"]) .icona-sole { display: none; }
/* spazio per il pulsante sul telefono; nei modelli con la riga al centro, lo stesso spazio anche a sinistra */
.testata-marchio { padding-right: 3.25rem; }
.m-coppia .testata-marchio, .m-ricordo .testata-marchio, .m-festa .testata-marchio { padding-left: 3.25rem; }

.testata-marchio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0;
  color: var(--grafite-tenue);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.testata-marchio svg { width: 18px; height: 18px; fill: var(--simbolo); flex: none; }

/* Le curve stanno in un riquadro tutto loro, mai sotto il testo (docs/brand.md). */
.testata-curve {
  position: relative;
  height: var(--testata-altezza);
  margin-top: 0.5rem;
  color: var(--pietra);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 84%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 84%, transparent 100%);
}

.testata-curve svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* spessori in unità del disegno (lato 1000): sul telefono circa 1,2 e 2 px */
.curve .c { fill: none; stroke: currentColor; stroke-width: 2; }
.curve .d { stroke: var(--pietra-forte); stroke-width: 3.2; }
@media (min-width: 48rem) {
  .curve .c { stroke-width: 1.3; }
  .curve .d { stroke-width: 2.1; }
}
/* senza coordinate: al posto delle curve vere, le curve del simbolo, piccole e tenui */
.testata-curve svg.logo-grande { inset: 18% 0; height: 64%; fill: currentColor; opacity: 0.32; }

/* Il punto: il luogo del ricordo, al centro della mappa. È la cima piena del simbolo. */
.punto {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin: -0.45rem 0 0 -0.45rem;
  border-radius: 50%;
  background: var(--rovere);
  box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--rovere) 24%, transparent);
}

.testata-testo { padding-top: 0.5rem; }

.titolo {
  margin: 0;
  font-family: var(--titoli);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 2.75rem;
  text-wrap: balance;
}
@media (min-width: 40rem) { .titolo { font-size: 3.5rem; line-height: 3.75rem; } }

.coordinate {
  margin: 0.75rem 0 0;
  line-height: 1.125rem;
  color: var(--grafite-tenue);
  font-family: var(--dati);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.contatore {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--grafite-tenue);
}
.contatore:empty { display: none; }

/* Una sola animazione: le curve si disegnano dal punto verso l'esterno, poi il punto pulsa una volta. */
@media (prefers-reduced-motion: no-preference) {
  .curve .c {
    stroke-dasharray: 1 1;
    stroke-dashoffset: 1;
    animation: traccia 1.6s cubic-bezier(0.25, 0.6, 0.3, 1) forwards;
  }
  .curve .c:nth-child(n+3)  { animation-delay: 0.08s; }
  .curve .c:nth-child(n+6)  { animation-delay: 0.16s; }
  .curve .c:nth-child(n+9)  { animation-delay: 0.24s; }
  .curve .c:nth-child(n+12) { animation-delay: 0.32s; }
  .curve .c:nth-child(n+16) { animation-delay: 0.4s; }
  .curve .c:nth-child(n+20) { animation-delay: 0.5s; }
  .curve .c:nth-child(n+25) { animation-delay: 0.6s; }
  .curve .c:nth-child(n+31) { animation-delay: 0.7s; }
  .curve .c:nth-child(n+38) { animation-delay: 0.8s; }
  .curve .c:nth-child(n+46) { animation-delay: 0.9s; }

  .punto { animation: appare 0.5s ease-out both, pulsa 1.8s ease-out 1.5s 1; }
}

@keyframes traccia { to { stroke-dashoffset: 0; } }
@keyframes appare { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes pulsa {
  0% { box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--rovere) 24%, transparent); }
  45% { box-shadow: 0 0 0 1.75rem color-mix(in srgb, var(--rovere) 0%, transparent); }
  100% { box-shadow: 0 0 0 0.35rem color-mix(in srgb, var(--rovere) 24%, transparent); }
}

/* ── Sezioni ──────────────────────────────────────────────────────────── */

.blocco { margin-block: 3rem; }

.blocco-titolo {
  margin: 0 0 1rem;
  font-family: var(--titoli);
  font-weight: 400;
  font-size: 1.75rem;
  line-height: 2rem;
}

.b-copertina img, .b-foto img, .galleria img, .momento img { border-radius: var(--raggio-foto); background: var(--velo); }

.apri-foto {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

figcaption {
  margin-top: 0.5rem;
  color: var(--grafite-tenue);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* La canzone */
.brano {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0.25rem 1rem;
  align-items: center;
}
.disco { width: 3.5rem; height: 3.5rem; color: var(--pietra); }
.disco circle { fill: none; stroke: currentColor; stroke-width: 1.4; }
.disco .centro { fill: var(--rovere); stroke: none; }
.brano-titolo { margin: 0; font-family: var(--titoli); font-size: 1.75rem; line-height: 2rem; }
.brano-artista { margin: 0.125rem 0 0; color: var(--grafite-tenue); font-size: 0.875rem; line-height: 1.25rem; }

.azioni { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

.bottone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--grafite);
  border-radius: 999px;
  background: var(--grafite);
  color: var(--gesso);
  font: 600 1rem/1.5rem var(--testo);
  text-decoration: none;
  cursor: pointer;
}
.bottone:hover { opacity: 0.88; }
.bottone.secondario { background: transparent; color: var(--grafite); }

.nota { margin: 0.5rem 0 0; color: var(--grafite-tenue); font-size: 0.75rem; line-height: 1.125rem; }

.lettore-esterno { margin-top: 1rem; }
.lettore-esterno iframe { display: block; width: 100%; border: 0; border-radius: 10px; }
.lettore-esterno .video { aspect-ratio: 16 / 9; height: auto; }

/* La lettera */
.lettera {
  margin: 0;
  padding: 1.5rem 1.25rem 2rem;
  background: var(--carta);
  border-radius: 10px;
  box-shadow: var(--ombra-carta);
  font-size: 1rem;
  line-height: 1.625rem;
}
.lettera p { margin: 0 0 1em; }
.lettera .firma { margin: 1.6rem 0 0; text-align: right; font-family: var(--titoli); font-size: 1.5rem; line-height: 1.2; }

/* Le foto */
.galleria-griglia .galleria {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* ritmo: una larga, poi due coppie; una foto rimasta sola sulla riga diventa larga */
.galleria-griglia li:nth-child(5n + 1),
.galleria-griglia li:last-child:nth-child(5n + 2),
.galleria-griglia li:last-child:nth-child(5n + 4) { grid-column: span 2; }
.galleria-griglia img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.galleria-griglia li:nth-child(5n + 1) img,
.galleria-griglia li:last-child:nth-child(5n + 2) img,
.galleria-griglia li:last-child:nth-child(5n + 4) img { aspect-ratio: 3 / 2; }

/* I messaggi vocali: titolo sopra, lettore a pillola sotto */
.vocali { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.25rem; }
.vocale-titolo { margin: 0 0 0.5rem; font-size: 1rem; line-height: 1.5rem; }
.vocale audio { width: 100%; }
.vocale.pronto audio { display: none; }

.lettore {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  border-radius: 999px;
  background: var(--velo);
}
.vocale.pronto .lettore { display: flex; }

.suona {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--grafite);
  color: var(--gesso);
  cursor: pointer;
}
.suona svg { width: 1rem; height: 1rem; fill: currentColor; }
.suona .icona-pausa { display: none; }
.vocale.in-corso .suona .icona-suona { display: none; }
.vocale.in-corso .suona .icona-pausa { display: block; }

.vocale-tempo { color: var(--grafite-tenue); font-family: var(--dati); font-size: 0.75rem; white-space: nowrap; }

.avanzamento {
  --fatto: 0%;
  flex: 1;
  min-width: 0;
  height: 1.75rem;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.avanzamento::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--grafite) var(--fatto), var(--pietra) var(--fatto));
}
.avanzamento::-moz-range-track { height: 3px; border-radius: 2px; background: var(--pietra); }
.avanzamento::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--grafite); }
.avanzamento::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 0.85rem; height: 0.85rem; margin-top: -0.32rem;
  border-radius: 50%; border: 0; background: var(--grafite);
}
.avanzamento::-moz-range-thumb { width: 0.85rem; height: 0.85rem; border-radius: 50%; border: 0; background: var(--grafite); }

/* ── Piede ────────────────────────────────────────────────────────────── */

.piede {
  margin-top: 3rem;
  padding: 1.25rem 0 calc(1.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--filo);
  color: var(--grafite-tenue);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}
.piede-marchio { display: flex; align-items: center; gap: 0.5rem; margin: 0; color: var(--grafite); font-size: 0.875rem; }
.piede-marchio svg { width: 16px; height: 16px; fill: var(--simbolo); flex: none; }
.piede-link { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.6rem; }
.piede-link a { color: var(--grafite-tenue); text-decoration-color: var(--pietra); }
.piede-nota { margin: 0.4rem 0 0; font-size: 0.75rem; line-height: 1.125rem; }
.piede-nota a { color: inherit; }
/* pagine del sito (fonti, privacy): elenco di link nel piede */
.piede nav:not(.piede-link) { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }

/* ── Visore delle foto ────────────────────────────────────────────────── */

html.visore-aperto { overflow: hidden; }

.visore {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #1b1c1e;
  color: #ecece8;
}
.visore::backdrop { background: #1b1c1e; }

.visore-barra {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(0.6rem, env(safe-area-inset-top)) 0.75rem 0.6rem 1.1rem;
  font-family: var(--dati);
  font-size: 0.8125rem;
}

.visore button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(241, 241, 238, 0.12);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.visore button svg { width: 1.2rem; height: 1.2rem; stroke: currentColor; stroke-width: 1.8; fill: none; vertical-align: middle; }

.visore-binario {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.visore-binario::-webkit-scrollbar { display: none; }

.visore figure {
  flex: 0 0 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.75rem 0.75rem max(1.25rem, env(safe-area-inset-bottom));
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.visore figure img { max-width: 100%; max-height: calc(100% - 3rem); width: auto; height: auto; object-fit: contain; border-radius: 2px; }
.visore figcaption { color: #c8cac5; text-align: center; max-width: 34rem; }

.visore .indietro, .visore .avanti { display: none; }
@media (hover: hover) and (min-width: 48rem) {
  .visore .indietro, .visore .avanti {
    display: block;
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
  }
  .visore .indietro { left: 1rem; }
  .visore .avanti { right: 1rem; }
}

/* ── Pagine del sito (fonti, privacy, home) ───────────────────────────── */

.intestazione { padding-block: 1.5rem; }
.marchio { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--grafite); text-decoration: none; font-size: 0.9375rem; }
.marchio svg { width: 1.75rem; height: 1.75rem; fill: var(--simbolo); }

.testo { padding-bottom: 1rem; }
.testo h1 {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--titoli);
  font-weight: 400;
  font-size: 2.5rem;
  line-height: 2.75rem;
}
@media (min-width: 40rem) { .testo h1 { font-size: 3.5rem; line-height: 3.75rem; } }
.testo h2 { margin: 2.5rem 0 0.5rem; font-family: var(--titoli); font-weight: 400; font-size: 1.75rem; line-height: 2rem; }
.testo h3 { margin: 1.75rem 0 0.4rem; font-size: 1.0625rem; font-weight: 600; }
.testo p, .testo li { max-width: 36rem; }
.testo p { margin: 0 0 0.9rem; }
.testo ul, .testo ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.testo li { margin-bottom: 0.4rem; }
.testo .attacco { font-size: 1.1875rem; line-height: 1.75rem; }
.testo .piccolo { color: var(--grafite-tenue); font-size: 0.875rem; }
.testo code { font-family: var(--dati); font-size: 0.875em; }

.avviso {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 3px;
  background: var(--velo);
  font-size: 0.9375rem;
}

.da-completare { background: color-mix(in srgb, var(--rovere) 40%, transparent); padding: 0 0.25em; border-radius: 2px; }

.fonte { padding: 1.4rem 0; border-top: 1px solid var(--filo); }
.fonte:last-of-type { border-bottom: 1px solid var(--filo); }
.fonte h2 { margin: 0 0 0.5rem; font-size: 1.75rem; line-height: 2rem; }
.fonte p { margin: 0 0 0.5rem; }
.fonte .citazione { font-family: var(--dati); font-size: 0.8125rem; line-height: 1.125rem; letter-spacing: 0.02em; }
.fonte dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.7rem 0 0; font-size: 0.9375rem; }
.fonte dt { color: var(--grafite-tenue); }
.fonte dd { margin: 0; }

details { margin: 0.6rem 0 0; }
summary { cursor: pointer; color: var(--rovere-scuro); font-size: 0.9375rem; text-decoration: underline; text-underline-offset: 0.2em; }
details ul { margin-top: 0.6rem; font-size: 0.875rem; }

.vuota { padding-block: 16svh 4rem; }
.vuota > svg { width: 3rem; height: 3rem; fill: var(--simbolo); margin-bottom: 1.5rem; }

/* ══ Blocchi della pagina a blocchi (seconda versione, 21/11/2026) ═══════════════════════════════════ */

.b-copertina, .b-foto { margin-inline: auto; }
.sopratitolo { margin: 0 0 0.5rem; color: var(--grafite-tenue); font-size: 0.875rem; line-height: 1.25rem; }
.sottotitolo { margin: 0.75rem 0 0; font-size: 1.1875rem; line-height: 1.75rem; }
.lettera .saluto { margin: 0 0 1rem; font-family: var(--titoli); font-size: 1.5rem; line-height: 1.75rem; }
.brano-perche { margin: 0.75rem 0 0; color: var(--grafite-tenue); font-size: 0.9375rem; line-height: 1.5rem; }
.testo-corpo p { margin: 0 0 1em; }
.testo-corpo p:last-child { margin-bottom: 0; }

/* Capitoli: una fila di pulsanti; senza script si vedono tutti, uno dopo l'altro */
.capitoli { display: flex; gap: 0.5rem; overflow-x: auto; margin-top: 2rem; padding-bottom: 0.25rem; scrollbar-width: none; }
.capitoli::-webkit-scrollbar { display: none; }
.capitoli button {
  flex: none; min-height: 2.5rem; padding: 0.4rem 1rem;
  border: 1px solid var(--grafite); border-radius: 999px; background: transparent; color: var(--grafite);
  font: 600 0.875rem/1.25rem var(--testo); cursor: pointer;
}
.capitoli button[aria-pressed="true"] { background: var(--grafite); color: var(--gesso); }
.capitolo-titolo { margin: 2.5rem auto 0; font-family: var(--titoli); font-weight: 400; font-size: 2.5rem; line-height: 2.75rem; }
.js-capitoli .capitolo-titolo { display: none; }

/* Galleria a pila: tre foto sovrapposte; un tocco le apre tutte */
.pila { position: relative; display: block; width: min(88%, 21rem); margin: 0.5rem auto 0; padding: 0; border: 0;
        background: none; cursor: zoom-in; }
.pila-strati { display: grid; }
.pila .strato {
  grid-area: 1 / 1; width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border: 0.5rem solid var(--carta); border-bottom-width: 1.75rem; border-radius: 3px; box-shadow: var(--ombra-carta);
  background: var(--velo);
}
.pila .strato-1 { transform: rotate(3deg) translate(0.3rem, -0.15rem); }
.pila .strato-2 { transform: rotate(-3.5deg) translate(-0.35rem, 0.1rem); }
.pila-conta {
  position: absolute; right: -0.25rem; bottom: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 999px;
  background: var(--grafite); color: var(--gesso); font: 600 0.8125rem/1.25rem var(--testo);
}
.pila-aiuto { margin: 0.75rem 0 0; text-align: center; color: var(--grafite-tenue); font-size: 0.875rem; }

/* Galleria in fila: si scorre col dito, la foto dopo si intravede */
.galleria-fila .galleria {
  display: flex; gap: 0.75rem; margin: 0 calc(-1 * var(--margine)); padding: 0 var(--margine) 0.25rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--margine); list-style: none; scrollbar-width: none;
}
.galleria-fila .galleria::-webkit-scrollbar { display: none; }
.galleria-fila li { flex: 0 0 82%; scroll-snap-align: start; }
.galleria-fila figure { margin: 0; }
.galleria-fila img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* Galleria polaroid: stampe con il bordo bianco, appena storte */
.galleria-polaroid .galleria { display: grid; gap: 1.75rem; margin: 0; padding: 0.5rem 0.75rem; list-style: none; }
.galleria-polaroid figure {
  margin: 0; padding: 0.6rem 0.6rem 0.9rem; background: var(--carta); border-radius: 3px; box-shadow: var(--ombra-carta);
}
.galleria-polaroid li:nth-child(odd) figure { transform: rotate(-1.4deg); }
.galleria-polaroid li:nth-child(even) figure { transform: rotate(1.2deg); }
.galleria-polaroid img { width: 100%; border-radius: 2px; }
.galleria-polaroid figcaption { margin-top: 0.75rem; text-align: center; color: var(--grafite); }
.galleria-fila figcaption { margin-top: 0.5rem; }

/* Video */
.video-file { margin: 0; }
.video-file video { display: block; width: 100%; height: auto; border-radius: var(--raggio-foto); background: #000; }

/* Citazione: la frase al centro, il simbolo piccolo sopra */
.b-citazione blockquote { margin: 0; text-align: center; }
.citazione-segno { width: 1.25rem; height: 1.25rem; fill: var(--rovere); margin: 0 auto 0.75rem; display: block; }
.b-citazione blockquote p { margin: 0; font-family: var(--titoli); font-size: 1.75rem; line-height: 2.25rem; text-wrap: balance; }
.b-citazione footer { margin-top: 0.75rem; color: var(--grafite-tenue); font-size: 0.875rem; }

/* Pausa */
.b-divisore { display: flex; align-items: center; gap: 0.75rem; }
.b-divisore span { flex: 1; height: 1px; background: var(--filo); }
.b-divisore svg { width: 14px; height: 14px; fill: var(--pietra); flex: none; }

/* Lettera sigillata: una busta con il nostro sigillo */
.busta {
  position: relative; padding: 4.25rem 1.25rem 1.75rem; border-radius: 10px; background: var(--carta);
  box-shadow: var(--ombra-carta); text-align: center; overflow: hidden;
}
.busta::before {             /* il lembo della busta */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4.5rem;
  background: linear-gradient(to bottom right, transparent 49.5%, var(--filo) 50%, transparent 50.5%) left / 50% 100% no-repeat,
              linear-gradient(to bottom left, transparent 49.5%, var(--filo) 50%, transparent 50.5%) right / 50% 100% no-repeat;
}
.busta-sigillo {
  position: absolute; left: 50%; top: 2.9rem; width: 3rem; height: 3rem; margin-left: -1.5rem; border-radius: 50%;
  background: var(--rovere); display: grid; place-items: center;
}
.busta-sigillo svg { width: 1.6rem; height: 1.6rem; fill: var(--on-rovere); }
.busta-titolo { margin: 1.5rem 0 0; font-family: var(--titoli); font-size: 1.75rem; line-height: 2rem; }
.busta-data { margin: 0.5rem 0 0; font-family: var(--dati); font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--grafite-tenue); }
.busta-conto { margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--grafite-tenue); }
.sigillo-nota { margin: 0 0 1.25rem; padding: 0.5rem 0.75rem; border-radius: 3px; background: var(--velo);
                font-size: 0.8125rem; line-height: 1.25rem; color: var(--grafite-tenue); }

/* Numeri: da quanto tempo, quanto manca */
.b-contatore, .b-conto { text-align: center; }
.numero { margin: 0; font-family: var(--titoli); font-size: 3.5rem; line-height: 3.75rem; color: var(--grafite); }
.numero-testo { margin: 0.25rem 0 0; font-size: 1rem; line-height: 1.5rem; }
.numero-data { margin: 0.5rem 0 0; font-family: var(--dati); font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--grafite-tenue); }

/* Linea del tempo */
.linea { margin: 0; padding: 0; list-style: none; }
.momento { position: relative; padding: 0 0 2rem 1.75rem; }
.momento::before { content: ""; position: absolute; left: 0.3rem; top: 0.5rem; bottom: -0.5rem; width: 1px; background: var(--pietra); }
.momento:last-child::before { bottom: auto; height: 100%; background: linear-gradient(var(--pietra), transparent); }
.momento::after {
  content: ""; position: absolute; left: 0; top: 0.2rem; width: 0.65rem; height: 0.65rem; border-radius: 50%;
  background: var(--gesso); border: 2px solid var(--rovere);
}
.momento-quando { margin: 0; font-family: var(--dati); font-size: 0.8125rem; line-height: 1.125rem; letter-spacing: 0.02em; color: var(--grafite-tenue); }
.momento-titolo { margin: 0.25rem 0 0; font-family: var(--titoli); font-weight: 400; font-size: 1.75rem; line-height: 2rem; }
.momento-testo { margin-top: 0.5rem; color: var(--grafite); }
.momento-testo p { margin: 0 0 0.75em; }
.momento .apri-foto { margin-top: 0.75rem; }

/* Luogo: una scheda con la piccola mappa */
.luogo-carta { margin: 0; border-radius: 10px; background: var(--carta); box-shadow: var(--ombra-carta); overflow: hidden; }
.luogo-mappa { position: relative; aspect-ratio: 4 / 3; color: var(--grafite); background: var(--velo); }
.luogo-mappa svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.luogo-carta figcaption { margin: 0; padding: 1rem 1.25rem 1.25rem; color: var(--grafite); }
.luogo-nome { margin: 0; font-weight: 600; font-size: 1.0625rem; line-height: 1.5rem; }
.luogo-carta .coordinate { margin-top: 0.25rem; }
.luogo-didascalia { margin: 0.5rem 0 0; color: var(--grafite-tenue); font-size: 0.9375rem; }
.luogo-azioni { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.luogo-azioni .bottone { min-height: 2.5rem; padding: 0.4rem 1rem; font-size: 0.875rem; }
/* i colori della mappa del luogo: gli stessi della mappa stampata */
.mappa-luogo { fill: none; stroke: none; }
.ml-verde path, .ml-verde { fill: color-mix(in srgb, var(--pietra) 22%, var(--velo)); }
.ml-acqua path, .ml-acqua { fill: color-mix(in srgb, #7fa7b8 45%, var(--velo)); }
.ml-acqua .ml-fiume { fill: none; stroke: color-mix(in srgb, #7fa7b8 45%, var(--velo)); stroke-width: 9; stroke-linecap: round; }
.ml-acqua .ml-ruscello { stroke-width: 4.5; }
.ml-edifici path, .ml-edifici { fill: color-mix(in srgb, var(--pietra) 55%, var(--velo)); }
.ml-strade path { fill: none; stroke: var(--carta); stroke-linecap: round; stroke-linejoin: round; }
.ml-strade .ml-s1 { stroke-width: 16; }
.ml-strade .ml-s2 { stroke-width: 10; }
.ml-strade .ml-s3 { stroke-width: 4.5; }
.ml-ferrovia path, .ml-ferrovia { fill: none; stroke: var(--grafite-tenue); stroke-width: 3.5; stroke-dasharray: 10 8; }
.luogo-mappa .punto { animation: none; }

/* Percorso: il disegno, i numeri, il profilo */
.percorso-carta { margin: 0; padding: 1rem 1rem 1.25rem; border-radius: 10px; background: var(--carta); box-shadow: var(--ombra-carta); }
.percorso-disegno { margin: 0 auto; }
.percorso-disegno svg { width: 100%; height: auto; max-height: 24rem; display: block; }
.pc-linea { fill: none; stroke: var(--grafite); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pc-partenza, .pc-arrivo, .pc-anello { stroke: var(--carta); stroke-width: 5; }
.pc-partenza, .pc-anello { fill: var(--rovere); }
.pc-arrivo { fill: var(--grafite); }
.percorso-numeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 1rem 0 0; text-align: center; }
.percorso-numeri dt { color: var(--grafite-tenue); font-size: 0.75rem; line-height: 1rem; }
.percorso-numeri dd { margin: 0.25rem 0 0; font-family: var(--dati); font-size: 0.9375rem; line-height: 1.25rem; }
.percorso-profilo { margin-top: 1rem; }
.percorso-profilo svg { width: 100%; height: auto; display: block; }
.pc-area { fill: color-mix(in srgb, var(--pietra) 30%, transparent); stroke: none; }
.pc-profilo { fill: none; stroke: var(--grafite); stroke-width: 3; stroke-linejoin: round; }
.pc-etichetta { fill: var(--grafite-tenue); font-family: var(--dati); font-size: 34px; }
.percorso-carta figcaption { margin-top: 0.75rem; }


/* ══ Modelli: cambiano l'aspetto, mai il contenuto ══════════════════════════════════════════════════ */

/* Coppia: tutto al centro, lettera e canzone in primo piano */
.m-coppia .testata-testo, .m-coppia .blocco-titolo, .m-coppia .capitolo-titolo { text-align: center; }
.m-coppia .testata-marchio { justify-content: center; }
.m-coppia .lettera { padding: 2rem 1.5rem 2.25rem; }
.m-coppia .lettera .firma { font-size: 1.75rem; }
.m-coppia .b-canzone .brano { grid-template-columns: 3.5rem auto; justify-content: center; text-align: left; }
.m-coppia .brano-perche { text-align: center; }
.m-coppia .b-canzone .azioni { justify-content: center; }

/* Casa: le foto sono stampe con il bordo, appena storte */
.m-casa { --testata-altezza: min(44svh, 26rem); }
.m-casa .b-copertina .apri-foto, .m-casa .b-foto .apri-foto {
  padding: 0.6rem 0.6rem 1.5rem; background: var(--carta); border-radius: 3px; box-shadow: var(--ombra-carta);
  transform: rotate(-1deg);
}
.m-casa .b-foto:nth-of-type(even) .apri-foto { transform: rotate(1deg); }
.m-casa .b-copertina img, .m-casa .b-foto img { border-radius: 2px; }

/* Cammino: curve più grandi e marcate, coordinate in vista */
.m-cammino { --testata-altezza: min(66svh, 38rem); }
.m-cammino .testata-curve { color: var(--pietra-forte); }
.m-cammino .coordinate { font-size: 0.9375rem; color: var(--grafite); }
.m-cammino .momento-quando { color: var(--grafite); }

/* Ricordo: calmo, niente movimento, il punto in pietra */
.m-ricordo { --testata-altezza: min(44svh, 26rem); }
.m-ricordo .testata-testo, .m-ricordo .blocco-titolo, .m-ricordo .b-citazione { text-align: center; }
.m-ricordo .testata-marchio { justify-content: center; }
.m-ricordo .testata-curve { opacity: 0.7; }
.m-ricordo .punto, .m-ricordo .momento::after { background: var(--pietra); border-color: var(--pietra); box-shadow: none; }
.m-ricordo .curve .c, .m-ricordo .punto { animation: none; stroke-dasharray: none; }
.m-ricordo .numero { font-size: 2.5rem; line-height: 2.75rem; }

/* Festa: numeri grandi, foto inclinate, il rovere in evidenza */
.m-festa .testata-testo, .m-festa .blocco-titolo { text-align: center; }
.m-festa .testata-marchio { justify-content: center; }
.m-festa .numero { font-size: 4.5rem; line-height: 4.5rem; color: var(--rovere-scuro); }
.m-festa .punto { width: 1.2rem; height: 1.2rem; margin: -0.6rem 0 0 -0.6rem; }
.m-festa .b-foto .apri-foto { transform: rotate(-1.5deg); }
.m-festa .b-foto:nth-of-type(even) .apri-foto { transform: rotate(1.5deg); }
.m-festa .galleria-griglia li:nth-child(odd) img { transform: rotate(-0.8deg); }
.m-festa .galleria-griglia li:nth-child(even) img { transform: rotate(0.8deg); }

@media (prefers-reduced-motion: reduce) {
  .m-casa .apri-foto, .m-festa .apri-foto, .galleria-polaroid figure { transform: none !important; }
}
