/*
 * Héros-diaporama partagé des pages publiques (macro App/Views/vitrine/_hero.php), chargé après site.css.
 * Modèle : l'Espace numérique (external/ent.php). Moteur : js/scripts/connexion-slider.js (contrat .sx-ls-*),
 * aucun script propre. Scènes : vitrine/_hero-scenes.php (+ external/_ent-scenes.php).
 * 1. .sx-eh   héros en carrousel (variante .is-compact pour /demo)
 * 2. .sx-rib  rangée statique de mots-clés (puces qui passent à la ligne, aucun mouvement)
 * Mobile d'abord (360 px). Sans JavaScript : diapositives empilées et lisibles, seule la première scène affichée.
 * Animations : transform, opacity et stroke-dashoffset seulement ; coupées par prefers-reduced-motion
 * (règle globale de site.css + aucune lecture automatique côté moteur).
 * Couleurs : jetons --sx-* de site.css uniquement (les rgba reprennent les mêmes teintes).
 */

/* ---------- palette des scènes ---------- */
.sx-eh svg .i-w { fill: var(--sx-white); }
.sx-eh svg .i-c { fill: var(--sx-cream); }
.sx-eh svg .i-n { fill: var(--sx-navy); }
.sx-eh svg .i-n9 { fill: var(--sx-navy-900); }
.sx-eh svg .i-b { fill: var(--sx-blue); }
.sx-eh svg .i-s { fill: var(--sx-sage); }
.sx-eh svg .i-sl { fill: var(--sx-sage-light); }
.sx-eh svg .i-sp { fill: var(--sx-sage-pale); }
.sx-eh svg .i-g { fill: var(--sx-gold); }
.sx-eh svg .i-gp { fill: var(--sx-gold-pale); }
.sx-eh svg .i-r { fill: var(--sx-red); }
.sx-eh svg .i-halo { fill: rgba(255, 255, 255, .06); }
.sx-eh svg .i-sh { fill: rgba(15, 30, 46, .3); }
.sx-eh svg [class^="k-"] { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sx-eh svg .k-w { stroke: var(--sx-white); }
.sx-eh svg .k-b { stroke: var(--sx-blue); }
.sx-eh svg .k-n { stroke: var(--sx-navy); }
.sx-eh svg .k-g { stroke: var(--sx-gold); stroke-width: 3; }
.sx-eh svg .k-r { stroke: var(--sx-red); }
.sx-eh svg .k-sl { stroke: var(--sx-sage-light); stroke-width: 2; }
.sx-eh svg .k-dash { stroke: rgba(255, 255, 255, .28); stroke-width: 1.5; stroke-dasharray: 3 7; }
.sx-eh svg .k-dot { stroke: rgba(255, 255, 255, .45); stroke-width: 2; stroke-dasharray: 2 7; }
.sx-eh svg .k-thin { stroke-width: 1.8; }
.sx-eh svg .k-bold { stroke-width: 7; }
.sx-eh svg .t-n, .sx-eh svg .t-w, .sx-eh svg .t-g { font-family: var(--sx-sans); font-weight: 800; }
.sx-eh svg .t-n { fill: var(--sx-navy); }
.sx-eh svg .t-w { fill: var(--sx-white); }
.sx-eh svg .t-g { fill: var(--sx-gold-ink); }
/* origine des animations : seulement les éléments animés (un transform="" d'origine reste intact) */
.sx-eh svg [class*=" a-"], .sx-eh svg [class^="a-"] { transform-box: fill-box; transform-origin: center; }
.sx-eh svg .a-grow { transform-origin: center bottom; }
.sx-eh svg .a-swing { transform-origin: center top; }

/* ---------- 1. héros en carrousel ---------- */
.sx-eh { position: relative; overflow: hidden; overflow: clip; color: var(--sx-white); /* clip : zone non défilable (un focus ou un scrollIntoView ne décale plus les diapositives) */
    background: linear-gradient(155deg, var(--sx-navy-950) 0%, var(--sx-navy-900) 45%, var(--sx-navy) 100%); } /* jamais plus clair que --sx-navy : textes ≥ 4,5:1 partout (P0-1) */
.sx-eh::before { content: ""; position: absolute; top: -40px; left: -40px; width: 300px; height: 300px; pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .14) 1.2px, transparent 1.6px); background-size: 18px 18px;
    -webkit-mask-image: radial-gradient(circle at 30% 30%, #000 0, transparent 70%); mask-image: radial-gradient(circle at 30% 30%, #000 0, transparent 70%); }
.sx-eh::after { content: ""; position: absolute; right: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
    border: 2px dashed rgba(168, 197, 171, .3); box-shadow: inset 0 0 0 48px rgba(255, 255, 255, .025); }
.sx-eh-in { position: relative; z-index: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.1rem 16px 1.4rem; }
@media (min-width: 768px) { .sx-eh-in { padding: 1.6rem 24px 1.8rem; } }
@media (min-width: 1200px) { .sx-eh-in { padding: 2rem 40px 2rem; } }
.sx-eh :focus-visible { outline-color: var(--sx-white); }
.sx-eh-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem 1rem; margin-bottom: 1.2rem; }
.sx-eh .sx-crumb { margin: 0; color: var(--sx-on-dark-2); }
.sx-eh .sx-crumb a { color: var(--sx-on-dark); }
.sx-eh .sx-crumb a:hover { color: var(--sx-white); }
.sx-eh .sx-crumb [aria-current] { color: var(--sx-white); }
.sx-eh .sx-crumb li + li::before { color: var(--sx-sage-light); }
.sx .sx-eh-kicker { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--sx-sans); font-size: var(--sx-fs-12); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--sx-sage-light); line-height: 1.4; }
.sx-eh-kicker::before { content: ""; width: 28px; height: 2px; flex: 0 0 28px; background: var(--sx-gold); }

