/* =====================================================================
   Yona Events — mouvement 2027 : fondus au défilement
   ---------------------------------------------------------------------
   • Technologie : animations liées au défilement (CSS pur, animation-timeline:view()),
     exécutées sur le fil du compositeur — aucun JavaScript, aucune bibliothèque.
   • Navigateurs sans cette fonction (Firefox, iOS < 26) : motion-2027.js prend le relais
     avec un IntersectionObserver ; sans JavaScript, la page reste entièrement visible.
   • Respect de « réduire les animations » : tout est coupé.
   • Jamais de texte courant masqué en continu : fondu court, au moment d'entrer à l'écran.
   Les sélecteurs ci-dessous sont dupliqués dans motion-2027.js (liste TARGETS).
   ===================================================================== */

/* ---------- Typographie : retours à la ligne plus élégants (sans animation) ---------- */
h1,h2,h3,.sec-head,.statement{text-wrap:balance}
p,li,blockquote{text-wrap:pretty}

@media (prefers-reduced-motion:no-preference){
  html{scroll-behavior:smooth;scroll-padding-top:calc(var(--hh,64px) + 16px)}

  /* ---------- Repli (JS) : état de départ uniquement si le script a tourné ---------- */
  html.mo-fb .mo-t{
    opacity:0;transform:translate3d(0,26px,0);
    transition:opacity .9s var(--e-out,cubic-bezier(.22,1,.36,1)) var(--mo-delay,0s),
               transform .9s var(--e-out,cubic-bezier(.22,1,.36,1)) var(--mo-delay,0s);
  }
  html.mo-fb .mo-t.mo-in{opacity:1;transform:none}
  /* Photos : fondu + légère montée (pas de clip-path ici : Chrome le compte dans l'IntersectionObserver et la photo ne se révélerait jamais) */
  html.mo-fb .ph-band.mo-t,html.mo-fb .mo-img.mo-t{transform:translate3d(0,34px,0) scale(.985);
    transition:opacity 1.1s var(--e-out,cubic-bezier(.22,1,.36,1)),transform 1.3s var(--e-out,cubic-bezier(.22,1,.36,1))}
  html.mo-fb .ph-band.mo-t.mo-in,html.mo-fb .mo-img.mo-t.mo-in{transform:none}
  html.mo-fb .section-rule.mo-t{opacity:1;transform:scaleX(0);transform-origin:left center}
  html.mo-fb .section-rule.mo-t.mo-in{transform:none}
  html[dir="rtl"].mo-fb .section-rule.mo-t,:lang(he).mo-fb .section-rule.mo-t{transform-origin:right center}
}

/* ---------- Natif : animations liées au défilement ---------- */
@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    :root{--mo-ease:cubic-bezier(.22,1,.36,1)}

    /* 1 · Titres de section : montée douce + léger flou qui se résorbe */
    :is(.sec-head,.seo-section>h2,.prose h2,.article h2,.hfaq-title):not(.fade):not(.hero *){
      animation:mo-rise-soft both var(--mo-ease);
      animation-timeline:view();animation-range:entry 2% entry 42%;
    }
    /* 2 · Surtitres et chapeaux : un cran après le titre */
    :is(.eyebrow,.lead,.seo-section>p:first-of-type):not(.fade):not(.hero *):not(.hero-eyebrow):not(.sec-head *){
      animation:mo-rise both var(--mo-ease);
      animation-timeline:view();animation-range:entry 6% entry 46%;
    }
    /* 3 · Cartes, étapes, questions, lieux : montée en cascade (rang calculé par nth-child) */
    :is(.faq-item,.venue-item,.step,.pstep,.hbudget-card,.sstat,.tcard,.f-col,.tip,.table-wrap,.seo-table-wrap,.seo-note,.seo-service):not(.fade):not(.hero *){
      animation:mo-rise both var(--mo-ease);
      animation-timeline:view();
      animation-range:entry calc(4% + var(--mo-r,0%)) entry calc(46% + var(--mo-r,0%));
    }
    :is(.faq-item,.venue-item,.step,.pstep,.hbudget-card,.sstat,.tcard,.f-col):nth-child(2){--mo-r:5%}
    :is(.faq-item,.venue-item,.step,.pstep,.hbudget-card,.sstat,.tcard,.f-col):nth-child(3){--mo-r:10%}
    :is(.faq-item,.venue-item,.step,.pstep,.hbudget-card,.sstat,.tcard,.f-col):nth-child(n+4){--mo-r:14%}

    /* 4 · Photos : le cadre se dévoile de bas en haut, l'image se pose (sans jamais rogner le bas) */
    .ph-band{animation:mo-wipe both var(--mo-ease);animation-timeline:view();animation-range:entry 0% entry 60%}
    .ph-band img{animation:mo-settle both linear;animation-timeline:view();animation-range:entry 0% cover 45%}
    .seo-figure,.mo-img{animation:mo-wipe both var(--mo-ease);animation-timeline:view();animation-range:entry 0% entry 60%}

    /* 5 · Filet de séparation : se trace de gauche à droite (de droite à gauche en hébreu) */
    .section-rule{transform-origin:left center;animation:mo-rule both var(--mo-ease);animation-timeline:view();animation-range:entry 0% entry 80%}
    :lang(he) .section-rule,html[dir="rtl"] .section-rule{transform-origin:right center}

    @keyframes mo-rise{from{opacity:0;transform:translate3d(0,26px,0)}to{opacity:1;transform:none}}
    @keyframes mo-rise-soft{from{opacity:0;transform:translate3d(0,18px,0);filter:blur(5px)}to{opacity:1;transform:none;filter:none}}
    @keyframes mo-wipe{from{clip-path:inset(0 0 100% 0 round 14px)}to{clip-path:inset(0 0 0 0 round 14px)}}
    @keyframes mo-settle{from{transform:scale(1.07)}to{transform:none}}
    @keyframes mo-rule{from{transform:scaleX(0)}to{transform:none}}
  }
}

@media print{
  *,*::before,*::after{animation:none!important;transition:none!important;opacity:1!important;transform:none!important;clip-path:none!important;filter:none!important}
}
