/* ==========================================================================
   Andrea Toschi — Organista
   Foglio di stile unico. Nessuna dipendenza esterna.

   Idea guida: la pagina di un libro liturgico. Carta avorio, inchiostro nero,
   un solo colore d'accento (il rosso delle rubriche) usato per le indicazioni:
   date, etichette, iniziali. Nessuna animazione.
   ========================================================================== */

/* ---------- Caratteri (ospitati in locale, licenza SIL OFL) ---------- */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-wght-normal.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: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-wght-italic.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: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-wght-normal.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: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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;
}

/* ---------- Variabili ---------- */

:root {
  color-scheme: light;

  --paper: #f6f2e9;
  --paper-deep: #ede7da;
  --ink: #1e1b18;
  --ink-soft: #554e46;
  --rule: #d6ccba;
  --rubric: #98221a;

  --night: #1a1714;
  --night-raised: #26221d;
  --night-ink: #ece5d6;
  --night-soft: #b9af9c;
  --night-rule: #3b352d;

  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --display: "Cormorant Garamond", "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --edge: max(var(--gutter), calc((100vw - var(--wide)) / 2));
  --section: clamp(4.5rem, 9vw, 8.5rem);
  --header: 4.25rem;
  --wide: 80rem;
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 1.5rem);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.1875rem, 1.06rem + 0.4vw, 1.375rem);
  line-height: 1.6;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, iframe, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
h1, h2, h3, h4, .hero-sub, .where { text-wrap: balance; }
p, li { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }

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

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

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

em, i, cite { font-style: italic; }
strong, b { font-weight: 600; }

::selection { background: var(--rubric); color: var(--paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; text-decoration: none;
}
.skip:focus { top: 1rem; color: var(--paper); }

/* ---------- Elementi ricorrenti ---------- */

/* La rubrica: etichetta in rosso, maiuscolo spaziato. */
.rubric {
  font-size: 0.74em;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rubric);
  line-height: 1.3;
}

/* Fregio: profilo di una facciata d'organo "a cuspide". */
.pipes { width: 4.5rem; height: 2rem; color: var(--rubric); }
.pipes line { stroke: currentColor; stroke-width: 1.25; vector-effect: non-scaling-stroke; }


.section {
  padding: var(--section) var(--edge);
  border-top: 1px solid var(--rule);
}
.section--deep { background: var(--paper-deep); }

.section-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.75rem, 2rem + 3.4vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  margin-top: 0.6rem;
}
.section-head .intro {
  margin-top: 1.25rem;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 24rem;
}

/* Impaginazione a due colonne: titolo a sinistra, contenuto a destra. */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 5rem);
}
@media (min-width: 62rem) {
  .split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .split > .section-head { position: sticky; top: calc(var(--header) + 2.5rem); align-self: start; }
}

/* Impaginazione a tutta larghezza: titolo sopra, contenuto sotto. */
.stack > .section-head { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }

.prose { max-width: 36rem; }
.prose p + p { margin-top: 1em; }

/* ---------- Testata ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  min-height: var(--header);
  padding: 0 var(--edge);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }

.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.75rem; }
.site-nav a {
  display: block;
  padding: 0.6rem 0;
  font-size: 1.0625rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--rubric); border-bottom-color: var(--rubric); }

.nav-toggle { display: none; }

@media (max-width: 74.99rem) {
  .site-header { flex-wrap: wrap; }
  .site-nav { flex-basis: 100%; padding-bottom: 0.75rem; }
  /* Con JavaScript attivo il menu si apre e chiude dal pulsante «Menu». */
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: 0.6rem;
    min-height: 2.75rem; padding: 0 0.25rem;
    font-size: 1.0625rem;
  }
  .js .nav-toggle::after {
    content: ""; width: 1.25rem; height: 0.5rem;
    border-top: 1px solid currentColor; border-bottom: 1px solid currentColor;
  }
  .js .site-nav { display: none; padding-bottom: 1.25rem; }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { display: block; border-top: 1px solid var(--rule); }
  .js .site-nav a { padding: 0.8rem 0; font-size: 1.25rem; border-bottom: 1px solid var(--rule); }
}

/* ---------- Apertura ---------- */

.hero { display: grid; background: var(--paper); }

.hero-text {
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 4rem) clamp(2.5rem, 5vw, 4rem) var(--edge);
  display: flex; flex-direction: column; justify-content: center;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(3.75rem, 2rem + 7vw, 7.5rem);
  line-height: 0.9;
  letter-spacing: -0.02em;
  margin: 1.25rem 0 0 -0.04em;
}
.hero h1 span { display: block; }