/* diapositives SUPERPOSÉES dès le premier rendu (stabilité de mise en page, CLS) : toutes occupent la même
   cellule de grille, la piste prend donc d'emblée la hauteur de la plus haute ; seule la diapositive de départ
   est visible avant le moteur (les autres : visibility hidden, hors arbre d'accessibilité, sans collapse).
   Sans JavaScript : css/nojs.css (chargée dans <noscript> par vitrine/_layout.php) les ré-empile, lisibles. */
.sx-eh .sx-ls-track { display: grid; }
.sx-eh .sx-ls-slide { grid-area: 1 / 1; display: grid; gap: 1rem; align-items: center; visibility: hidden; }
.sx-eh:not(.is-ready) .sx-ls-slide.is-start { visibility: visible; }
/* téléphone : texte et bouton d'abord, scène réduite (≤ 160 px) dessous ; ordinateur : scène à droite */
.sx-eh-art { order: 2; width: 100%; max-width: 280px; margin: 0 auto; }
@media (max-width: 767.98px) { .sx-eh-art .sx-eh-svg { width: auto; max-width: 100%; max-height: 120px; margin: 0 auto; } }
.sx-eh-svg { display: block; width: 100%; height: auto; overflow: visible; }
.sx-eh h2 { color: var(--sx-white); font-size: var(--sx-fs-t56); font-weight: 800; line-height: 1.06; margin: 0 0 .9rem; text-wrap: balance; }
.sx-eh h2 em { font-style: normal; color: var(--sx-gold); }
.sx-eh-txt .sx-eyebrow { margin-bottom: .7rem; }
.sx-eh-txt p { color: var(--sx-on-dark); font-size: var(--sx-fs-16); line-height: 1.5; max-width: 560px; margin: 0 0 1.4rem; }
.sx-eh-acts { display: flex; flex-wrap: wrap; gap: 10px; }
/* téléphone : les deux boutons partagent la ligne quand ils tiennent, sinon chacun prend toute la largeur */
.sx-eh-txt .sx-btn { flex: 1 1 auto; padding-left: 1rem; padding-right: 1rem; }
.sx .sx-eh .sx-eh-btn2 { background: transparent; border-color: rgba(255, 255, 255, .7); color: var(--sx-white); }
.sx .sx-eh .sx-eh-btn2:hover { background: rgba(255, 255, 255, .14); border-color: var(--sx-white); color: var(--sx-white); }
@media (min-width: 480px) { .sx-eh-txt .sx-btn { flex: 0 0 auto; padding-left: 1.4rem; padding-right: 1.4rem; } }
@media (min-width: 768px) {
    .sx-eh .sx-ls-slide { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 2.4rem; }
    .sx-eh-art { max-width: 440px; }
    .sx-eh-txt p { font-size: var(--sx-fs-18); }
}
@media (min-width: 992px) { .sx-eh .sx-ls-slide { min-height: 330px; gap: 4rem; } }
@media (min-width: 1200px) { .sx-eh .sx-ls-slide { min-height: 330px; } .sx-eh-art { max-width: 440px; } }

