/* =========================================================
   ROMAN SCROLL STYLE 01 — V6.63 SPEED FIX
   ---------------------------------------------------------
   Version légère :
   - titre sur l'image
   - pas de JS
   - ouverture roman rapide
   - effets CSS doux uniquement
========================================================= */

/* HERO : titre posé sur l'image du livre */
body.is-book-page .roman-master-hero{
  min-height:100vh !important;
  display:block !important;
  position:relative !important;
  overflow:hidden !important;
}

body.is-book-page .roman-master-visual{
  position:absolute !important;
  inset:0 !important;
  z-index:1 !important;
  height:100vh !important;
  min-height:100vh !important;
  opacity:.76 !important;
}

body.is-book-page .roman-master-cover{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  filter:brightness(.62) contrast(1.14) saturate(1.08) !important;
  transform:scale(1.08);
  animation:romanCoverLightDrift 18s ease-in-out infinite alternate;
}

body.is-book-page .roman-master-visual::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:
    linear-gradient(90deg, rgba(5,3,4,.82), rgba(5,3,4,.34) 48%, rgba(5,3,4,.72)),
    linear-gradient(180deg, rgba(5,3,4,.30), transparent 42%, rgba(5,3,4,.86)) !important;
}

body.is-book-page .roman-master-copy{
  position:absolute !important;
  left:8vw !important;
  bottom:12vh !important;
  z-index:5 !important;
  max-width:980px !important;
  padding:0 !important;
  margin:0 !important;
  animation:romanHeroCopyIn .9s cubic-bezier(.16,1,.3,1) both;
}

body.is-book-page .roman-master-title{
  font-size:clamp(5.4rem, 10vw, 12.5rem) !important;
  line-height:.82 !important;
  color:var(--book-soft, #f1e8e4) !important;
  text-shadow:
    0 0 48px color-mix(in srgb, var(--book-accent, #d61d3b) 30%, transparent),
    0 0 130px rgba(0,0,0,.58) !important;
}

body.is-book-page .roman-master-summary{
  max-width:720px !important;
  color:rgba(255,245,238,.82) !important;
  text-shadow:0 0 32px rgba(0,0,0,.55);
}

/* Sections façon scènes, sans JS */
body.is-book-page .roman-master-section{
  min-height:90vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

body.is-book-page .roman-master-question,
body.is-book-page .roman-master-extract{
  animation:romanSceneSoftIn 1s cubic-bezier(.16,1,.3,1) both;
}

body.is-book-page .roman-master-cards article{
  animation:romanCardSoftFloat 8s ease-in-out infinite alternate;
}

body.is-book-page .roman-master-cards article:nth-child(2){
  animation-delay:-2s;
}

body.is-book-page .roman-master-cards article:nth-child(3){
  animation-delay:-4s;
}

/* Ligne narrative légère, pas dynamique JS */
body.is-book-page .roman-master-cards::before{
  content:'';
  position:absolute;
  left:50%;
  top:10vh;
  bottom:10vh;
  width:1px;
  background:
    linear-gradient(
      180deg,
      transparent,
      color-mix(in srgb, var(--book-accent, #d61d3b) 42%, transparent),
      transparent
    );
  opacity:.42;
  filter:drop-shadow(0 0 18px color-mix(in srgb, var(--book-accent, #d61d3b) 42%, transparent));
}

/* Scroll-driven optionnelle si navigateur compatible, sans JS */
@supports (animation-timeline: view()){
  body.is-book-page .roman-master-section{
    animation:romanSectionViewDepth both linear;
    animation-timeline:view();
    animation-range:entry 0% cover 45%;
  }

  body.is-book-page .roman-master-cards article{
    animation:romanCardViewDepth both linear;
    animation-timeline:view();
    animation-range:entry 0% cover 45%;
  }
}

@keyframes romanCoverLightDrift{
  0%{ transform:scale(1.08) translate3d(-1%, -1%, 0); }
  100%{ transform:scale(1.15) translate3d(1%, 1%, 0); }
}

@keyframes romanHeroCopyIn{
  from{
    opacity:0;
    transform:translate3d(0, 26px, 0);
    filter:blur(10px);
  }
  to{
    opacity:1;
    transform:translate3d(0, 0, 0);
    filter:blur(0);
  }
}

@keyframes romanSceneSoftIn{
  from{
    opacity:.35;
    transform:translate3d(0, 34px, 0);
  }
  to{
    opacity:1;
    transform:translate3d(0, 0, 0);
  }
}

@keyframes romanCardSoftFloat{
  0%{ transform:translate3d(0, 0, 0); }
  100%{ transform:translate3d(0, -10px, 0); }
}

@keyframes romanSectionViewDepth{
  0%{
    opacity:.58;
    transform:translate3d(0, 42px, 0);
  }
  45%{
    opacity:1;
    transform:translate3d(0, 0, 0);
  }
  100%{
    opacity:1;
    transform:translate3d(0, 0, 0);
  }
}

@keyframes romanCardViewDepth{
  0%{
    opacity:.45;
    filter:blur(8px);
    transform:translate3d(0, 46px, 0) scale(.98);
  }
  45%{
    opacity:1;
    filter:blur(0);
    transform:translate3d(0, 0, 0) scale(1);
  }
  100%{
    opacity:1;
    filter:blur(0);
    transform:translate3d(0, 0, 0) scale(1);
  }
}

@media(max-width:900px){
  body.is-book-page .roman-master-copy{
    left:24px !important;
    right:24px !important;
    bottom:10vh !important;
  }

  body.is-book-page .roman-master-section{
    min-height:auto;
  }
}
