/* ─── Atmospheric Gallery ──────────────────────────────────────
   Pagina galleria immersiva. Fullscreen canvas + UI overlay.
─────────────────────────────────────────────────────────────── */

/* ── Pagina ──────────────────────────────────────────────────── */
.atmospheric {
  background-color: #0d0907; /* aggiornato via JS per ogni slide */
  transition: background-color 1.2s ease;
  /* Scrollabile: il canvas è fixed, le sezioni sotto lo coprono */
}

/* Spacer: occupa il primo 100vh (la galleria) */
.atm-stage {
  position: relative;
  height: 100dvh;
  z-index: 0;
}

/* Sezioni sotto la galleria — coprono il canvas fixed */
.atm-unsplash,
.page-atmospheric .chapter,
.page-atmospheric .contact,
.page-atmospheric .cities-strip,
.page-atmospheric .footer {
  position: relative;
  z-index: 5;
  background: var(--bg);
}
.page-atmospheric .cities-strip { background: var(--bg); }

/* ── Rail header — trasparente sul canvas ────────────────────── */
.page-atmospheric .rail {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
/* Nessun fade sopra le foto — immagini naturali */
/* Testo rail leggermente più luminoso */
.page-atmospheric .rail .mark,
.page-atmospheric .rail .nav a,
.page-atmospheric .rail .meta { opacity: 0.85; }
.page-atmospheric .rail .nav a:hover,
.page-atmospheric .rail .mark:hover { opacity: 1; }

/* ── Tx-rail — semi-trasparente ──────────────────────────────── */
.page-atmospheric .tx-rail {
  opacity: 0.55;
  transition: opacity 0.3s;
}
.page-atmospheric .tx-rail:hover { opacity: 1; }

/* ── Side rails — semi-trasparenti ──────────────────────────── */
.page-atmospheric .side-rail { opacity: 0.3; }

/* ── Freq badge ──────────────────────────────────────────────── */
.page-atmospheric .freq-badge { opacity: 0.45; }

/* ── Grain — disabilitato su questa pagina ───────────────────── */
.page-atmospheric .grain { display: none; }

/* ── Canvas Three.js ─────────────────────────────────────────── */
.atm-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  transition: opacity 0.15s linear;
}

/* Caption + counter: stesso fade del canvas */
.atm-caption,
#atm-num {
  transition: opacity 0.15s linear;
}


/* ── Counter top-right ───────────────────────────────────────── */
.atm-counter {
  position: fixed;
  top: clamp(20px, 3vh, 32px);
  right: var(--pad-x, 48px);
  z-index: 10;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(236,232,225,.5);
  pointer-events: none;
}

/* ── Caption area — basso ────────────────────────────────────── */
.atm-caption {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: clamp(28px, 5vh, 52px) var(--pad-x, 48px) clamp(28px, 5vh, 52px);
  /* Gradiente rimosso — foto naturali; ombra sul testo per leggibilità */
  text-shadow: 0 1px 14px rgba(10, 8, 6, 0.65);
  pointer-events: none;
}