/* variante compacte (/demo) : le formulaire reste visible tôt ; pas de scène sur téléphone */
.sx-eh.is-compact .sx-eh-in { padding-bottom: 1rem; }
.sx-eh.is-compact .sx-eh-top { margin-bottom: .8rem; }
.sx-eh.is-compact h2 { font-size: var(--sx-fs-t40); margin-bottom: .6rem; }
.sx-eh.is-compact .sx-eh-txt p { margin-bottom: 1rem; }
.sx-eh.is-compact .sx-ls-ctrl { margin-top: .8rem; }
@media (max-width: 767.98px) { .sx-eh.is-compact .sx-eh-art { display: none; } }
@media (min-width: 768px) { .sx-eh.is-compact .sx-eh-art { max-width: 300px; } }
@media (min-width: 992px) { .sx-eh.is-compact .sx-ls-slide { min-height: 260px; } }
/* contenu qui suit le héros compact : remonté, repères avant le formulaire */
.sx-eh.is-compact + .sx-sec { padding-top: 1.4rem; }
.sx .sx-eh-facts { margin: 0 0 1.4rem; }
@media (min-width: 1200px) { .sx-eh.is-compact .sx-ls-slide { min-height: 280px; } .sx-eh.is-compact .sx-eh-art { max-width: 330px; } }

/* carrousel (connexion-slider.js) : mêmes cellules superposées, transitions entre diapositives */
.sx-eh.is-ready .sx-ls-slide { opacity: 0; visibility: hidden; transform: translateX(32px);
    transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .6s; }
.sx-eh.is-ready .sx-ls-slide.is-prev { transform: translateX(-32px); }
.sx-eh.is-ready[data-dir="back"] .sx-ls-slide { transform: translateX(-32px); }
.sx-eh.is-ready[data-dir="back"] .sx-ls-slide.is-prev { transform: translateX(32px); }
.sx-eh.is-ready .sx-ls-slide.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* contrôles : place réservée dès le premier rendu (invisibles tant que le moteur n'est pas prêt) */
.sx-eh .sx-ls-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 1rem; }
@media (min-width: 768px) { .sx-eh .sx-ls-ctrl { margin-top: 1.4rem; } }
.sx-eh:not(.is-ready) .sx-ls-ctrl { visibility: hidden; }
.sx-eh .sx-ls-dots { display: flex; flex: 1 1 260px; gap: 6px; }
.sx .sx-eh .sx-ls-dot { position: relative; flex: 1 1 0; min-width: 44px; max-width: 120px; min-height: 44px; display: flex; flex-direction: column; justify-content: center; gap: 6px;
    padding: 0 2px; border: 0; background: transparent; color: var(--sx-on-dark-2); font-size: var(--sx-fs-12); font-weight: 700; cursor: pointer; text-align: left; }
