/**
 * DBM — Frise chronologique
 *
 * Toutes les valeurs de design passent par des variables CSS, pilotées
 * depuis l'onglet Style d'Elementor. Ne pas coder de valeur en dur ici.
 */

/* La règle globale « * » des thèmes ne couvre pas les pseudo-éléments :
   sans cette ligne, un point de 12 px bordé de 2 px en occupe 16 et déborde
   de sa boîte flex, ce qui le rogne. */
.dbm-timeline,
.dbm-timeline *,
.dbm-timeline *::before,
.dbm-timeline *::after {
	box-sizing: border-box;
}

.dbm-timeline {
	/* — Marque — */
	--dbm-tl-accent: #A57300;
	--dbm-tl-ink: #333333;
	--dbm-tl-section-bg: #FFFFFF;

	/* — Frise — */
	--dbm-tl-rail-line: #E7E1D4;
	--dbm-tl-rail-line-h: 2px;
	--dbm-tl-rail-progress: var(--dbm-tl-accent);
	--dbm-tl-dot-size: 12px;
	--dbm-tl-dot-bg: var(--dbm-tl-section-bg);
	--dbm-tl-dot-border: #DED7C7;
	--dbm-tl-dot-border-w: 2px;
	--dbm-tl-dot-size-active: 18px;
	--dbm-tl-dot-bg-active: var(--dbm-tl-accent);
	--dbm-tl-dot-border-active: var(--dbm-tl-accent);
	--dbm-tl-rail-label-color: #9A9288;
	--dbm-tl-rail-label-active: var(--dbm-tl-ink);
	--dbm-tl-rail-label-color-h: var(--dbm-tl-accent);
	--dbm-tl-rail-gap: 14px;
	--dbm-tl-rail-space: 36px;

	/* — Carte — */
	--dbm-tl-card-bg: #FFFFFF;
	--dbm-tl-card-max-w: 820px;
	--dbm-tl-card-radius: 18px;
	--dbm-tl-card-pad-x: 40px;
	--dbm-tl-card-pad-y: 34px;
	--dbm-tl-inactive-opacity: .7;
	--dbm-tl-inactive-scale: .97;
	/* Marge réservée autour des cartes pour que l'ombre portée ne soit pas
	   rognée par le masquage dont Swiper a besoin. */
	--dbm-tl-clip-space: 60px;

	/* — Image — */
	--dbm-tl-img-ratio: 21 / 9;
	--dbm-tl-img-max-h: 340px;
	--dbm-tl-img-fit: cover;
	--dbm-tl-img-position: center center;

	/* — Contenu — */
	--dbm-tl-content-align: flex-start;
	--dbm-tl-date-color: var(--dbm-tl-accent);
	--dbm-tl-date-mb: 12px;
	--dbm-tl-title-color: var(--dbm-tl-ink);
	--dbm-tl-title-mb: 14px;
	--dbm-tl-text-color: #5E584F;
	--dbm-tl-text-max-w: 68ch;

	/* — Flèches — */
	--dbm-tl-arrow-size: 52px;
	--dbm-tl-arrow-icon: 17px;
	--dbm-tl-arrow-color: var(--dbm-tl-accent);
	--dbm-tl-arrow-bg: rgba(255, 255, 255, .94);
	--dbm-tl-arrow-border: #F0EBE1;
	--dbm-tl-arrow-radius: 50%;
	--dbm-tl-arrow-color-h: #FFFFFF;
	--dbm-tl-arrow-bg-h: var(--dbm-tl-accent);
	--dbm-tl-arrow-offset: 0px;

	/* — Puces — */
	--dbm-tl-bullet-size: 7px;
	--dbm-tl-bullet-size-active: 7px;
	--dbm-tl-bullet-bg: #E2DBCB;
	--dbm-tl-bullet-bg-active: var(--dbm-tl-accent);
	--dbm-tl-bullet-gap: 10px;
	--dbm-tl-bullet-radius: 50%;
	--dbm-tl-nav-space: 30px;

	position: relative;
}

/* ------------------------------------------------------------------ Frise */

