/* ============================================================
   GIUSEPPE — UNA RETROSPETTIVA · 1966–2026
   Estetica: museo classico. Pareti crema, cornici scure spesse,
   dettagli oro antico, serif d'epoca (Cormorant Garamond),
   didascalie da catalogo. Il finale trapianta intatta
   "l'Unità Familiare" dal vecchio allestimento.
   ============================================================ */

:root {
  --wall:       #f6f1e7;
  --wall-soft:  #efe7d6;
  --ink:        #2b2722;
  --ink-soft:   #6e6557;
  --gold:       #a8893f;
  --frame:      #2e2922;
  --red:        #a4161a;
  --red-bright: #c1121f;
  --red-deep:   #6e0a0f;
  --gold-star:  #f2c14e;
  --maxw:       1120px;
  --display: "Cormorant Garamond", "Didot", Georgia, serif;
  --body:    "Cormorant Garamond", Georgia, serif;
  --cond:    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --hand:    "Caveat", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--wall);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.15rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grana fine da parete intonacata */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 2000;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .05;
  mix-blend-mode: multiply;
}
/* Luce da museo: vignettatura morbida */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1999;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 60%, rgba(70, 55, 25, .12) 100%);
}

img { display: block; max-width: 100%; }
a { color: inherit; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; }

/* ---------- Percorso di visita (progress) ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--gold);
  z-index: 2001; transition: width .1s linear;
}

/* ---------- Pulsante audio ---------- */
.sound-toggle {
  position: fixed; bottom: 18px; right: 18px; z-index: 2002;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .55rem 1rem;
  background: var(--wall);
  border: 1px solid var(--gold);
  box-shadow: 0 4px 14px rgba(40, 30, 10, .18);
  color: var(--ink); font-family: var(--cond);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, color .25s, border-color .25s;
}
.sound-toggle:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(40, 30, 10, .25); }
.sound-toggle.playing { color: var(--red); border-color: var(--red); }
.sound-toggle #soundIcon { font-size: 1rem; line-height: 1; }
@media (max-width: 720px) {
  .sound-toggle #soundLabel { display: none; }
  .sound-toggle { padding: .6rem .7rem; }
}

/* ============================================================
   INGRESSO — il manifesto della mostra
   ============================================================ */
.ingresso {
  position: relative;
  min-height: 100vh;
  padding: clamp(3rem, 8vh, 6rem) 5vw 12vh;
  text-align: center;
}

.museo-ente {
  font-family: var(--cond);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .5em; text-transform: uppercase;
  color: var(--gold);
}

.museo-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3.4rem, 13vw, 9.5rem);
  line-height: 1;
  letter-spacing: .06em;
  margin: clamp(1rem, 3vh, 2rem) 0 .6rem;
}

.museo-sub {
  font-style: italic;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  color: var(--ink-soft);
}

.filetto {
  width: 70px; height: 2px;
  background: var(--gold);
  margin: clamp(1.4rem, 3.5vh, 2.4rem) auto;
}

.ingresso-text {
  font-style: italic;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  line-height: 1.7;
  color: #4a4338;
  max-width: 52ch;
  margin: clamp(1.6rem, 4vh, 2.6rem) auto;
}
.ingresso-text strong { font-style: normal; color: var(--ink); }
@media (max-width: 700px) { .br-desk { display: none; } }

.hero-opera { max-width: 380px; margin: 0 auto; }
.hero-camera { max-width: 520px; margin: 0 auto; }

.ingresso .scroll-hint {
  margin-top: clamp(2rem, 5vh, 3.4rem);
  font-family: var(--cond);
  font-size: .7rem; font-weight: 600;
  letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold);
}

/* ============================================================
   SALE — struttura espositiva
   ============================================================ */
.sala {
  position: relative;
  padding: clamp(4.5rem, 11vh, 8rem) 5vw;
  overflow: hidden;
  text-align: center;
}
.sala.alt { background: var(--wall-soft); }
/* Filetto dorato che separa le sale */
.sala::before {
  content: "";
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(320px, 50vw); height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.sala-label {
  font-family: var(--cond);
  font-size: .72rem; font-weight: 600;
  letter-spacing: .5em; text-transform: uppercase;
  color: var(--gold);
}

.sala-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.08;
  margin: .5rem auto .2rem;
  max-width: 20ch;
}

.sala-period {
  font-style: italic;
  font-size: clamp(.95rem, 1.8vw, 1.15rem);
  color: var(--ink-soft);
}

.sala-text {
  max-width: 58ch;
  margin: clamp(1.2rem, 3vh, 2rem) auto 0;
  font-size: clamp(1.08rem, 2vw, 1.3rem);
  line-height: 1.65;
  color: #4a4338;
}
.sala-text i { color: var(--ink); }

/* ---------- Pareti di quadri ---------- */
.parete {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1.6rem, 3.5vw, 2.8rem);
  align-items: end;
  justify-items: center;
  margin-top: clamp(2.4rem, 6vh, 4rem);
}
.parete + .parete { margin-top: clamp(2rem, 5vh, 3.2rem); }
.parete-solo { grid-template-columns: 1fr; }

/* ---------- Le opere ---------- */
.opera {
  max-width: 360px;
  width: 100%;
}
.opera img {
  width: 100%; height: auto;
  border: 10px solid var(--frame);
  outline: 1px solid rgba(168, 137, 63, .55);
  outline-offset: -13px;
  box-shadow: 0 14px 34px rgba(40, 30, 10, .28);
  background: #fff;
}
.opera.wide   { max-width: 520px; }
.opera.grande { max-width: 640px; }
.opera.grande img { border-width: 14px; box-shadow: 0 20px 50px rgba(40, 30, 10, .35); }