.hero-sub {
  margin-top: 1.5rem;
  font-style: italic;
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.7rem);
  line-height: 1.35;
  max-width: 22rem;
}

.hero .pipes { margin-top: 1.75rem; }

.next {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  max-width: 30rem;
}
.next-date { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.2; margin-top: 0.5rem; }
.next-where { margin-top: 0.15rem; }
.next-prog { color: var(--ink-soft); font-style: italic; margin-top: 0.15rem; }
.next-link { display: inline-block; margin-top: 0.9rem; font-size: 1.0625rem; }

.hero-photo { align-self: center; background: var(--night); }
.hero-photo img { width: 100%; aspect-ratio: 1920 / 1228; object-fit: cover; }

@media (min-width: 62rem) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 8fr);
    align-items: center;
    min-height: min(calc(100svh - var(--header)), 48rem);
  }
}

/* ---------- Biografia ---------- */

.bio-aside .portrait { margin-top: 2.25rem; max-width: 22rem; }
.bio-aside .portrait img { width: 100%; }

.langs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 1.75rem; }
.langs[hidden] { display: none; }
.langs button {
  min-height: 2.75rem;
  font-size: 1.0625rem;
  border-bottom: 1px solid transparent;
}
.langs button:hover { color: var(--rubric); }
.langs button[aria-pressed="true"] { color: var(--rubric); border-bottom-color: var(--rubric); }

.bio-panel + .bio-panel { margin-top: 3.5rem; padding-top: 3rem; border-top: 1px solid var(--rule); }
.js .bio-panel + .bio-panel { margin-top: 0; padding-top: 0; border-top: 0; }
.bio-panel h3 { margin-bottom: 1.25rem; }
.js .bio-panel h3 { display: none; }

.bio-panel p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 500;
  font-size: 4.9em;
  line-height: 0.74;
  padding: 0.07em 0.09em 0 0;
  color: var(--rubric);
}
.bio-panel .name { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.84em; font-weight: 500; }

/* ---------- Concerti ---------- */

.year + .year, .archive { margin-top: 3.5rem; }

.year h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3rem);
  line-height: 1;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--ink);
}

.concert {
  display: grid;
  gap: 0.2rem 2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 40rem) {
  .concert { grid-template-columns: 10.5rem minmax(0, 1fr); }
}

.when { color: var(--rubric); line-height: 1.35; }
.when time { display: block; font-weight: 500; }
.when .hour { display: block; font-size: 0.9em; }
.when .tag { display: none; margin-top: 0.4rem; }

.where { font-weight: 500; line-height: 1.35; }
.where .country { font-weight: 400; color: var(--ink-soft); }
.prog { color: var(--ink-soft); line-height: 1.45; margin-top: 0.2rem; }

.concert.is-upcoming .when .tag { display: block; }

.archive > summary {
  cursor: pointer;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 1.6rem; line-height: 1.2;
  list-style: none;
}
.archive > summary::-webkit-details-marker { display: none; }
.archive > summary::after { content: "Apri"; font-family: var(--serif); font-weight: 400; font-size: 1.0625rem; color: var(--rubric); }
.archive[open] > summary::after { content: "Chiudi"; }
.archive > summary:hover { color: var(--rubric); }
.archive .year:first-of-type { margin-top: 3rem; }

/* ---------- Collaborazioni ---------- */

.duo { display: grid; gap: 2rem clamp(2rem, 5vw, 5rem); align-items: start; }
.duo + .duo { margin-top: clamp(3.5rem, 7vw, 6rem); padding-top: clamp(3.5rem, 7vw, 6rem); border-top: 1px solid var(--rule); }
.duo figure { max-width: 30rem; }
.duo h3 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2rem, 1.6rem + 1.5vw, 2.75rem); line-height: 1.05;
  margin: 0.5rem 0 1.25rem;
}
.duo .translation { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-style: italic; }
@media (min-width: 52rem) {
  .duo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .duo--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .duo--flip figure { order: 2; justify-self: end; }
}

/* ---------- Direzione artistica ---------- */

.church h3 {
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.5rem); line-height: 1.1;
}
.church address { font-style: italic; color: var(--ink-soft); margin-top: 0.4rem; }
.plates { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 2rem 0 2.5rem; }
.plates img { width: auto; height: 11rem; }
@media (max-width: 30rem) { .plates img { height: 8.5rem; } }
.church .concert:first-of-type { border-top: 1px solid var(--ink); }

/* ---------- Discografia ---------- */