.dbm-timeline__rail {
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding-block: 4px;
	margin-bottom: var(--dbm-tl-rail-space);
}

.dbm-timeline__rail::-webkit-scrollbar {
	display: none;
}

.dbm-timeline__rail-track {
	position: relative;
	width: 100%;
	margin-inline: auto;
	min-height: calc(var(--dbm-tl-dot-size-active) + var(--dbm-tl-rail-gap) + 1.4em);
}

.dbm-timeline__rail-line,
.dbm-timeline__rail-progress {
	position: absolute;
	top: calc(var(--dbm-tl-dot-size-active) / 2);
	height: var(--dbm-tl-rail-line-h);
	transform: translateY(-50%);
	pointer-events: none;
	z-index: 0;
}

.dbm-timeline__rail-line {
	left: var(--dbm-tl-rail-start, 0px);
	width: var(--dbm-tl-rail-span, 0px);
	background: var(--dbm-tl-rail-line);
}

.dbm-timeline__rail-progress {
	left: var(--dbm-tl-rail-start, 0px);
	width: var(--dbm-tl-progress-w, 0px);
	background: var(--dbm-tl-rail-progress);
	transition: width .55s cubic-bezier(.32, .72, 0, 1);
}

.dbm-timeline.is-measuring .dbm-timeline__rail-progress {
	transition: none;
}

/* Les étapes sont positionnées en absolu à un pourcentage exact de la piste :
   les points restent équidistants quel que soit le nombre d'étapes et la
   longueur des libellés. Un flux flex donnerait des cellules de largeur égale
   et non des points équidistants — les deux extrémités seraient décalées. */
.dbm-timeline__rail-item {
	position: absolute;
	top: 0;
	left: var(--dbm-tl-item-pos, 0%);
	transform: translateX(-50%);
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--dbm-tl-rail-gap);
	color: var(--dbm-tl-rail-label-color);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

/* Remise à zéro défensive : de nombreux thèmes (dont Hello Biz) stylent
   « button » avec la couleur d'accent au survol. Sans cela, un aplat coloré
   apparaît derrière l'étape survolée. */
.dbm-timeline button.dbm-timeline__rail-item,
.dbm-timeline button.dbm-timeline__rail-item:hover,
.dbm-timeline button.dbm-timeline__rail-item:focus,
.dbm-timeline button.dbm-timeline__rail-item:active,
.dbm-timeline button.dbm-timeline__rail-item:visited {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0 6px;
	border: 0;
	border-radius: 0;
	background: none transparent;
	box-shadow: none;
	font: inherit;
	text-decoration: none;
	text-transform: none;
	letter-spacing: inherit;
}

.dbm-timeline__rail-dot {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--dbm-tl-dot-size-active);
	height: var(--dbm-tl-dot-size-active);
}

.dbm-timeline__rail-dot::before {
	content: "";
	width: var(--dbm-tl-dot-size);
	height: var(--dbm-tl-dot-size);
	border-radius: 50%;
	background: var(--dbm-tl-dot-bg);
	border: var(--dbm-tl-dot-border-w) solid var(--dbm-tl-dot-border);
	transition: width .4s cubic-bezier(.32, .72, 0, 1),
	            height .4s cubic-bezier(.32, .72, 0, 1),
	            background-color .35s, border-color .35s;
}

.dbm-timeline__rail-label {
	line-height: 1.2;
	white-space: nowrap;
	transition: color .35s;
}

/* Aux extrémités, seul le libellé est recalé vers l'intérieur : le point,
   lui, reste à sa position exacte. */
.dbm-timeline__rail-item:first-child .dbm-timeline__rail-label {
	transform: translateX(calc(50% - var(--dbm-tl-dot-size-active) / 2));
}

.dbm-timeline__rail-item:last-child .dbm-timeline__rail-label {
	transform: translateX(calc(-50% + var(--dbm-tl-dot-size-active) / 2));
}

.dbm-timeline__rail-item:only-child .dbm-timeline__rail-label {
	transform: none;
}

