/* Hero cinématique DialyBladi — concept A « La route »
   Par défaut : hero fixe (téléphones, mouvement réduit, économie de données, JS absent).
   html.cine-scrub (posé par le script d'en-tête) : vidéo pilotée par le scroll. */
:root{
  --cine-accent:#d18a06; --cine-accent-hover:#b37504;
  --cine-ink:#fdfaf2;
  --tshadow:0 1px 2px rgba(5,10,8,.95),0 3px 12px rgba(5,10,8,.78),0 10px 44px rgba(5,10,8,.8);
  --ease-out:cubic-bezier(.22,.8,.24,1);
}

.cine{position:relative;background:#0e2a1d;color:var(--cine-ink)}
.cine-stage{position:relative;overflow:hidden;min-height:min(640px,88vh);display:flex;align-items:center;justify-content:center}
.cine-poster{position:absolute;inset:0;background:#123a2c center/cover no-repeat}
html:not(.cine-scrub) .cine-poster{background-image:url('/hero/hero-ending.jpg')}
.cine-video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .6s var(--ease-out);will-change:transform;transform:translateZ(0)}
.cine.video-ready .cine-video{opacity:1}
.cine-scrim{position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse 120% 90% at 50% 40%,rgba(6,14,10,0) 35%,rgba(6,14,10,.55) 100%)}

/* Bandes de texte */
.band{position:absolute;z-index:2;text-shadow:var(--tshadow)}
.band::before{content:"";position:absolute;inset:-70% -45%;z-index:-1;pointer-events:none;opacity:calc(.25 + .75*var(--k,1));
  background:radial-gradient(ellipse 50% 50% at 50% 50%,rgba(6,14,10,var(--scrim,.42)) 0%,rgba(6,14,10,calc(var(--scrim,.42)*.55)) 45%,rgba(6,14,10,0) 100%)}
