/* ── Versione bianca ──────────────────────────────────────
   Stessa struttura del sito, linguaggio della presentazione:
   fondo bianco puro, testo nero, un solo font (Medium Squeezed)
   in corpi grandi, etichette nere con testo bianco aderenti al testo.
   Niente grigi decorativi, bordi, ombre o angoli arrotondati.
   Si carica DOPO style.css e ne sovrascrive solo l'aspetto.
   Font: OT Neue Montreal Squeezed (cartella fonts/). */
@font-face { font-family: "Neue Montreal Squeezed"; src: url("fonts/OTNeueMontreal-MediumSqueezed.otf") format("opentype"); font-weight: 400 700; font-display: swap; }

:root,
[data-theme="light"] {
  --font: "Neue Montreal Squeezed", "Archivo Narrow", "Helvetica Neue", Arial, sans-serif;
  --bg: #fff;
  --fg: #000;
  --muted: #000;
  --line: transparent;
  --panel: #fff;
  --chip: transparent;
  --chip-on: #000;
  --chip-on-fg: #fff;
}

html, body {
  font: 500 18px/1.25 var(--font);
  letter-spacing: 0;
}
button { text-transform: none; font-weight: 500; }

/* Etichetta nera: il segno grafico della presentazione */
#title,
.group h3,
.frow.on .frow-label,
.chip.on,
.panel-bar button.on,
#emptyMsg,
.lb-title,
#aboutTitle,
.about-cols h2 {
  background: #000;
  color: #fff;
}

/* ── Immagini: collage senza ombre ───────────────────────── */
.tile.in-cloud .inner,
#stage.dense .tile.in-cloud .inner { box-shadow: none; }
.tile.dim { opacity: 0.08; }

/* ── Barra in basso: niente cornice ──────────────────────── */
#panel {
  bottom: 20px;
  width: min(1120px, calc(100% - 32px));
  border: 0;
  box-shadow: none;
  background: #fff;
}
.panel-bar {
  min-height: 0;
  padding: 0;
  align-items: stretch;
  column-gap: 16px;
}
#title {
  white-space: nowrap;
  padding: 0.12em 0.3em 0.16em;
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.05;
  font-weight: 500;
}
#title::after { opacity: 1; }
#title:hover,
.panel-bar #title:hover { opacity: 1; text-decoration: none; }
.panel-actions { align-items: center; column-gap: 4px; }
.panel-bar button { padding: 4px 8px 6px; font-size: 21px; line-height: 1.1; }
.panel-bar button:hover { opacity: 1; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.panel-bar button.on:hover { text-decoration: none; }
.panel-bar button:disabled { opacity: 0.35; text-decoration: none; }
#activeCount:not(:empty)::before { content: ""; }
#activeCount:not(:empty) {
  display: inline-block;
  margin-left: 4px;
  padding: 0 0.25em 0.06em;
  background: #000;
  color: #fff;
}