.sx-eh .sx-ls-dot-track { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.sx-eh .sx-ls-dot-bar { display: block; height: 100%; background: var(--sx-gold); transform: scaleX(0); transform-origin: left center; }
.sx-eh .sx-ls-dot:hover .sx-ls-dot-track { background: rgba(255, 255, 255, .45); }
.sx-eh .sx-ls-dot.is-active { color: var(--sx-white); }
.sx-eh .sx-ls-dot.is-active .sx-ls-dot-bar { transform: none; }
.sx-eh.is-playing .sx-ls-dot.is-active .sx-ls-dot-bar { animation: sx-eh-prog 7s linear both; }
.sx-eh.is-playing.is-hold .sx-ls-dot.is-active .sx-ls-dot-bar { animation-play-state: paused; }
.sx-eh .sx-ls-dot-txt { line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 575.98px) { .sx-eh .sx-ls-dot-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
.sx-eh .sx-ls-nav { display: flex; gap: 6px; margin-left: auto; }
.sx .sx-eh .sx-ls-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%;
    background: transparent; color: var(--sx-white); font-size: 1rem; cursor: pointer; transition: background-color .2s, border-color .2s, transform .2s; }
.sx .sx-eh .sx-ls-btn:hover { background: rgba(255, 255, 255, .14); border-color: var(--sx-white); }
.sx .sx-eh .sx-ls-btn:active { transform: scale(.94); }
.sx-eh:not(.is-playing) .sx-ls-ico-pause, .sx-eh.is-playing .sx-ls-ico-play { display: none; }
.sx-eh .sx-ls-btn[hidden] { display: none; }

/* ---------- 2. rangée de mots-clés (ancien ruban défilant, désormais statique) ---------- */
.sx-rib { background: var(--sx-gold-pale); border-bottom: 1px solid rgba(110, 85, 18, .14); color: var(--sx-gold-ink); }
.sx-rib-list { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; width: 100%; max-width: 1440px; margin: 0 auto; padding: .8rem 16px; }
.sx-rib-list li { display: inline-flex; align-items: center; gap: 6px; padding: .2rem .6rem; border: 1px solid rgba(110, 85, 18, .22); border-radius: var(--sx-r-pill); background: var(--sx-white); font-size: var(--sx-fs-14); font-weight: 700; line-height: 1.5; }
.sx-rib-list li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sx-gold); flex: 0 0 auto; }
/* téléphone : une seule rangée (au lieu de 4 à 6 lignes) qui défile (fondu à droite = il y a une suite ;
   atteignable au clavier, site.js [data-scroller]) */
