/* Centre Sahélien pour la Biodiversité : section « Apprendre sur le terrain » de l'accueil en feuille de route à 4 étapes (13 nov. 2026), préfixe .csb-fr-
   Reprend csb-docs/maquettes/roadmap/roadmap.html avec les polices et variables du thème. Chargé après csb.css et csb-accueil.css.
   Les apparitions (data-rv) sont gérées par assets/js/csb-anime.js ; ce fichier ne cache rien par lui-même. */

.csb-fr {
	--fr-foret: #004540; --fr-vegetal: #23734A; --fr-mil: #FFE175; --fr-encre: #16231A;
	--fr-texte: rgba(22, 35, 26, .78); --fr-doux: rgba(22, 35, 26, .62); --fr-trait: rgba(0, 69, 64, .14); --fr-pale: #EEF4EF;
	--fr-titre: var(--csb-font-titre, Georgia, serif); --fr-sans: var(--csb-font-texte, system-ui, sans-serif);
	--fr-courbe: cubic-bezier(.2, .7, .2, 1);
	padding: 96px 0; background: #fff; font-family: var(--fr-sans); color: var(--fr-encre);
}
.csb-fr *, .csb-fr *::before, .csb-fr *::after { box-sizing: border-box; }
.csb-fr img { display: block; max-width: 100%; }
.csb-fr :focus-visible { outline: 3px solid var(--fr-foret); outline-offset: 3px; border-radius: 6px; }