/* ── Filtri: testo nero, attivo = etichetta nera ─────────── */
#filters {
  max-height: min(62vh, 560px);
  padding: 8px 8px 24px;
  border-bottom: 0;
}
.group { padding: 0; }
.group + .group { border-top: 0; margin-top: 22px; }
.group h3 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 0.1em 0.3em 0.14em;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.1;
  text-transform: none;
}
.chips { gap: 2px 6px; align-items: baseline; }
.chip {
  padding: 2px 6px 4px;
  border: 0;
  font-size: 21px;
  line-height: 1.15;
  transition: background 150ms, color 150ms, opacity 150ms;
}
.chip:hover { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.chip.on:hover { text-decoration: none; }
/* conteggio piccolo, in apice */
.chip .n {
  margin-left: 2px;
  font-size: 11px;
  color: inherit;
  vertical-align: super;
  line-height: 0;
}
.chip.on .n { opacity: 1; }
.chip.empty, .chip.zero { opacity: 0.3; }
.frow { align-items: baseline; gap: 14px; padding: 1px 0; }
/* l'etichetta del focus resta larga quanto il testo; la colonna resta allineata */
.frow-label {
  flex: 0 0 auto;
  min-width: 0;
  padding: 2px 6px 4px;
  color: #000;
  font-size: 21px;
  line-height: 1.15;
}
.frow-label::before,
.frow.on .frow-label::before { content: none; }
.frow > .frow-label + .chips { margin-left: 0; }
@media (min-width: 721px) {
  .frow { display: grid; grid-template-columns: 120px 1fr; }
  .frow-label { justify-self: start; }
}
.frow-label:hover { color: #000; text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
.frow.on .frow-label { color: #fff; font-weight: 500; text-decoration: none; }
.frow:not(.on) .chip[data-side] { opacity: 0.4; }
.vs { padding: 0 2px; color: #000; font-size: 15px; }
#emptyMsg {
  padding: 0.1em 0.3em 0.16em;
  border: 0;
  text-transform: none;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.1;
}

/* ── Tooltip: etichetta nera, come le citazioni ──────────── */
#tip {
  max-width: min(420px, calc(100vw - 16px));
  padding: 8px 12px 10px;
  background: #000;
  color: #fff;
  font-size: 15px;
  line-height: 1.25;
}
#tip b { margin-bottom: 4px; font-size: 24px; font-weight: 500; line-height: 1.05; }
#tip span { opacity: 1; }

/* ── Lightbox ────────────────────────────────────────────── */
.lb-backdrop,
[data-theme="light"] .lb-backdrop { background: #fff; }
.lb-title {
  display: inline-block;
  align-self: flex-start; /* la didascalia è flex: l'etichetta resta larga quanto il testo */
  margin: 0 0 10px;
  padding: 0.1em 0.3em 0.16em;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.05;
  text-transform: none;
}
.lb-meta { margin: 0 0 10px; color: #000; font-size: 18px; }
/* la nota è una citazione: box nero */
.lb-note {
  margin: 0 0 12px;
  padding: 10px 12px 12px;
  background: #000;
  color: #fff;
  font-size: 18px;
  line-height: 1.25;
}
.lb-tags { gap: 2px 4px; }
.lb-tags .chip { font-size: 18px; }
.lb-close { top: 14px; right: 18px; font-size: 40px; color: #000; }

/* ── Titolo in apertura ──────────────────────────────────
   Etichetta nera grande al centro, sopra la griglia di immagini.
   Scompare appena c'è una selezione (body.has-selection) o l'about è aperto. */
#intro {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 16px 80px;
  pointer-events: none;
  transition: opacity 500ms ease, transform 700ms var(--ease);
}
#introTitle {
  /* sempre su una riga: il titolo è largo ~10.9 volte la dimensione del font */
  white-space: nowrap;
  padding: 0.16em 0.42em 0.22em;
  background: #000;
  color: #fff;
  font-size: min(7.4vw, 132px);
  font-weight: 500;
  line-height: 1;
  text-align: center;
  pointer-events: auto;
  cursor: pointer;
}
.intro-hint {
  margin: 0;
  padding: 0.1em 0.35em 0.16em;
  background: #fff;
  color: #000;
  font-size: 17px;
  text-align: center;
}
body.has-selection #intro,
body.about-open #intro {
  opacity: 0;
  transform: scale(0.97);
}
body.has-selection #introTitle,
body.about-open #introTitle { pointer-events: none; }

/* ── About: schede sparse, come le citazioni nella presentazione ── */
#about,
[data-theme="light"] #about {
  display: block;
  background: rgba(255, 255, 255, 0.86);
}
.about-card {
  position: absolute;
  padding: 12px 16px 16px;
  background: #000;
  color: #fff;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 450ms ease, transform 650ms var(--ease);
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.about-card.dragging { cursor: grabbing; }
body.about-open .about-card { opacity: 1; transform: none; }
/* compaiono nell'ordine di lettura */
body.about-open .c-lead    { transition-delay: 60ms; }
body.about-open .c-r1      { transition-delay: 140ms; }
body.about-open .c-r2      { transition-delay: 200ms; }
body.about-open .c-v1      { transition-delay: 280ms; }
body.about-open .c-v2      { transition-delay: 340ms; }
body.about-open .c-credits { transition-delay: 420ms; }

/* coppie di schede (Our research, Visual archive): partono una sotto l'altra,
   leggermente sfalsate; ognuna si può poi trascinare */
.about-group .about-card { position: relative; }
.about-group .about-card + .about-card { margin: -4px 0 0 28px; }
.about-card h2 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 0.06em 0.3em 0.12em;
  background: #fff;
  color: #000;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.1;
}
.about-card p {
  margin: 0;
  font-size: clamp(16px, min(1.5vw, 2.5vh), 26px);
  line-height: 1.2;
}
/* titolo: etichetta nera grande */
.c-title { padding: 0.12em 0.36em 0.18em; }
#aboutTitle,
.c-title #aboutTitle {
  display: block;
  margin: 0;
  padding: 0;
  font-size: clamp(34px, min(4.6vw, 8vh), 84px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
/* domanda di ricerca: testo nero grande su bianco, come le slide di testo */
.about-card.light { background: #fff; color: #000; padding: 6px 10px 10px; }
.c-lead p { font-size: clamp(22px, min(2.4vw, 4vh), 42px); line-height: 1.1; }
.c-credits p { font-size: clamp(14px, 1.1vw, 17px); text-align: center; }

/* posizioni sparse (desktop); le schede si possono trascinare */
@media (min-width: 900px) {
  #about { overflow: hidden; }
  /* disposizione d'apertura (in % dello schermo); poi le schede si trascinano */
  .c-title   { left: 0; right: 0; top: 7vh; width: fit-content; margin: 0 auto; }
  .c-lead    { left: 64.7vw; top: 28vh; width: 29vw; z-index: 3; }
  .about-group { position: absolute; }
  .g-research { left: 7.9vw; top: 26.4vh; }
  .c-r1      { width: 30vw; }
  .about-group .about-card.c-r2 { width: 28.2vw; margin: -6px 0 0 5.4vw; }
  .c-v1      { left: 56.1vw; top: 43.4vh; width: 27vw; }
  .c-v2      { left: 66.1vw; top: 60.5vh; width: 25vw; }
  .c-credits { left: 0; right: 0; bottom: 100px; width: fit-content; margin: 0 auto; }
}

/* mobile: schede una sotto l'altra, si scorre */
@media (max-width: 899px) {
  #about { padding: 40px 12px 170px; }
  .about-card {
    position: relative;
    margin: 0 0 12px;
    cursor: default;
    touch-action: auto;
  }
  .c-lead { margin-bottom: 20px; }
  .about-group { margin-bottom: 12px; }
  .about-group .about-card + .about-card { margin: -4px 0 12px 16px; }
  #aboutTitle, .c-title #aboutTitle { font-size: min(7.6vw, 40px); }
}

@media (max-width: 720px) {
  #panel { bottom: 10px; width: calc(100% - 20px); }
  .panel-bar { padding: 0; row-gap: 4px; }
  #title { width: auto; padding: 0.12em 0.3em 0.16em; font-size: 22px; }
  .panel-actions { justify-content: flex-start; width: 100%; }
  .panel-bar button { font-size: 19px; padding: 4px 6px 6px; }
  .group h3, .chip, .frow-label { font-size: 19px; }
  .frow { flex-wrap: wrap; gap: 2px 8px; }
  .frow-label { flex-basis: auto; }
  .lb-title { font-size: 24px; }
}

/* Niente titolo nella barra: all'apertura c'è quello grande al centro,
   l'about si apre anche dal pulsante "About". */
#title { display: none; }
.panel-bar { justify-content: flex-end; }

/* Titoli in maiuscolo: parentesi e segni all'altezza delle maiuscole (funzione "case" del font) */
#introTitle, #aboutTitle, #title { font-feature-settings: "case" 1; }