/* Due colonne: a sinistra i dischi da solista, a destra quelli di musica da camera. */
.album-groups { display: grid; gap: 3.5rem clamp(2.5rem, 5vw, 5rem); align-items: start; }
@media (min-width: 62rem) { .album-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.group-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.6rem + 1vw, 2.4rem);
  line-height: 1.1;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--ink);
}
.group-title + .albums > .album:first-child { border-top: 0; }

.album {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding: 2.25rem 0;
  border-top: 1px solid var(--rule);
}
@media (min-width: 36rem) { .album { grid-template-columns: 8.125rem minmax(0, 1fr); gap: 2rem; } }
@media (max-width: 35.99rem) {
  /* Su schermi stretti la copertina resta accanto al titolo e i brani occupano tutta la riga. */
  .album { display: block; }
  .album::after { content: ""; display: block; clear: both; }
  .album .cover { float: left; width: 5.75rem; margin: 0.2rem 1.1rem 0.6rem 0; }
  .album .tracks, .album .programme, .album .album-links { clear: both; }
}

.cover img { width: 100%; box-shadow: 0 1px 2px rgb(30 27 24 / 0.18), 0 8px 22px -10px rgb(30 27 24 / 0.35); }

.album h4 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.55rem, 1.4rem + 0.6vw, 1.9rem); line-height: 1.12;
  margin-top: 0.35rem;
}
.album-meta { color: var(--ink-soft); font-size: 0.92em; line-height: 1.45; margin-top: 0.6rem; }

.tracks { margin-top: 1.1rem; border-top: 1px solid var(--rule); }
.track { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
.track-title { display: block; line-height: 1.35; }
.track audio { width: 100%; margin-top: 0.5rem; height: 2.5rem; }

/* Lettore audio (attivato da JavaScript; senza, resta il lettore del browser). */
.track.is-player { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr) auto; gap: 0 0.9rem; align-items: center; }
.track.is-player audio { display: none; }
.play {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--ink);
  display: grid; place-items: center;
}
.play:hover { border-color: var(--rubric); color: var(--rubric); }
.play svg { width: 0.95rem; height: 0.95rem; fill: currentColor; }
.play .i-pause { display: none; }
.track.is-playing .play { background: var(--rubric); border-color: var(--rubric); color: var(--paper); }
.track.is-playing .play .i-play { display: none; }
.track.is-playing .play .i-pause { display: block; }
.track-time { font-size: 0.9em; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seek {
  grid-column: 2 / -1;
  width: 100%; height: 1.5rem; margin: 0.15rem 0 0;
  -webkit-appearance: none; appearance: none; background: none; cursor: pointer;
  accent-color: var(--rubric);
}
.seek[hidden] { display: none; }
.seek::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(to right, var(--rubric) var(--played, 0%), var(--rule) var(--played, 0%)); }
.seek::-moz-range-track { height: 2px; background: var(--rule); }
.seek::-moz-range-progress { height: 2px; background: var(--rubric); }
.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 0.8rem; height: 0.8rem; margin-top: calc(-0.4rem + 1px); border-radius: 50%; background: var(--rubric); }
.seek::-moz-range-thumb { width: 0.8rem; height: 0.8rem; border: 0; border-radius: 50%; background: var(--rubric); }

.programme { margin-top: 0.9rem; }
.programme summary {
  cursor: pointer; display: inline-block; min-height: 2.25rem; padding: 0.3rem 0;
  font-size: 0.95em; color: var(--rubric);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
  list-style: none;
}
.programme summary::-webkit-details-marker { display: none; }
.programme summary::before { content: "+ "; }
.programme[open] summary::before { content: "– "; }
.programme p, .programme li { font-size: 0.92em; line-height: 1.5; color: var(--ink-soft); }
.programme p + p { margin-top: 0.6em; }
.programme li + li { margin-top: 0.35em; }
.programme b { font-weight: 500; color: var(--ink); }

.album-links { margin-top: 1rem; line-height: 2; }
.album-links a { padding: 0.35rem 0; white-space: nowrap; }

/* ---------- Video ---------- */

.section--night { background: var(--night); color: var(--night-ink); border-top: 0; }
.section--night .rubric { color: var(--night-soft); }
.section--night .section-head .intro { color: var(--night-soft); }
.section--night :focus-visible { outline-color: var(--night-ink); }

