/* ============================================================
   effets.css — couche d'effets commune aux sites /oldnewsite
   À charger APRÈS style.css. Compagnon obligatoire : effets.js.
   - photos : cadre arrondi, ombre portée, zoom intérieur au survol
   - apparitions au défilement (.rv → .in, posées par effets.js)
   - en-tête qui se condense (.hdr.is-stuck)
   - héros vivant (lent zoom de la photo, entrée du texte)
   - cartes qui se soulèvent, boutons qui répondent
   - visionneuse plein écran, bouton « remonter »
   Règle conservée : AUCUN backdrop-filter sur .hdr (le menu mobile
   est un enfant position:fixed de l'en-tête, un filtre le casserait).
   Options par site, sur <html data-fx="..."> : sans-soulignement,
   sans-actif, sans-visionneuse, sans-reveal.
   ============================================================ */
:root{
  --fx-ease:cubic-bezier(.22,.61,.36,1);
  --fx-rayon:18px;
  --fx-ombre:0 18px 40px -20px rgba(20,18,12,.45);
  --fx-ombre-survol:0 30px 60px -24px rgba(20,18,12,.55);
}

/* ---------- Photos : arrondi, ombre, zoom intérieur ---------- */
.fx-photo{border-radius:var(--fx-rayon);overflow:hidden;box-shadow:var(--fx-ombre);
  isolation:isolate;transform:translateZ(0);transition:box-shadow .7s var(--fx-ease)}
.fx-photo > img,.fx-photo > picture > img,.fx-photo > a > img{display:block;width:100%;
  transition:transform 1.1s var(--fx-ease)}
