/* =========================================================================
   TCRV — Widget Elementor « Frise chronologique »
   ====================================================================== */

.tcrv-frise {
	--tcrv-frise-pastille: 160px;
	--tcrv-frise-ecart-x: 32px;
	--tcrv-frise-ecart-y: 56px;
	--tcrv-frise-trait: 1px;
	--tcrv-frise-trait-couleur: #9fb3ae;

	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: none;
}

/* L'écart entre étapes est pris en marge intérieure, pas en gap : le trait
   peut ainsi courir sur toute la hauteur de la ligne sans interruption. */
.tcrv-frise__etape {
	position: relative;
	display: grid;
	grid-template-columns: var(--tcrv-frise-pastille) 1fr;
	align-items: center;
	gap: var(--tcrv-frise-ecart-x);
	padding-block: calc(var(--tcrv-frise-ecart-y) / 2);
}

.tcrv-frise__etape:first-child {
	padding-top: 0;
}

.tcrv-frise__etape:last-child {
	padding-bottom: 0;
}

/* Deux segments de trait par étape : du haut de la ligne au centre, puis du
   centre au bas. Le premier et le dernier sont supprimés pour que la frise
   commence et finisse sur une pastille. */
.tcrv-frise__etape::before,
.tcrv-frise__etape::after {
	content: "";
	position: absolute;
	left: calc(var(--tcrv-frise-pastille) / 2);
	width: var(--tcrv-frise-trait);
	transform: translateX(-50%);
	background: var(--tcrv-frise-trait-couleur);
	z-index: 0;
}

.tcrv-frise__etape::before {
	top: 0;
	height: 50%;
}

.tcrv-frise__etape::after {
	top: 50%;
	bottom: 0;
}

.tcrv-frise__etape:first-child::before,
.tcrv-frise__etape:last-child::after {
	content: none;
}

/* -------------------------------------------------------------------------
   Pastille
   ---------------------------------------------------------------------- */

.tcrv-frise__pastille {
	position: relative;
	z-index: 1; /* Passe devant le trait, qu'elle interrompt visuellement. */
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--tcrv-frise-pastille);
	height: var(--tcrv-frise-pastille);
	border-radius: 50%;
	background: #003b3b;
	text-align: center;
}

.tcrv-frise__date {
	padding: 0 0.5rem;
	color: #fff;
	font-size: clamp(1.25rem, calc(var(--tcrv-frise-pastille) / 5), 2.25rem);
	font-weight: 600;
	line-height: 1.1;
	overflow-wrap: anywhere; /* « Septembre 1959 » ne débordera pas du rond. */
}

/* -------------------------------------------------------------------------
   Carte
   ---------------------------------------------------------------------- */

.tcrv-frise__carte {
	position: relative;
	z-index: 1;
	padding: 28px 32px;
	border-radius: 12px;
	background: #eef2f1;
}

.tcrv-frise__titre {
	margin: 0 0 12px;
	color: #003b3b;
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.3;
}

.tcrv-frise__texte {
	color: #406c6c;
	font-size: 1rem;
	line-height: 1.6;
}

.tcrv-frise__texte > :first-child {
	margin-top: 0;
}

.tcrv-frise__texte > :last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Mobile : la pastille passe au-dessus de la carte, le trait disparaît.
   ---------------------------------------------------------------------- */

@media (max-width: 767px) {
	.tcrv-frise {
		--tcrv-frise-pastille: 96px;
	}

	.tcrv-frise__etape {
		grid-template-columns: 1fr;
		justify-items: start;
		gap: 1rem;
	}

	.tcrv-frise__etape::before,
	.tcrv-frise__etape::after {
		content: none;
	}

	.tcrv-frise__carte {
		width: 100%;
	}
}
