/* Home : composition du thème, palette unique du site.
   Chargé après da.css et kit-vivant.css. */

/* ── hero : le hero seul fait un écran, sous le header ───────────────────── */
.hero {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: calc(100svh - var(--header-h, 116px));
  padding-block: 2.5rem;
}

.hero-grille {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .hero-grille {
    flex-direction: row;
    align-items: center;
    gap: 4rem;
  }
}

.hero-texte {
  flex: 1 1 auto;
  min-width: 0;
}

.hero-media {
  order: -1;
  flex: none;
}

@media (min-width: 1024px) {
  .hero-media {
    order: 1;
  }
}

.hero-photo {
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(36, 28, 31, 0.12), 0 12px 30px -18px rgba(28, 17, 22, 0.5);
}

@media (min-width: 1024px) {
  .hero-photo {
    width: 350px;
    height: 350px;
  }
}

.hero-titre {
  font-family: var(--f-titre);
  font-weight: 800;
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0.6rem 0 1rem;
}

/* ── blocs : hauteur du contenu, jamais un écran ─────────────────────────── */
.bloc {
  padding-block: 4rem;
}

.bloc-titre {
  font-family: var(--f-titre);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2.125rem);
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0;
}

.bloc-sous {
  color: var(--c-texte-2);
  max-width: 34em;
  margin-top: 0.75rem;
  line-height: 1.7;
}

/* ── cartes, tags, rails ─────────────────────────────────────────────────── */
.carte {
  position: relative;
  border-radius: var(--r-carte);
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--c-bord), var(--o-carte);
  padding: 1.25rem;
}

.carte-doux {
  background: var(--c-doux);
  box-shadow: none;
}

.chiffre {
  font-family: var(--f-titre);
  font-weight: 700;
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.4rem);
  line-height: 1;
  color: var(--c-primaire-texte);
  font-variant-numeric: tabular-nums;
}

.chiffre-libelle {
  font-size: 0.9rem;
  color: var(--c-texte-2);
  margin-top: 0.4rem;
}

.rail {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.rail > * {
  scroll-snap-align: start;
  flex: none;
}

.rail-avis > * {
  width: min(20rem, 82vw);
}

.etoiles {
  display: inline-flex;
  gap: 2px;
  color: var(--c-primaire);
}

.vignette {
  border-radius: var(--r-carte);
  overflow: hidden;
  background: var(--c-fond-2);
}

.vignette img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mesure {
  max-width: 34em;
}

.lexique summary,
.accordeon summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  color: inherit;
}

.lexique summary::-webkit-details-marker,
.accordeon summary::-webkit-details-marker {
  display: none;
}

/* Le chevron est un vrai pictogramme (Lucide), pas un caractere texte :
   il tourne a l'ouverture au lieu de se remplacer par un autre glyphe. */
.chevron {
  flex: none;
  color: var(--c-primaire-texte);
  transition: transform 200ms ease;
}

details[open] .chevron {
  transform: rotate(90deg);
}

.etoile {
  display: inline-flex;
}

/* ── widgets : le kit est ramené aux formes du thème ─────────────────────── */
[data-onglets] [role="tablist"],
[data-bascule] .kv-interrupteur {
  border-radius: var(--r-bouton);
  background: var(--c-doux);
  flex-wrap: wrap;
  padding: 0.35rem;
}

[data-onglet],
[data-choix] {
  border-radius: 4px;
  min-height: 44px;
  white-space: nowrap;
}

[data-onglet].kv-actif,
[data-choix].kv-actif {
  background: var(--c-primaire);
  color: #ffffff;
}

.kv-bouton {
  border: 0;
  box-shadow: inset 0 0 0 1px var(--c-bord);
  border-radius: var(--r-bouton);
  background: #ffffff;
  color: var(--c-texte);
}

.kv-bouton.kv-choisi {
  background: var(--c-primaire);
  box-shadow: none;
  color: #ffffff;
}

[data-calcul] input,
[data-calcul] select {
  border-radius: var(--r-bouton);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--c-bord);
  background: #ffffff;
}

[data-formule] {
  font-family: var(--f-titre);
  color: var(--c-primaire-texte);
}

[data-defile] img {
  height: 34px;
  filter: grayscale(1);
  opacity: 0.8;
}

[data-frise]::after {
  background: var(--c-froid);
}

[data-jalon]::before {
  background: #ffffff;
  border-color: var(--c-froid);
}

[data-jalon].kv-atteint::before {
  background: var(--c-primaire);
  border-color: var(--c-primaire);
}

[data-lottie] {
  max-width: 200px;
}

/* Le cadre du lottie tient une hauteur des le premier rendu : la colonne de
   gauche de la checklist n'est jamais vide, meme si le JSON n'est pas encore joue. */
.lottie-cadre {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* avant / après et images de blocs : jamais plus haut que 480 px hors hero */
.img-bloc {
  max-height: 480px;
  object-fit: cover;
  width: 100%;
}

.img-parcours {
  max-height: 320px;
  object-fit: cover;
  width: 100%;
}

.echap {
  font-family: var(--f-titre);
  font-weight: 500;
  font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

@media (prefers-reduced-motion: reduce) {
  [data-defile] .kv-piste {
    animation: none;
  }
}

/* ── hero en mobile : le contenu tient dans calc(100svh - header) ─────────── */
/* Le hero fait exactement un ecran : on reduit l'encombrement vertical plutot
   que de laisser la ligne de preuve passer sous la ligne de flottaison. */
@media (max-width: 640px) {
  .hero {
    padding-block: 1rem;
  }

  .hero .hero-grille {
    gap: 0.75rem;
  }

  .hero .hero-media {
    margin-bottom: 0.75rem;
  }

  .hero .hero-photo {
    width: 4rem;
    height: 4rem;
  }

  .hero .hero-titre {
    font-size: 1.875rem;
    line-height: 1.12;
    margin: 0.35rem 0 0.5rem;
  }

  .hero .hero-chapo {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .hero .hero-actions {
    margin-top: 1rem;
    gap: 0.5rem;
  }

  .hero .hero-preuves {
    margin-top: 1rem;
  }
}

/* ── etapes : l'etape inactive reste lisible, l'active seule au contraste max ─ */
/* kit-vivant.css posait opacity .5 sur toute la carte, ce qui faisait tomber le
   texte a 2,5:1. On garde un ecart visible, sans descendre sous --c-texte-2. */
[data-etape] {
  opacity: 1;
  color: var(--c-texte-2);
  transition: color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

[data-etape].kv-actif {
  color: var(--c-texte);
  box-shadow:
    inset 0 0 0 1px var(--c-primaire),
    var(--o-carte);
}

/* ── checklist : le panneau de gauche suit le defilement des 8 points ────────── */
@media (min-width: 1024px) {
  .checklist-cote {
    position: sticky;
    top: calc(var(--header-h, 116px) + 1rem);
    align-self: start;
  }
}

.lottie-cadre {
  min-height: 300px;
}

[data-lottie] {
  max-width: 260px;
}

/* Repli statique du lottie : le lecteur (lottie-web) vient d'un CDN, il est donc
   indisponible hors ligne. Le dessin ci-dessous tient la colonne de gauche des le
   premier rendu ; des que l'animation est posee, le repli s'efface. */
.lottie-cadre .lottie-repli {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
  margin-inline: auto;
  color: var(--c-primaire, #a63a5b);
  opacity: 0.85;
}
.lottie-cadre:has(svg:not(.lottie-repli)) .lottie-repli {
  display: none;
}