.dbm-timeline__rail-item:hover .dbm-timeline__rail-dot::before {
	border-color: var(--dbm-tl-accent);
}

.dbm-timeline__rail-item.is-active .dbm-timeline__rail-dot::before {
	width: var(--dbm-tl-dot-size-active);
	height: var(--dbm-tl-dot-size-active);
	background: var(--dbm-tl-dot-bg-active);
	border-color: var(--dbm-tl-dot-border-active);
}

.dbm-timeline__rail-item.is-active {
	color: var(--dbm-tl-rail-label-active);
}

/* Le thème impose color: #fff sur button:hover. Ces deux règles reprennent la
   main sans figer la couleur dans la remise à zéro, qui écraserait l'état actif. */
.dbm-timeline button.dbm-timeline__rail-item:hover,
.dbm-timeline button.dbm-timeline__rail-item:focus {
	color: var(--dbm-tl-rail-label-color-h);
}

.dbm-timeline button.dbm-timeline__rail-item.is-active,
.dbm-timeline button.dbm-timeline__rail-item.is-active:hover,
.dbm-timeline button.dbm-timeline__rail-item.is-active:focus {
	color: var(--dbm-tl-rail-label-active);
}

.dbm-timeline__rail-item:focus-visible {
	outline: 2px solid var(--dbm-tl-accent);
	outline-offset: 4px;
	border-radius: 4px;
}

/* ------------------------------------------------------------------ Scène */

.dbm-timeline__stage {
	position: relative;
}

/* Débord pleine largeur. La valeur vient du JS (clientWidth) : 100vw inclut
   la barre de défilement et décalerait le centrage de quelques pixels. */
.dbm-timeline__viewport {
	width: var(--dbm-tl-vw, 100%);
	margin-left: 50%;
	transform: translateX(-50%);
}

.dbm-timeline__swiper {
	overflow: hidden;
	padding-block: var(--dbm-tl-clip-space);
	margin-block: calc(var(--dbm-tl-clip-space) * -1);
}

/* Elementor applique overflow: hidden à .swiper-slide dans sa feuille
   widget-carousel, ce qui rogne l'ombre portée de la carte. Le masquage utile
   à Swiper est assuré par le conteneur, pas par les slides. */
.dbm-timeline__swiper .swiper-slide {
	overflow: visible;
	height: auto;
	display: flex;
	justify-content: center;
	opacity: var(--dbm-tl-inactive-opacity);
	transform: scale(var(--dbm-tl-inactive-scale));
	transition: opacity .55s cubic-bezier(.32, .72, 0, 1),
	            transform .55s cubic-bezier(.32, .72, 0, 1);
}

.dbm-timeline__swiper .swiper-slide-active {
	opacity: 1;
	transform: scale(1);
}

.dbm-timeline__card {
	flex: 1;
	max-width: var(--dbm-tl-card-max-w);
	display: flex;
	flex-direction: column;
	background: var(--dbm-tl-card-bg);
	border-radius: var(--dbm-tl-card-radius);
	overflow: hidden;
}

.dbm-timeline__media {
	margin: 0;
	background: rgba(0, 0, 0, .04);
	line-height: 0;
}

.dbm-timeline__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--dbm-tl-img-ratio);
	max-height: var(--dbm-tl-img-max-h);
	object-fit: var(--dbm-tl-img-fit);
	object-position: var(--dbm-tl-img-position);
	border-radius: 0;
}

.dbm-timeline__content {
	display: flex;
	flex-direction: column;
	align-items: var(--dbm-tl-content-align);
	padding: var(--dbm-tl-card-pad-y) var(--dbm-tl-card-pad-x);
}

.dbm-timeline__date {
	color: var(--dbm-tl-date-color);
	margin-bottom: var(--dbm-tl-date-mb);
}

.dbm-timeline__date sup {
	text-transform: lowercase;
	font-size: .72em;
}

.dbm-timeline__title {
	margin: 0 0 var(--dbm-tl-title-mb);
	color: var(--dbm-tl-title-color);
}