.opera figcaption {
  font-style: italic;
  font-size: .92rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: .9rem;
  padding: 0 .3rem;
}
.opera-num {
  font-style: normal;
  font-family: var(--cond);
  font-size: .68rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold);
}

/* ============================================================
   ALA ROSSA — l'Unità Familiare (trapianto dal vecchio sito)
   ============================================================ */
.article {
  position: relative;
  padding: clamp(4rem, 10vh, 7rem) 5vw;
  overflow: hidden;
}

#comunista {
  background: #1f0405;
  color: #ffe9df;
}
.red-flood {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(circle at 50% 42%, var(--red-bright) 0%, var(--red-deep) 62%, #1f0405 100%);
  opacity: 0; transform: scale(.65);
}
#comunista .wrap { position: relative; z-index: 2; text-align: center; }

.unita-mast { margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.unita-top {
  font-family: var(--cond); font-size: .7rem; font-weight: 600;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold-star);
  border-top: 1px solid rgba(255,233,223,.55);
  border-bottom: 1px solid rgba(255,233,223,.55);
  padding: .4rem 0;
}
.unita-title {
  font-family: var(--display);
  font-style: italic; font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 1.1;
  color: #fff;
  margin: .6rem 0 .4rem;
  text-shadow: 0 4px 30px rgba(0,0,0,.45);
}
.unita-rule { border-bottom: 3px double rgba(255,233,223,.55); }

.headline {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5.6vw, 4.2rem);
  line-height: 1.04;
  text-align: center;
  max-width: 22ch;
  margin: 0 auto .9rem;
}
.deck {
  font-style: italic;
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-align: center;
  max-width: 56ch;
  margin: 0 auto clamp(1.6rem, 3.5vw, 2.6rem);
}
.body-cols { max-width: 64ch; margin: 0 auto; }
.lead { font-size: clamp(1.05rem, 1.9vw, 1.25rem); }

#comunista .headline { color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.4); }
#comunista .deck { color: #ffd9d0; }
#comunista .lead { color: #ffe4df; text-align: center; }
#comunista .body-cols { text-align: center; }
#comunista .accent { color: var(--gold-star); font-style: italic; }

.media { margin: clamp(2rem, 4.5vw, 3.4rem) auto 0; width: 100%; }
.media + .media { margin-top: 1.6rem; }
.duo { display: grid; gap: clamp(.9rem, 2vw, 1.4rem); align-items: start; grid-template-columns: 1fr 1fr; }
.tall .photo { max-width: 440px; margin: 0 auto; }
.red-duo { max-width: 760px; }
.red-duo .photo { max-width: 360px; margin: 0 auto; }

.photo {
  background: #fff;
  border: 1px solid #1f0405;
  padding: 8px 8px 0;
  box-shadow: 6px 6px 0 rgba(0,0,0,.4);
}
.photo img { width: 100%; height: auto; }
#comunista .photo img { filter: sepia(.25) saturate(1.15) contrast(1.05); }
#comunista .photo figcaption {
  font-family: var(--cond);
  font-size: .74rem; font-weight: 500;
  letter-spacing: .05em;
  color: var(--red-deep);
  padding: .5rem .15rem .55rem;
  border-top: 1px dotted rgba(31,4,5,.35);
  margin-top: 8px;
}
.postilla { margin: 1.8rem auto 0; max-width: 60ch; }

.stamp {
  font-family: var(--cond); font-weight: 700;
  font-size: clamp(.8rem, 1.6vw, 1.05rem);
  letter-spacing: .22em; text-transform: uppercase;
  border: 3px double var(--gold-star);
  border-radius: 3px;
  padding: .4em .9em;
  pointer-events: none;
  z-index: 5;
}
.stamp-red {
  position: relative; display: inline-block;
  color: var(--gold-star); border-color: var(--gold-star);
  margin-bottom: 1.2rem;
  transform: rotate(-5deg);
}

.star {
  position: absolute; z-index: 1; color: var(--gold-star); opacity: 0;
  font-size: 2rem;
}

/* ============================================================
   USCITA — auguri e firme
   ============================================================ */
#uscita { padding-bottom: 6vh; }

.annuncio {
  position: relative;
  border: 1px solid var(--gold);
  outline: 3px double var(--gold);
  outline-offset: 7px;
  padding: clamp(2.2rem, 6vw, 4.5rem) clamp(1.4rem, 5vw, 4rem);
  text-align: center;
  max-width: 840px;
  margin: clamp(2rem, 5vh, 3rem) auto 0;
  background: var(--wall);
}
.annuncio-orn { font-size: 1.6rem; color: var(--gold); }

.closing-head {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.08;
  margin-top: 1rem;
}

.signoff {
  font-style: italic;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--ink-soft);
  margin: 1.6rem 0 2.2rem;
  line-height: 1.5;
}

.closing-opera { max-width: 420px; margin: 0 auto 2.4rem; }

.family {
  margin-bottom: 1.4rem;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
}
.family span { display: inline-block; margin: 0 .25rem; }
.hand {
  font-family: var(--hand);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.15;
}
.family .hand { font-size: inherit; color: var(--ink); }
.heart { color: var(--red-bright); font-size: .6em; vertical-align: .25em; }

.colophon {
  margin-top: clamp(2.5rem, 6vh, 4rem);
  border-top: 1px solid var(--gold);
  padding-top: .7rem;
  text-align: center;
  font-family: var(--cond); font-size: .66rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft);
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 720px) {
  .parete { grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  .parete-solo { grid-template-columns: 1fr; }
  .opera figcaption { font-size: .8rem; }
  .duo { grid-template-columns: 1fr; }
  .red-duo .photo { max-width: 440px; }
}
@media (max-width: 480px) {
  .parete { grid-template-columns: 1fr; }
}

/* Rispetta chi preferisce meno movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