/* Neutralise les styles du thème sur titres, paragraphes, listes et boutons */
body .csb-fr :is(h2, h3):not(#csb) { margin: 0; font-family: var(--fr-titre); font-weight: 600; color: var(--fr-encre); text-transform: none; text-wrap: balance; }
body .csb-fr p:not(#csb) { margin: 0; text-align: left; hyphens: none; max-width: none; }
body .csb-fr :is(ul, ol):not(#csb) { margin: 0; padding: 0; list-style: none; }

/* En-tête : titre et phrase à gauche, navigation à droite */
.csb-fr-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 48px; }
.csb-fr-label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--fr-vegetal); }
body .csb-fr-intro h2:not(#csb) { font-size: 29px; line-height: 1.2; letter-spacing: -.015em; max-width: 28ch; }   /* même titre de section que le reste de l’accueil */
body .csb-fr-intro p:not(#csb) { margin-top: 16px; max-width: 60ch; font-size: 17px; line-height: 28px; color: var(--fr-texte); }
.csb-fr-nav { display: flex; align-items: center; gap: 16px; flex: none; }
.csb-fr-compteur { min-width: 56px; text-align: right; font-weight: 600; color: var(--fr-foret); font-variant-numeric: tabular-nums; }
.csb-fr-compteur span { color: var(--fr-doux); font-weight: 500; }
.csb-fr-compteur b { font-weight: 600; }
body .csb-fr .csb-fr-fleche:not(#csb) { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--fr-pale); color: var(--fr-foret); cursor: pointer; transition: background-color .25s ease, color .25s ease; }
body .csb-fr .csb-fr-fleche:hover:not(:disabled):not(#csb) { background: var(--fr-foret); color: #fff; }
body .csb-fr .csb-fr-fleche:disabled:not(#csb) { opacity: .35; cursor: default; }
.csb-fr-fleche svg { width: 18px; height: 18px; }

/* Piste : 4 étapes reliées par une ligne qui se remplit */
body .csb-fr ol.csb-fr-piste:not(#csb) { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 48px; }
.csb-fr-piste::before, .csb-fr-ligne { content: ""; position: absolute; top: 21px; left: 22px; right: calc(25% - 22px); height: 2px; background: var(--fr-trait); }
.csb-fr-ligne { background: var(--fr-foret); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .7s var(--fr-courbe); z-index: 0; }
body .csb-fr .csb-fr-etape:not(#csb) { all: unset; box-sizing: border-box; position: relative; z-index: 1; display: block; width: 100%; padding-right: 24px; font-family: var(--fr-sans); cursor: pointer; }
.csb-fr-point { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 2px var(--fr-trait); font: 600 16px/1 var(--fr-sans); color: var(--fr-doux); transition: background-color .4s ease, box-shadow .4s ease, color .4s ease, transform .4s var(--fr-courbe); }
.csb-fr-etape strong { display: block; margin-top: 16px; font: 600 18px/24px var(--fr-titre); letter-spacing: 0; color: var(--fr-doux); transition: color .3s ease; }
.csb-fr-etape small { display: block; margin-top: 4px; font: 400 14px/20px var(--fr-sans); color: var(--fr-doux); }
.csb-fr-etape.fait .csb-fr-point { background: var(--fr-foret); box-shadow: none; color: #fff; }
.csb-fr-etape[aria-selected="true"] .csb-fr-point { background: var(--fr-mil); box-shadow: 0 0 0 6px rgba(255, 225, 117, .35); color: var(--fr-foret); transform: scale(1.08); }
.csb-fr-etape[aria-selected="true"] strong, .csb-fr-etape.fait strong { color: var(--fr-encre); }
@media (hover: hover) {
	.csb-fr-etape:hover strong { color: var(--fr-foret); }
	.csb-fr-etape:hover .csb-fr-point { box-shadow: inset 0 0 0 2px var(--fr-foret); }
	.csb-fr-etape[aria-selected="true"]:hover .csb-fr-point { box-shadow: 0 0 0 6px rgba(255, 225, 117, .45); }
}
body .csb-fr .csb-fr-etape:focus-visible:not(#csb) { outline: 3px solid var(--fr-foret); outline-offset: 6px; border-radius: 6px; }

/* Scène : photo à gauche, panneau de l'étape à droite */
.csb-fr-scene { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.csb-fr-photos { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--fr-pale); }
.csb-fr-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .7s var(--fr-courbe), transform 1.4s var(--fr-courbe); }
.csb-fr-photos img.actif { opacity: 1; transform: none; }
.csb-fr-num { position: absolute; left: 16px; top: 16px; z-index: 1; padding: 4px 12px; border-radius: 100px; background: #fff; font-size: 14px; line-height: 24px; font-weight: 600; color: var(--fr-foret); }
/* Les quatre panneaux occupent la même cellule : la hauteur est celle du plus grand, la scène ne saute pas d'une étape à l'autre */
.csb-fr-textes { display: grid; }
.csb-fr-panneau { grid-area: 1 / 1; align-self: start; }
.csb-fr-panneau[hidden] { display: block !important; visibility: hidden; }   /* Bootstrap impose [hidden] { display: none !important } */
.csb-js .csb-fr-panneau > * { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--fr-courbe), transform .6s var(--fr-courbe); }
.csb-js .csb-fr-panneau.actif > * { opacity: 1; transform: none; }
.csb-js .csb-fr-panneau.actif > :nth-child(2) { transition-delay: .06s; }
.csb-js .csb-fr-panneau.actif > :nth-child(3) { transition-delay: .12s; }
.csb-js .csb-fr-panneau.actif > :nth-child(4) { transition-delay: .18s; }
.csb-js .csb-fr-panneau.actif > :nth-child(5) { transition-delay: .24s; }
.csb-fr-etiq { display: block; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fr-vegetal); }
body .csb-fr-panneau h3:not(#csb) { margin-top: 8px; font-size: clamp(24px, 20px + 1vw, 32px); line-height: 1.2; letter-spacing: -.015em; }
body .csb-fr-panneau p:not(#csb) { margin-top: 16px; max-width: 52ch; font-size: 17px; line-height: 28px; color: var(--fr-texte); }
body .csb-fr ul.csb-fr-liste:not(#csb) { margin-top: 20px; border-top: 1px solid var(--fr-trait); }
body .csb-fr-liste li:not(#csb) { display: grid; grid-template-columns: 16px 1fr; gap: 8px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--fr-trait); font-size: 16px; font-weight: 500; line-height: 24px; color: var(--fr-encre); }
.csb-fr-liste li::before { content: ""; width: 10px; height: 10px; margin-top: 7px; border-radius: 3px; background: var(--fr-mil); box-shadow: inset 0 0 0 1.5px var(--fr-foret); }
.csb-fr-action { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin-top: 28px; }
body .csb-fr .csb-fr-lien:not(#csb) { font-weight: 700; color: var(--fr-foret); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 5px; }

/* Navigation sous le panneau (mobile) */
.csb-fr-nav-mobile { display: none; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--fr-trait); }

/* Tablette : photo puis texte */
@media (max-width: 991px) {
	.csb-fr-tete { flex-direction: column; align-items: flex-start; }
	.csb-fr-nav { order: 3; }
	.csb-fr-scene { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.csb-fr-panneau { grid-area: auto; }
	.csb-fr-panneau[hidden] { display: none !important; }
}
/* Mobile : la piste devient une bande à faire glisser ; flèches et compteur sous le panneau */
@media (max-width: 640px) {
	.csb-fr { padding: 72px 0; }
	.csb-fr-tete { margin-bottom: 32px; }
	.csb-fr-nav { display: none; }
	body .csb-fr ol.csb-fr-piste:not(#csb) { grid-template-columns: repeat(4, minmax(150px, 1fr)); margin: 0 -20px 28px; padding: 10px 20px 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
	.csb-fr-piste::-webkit-scrollbar { display: none; }
	.csb-fr-piste::before, .csb-fr-ligne { top: 31px; left: 42px; right: auto; width: calc(150px * 3 + 2px); }
	.csb-fr-piste > li { scroll-snap-align: start; }
	body .csb-fr .csb-fr-etape:not(#csb) { padding-right: 16px; }
	.csb-fr-etape small { display: none; }
	.csb-fr-nav-mobile { display: flex; }
}

/* Mouvement réduit : aucune transition */
@media (prefers-reduced-motion: reduce) {
	.csb-fr *, .csb-fr *::before, .csb-fr *::after { transition: none !important; animation: none !important; }
	.csb-js .csb-fr-panneau > * { opacity: 1; transform: none; }
}
/* Sans JavaScript : la première étape est active, les quatre étapes restent lisibles (tous les panneaux affichés) */
html:not(.csb-js) .csb-fr-textes { display: block; }
html:not(.csb-js) .csb-fr-panneau[hidden] { display: block !important; visibility: visible; margin-top: 32px; }
html:not(.csb-js) .csb-fr-nav, html:not(.csb-js) .csb-fr-nav-mobile { display: none; }