.dbm-timeline__text {
	margin: 0;
	max-width: var(--dbm-tl-text-max-w);
	color: var(--dbm-tl-text-color);
}

.dbm-timeline__text > *:last-child {
	margin-bottom: 0;
}

/* Carte sans image : le contenu se recentre verticalement */
.dbm-timeline__card--no-media {
	justify-content: center;
}

.dbm-timeline__card--no-media .dbm-timeline__content {
	padding-block: calc(var(--dbm-tl-card-pad-y) * 1.6);
}

.dbm-timeline__card--no-media .dbm-timeline__content::before {
	content: "";
	width: 46px;
	height: 2px;
	background: var(--dbm-tl-accent);
	margin-bottom: 24px;
}

/* ------------------------------------------------------------- Navigation */

.dbm-timeline__nav {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: var(--dbm-tl-nav-space);
}

.dbm-timeline__arrow {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--dbm-tl-arrow-size);
	height: var(--dbm-tl-arrow-size);
	padding: 0;
	border: 1px solid var(--dbm-tl-arrow-border);
	border-radius: var(--dbm-tl-arrow-radius);
	background: var(--dbm-tl-arrow-bg);
	color: var(--dbm-tl-arrow-color);
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	transition: background-color .3s, color .3s, opacity .3s, visibility .3s;
}

.dbm-timeline__arrow i,
.dbm-timeline__arrow svg {
	width: var(--dbm-tl-arrow-icon);
	height: var(--dbm-tl-arrow-icon);
	font-size: var(--dbm-tl-arrow-icon);
	line-height: 1;
	fill: currentColor;
}

.dbm-timeline button.dbm-timeline__arrow {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	text-decoration: none;
	text-transform: none;
}

.dbm-timeline button.dbm-timeline__arrow:hover,
.dbm-timeline button.dbm-timeline__arrow:focus-visible {
	background: var(--dbm-tl-arrow-bg-h);
	color: var(--dbm-tl-arrow-color-h);
	border-color: var(--dbm-tl-arrow-border);
}

.dbm-timeline__arrow:focus-visible {
	outline: 2px solid var(--dbm-tl-accent);
	outline-offset: 3px;
}

/* En butée, la flèche disparaît complètement */
.dbm-timeline__arrow.swiper-button-disabled,
.dbm-timeline__arrow.swiper-button-lock {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.dbm-timeline--keep-arrows .dbm-timeline__arrow.swiper-button-disabled {
	opacity: .3;
	visibility: visible;
}

.dbm-timeline__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--dbm-tl-bullet-gap);
}

.dbm-timeline__dots .swiper-pagination-bullet {
	width: var(--dbm-tl-bullet-size);
	height: var(--dbm-tl-bullet-size);
	border-radius: var(--dbm-tl-bullet-radius);
	background: var(--dbm-tl-bullet-bg);
	opacity: 1;
	margin: 0 !important;
	transition: background-color .35s, width .35s, height .35s;
}

.dbm-timeline__dots .swiper-pagination-bullet-active {
	width: var(--dbm-tl-bullet-size-active);
	height: var(--dbm-tl-bullet-size-active);
	background: var(--dbm-tl-bullet-bg-active);
}

/* Flèches en surimpression au-delà du point d'arrêt mobile */
@media (min-width: 768px) {
	.dbm-timeline__arrow {
		position: absolute;
		top: var(--dbm-tl-arrow-top, 50%);
		transform: translateY(-50%);
		z-index: 3;
	}

	.dbm-timeline__arrow--prev {
		left: var(--dbm-tl-arrow-offset);
	}

	.dbm-timeline__arrow--next {
		right: var(--dbm-tl-arrow-offset);
	}
}

@media (max-width: 767px) {
	.dbm-timeline--hide-rail-mobile .dbm-timeline__rail {
		display: none;
	}

	/* Le flou d'arrière-plan provoque des repeints coûteux pendant le
	   glissement sur les appareils modestes. */
	.dbm-timeline__arrow {
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dbm-timeline *,
	.dbm-timeline *::before {
		transition-duration: .01ms !important;
	}
}
