/* ==========================================================
   Fiches de cours (version 2) et fiches d'événements :
   texte à gauche, encadré à droite qui accompagne toute la lecture
   ========================================================== */

/* ---------- Bandeau des fiches de cours (sessions A et B) ----------
   Sur ordinateur, le texte du bandeau s'arrête au même bord droit que l'encadré
   « À quoi s'attendre » de la partie suivante (bord du contenu de .wrap). */

@media (min-width: 56em) {
  .detail-hero--class {
    container-type: inline-size;
  }

  .detail-hero--class .detail-hero__text {
    padding-right: max(
      clamp(1.25rem, 5vw, 4.5rem),
      calc((100cqw - var(--wrap)) / 2 + clamp(1.25rem, 4vw, 2.5rem))
    );
  }
}

/* ---------- Mise en page « texte + encadré qui suit » ----------
   Sur ordinateur, tout le texte (présentation puis blocs ou détails) est dans la colonne
   de gauche ; l'encadré (« À quoi s'attendre » ou tarifs) occupe la colonne de droite sur
   toute la hauteur et reste visible pendant la lecture.
   Sur mobile : présentation, encadré, puis le reste du texte. */

@media (min-width: 56em) {
  .detail-body--flow {
    row-gap: 0;
  }

  .detail-body--flow > * {
    grid-column: 1;
  }

  .detail-body--flow > .detail-aside {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }

  .detail-body--flow > .live-blocks,
  .detail-body--flow > .detail-more {
    margin-top: clamp(3rem, 6vw, 4.5rem);
  }
}

/* Détails d'un événement (programme, biographie…) sous l'aperçu, avec une ligne de séparation */
.detail-more {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--color-line);
}

.detail-more h2 {
  margin-top: 1.8em;
}

.detail-more h2:first-child {
  margin-top: 0;
}

/* ---------- Présentation du cours ---------- */

.live-intro p {
  font-size: 1.15rem;
  line-height: 1.7;
}

.live-intro p:first-child {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  line-height: 1.35;
  color: var(--color-ink);
}

/* ---------- Suite des blocs ---------- */

.live-block + .live-block {
  margin-top: clamp(3.5rem, 7vw, 5rem);
}

.live-block__title {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 0.6rem;
}

/* Petit trait de couleur au-dessus de chaque titre de bloc */
.live-block__title::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-bottom: 1rem;
  background: var(--color-accent);
}

.live-block__intro {
  max-width: var(--measure);
  margin: 0 0 1.75rem;
  color: var(--color-muted);
  font-size: 1.05rem;
}

/* ---------- Phrase mise en valeur (pas une citation) ---------- */

.live-block--quote {
  text-align: center;
}

.live-quote {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.live-quote::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin: 0 auto 1.5rem;
  background: var(--color-accent);
}

.live-quote p {
  max-width: none;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  line-height: 1.35;
  color: var(--color-ink);
}

/* ---------- Notions clés, en cartes (deux par ligne) ---------- */

.live-features {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.live-features li {
  padding: 1.5rem 1.5rem 1.25rem;
  background: var(--color-tint);
  border-radius: 12px;
}

.live-features h3 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  color: var(--color-primary);
}

.live-features p {
  margin: 0;
  line-height: 1.6;
}

/* ---------- Niveaux : un simple cadre aux coins légèrement arrondis ---------- */

.live-levels {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  margin-top: 1.5rem;
}

.live-level {
  padding: 1.5rem 1.5rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: 12px;
}

.live-level h3 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
}