.fx-photo--wrap{margin:0}
.fx-photo--wrap > img{height:100%;object-fit:cover;border-radius:0}
.emplacement > .fx-photo{height:100%;border-radius:0;box-shadow:none}
@media (hover:hover){
  .fx-photo:hover{box-shadow:var(--fx-ombre-survol)}
  .fx-photo:hover > img,.fx-photo:hover > picture > img,.fx-photo:hover > a > img{transform:scale(1.05)}
}
[data-fx-zoom]{cursor:zoom-in}
[data-fx-zoom]:focus-visible{outline:3px solid #fff;outline-offset:-4px}

/* ---------- Apparitions au défilement ---------- */
.js-rv .rv{transition:opacity .9s var(--fx-ease),transform .9s var(--fx-ease);
  transition-delay:calc(var(--rv-i,0)*90ms)}
.js-rv .rv:not(.in){opacity:0;transform:translateY(28px)}

/* ---------- En-tête qui se condense ---------- */
.hdr{transition:padding .45s var(--fx-ease),box-shadow .45s var(--fx-ease),background-color .45s}
.hdr.is-stuck{box-shadow:0 10px 30px -18px rgba(0,0,0,.35);padding-top:.35rem;padding-bottom:.35rem}

/* ---------- Menu : soulignement qui glisse, lien actif ---------- */
@media (min-width:900px) and (hover:hover){
  html:not([data-fx~="sans-soulignement"]) .nav a:not(.nav__cta){position:relative}
  html:not([data-fx~="sans-soulignement"]) .nav a:not(.nav__cta)::after{content:"";position:absolute;
    left:.6rem;right:.6rem;bottom:0;height:1.5px;background:currentColor;opacity:.85;
    transform:scaleX(0);transform-origin:right;transition:transform .45s var(--fx-ease)}
  html:not([data-fx~="sans-soulignement"]) .nav a:not(.nav__cta):hover::after,
  html:not([data-fx~="sans-soulignement"]) .nav a.actif::after{transform:scaleX(1);transform-origin:left}
}

/* ---------- Boutons et cartes ---------- */
.btn{transition:transform .35s var(--fx-ease),box-shadow .35s var(--fx-ease),background-color .3s,
  color .3s,border-color .3s,filter .3s}
.btn:active{transform:translateY(0) scale(.98)}
.grille > article,.grille > .carte{transition:transform .55s var(--fx-ease),box-shadow .55s var(--fx-ease)}
@media (hover:hover){
  .btn:hover{transform:translateY(-2px);box-shadow:0 12px 26px -14px rgba(0,0,0,.5)}
  .grille > article:hover,.grille > .carte:hover{transform:translateY(-5px);box-shadow:var(--fx-ombre-survol)}
}
.chiffres li > :first-child,.chiffres__liste li > :first-child,.reperes__liste li > :first-child,
[data-compteur]{font-variant-numeric:tabular-nums}

/* ---------- Héros vivant ---------- */
.hero{overflow:hidden} /* la photo zoomée ne doit jamais déborder (sinon défilement horizontal) */
@media (prefers-reduced-motion:no-preference){
  .hero .hero__img,.hero img.hero__fond,.hero picture.hero__fond > img,.hero__media img{
    animation:fx-kb 36s var(--fx-ease) infinite alternate;transform-origin:50% 50%}
  @keyframes fx-kb{from{transform:scale(1.02)}to{transform:scale(1.11)}}
  .hero__texte > *,.hero__contenu > *{animation:fx-monte 1s var(--fx-ease) both}
  .hero__texte > :nth-child(1),.hero__contenu > :nth-child(1){animation-delay:.2s}
  .hero__texte > :nth-child(2),.hero__contenu > :nth-child(2){animation-delay:.35s}
  .hero__texte > :nth-child(3),.hero__contenu > :nth-child(3){animation-delay:.5s}
  .hero__texte > :nth-child(4),.hero__contenu > :nth-child(4){animation-delay:.65s}
  .hero__texte > :nth-child(5),.hero__contenu > :nth-child(5){animation-delay:.8s}
  @keyframes fx-monte{from{opacity:0;transform:translateY(24px)}}
}

/* ---------- Visionneuse ---------- */
.fx-vis{position:fixed;inset:0;width:100vw;height:100vh;max-width:none;max-height:none;margin:0;
  padding:clamp(1rem,4vw,3rem);border:0;background:transparent;color:#fff}
.fx-vis[open]{display:grid;place-items:center}
.fx-vis::backdrop{background:rgba(12,10,8,.92)}
.fx-vis figure{margin:0;max-width:min(1400px,94vw);text-align:center}
.fx-vis img{max-width:94vw;max-height:80vh;width:auto;height:auto;object-fit:contain;border-radius:12px;
  box-shadow:0 30px 80px -30px rgba(0,0,0,.8);animation:fx-vis-in .35s var(--fx-ease)}
@keyframes fx-vis-in{from{opacity:0;transform:scale(.96)}}
.fx-vis figcaption{color:#eae4da;margin-top:1rem;font-size:.95rem}
.fx-vis button{position:absolute;width:48px;height:48px;border-radius:50%;border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.12);color:#fff;cursor:pointer;display:grid;place-items:center;padding:0;
  transition:background .3s}
.fx-vis button:hover{background:rgba(255,255,255,.28)}
.fx-vis button svg{width:22px;height:22px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.fx-vis__fermer{top:1rem;right:1rem}
.fx-vis__prec{left:1rem;top:50%;transform:translateY(-50%)}
.fx-vis__suiv{right:1rem;top:50%;transform:translateY(-50%)}

/* ---------- Remonter ---------- */
.fx-haut{position:fixed;right:1.1rem;bottom:1.1rem;z-index:45;width:46px;height:46px;border-radius:50%;
  border:0;color:#fff;background:#333;box-shadow:0 10px 24px -10px rgba(0,0,0,.5);display:grid;
  place-items:center;cursor:pointer;padding:0;opacity:0;transform:translateY(12px);pointer-events:none;
  transition:opacity .4s,transform .4s var(--fx-ease),filter .3s}
.fx-haut.visible{opacity:1;transform:none;pointer-events:auto}
.fx-haut:hover{filter:brightness(1.12)}
.fx-haut svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion:reduce){
  .fx-photo,.fx-photo > img,.btn,.hdr,.fx-haut,.grille > article,.grille > .carte,.js-rv .rv{transition:none!important}
  .js-rv .rv:not(.in){opacity:1;transform:none}
  .fx-vis img{animation:none}
}