.sx-rib-list { flex-wrap: nowrap; justify-content: safe center; overflow-x: auto; scrollbar-width: none; padding-right: 40px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.sx-rib-list::-webkit-scrollbar { display: none; }
.sx-rib-list li { flex: 0 0 auto; white-space: nowrap; }
/* tablette et ordinateur : pas de défilement caché à la souris, les puces passent à la ligne si besoin */
@media (min-width: 768px) {
    .sx-rib-list { flex-wrap: wrap; justify-content: center; overflow: visible; padding-right: 16px; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- animations (jamais avec prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* Mouvement borné (audit P1-6) : une seule boucle infinie, le halo .a-ring (signal « actif »).
       Les flottements et effets décoratifs se jouent 1 à 2 fois à l'arrivée de la diapositive. */
    .sx-eh.is-ready .is-active .a-float { animation: sx-eh-float 2.3s ease-in-out .6s 2 alternate both; }
    .sx-eh.is-ready .is-active .a-float.f2 { animation-duration: 2.8s; animation-delay: .9s; }
    .sx-eh.is-ready .is-active .a-pop { animation: sx-eh-pop .55s cubic-bezier(.2, .8, .3, 1.35) .35s both; }
    .sx-eh.is-ready .is-active .a-draw { stroke-dasharray: 1; animation: sx-eh-draw .9s ease .2s both; }
    .sx-eh.is-ready .is-active .a-spin { animation: sx-eh-spin 1.6s cubic-bezier(.2, .8, .2, 1) .4s both; }
    .sx-eh.is-ready .is-active .a-ring { animation: sx-eh-ring 2.6s ease-out 1s infinite; }
    .sx-eh.is-ready .is-active .a-blink { animation: sx-eh-blink 2.4s ease-in-out 2; }
    .sx-eh.is-ready .is-active .a-send { animation: sx-eh-send 2.4s ease-in 1s 2; }
    .sx-eh.is-ready .is-active .a-flow { animation: sx-eh-flow 1.2s linear 2; }
    .sx-eh.is-ready .is-active .a-scan { animation: sx-eh-scan 2.2s ease-in-out .4s 2 alternate; }
    .sx-eh.is-ready .is-active .a-wave { animation: sx-eh-wave 1.8s ease-in-out 2; }
    .sx-eh.is-ready .is-active .a-grow { animation: sx-eh-grow .9s cubic-bezier(.2, .8, .2, 1) .35s both; }
    .sx-eh.is-ready .is-active .a-slide { animation: sx-eh-slide .7s cubic-bezier(.2, .8, .2, 1) .3s both; }
    .sx-eh.is-ready .is-active .a-stamp { animation: sx-eh-stamp .5s cubic-bezier(.3, 1.5, .5, 1) 1s both; }
    .sx-eh.is-ready .is-active .a-swing { animation: sx-eh-swing 1.5s ease-in-out 2 alternate; }
    .sx-eh.is-ready .is-active .a-drop { animation: sx-eh-drop .6s cubic-bezier(.3, 1.4, .5, 1) .4s both; }
    .sx-eh.is-ready .is-active .a-fade { animation: sx-eh-fade .4s ease 1.1s both; }
    .sx-eh.is-ready .is-active .a-knob { animation: sx-eh-knob .4s cubic-bezier(.2, .8, .2, 1) 1.1s both; }
    .sx-eh.is-ready .is-active .d1 { animation-delay: .35s; }
    .sx-eh.is-ready .is-active .d2 { animation-delay: .55s; }
    .sx-eh.is-ready .is-active .d3 { animation-delay: .75s; }
    .sx-eh.is-ready .is-active .d4 { animation-delay: .95s; }
    .sx-eh.is-ready .is-active .d5 { animation-delay: 1.15s; }
    .sx-eh.is-ready .is-active .d6 { animation-delay: 1.35s; }
    .sx-eh.is-ready .is-active .a-blink.d1, .sx-eh.is-ready .is-active .a-wave.d1 { animation-delay: 0s; }
    .sx-eh.is-ready .is-active .a-blink.d2, .sx-eh.is-ready .is-active .a-wave.d2 { animation-delay: .25s; }
    .sx-eh.is-ready .is-active .a-blink.d3, .sx-eh.is-ready .is-active .a-wave.d3 { animation-delay: .5s; }
    .sx-eh.is-ready .is-active .a-blink.d4 { animation-delay: .75s; }
    .sx-eh.is-ready .is-active .a-send.d2 { animation-delay: 1.8s; }
    .sx-eh.is-ready .is-active .a-send.d4 { animation-delay: 2.6s; }
    .sx-eh.is-ready .is-active .sx-eh-txt > * { animation: sx-eh-up .6s cubic-bezier(.2, .8, .2, 1) both; }
    .sx-eh.is-ready .is-active .sx-eh-txt > :nth-child(2) { animation-delay: .07s; }
    .sx-eh.is-ready .is-active .sx-eh-txt > :nth-child(3) { animation-delay: .14s; }
    .sx-eh.is-ready .is-active .sx-eh-txt > :nth-child(4) { animation-delay: .21s; }
}
@keyframes sx-eh-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sx-eh-float { from { transform: translateY(0); } to { transform: translateY(-8px); } }
@keyframes sx-eh-pop { from { transform: scale(.35); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sx-eh-spin { to { transform: rotate(360deg); } }
@keyframes sx-eh-ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes sx-eh-blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes sx-eh-send { 0% { transform: translate(0, 0) scale(.6); opacity: 0; } 20% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translate(52px, -50px) scale(1); opacity: 0; } }
@keyframes sx-eh-flow { to { stroke-dashoffset: -18; } }
@keyframes sx-eh-scan { from { transform: translateY(0); } to { transform: translateY(66px); } }
@keyframes sx-eh-wave { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@keyframes sx-eh-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-drift { from { transform: translate(0, 0) rotate(0deg); } to { transform: translate(-22px, -16px) rotate(28deg); } }
@keyframes sx-eh-ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes sx-eh-grow { from { transform: scaleY(.12); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-slide { from { transform: translateX(-26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-stamp { from { transform: scale(1.8) rotate(-14deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-swing { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes sx-eh-drop { from { transform: translateY(-34px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sx-eh-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sx-eh-knob { from { transform: translateX(-20px); } to { transform: none; } }

@media print { .sx-eh-art, .sx-eh .sx-ls-ctrl, .sx-rib { display: none !important; } }
