/* Stalle Lunghe Chalet: movimento leggero (18/11/2026)
   Firma: "la stanza che si illumina". Hero che respira una volta, comparse morbide e corte,
   foto che si scaldano entrando, slider della hero in dissolvenza incrociata.
   Si animano solo transform e opacity. Tutto vive sotto html.ch-mo, che lo script in testa
   aggiunge solo senza "riduci movimento" e toglie da solo se motion.js non parte. */

/* Scroll morbido (Lenis 1.3.26, ospitato nel tema) */
html.lenis,html.lenis body{height:auto}
.lenis:not(.lenis-autoToggle).lenis-stopped{overflow:clip}
.lenis [data-lenis-prevent]{overscroll-behavior:contain}
.lenis.lenis-smooth iframe{pointer-events:none}

/* Hero: la foto entra dal buio e respira (lo zoom lo guida motion.js), poi il testo sale piano */
html.ch-mo .sl-hero-bg{animation:chLight 1.8s cubic-bezier(.22,.61,.36,1) both;will-change:transform}
html.ch-mo .sl-hero .ch-ghost{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none;will-change:transform,opacity;transition:opacity 1.7s cubic-bezier(.4,0,.2,1)}
html.ch-mo .sl-hero .ch-ghost.ch-out{opacity:0}
html.ch-mo .sl-hero-copy>*{animation:chUp 1.3s cubic-bezier(.16,.84,.3,1) both}
html.ch-mo .sl-hero-copy>:nth-child(1){animation-delay:.35s}
html.ch-mo .sl-hero-copy>:nth-child(2){animation-delay:.5s}
html.ch-mo .sl-hero-copy>:nth-child(3){animation-delay:.68s}
html.ch-mo .sl-hero-copy>:nth-child(4){animation-delay:.84s}
html.ch-mo .sl-hero-cards .sl-hcard{animation:chCard 1.15s cubic-bezier(.34,1.32,.64,1) both}
html.ch-mo .sl-hero-cards .sl-hcard:nth-child(1){animation-delay:1s}
html.ch-mo .sl-hero-cards .sl-hcard:nth-child(2){animation-delay:1.1s}
html.ch-mo .sl-hero-cards .sl-hcard:nth-child(3){animation-delay:1.2s}
html.ch-mo .sl-hero-cards .sl-hcard:nth-child(4){animation-delay:1.3s}
html.ch-mo .sl-hero-foot{animation:chFade 1.2s ease both;animation-delay:1.3s}
html.ch-mo .sl-hero-body{will-change:transform,opacity}
/* pagine senza foto in testa (note legali) e pagina di ringraziamento */
html.ch-mo .sl-legal-hero .sl-legal-in>*,html.ch-mo .sl-thanks .in>*{animation:chUp 1.3s cubic-bezier(.16,.84,.3,1) both}
html.ch-mo .sl-legal-hero .sl-legal-in>:nth-child(1),html.ch-mo .sl-thanks .in>:nth-child(1){animation-delay:.3s}
html.ch-mo .sl-legal-hero .sl-legal-in>:nth-child(2),html.ch-mo .sl-thanks .in>:nth-child(2){animation-delay:.45s}
html.ch-mo .sl-thanks .in>:nth-child(3){animation-delay:.6s}
html.ch-mo .sl-thanks .in>:nth-child(4){animation-delay:.75s}
/* lightbox delle gallerie in dissolvenza incrociata */
html.ch-mo .slx-lb img{transition:opacity .9s cubic-bezier(.4,0,.2,1)}
html.ch-mo .slx-lb img.ch-lbwait{opacity:0;transition:none}
html.ch-mo .slx-lb .ch-lbg{position:fixed;max-width:none;max-height:none;object-fit:contain;box-shadow:none;pointer-events:none;opacity:.001;z-index:1;transition:none}
html.ch-mo .slx-lb .ch-lbg.ch-show{opacity:1}
html.ch-mo .slx-lb .ch-lbg.ch-show.ch-out{opacity:0;transition:opacity .9s cubic-bezier(.4,0,.2,1)}
html.ch-mo .slx-lb button{z-index:2}
/* nome dello chalet che cambia con lo slider */
html.ch-mo .ch-swap{animation:chSwap .95s cubic-bezier(.16,.84,.3,1) both}

@keyframes chLight{from{opacity:0}}
@keyframes chFade{from{opacity:0}}
@keyframes chUp{from{opacity:0;transform:translate3d(0,18px,0)}}
@keyframes chCard{from{opacity:0;transform:translate3d(0,26px,0) scale(.965)}}
@keyframes chSwap{from{opacity:0;transform:translate3d(0,8px,0)}}

/* Comparse morbide e corte */
html.ch-mo .ch-in{opacity:0;transform:translate3d(0,16px,0)}
html.ch-mo .ch-in.ch-on{opacity:1;transform:none;transition:opacity 1s cubic-bezier(.22,.61,.36,1),transform 1.15s cubic-bezier(.16,.84,.3,1);transition-delay:var(--ch-d,0ms)}

/* Foto che si scaldano: un velo blu notte che si ritira e una luce calda che passa (valori da motion.js) */
html.ch-mo .ch-warm{--ch-v:0;--ch-g:0}
html.ch-mo .ch-warm::after,html.ch-mo .ch-warm::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none}
html.ch-mo .ch-warm::after{background:#122b3c;opacity:var(--ch-v)}
html.ch-mo .ch-warm::before{background:radial-gradient(120% 95% at 50% 100%,rgba(255,176,98,.75) 0%,rgba(255,196,128,.28) 45%,rgba(255,196,128,0) 75%);mix-blend-mode:soft-light;opacity:var(--ch-g)}

@media (prefers-reduced-motion:reduce){
  html.ch-mo .sl-hero-bg,html.ch-mo .sl-hero-copy>*,html.ch-mo .sl-legal-hero .sl-legal-in>*,html.ch-mo .sl-thanks .in>*,html.ch-mo .sl-hero-cards .sl-hcard,html.ch-mo .sl-hero-foot,html.ch-mo .ch-swap{animation:none!important}
  html.ch-mo .ch-in{opacity:1!important;transform:none!important}
  html.ch-mo .ch-warm::after,html.ch-mo .ch-warm::before{display:none}
}