.live-level p {
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

/* Public visé (« Tous niveaux »…), sous le texte : une petite ligne discrète, sans pastille */
.live-level p.live-level__for {
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

/* ---------- Thèmes de la semaine, en vignettes ---------- */

.live-weeks {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.live-weeks li {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem 0.9rem;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}

.live-weeks__n {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.live-weeks__text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

/* ---------- Étapes numérotées ---------- */

.live-steps {
  counter-reset: live-step;
  display: grid;
  gap: 1.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.live-steps li {
  counter-increment: live-step;
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1.25rem;
}

.live-steps li::before {
  content: counter(live-step);
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding-top: 0.15em;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.live-steps h3 {
  margin: 0.35rem 0 0.35rem;
  font-size: 1.45rem;
}

.live-steps p {
  margin: 0;
  line-height: 1.65;
}

/* ---------- Liste courte en pastilles ---------- */

.live-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0 1.5rem;
  padding: 0;
  list-style: none;
}

.live-chips li {
  padding: 0.55rem 1.1rem 0.45rem;
  border-radius: 999px;
  background: var(--color-tint);
  color: var(--color-ink);
  font-size: 0.95rem;
}

/* ---------- Questions (Mysore : « Observing the mind ») : de simples lignes ---------- */

.live-questions {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.live-questions li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-line);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.35;
}

/* ---------- Texte avec photo « habillée » ----------
   Titre en haut, puis la photo à droite (ou à gauche, en alternance) : le texte l'entoure
   et continue sur toute la largeur de la colonne en dessous, comme dans un magazine.
   Sur mobile : titre, photo, puis texte. */

.live-wrap {
  display: flow-root;
}

.live-wrap__media {
  margin: 0.5rem 0 1.5rem;
}

.live-wrap__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

@media (min-width: 40em) {
  .live-wrap__media {
    width: 42%;
    margin: 0.4rem 0 1.25rem 2.25rem;
    float: right;
  }

  .live-wrap--left .live-wrap__media {
    float: left;
    margin: 0.4rem 2.25rem 1.25rem 0;
  }
}

/* Les questions et listes passent sous la photo plutôt que de s'y coller */
.live-wrap .live-questions,
.live-wrap ul {
  overflow: hidden;
}

/* Remarque sous un bloc */
.live-block .live-note {
  margin-top: 1.25rem;
  font-size: 0.95rem;
}

/* ---------- Page Horaires : encadré de l'application, même cadre simple ---------- */

.app-box {
  border: 1px solid var(--color-line);
  border-radius: 12px;
}

/* ---------- Lien « → Texte » : une flèche blanche dans un rond de couleur, puis le texte,
   souligné seulement au survol ou au clic ---------- */

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.link-cta::before {
  content: "";
  flex: none;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--color-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 1rem no-repeat;
  transition: transform 0.25s var(--ease);
}

.link-cta:hover,
.link-cta:focus-visible,
.link-cta:active {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

.link-cta:hover::before {
  transform: translateX(2px);
}

/* ---------- Fondations : deux façons de commencer (encadré « À quoi s'attendre ») ---------- */

.offer-duo {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-line);
}

.offer-duo__title {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.offer-duo__item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem 0.75rem;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface);
}

.offer-duo__item strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--color-ink);
}

.offer-duo__item span {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-muted);
}

.offer-duo .link-cta {
  margin-top: 0.5rem;
}

/* ---------- Rangées qui défilent à l'horizontale : fondu sur la droite ----------
   La coupure du dernier élément visible est adoucie par un fondu. Un espace en fin de rangée
   permet au dernier élément de sortir entièrement du fondu une fois tout à droite ; dans les
   navigateurs qui le permettent, le fondu disparaît même complètement en fin de rangée. */

@property --row-fade {
  syntax: "<length>";
  inherits: false;
  initial-value: 4rem;
}

.card-row {
  --row-fade: 4rem;
  padding-inline-end: 3rem;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - var(--row-fade)), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - var(--row-fade)), transparent);
}

@supports (animation-timeline: scroll()) {
  .card-row {
    animation: card-row-fade linear both;
    animation-timeline: scroll(self inline);
  }

  @keyframes card-row-fade {
    0%, 92% { --row-fade: 4rem; }
    100% { --row-fade: 0rem; }
  }
}
