/* ============================================
   IL VOLO SKAPPA — hero della home
   Nessuna libreria: la fiancata dell'aereo e gli oblo' sono CSS puro,
   lo scorrimento e' scroll-snap nativo. js/volo.js aggiunge solo
   frecce, tastiera, trascinamento e la transizione porta.
   ============================================ */

.volo {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}
/* .hero e' flex per centrare il suo contenuto: con l'aereo in mezzo servono due
   righe impilate, altrimenti testo e fiancata diventano due colonne affiancate. */
.hero.volo {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  /* .hero taglia quel che esce e ha un'altezza minima pensata per il solo testo:
     con l'aereo dentro, tagliava la parte bassa degli oblo' e tutto il cartellino. */
  overflow: visible;
  min-height: 0;
}
.hero.volo .hero-content { padding-bottom: 0; }
.volo-aereo { width: 100%; }

/* ---- La fiancata dell'aereo ---- */
.volo-aereo {
  position: relative;
  z-index: 3;
  margin-top: 2.5rem;
  padding: 0 0 2.25rem;
  border-top-left-radius: 3.5rem;
  border-top-right-radius: 3.5rem;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.05) 14%, rgba(6,20,52,0.9) 46%, rgba(3,16,48,0.98) 100%),
    linear-gradient(90deg, #0a1f3d 0%, #16375f 30%, #1d4471 50%, #16375f 70%, #0a1f3d 100%);
  box-shadow: 0 -18px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.28);
}

/* Linea di rivetti sotto il bordo superiore */
.volo-aereo::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 1.1rem;
  height: 3px;
  background-image: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.34) 0 3px,
    transparent 3px 18px);
  opacity: 0.75;
}

/* ---- Il portello, disegnato a sinistra ---- */
.volo-portello {
  position: absolute;
  left: clamp(0.75rem, 3vw, 2.5rem);
  top: 2.6rem;
  width: clamp(46px, 5vw, 68px);
  height: clamp(76px, 8vw, 108px);
  border: 2px solid rgba(255,255,255,0.22);
  border-radius: 1.6rem 1.6rem 1.1rem 1.1rem;
  background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.02));
  box-shadow: inset 0 0 0 4px rgba(0,0,0,0.14);
  pointer-events: none;
}
.volo-portello::after {
  content: '';
  position: absolute;
  right: 7px;
  top: 50%;
  width: 12px; height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.4);
}
@media (max-width: 820px) { .volo-portello { display: none; } }

/* ---- La striscia di oblo': scroll-snap nativo ---- */
.volo-strip-wrap {
  position: relative;
  padding-top: 2.6rem;
}
.volo-strip {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.5rem calc(50vw - clamp(56px, 7.5vw, 84px));
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.volo-strip::-webkit-scrollbar { display: none; }
.volo-strip.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; }

/* ---- Un oblo' ---- */
.volo-oblo {
  position: relative;
  flex: 0 0 auto;
  width: clamp(112px, 15vw, 168px);
  height: clamp(140px, 19vw, 210px);
  scroll-snap-align: center;
  border-radius: 50% / 40%;
  overflow: hidden;
  isolation: isolate;
  background: #05122f;
  border: 3px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 0 0 6px rgba(3,16,48,0.85),
    inset 0 6px 22px rgba(0,0,0,0.55),
    0 10px 28px rgba(0,0,0,0.4);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.45s;
  text-decoration: none;
}
.volo-oblo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Riflesso sul vetro */
.volo-oblo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg,
    rgba(255,255,255,0.42) 0%,
    rgba(255,255,255,0.08) 26%,
    transparent 48%);
  mix-blend-mode: screen;
  pointer-events: none;
}
.volo-oblo:hover img,
.volo-oblo:focus-visible img { transform: scale(1.24); }
.volo-oblo:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

/* L'oblo' al centro: piu' grande e con il cartellino */
.volo-oblo.is-attivo {
  transform: scale(1.16);
  border-color: rgba(254,189,65,0.55);
  box-shadow:
    inset 0 0 0 6px rgba(3,16,48,0.85),
    inset 0 6px 22px rgba(0,0,0,0.5),
    0 18px 44px rgba(0,0,0,0.5),
    0 0 0 1px rgba(254,189,65,0.25);
}

/* ---- Cartellino della meta attiva ---- */
.volo-cartellino {
  position: relative;
  z-index: 4;
  margin: 1.5rem auto 0;
  max-width: 22rem;
  text-align: center;
  min-height: 3.4rem;
}
.volo-cartellino__nome {
  font-family: 'Days One', sans-serif;
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  letter-spacing: 0.1em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.2;
}
.volo-cartellino__prezzo {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ---- Frecce ---- */
.volo-freccia {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(3,16,48,0.72);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.volo-freccia:hover { background: rgba(3,16,48,0.95); border-color: rgba(254,189,65,0.5); }
.volo-freccia--prev { left: clamp(0.5rem, 2vw, 1.5rem); }
.volo-freccia--next { right: clamp(0.5rem, 2vw, 1.5rem); }
@media (max-width: 640px) { .volo-freccia { display: none; } }

/* ---- Transizione porta ---- */
#voloPorta {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  clip-path: inset(var(--porta-top, 40%) var(--porta-right, 40%) var(--porta-bottom, 40%) var(--porta-left, 40%) round 46% / 38%);
  transition: clip-path 0.42s cubic-bezier(0.65, 0, 0.35, 1);
}
#voloPorta.is-aperta {
  clip-path: inset(0% 0% 0% 0% round 0);
}
#voloLampo {
  position: fixed;
  inset: 0;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--lampo-x, 50%) var(--lampo-y, 50%),
    rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.6) 28%, transparent 70%);
  transition: opacity 0.42s ease;
}
#voloLampo.is-acceso { opacity: 0.7; }
body.volo-in-partenza main,
body.volo-in-partenza footer {
  transform: scale(1.05);
  opacity: 0;
  transition: transform 0.42s ease, opacity 0.42s ease;
}

/* L'arrivo sulla pagina meta era qui: `.volo-atterraggio` lo metteva uno
   script in viaggio.html leggendo un flag che scriveva js/volo.js. Da quando la
   cabina ha preso il posto del Volo, volo.js non viene piu' caricato da nessuna
   pagina: quel flag non si scriveva piu' e l'animazione non partiva mai.
   L'arrivo vero e' ora in style.css, "L'ARRIVO DALLA CABINA". */

/* ---- Chi ha chiesto meno movimento ---- */
@media (prefers-reduced-motion: reduce) {
  .volo-strip { scroll-behavior: auto; }
  .volo-oblo, .volo-oblo img { transition: none; }
  .volo-oblo.is-attivo { transform: none; }
  #voloPorta, #voloLampo { transition: none; }
}
