/* ============================================================
   MYTHÉO — Kailash · écran HISTOIRES (affiches + lecteur conte).
   Style porté du CODE RD (screens/histoires.css), renommé .kailash-
   histoires-*, consolidé sur le cadre (catégorie `grid`). Le lecteur
   conte est un overlay plein-écran interne ; le mot lu (.kailash-kw)
   est stylé par kailash.css (karaoké partagé).
   ============================================================ */

/* ---- fond ---- */
.kailash-histoires .kailash-screen-bg { background: radial-gradient(120% 60% at 50% 0%, #1a1608, #0e0b05 46%, #080a06 100%); }
.kailash-histoires-amb { position: absolute; left: 0; right: 0; bottom: 0; height: 70%; z-index: 0; background-position: center bottom; background-size: cover; background-repeat: no-repeat; opacity: .16; filter: blur(2px); }
.kailash-histoires .kailash-screen-stars {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 4%, rgba(var(--lueur,231,197,110),.8), transparent), radial-gradient(1.3px 1.3px at 74% 7%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 40% 10%, rgba(var(--lueur,231,197,110),.7), transparent), radial-gradient(1.1px 1.1px at 88% 14%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 24% 18%, rgba(var(--lueur,231,197,110),.6), transparent), radial-gradient(1.2px 1.2px at 60% 22%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 16% 27%, rgba(var(--lueur,231,197,110),.6), transparent), radial-gradient(1.1px 1.1px at 82% 30%, #fff, transparent);
}
.kailash-histoires .kailash-screen-title h1 { font-size: 36px; }

/* ---- grille d'affiches ---- */
.kailash-histoires-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 0 auto; max-width: 1100px; }
@media (min-width: 760px)  { .kailash-histoires-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .kailash-histoires-grid { grid-template-columns: repeat(4, 1fr); } }
/* La carte-affiche = .kailash-poster-card partagée (kailash.css). */
/* Pastille « lire » posée au centre : look = .kailash-playbtn partagé ;
   ici on ne pose que taille + position (décorative, la carte est le bouton). */
/* Play AU MILIEU de la carte (scopé html[data-template] pour battre la
   spécificité de .kailash-playbtn:position:relative). La méta étant en bas,
   un play centré ne la chevauche pas. */
html[data-template="kailash"] .kailash-histoires-play { position: absolute; left: 50%; top: 44%; right: auto; transform: translate(-50%, -50%); z-index: 2; width: 62px; height: 62px; }
/* Le play des affiches est décoratif (la carte EST le bouton) et centré via translate ;
   on préserve ce centrage dans l'état :active partagé (sinon scale(.95) écrase le translate → le play saute). */
html[data-template="kailash"] .kailash-histoires-play.kailash-playbtn:active { transform: translate(-50%, -50%) scale(.95); }
.kailash-histoires-play svg { width: 24px; height: 24px; }

/* ---- LECTEUR CONTE (overlay FLEX plein-écran interne) ----
   Colonne : image (haut) → titre + texte (milieu, défile si long) → contrôles
   (bas). Fini les positions en px fixes qui mettaient le titre dans le texte. */
.kailash-histoires-reader { position: absolute; inset: 0; z-index: 40; background: #08060a; opacity: 0; visibility: hidden; transition: opacity .36s; display: flex; flex-direction: column; }
.kailash-histoires-reader.open { opacity: 1; visibility: visible; }

/* SCÈNE : illustration du beat (plein), titre + « Lire » posés dessus. */
.kailash-histoires-rstage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.kailash-histoires-rbg { position: absolute; inset: 0; background-color: #14110a; background-size: cover; background-position: center 20%; }
.kailash-histoires-rscrim { position: absolute; inset: 0; background: linear-gradient(rgba(8,6,10,.2), rgba(8,6,10,0) 34%, rgba(8,6,10,.45) 62%, #08060a 100%); }
.kailash-histoires-rx { position: absolute; top: calc(env(safe-area-inset-top) + 18px); right: 16px; z-index: 6; width: 46px; height: 46px; border-radius: 50%; background: rgba(20,16,10,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(234,220,190,.25); color: var(--texte); display: grid; place-items: center; cursor: pointer; }
.kailash-histoires-rx svg { width: 18px; height: 18px; }
.kailash-histoires-rkick { position: absolute; top: calc(env(safe-area-inset-top) + 20px); left: 0; right: 0; text-align: center; z-index: 5; font-family: var(--disp); font-style: italic; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--or-clair); opacity: .9; }

/* sous-titre + titre posés en bas-GAUCHE de l'image (comme la fiche) */
.kailash-histoires-rhead { position: absolute; left: 0; right: 0; bottom: 94px; z-index: 4; padding: 0 30px; }
.kailash-histoires-rhead > * { max-width: 44ch; text-align: left; }
/* Typo sous-titre/titre = classes partagées .kailash-read-sub / .kailash-read-title. */

/* CTA « Lire le récit » : positionnement seul ; le look vient de .kailash-readtoggle (partagé). */
.kailash-histoires-readtoggle { position: absolute; left: 30px; bottom: 26px; z-index: 5; }
/* Le panneau accordéon (.kailash-readpanel) est monté par K.reading.panel(rstage)
   et stylé dans kailash.css — identique à la fiche par construction. */

.kailash-histoires-rfoot { flex: 0 0 auto; padding: 12px 30px calc(env(safe-area-inset-bottom) + 22px); background: linear-gradient(transparent, #08060a 30%); }
.kailash-histoires-rbar { height: 4px; border-radius: 4px; background: rgba(234,220,190,.18); overflow: hidden; }
.kailash-histoires-rfill { width: 0; height: 100%; background: linear-gradient(90deg, #caa451, var(--or-clair, #f6e4a9)); box-shadow: 0 0 8px rgba(var(--lueur,231,197,110),.6); transition: width .35s; }
.kailash-histoires-rtime { display: flex; justify-content: space-between; font-family: var(--disp); font-size: 11px; color: var(--texte-doux); margin-top: 6px; }
.kailash-histoires-rctrl { display: flex; align-items: center; justify-content: center; gap: 30px; margin-top: 10px; }
.kailash-histoires-rnav { width: 46px; height: 46px; border-radius: 50%; background: rgba(var(--lueur,231,197,110),.08); border: 1px solid rgba(var(--lueur,231,197,110),.35); color: var(--or-clair); display: grid; place-items: center; cursor: pointer; }
.kailash-histoires-rnav svg { width: 20px; height: 20px; }
.kailash-histoires-rplay { width: 76px; height: 76px; }   /* look = .kailash-playbtn partagé (médaillon du beat) */
.kailash-histoires-rplay svg { width: 28px; height: 28px; }
.kailash-histoires-rdots { display: flex; gap: 7px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.kailash-histoires-rdots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(234,220,190,.3); }
.kailash-histoires-rdots i.on { background: var(--or-clair); box-shadow: 0 0 8px var(--or-clair); }