.band-line{font-family:var(--font-display,'Playfair Display',Georgia,serif);font-weight:700;font-size:clamp(1.9rem,3.6vw,3.3rem);line-height:1.12;letter-spacing:-.02em;margin:0;max-width:16ch;text-wrap:balance}
.band-1,.band-2{inset-inline-start:max(24px,6vw);top:16%}
.band-2 .band-line{max-width:17ch}
.band-3{left:50%;top:9%;transform:translateX(-50%);width:min(860px,calc(100% - 32px));text-align:center;--scrim:.62}
.band-3::before{inset:-40% -25% -20%;background:radial-gradient(ellipse 50% 50% at 50% 45%,rgba(6,14,10,var(--scrim)) 0%,rgba(6,14,10,calc(var(--scrim)*.6)) 50%,rgba(6,14,10,0) 100%)}
.cine-title{font-family:var(--font-display,'Playfair Display',Georgia,serif);font-weight:700;font-size:clamp(2.2rem,5.2vw,4.4rem);line-height:1.06;letter-spacing:-.03em;margin:0 auto 14px;max-width:18ch;text-wrap:balance}
.cine-sub{font-size:clamp(15px,1.35vw,18px);line-height:1.6;max-width:52ch;margin:0 auto 26px;color:#fff;font-weight:600}

/* Recherche */
.cine-search{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;max-width:680px;margin:0 auto;text-shadow:none}
.cine-search input{flex:1 1 280px;min-width:0;min-height:52px;padding:0 18px;border-radius:12px;border:1px solid rgba(255,255,255,.6);background:#fff;color:#14261d;font:500 16px/1.2 var(--font-body,'Plus Jakarta Sans',system-ui,sans-serif);box-shadow:0 10px 30px rgba(6,14,10,.28)}
.cine-search input::placeholder{color:#6b7a72}
.cine-search input:focus-visible{outline:3px solid var(--cine-accent);outline-offset:2px}
.cine-btn{min-height:52px;padding:0 22px;border-radius:12px;border:0;font:700 15px/1 var(--font-body,'Plus Jakarta Sans',system-ui,sans-serif);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:background .25s var(--ease-out),transform .25s var(--ease-out)}
.cine-btn:focus-visible{outline:3px solid #fff;outline-offset:2px}
.cine-btn.primary{background:var(--cine-accent);color:#1b1204}
.cine-btn.primary:hover{background:var(--cine-accent-hover);color:#fff}
.cine-btn.ghost{background:rgba(10,26,18,.55);color:#fff;border:1px solid rgba(255,255,255,.45);backdrop-filter:blur(8px)}
.cine-btn.ghost:hover{background:rgba(10,26,18,.75)}

/* Anneau de chargement + indice de scroll */
.cine-ring{position:absolute;right:max(20px,3vw);bottom:24px;width:40px;height:40px;color:rgba(253,250,242,.85);z-index:3;transform:rotate(-90deg)}
.cine-ring circle{transition:stroke-dashoffset .2s linear}
.cine-cue{position:absolute;left:50%;bottom:22px;transform:translateX(-50%);z-index:3;color:rgba(253,250,242,.8);font:600 12px/1 var(--font-body,'Plus Jakarta Sans',sans-serif);letter-spacing:.14em;text-transform:uppercase;display:none;text-shadow:var(--tshadow)}
.cine-disclose{position:absolute;inset-inline-end:12px;bottom:8px;z-index:3;font-size:10.5px;color:rgba(253,250,242,.6);text-shadow:0 1px 2px rgba(0,0,0,.6)}

/* Mots découpés (aria-hidden) ; la phrase entière reste lisible par les lecteurs d'écran */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.w{display:inline-block;white-space:pre}

/* ── Hero fixe (défaut) ── */
html:not(.cine-scrub) .cine-stage{min-height:auto;padding:72px 0 64px}
html:not(.cine-scrub) .band-1,html:not(.cine-scrub) .band-2,html:not(.cine-scrub) .cine-ring,html:not(.cine-scrub) .cine-video{display:none}
html:not(.cine-scrub) .band-3{position:relative;left:auto;top:auto;transform:none;margin:0 auto}
html:not(.cine-scrub) .band{--k:1}

/* ── Mode vidéo scrubée ── */
html.cine-scrub .cine{height:400vh}
html.cine-scrub .cine-stage{position:sticky;top:64px;height:calc(100vh - 64px);min-height:0}
html.cine-scrub .band{opacity:0}
html.cine-scrub .band-1 .w{--kc:clamp(0,(var(--k,0) - var(--th,0))*2.6,1);opacity:var(--kc);transform:translateY(calc((1 - var(--kc))*18px))}
html.cine-scrub .band-2 .band-line{--kc:clamp(0,var(--k,0)*1.4,1);opacity:var(--kc);transform:scale(calc(.84 + .16*var(--kc)));transform-origin:0 50%}
html[dir=rtl].cine-scrub .band-2 .band-line{transform-origin:100% 50%}
html.cine-scrub .band-3 .w{--kc:clamp(0,(var(--k,0) - var(--th,0))*3,1);opacity:var(--kc);transform:translateY(calc((1 - var(--kc))*22px))}
html.cine-scrub .band-3 .cine-sub{--ks:clamp(0,(var(--k,0) - .55)*4,1);opacity:var(--ks);transform:translateY(calc((1 - var(--ks))*10px))}
html.cine-scrub .band-3 .cine-search{--kb:clamp(0,(var(--k,0) - .72)*4,1);opacity:var(--kb);transform:translateY(calc((1 - var(--kb))*12px))}
html.cine-scrub .band:not(.live){pointer-events:none}
html.cine-scrub .cine.video-failed .cine-cue{display:block}
html.cine-scrub .cine-disclose{display:none}
@media (max-height:560px){html.cine-scrub .cine-ring,html.cine-scrub .cine-cue{display:none}}

/* Ancien hero : on garde seulement les compteurs, en bandeau compact */
body.has-cine .hero-inner>div:first-child{display:none}
/* La recherche principale est dans le hero : sous lui, on garde seulement les filtres */
body.has-cine #view-main .si-wrap,body.has-cine #btn-near{display:none}
body.has-cine .hero-inner{grid-template-columns:1fr;padding:20px 40px 18px}
body.has-cine .hero-stats{flex-direction:row;justify-content:center;animation:none}
body.has-cine .stat-box{text-align:center;padding:10px 22px}
body.has-cine .stat-box .num{font-size:1.6rem}

@media (max-width:640px){
  html:not(.cine-scrub) .cine-stage{padding:44px 0 40px}
  .cine-search .cine-btn{flex:1 1 140px}
  body.has-cine .hero-inner{padding:14px 16px}
}
@media (prefers-reduced-motion:reduce){
  .cine-video,.cine-ring circle,.cine-btn{transition:none}
}