.videos { display: grid; gap: 2.75rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

.video-frame {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--night-raised);
  border: 1px solid var(--night-rule);
  text-decoration: none; color: var(--night-ink);
}
.video-frame img { width: 100%; height: 100%; object-fit: cover; }
.video-frame .typo {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 1.5rem;
  font-family: var(--display); font-style: normal; font-weight: 500; font-size: 1.7rem; line-height: 1.1;
}
.video-frame .typo small { display: block; margin-top: 0.5rem; font-family: var(--serif); font-size: 0.95rem; font-style: italic; color: var(--night-soft); }
.video-frame .badge {
  position: absolute; left: 0.9rem; bottom: 0.9rem;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: rgb(26 23 20 / 0.82); border: 1px solid rgb(236 229 214 / 0.7); color: var(--night-ink);
}
.video-frame .badge svg { width: 1rem; height: 1rem; fill: currentColor; margin-left: 0.15rem; }
.video-frame:hover { color: var(--night-ink); border-color: var(--night-ink); }
.video-frame:hover .badge { background: var(--night-ink); color: var(--night); }

.video-title { margin-top: 0.9rem; line-height: 1.3; }
.video-title .composer { display: block; font-size: 0.74em; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--night-soft); margin-bottom: 0.25rem; }
.video-title .work { font-family: var(--display); font-weight: 500; font-size: 1.45rem; line-height: 1.15; }
.video-title .note { display: block; color: var(--night-soft); font-style: italic; font-size: 0.92em; margin-top: 0.15rem; }

.video-more { margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid var(--night-rule); }
.video-more a { text-decoration-color: var(--night-soft); }
.video-more a:hover { color: #fff; }

/* ---------- Fotografie ---------- */

.gallery { columns: 2; column-gap: 0.75rem; }
@media (min-width: 40rem) { .gallery { columns: 3; column-gap: 1rem; } }
@media (min-width: 68rem) { .gallery { columns: 4; column-gap: 1.25rem; } }
.gallery li { break-inside: avoid; margin-bottom: 0.75rem; }
@media (min-width: 40rem) { .gallery li { margin-bottom: 1rem; } }
@media (min-width: 68rem) { .gallery li { margin-bottom: 1.25rem; } }
.gallery a { display: block; background: var(--rule); }
.gallery img { width: 100%; }
.gallery a:hover img { opacity: 0.88; }

/* ---------- Contatti ---------- */

.contacts { display: grid; gap: 2.5rem clamp(2rem, 5vw, 4rem); }
@media (min-width: 46rem) { .contacts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.contacts > div { padding-top: 1.25rem; border-top: 1px solid var(--ink); }
.contacts .value {
  margin-top: 0.75rem;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.9rem); line-height: 1.25;
  overflow-wrap: anywhere;
}
.contacts address { font-style: normal; }
.contacts .more { margin-top: 0.75rem; font-size: 1.0625rem; }

/* ---------- Piè di pagina ---------- */

.site-footer {
  background: var(--night); color: var(--night-soft);
  padding: clamp(3rem, 6vw, 5rem) var(--edge);
  text-align: center;
}
.site-footer .pipes { margin: 0 auto 1.5rem; color: var(--night-soft); }
.site-footer .sign { font-family: var(--display); font-weight: 500; font-size: 1.9rem; color: var(--night-ink); line-height: 1.2; }
.site-footer p + p { margin-top: 0.5rem; }
.site-footer small { font-size: 1rem; }
.site-footer a { text-decoration-color: var(--night-soft); }
.site-footer a:hover { color: var(--night-ink); }

/* ---------- Finestra per fotografie e video ---------- */

.viewer {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgb(20 17 15 / 0.97); color: var(--night-ink);
}
.viewer::backdrop { background: rgb(20 17 15 / 0.97); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }

.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem var(--gutter); }
.viewer-count { color: var(--night-soft); font-variant-numeric: tabular-nums; }
.viewer button {
  min-height: 2.75rem; padding: 0 1rem;
  border: 1px solid var(--night-rule);
  font-size: 1.0625rem;
}
.viewer button:hover { border-color: var(--night-ink); }
.viewer :focus-visible { outline-color: var(--night-ink); }

.viewer-stage { display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.viewer-stage .player { width: min(100%, calc((100dvh - 12rem) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.viewer-stage .player iframe, .viewer-stage .player video { width: 100%; height: 100%; border: 0; }

.viewer-foot { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem var(--gutter) 1.25rem; min-height: 5rem; text-align: center; }
.viewer-caption { font-family: var(--display); font-size: 1.4rem; line-height: 1.2; }
.viewer-nav { display: flex; gap: 0.75rem; }
.viewer-nav[hidden] { display: none; }

/* ---------- Movimento ridotto e stampa ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .section--night, .langs, .viewer, .track audio, .play, .seek, .next-link { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .section { padding: 1.5rem 0; }
  .hero-photo { display: none; }
  .archive > summary::after { content: ""; }
  .site-footer { background: none; color: #000; }
}
