/* ============================================================
   story.css — v2 uniquement (section « Une journée avec BillyDoo »)
   Chargé après style.css ; ne redéfinit rien de la v1.
   ============================================================ */

.story {
  padding: 64px 0 80px;
  text-align: center;
}
.story h2 { font-size: 26px; margin-bottom: 12px; }

/* ---------- Timeline ---------- */
.story-timeline {
  position: relative;
  max-width: 920px;
  margin: 48px auto 0;
  text-align: left;
}

/* Trait pointillé style feutre : piste discrète + encre révélée au scroll */
.story-line {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 15px;
  width: 4px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(242, 145, 97, 0.22) 0 12px,
    transparent 12px 24px
  );
}
.story-line-ink {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--peach) 0 12px,
    transparent 12px 24px
  );
}
/* .has-scroll-line est posée par story.js (jamais en reduced-motion) :
   sans JS, l'encre reste visible en entier */
.has-scroll-line .story-line-ink {
  --line-progress: 0%;
  clip-path: inset(0 0 calc(100% - var(--line-progress, 0%)) 0);
}

/* ---------- Chapitres ---------- */
.chapter {
  position: relative;
  padding-left: 48px;
  margin-bottom: 64px;
}
.chapter:last-of-type { margin-bottom: 0; }

/* Point sur la ligne (mobile uniquement) */
.chapter::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--coral);
  border: 3px solid var(--paper);
}

.chapter-time { margin: 0 0 18px; }
.time-badge {
  display: inline-block;
  font-family: 'Permanent Marker', cursive;
  font-size: 18px;
  color: var(--coral);
  background: var(--card);
  border: 1px solid rgba(232, 67, 98, 0.25);
  border-radius: 12px;
  padding: 6px 16px;
  box-shadow: var(--shadow-soft);
  transform: rotate(var(--tilt, 0deg));
}

.chapter-media { margin-bottom: 20px; }

/* Mockup téléphone léger, 100 % CSS */
.story-phone {
  max-width: 250px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 34px;
  padding: 10px;
  box-shadow: 0 24px 48px rgba(232, 67, 98, 0.18);
}
.story-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 26px;
}

.chapter-line {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  max-width: 400px;
}

/* ---------- Fausse barre de saisie du composer ---------- */
.composer-demo {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  max-width: 400px;
  margin-top: 18px;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1px solid rgba(12, 0, 29, 0.06);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  font-family: 'Inter', sans-serif;
}
.composer-demo-text {
  font-family: 'Permanent Marker', cursive;
  font-size: 18px;
  color: var(--ink);
  min-height: 1.4em;
}
.composer-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--coral);
  animation: caret-blink 1.1s steps(2, start) infinite;
}
@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.composer-count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- Rappel « comment ça marche » en trois étapes compactes ---------- */
.story-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 56px auto 0;
  padding: 0;
  text-align: left;
}
.story-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 8px;
  background: var(--card);
  border: 1px solid rgba(12, 0, 29, 0.06);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.4;
}
.story-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  color: white;
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Reduced motion : tout statique ---------- */
@media (prefers-reduced-motion: reduce) {
  .composer-caret { animation: none; }
  .story-line-ink { clip-path: none !important; }
}

/* ---------- Desktop : alternance gauche / droite ---------- */
@media (min-width: 900px) {
  .story h2 { font-size: 32px; }

  .story-line {
    left: 50%;
    margin-left: -2px;
  }

  .chapter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 120px;
    align-items: center;
    padding-left: 0;
    margin-bottom: 88px;
  }
  .chapter::before { display: none; }

  /* Le badge horaire se pose sur la ligne */
  .chapter-time {
    grid-column: 1 / -1;
    justify-self: center;
    margin: 0 0 28px;
  }

  .chapter-media {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    margin-bottom: 0;
  }
  .chapter-body {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
  .chapter:nth-of-type(even) .chapter-media {
    grid-column: 2;
    justify-self: start;
  }
  .chapter:nth-of-type(even) .chapter-body {
    grid-column: 1;
    grid-row: 2;
    justify-self: end;
    text-align: right;
  }
  .chapter:nth-of-type(even) .composer-demo {
    margin-left: auto;
    text-align: left;
  }

  .story-phone { max-width: 270px; }

  .story-steps {
    flex-direction: row;
    justify-content: center;
    max-width: none;
    gap: 16px;
  }
}