/* ── Scroll hint — centrato in basso ─────────────────────────── */
.atm-scroll {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 3.5vh, 34px);
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(236, 232, 225, 0.55);
  text-shadow: 0 1px 10px rgba(10, 8, 6, 0.6);
  pointer-events: none;
  transition: opacity 0.15s linear;
}
.atm-scroll i {
  position: relative;
  width: 1px;
  height: 30px;
  background: rgba(236, 232, 225, 0.18);
  overflow: hidden;
}
.atm-scroll i::after {
  content: '';
  position: absolute;
  left: 0;
  top: -50%;
  width: 100%;
  height: 50%;
  background: rgba(236, 232, 225, 0.8);
  animation: atmScrollDrop 2.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes atmScrollDrop {
  to { top: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .atm-scroll i::after { animation: none; }
}
/* Su schermi stretti la caption occupa il centro: nascondi l'hint */
@media (max-width: 640px) {
  .atm-scroll { display: none; }
}

/* Testo caption sinistra — i testi sono ingranditi per più presenza.
   pointer-events: all così il pulsante download è cliccabile (la
   .atm-caption attorno resta non-cliccabile per non rubare il mouse). */
.atm-caption-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.atm-caption-left > * { pointer-events: auto; }
.atm-location {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent, #c87850);
}
.atm-year {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(236,232,225,.5);
}
.atm-desc {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  font-weight: 400;
  color: rgba(236,232,225,.92);
  line-height: 1.32;
  max-width: 22ch;
  margin-top: 12px;
}

/* Pulsante "Scarica gratis" — scarica l'immagine della slide corrente */
.atm-download {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 13px 22px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink, #ece8e1);
  text-decoration: none;
  border: 1px solid rgba(236,232,225,.22);
  border-radius: 2px;
  background: rgba(12,16,26,.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  text-shadow: none;
  transition: border-color .3s ease, background .3s ease, color .3s ease;
}
.atm-download:hover {
  border-color: var(--accent, #c87850);
  background: rgba(200,120,80,.12);
  color: #fff;
}
.atm-download .atm-dl-ico {
  font-size: 13px;
  line-height: 1;
  transition: transform .3s ease;
}
.atm-download:hover .atm-dl-ico { transform: translateY(2px); }

/* ── Navigazione destra ──────────────────────────────────────── */
.atm-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  pointer-events: all;
}

/* Dots */
.atm-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.atm-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(236,232,225,.2);
  border: none; cursor: none;
  padding: 0;
  transition: background 0.35s, transform 0.35s;
}
.atm-dot.active {
  background: var(--accent, #c87850);
  transform: scale(1.4);
}
.atm-dot:hover { background: rgba(236,232,225,.5); }

/* Frecce */
.atm-arrows {
  display: flex;
  gap: 10px;
}
.atm-prev,
.atm-next {
  width: 44px; height: 44px;
  border: 1px solid rgba(236,232,225,.15);
  background: transparent;
  color: rgba(236,232,225,.55);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.atm-prev:hover,
.atm-next:hover {
  border-color: var(--accent, #c87850);
  color: var(--accent, #c87850);
  background: rgba(200,120,80,.06);
}

/* Numero slide */
#atm-num {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(236,232,225,.28);
}


/* ══════════════════════════════════════════════════════════════
   SEZIONE UNSPLASH
══════════════════════════════════════════════════════════════ */

.atm-unsplash {
  padding: clamp(64px, 10vh, 120px) var(--pad-x, 48px);
  border-top: 1px solid var(--ink-ghost);
}

.atm-uns-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

/* Testo sinistra */
.atm-uns-eye {
  display: block;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
  margin-bottom: 20px;
}
.atm-uns-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
  margin: 0 0 20px;
}
.atm-uns-title .ital {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--accent);
}
.atm-uns-body {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--ink-soft);
  margin: 0 0 32px;
}
.atm-uns-like-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  margin-bottom: 32px;
}
.atm-uns-like-note .heart {
  color: #e05c7a;
  font-size: 13px;
  animation: heartbeat 2s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.2); }
}
.atm-uns-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(200,120,80,.45);
  padding: 14px 24px;
  text-decoration: none;
  transition: border-color .25s, background .25s;
}
.atm-uns-cta:hover {
  border-color: var(--accent);
  background: rgba(200,120,80,.06);
}

/* Griglia foto destra */
.atm-uns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.atm-uns-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/2;
  display: block;
  text-decoration: none;
}
.atm-uns-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.atm-uns-thumb:hover img {
  transform: scale(1.04);
}
.atm-uns-thumb-like {
  position: absolute;
  bottom: 10px; right: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(236,232,225,.7);
  background: rgba(10,9,8,.6);
  padding: 5px 10px;
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s, transform .3s;
}
.atm-uns-thumb:hover .atm-uns-thumb-like {
  opacity: 1;
  transform: translateY(0);
}
.atm-uns-thumb-loc {
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(236,232,225,.55);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .atm-uns-inner { grid-template-columns: 1fr; }
  .atm-uns-grid  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .atm-uns-grid  { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .atm-caption {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: clamp(24px, 6vh, 44px);
  }
  .atm-nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .atm-desc { max-width: 100%; font-size: clamp(1.3rem, 5.5vw, 1.7rem); }
  .atm-location { font-size: 13px; }
  .atm-download { margin-top: 16px; }
  .atm-header-back { display: none; }
  .atm-counter { display: none; }
}

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .atm-dot, .atm-prev, .atm-next { transition: none; }
  .atmospheric { transition: none; }
}
