/**
 * Compositions : Études de cas
 * =================================
 * Blocs Gutenberg natifs + une classe CSS (insérés via
 * Compositions > « Youdemus · Études de cas ») :
 *
 *  .ydu-eyebrow        Paragraphe        Surtitre avec la ligne verte du site
 *  .ydu-case-summary   Groupe            Fiche d'intervention (liste « libellé + valeur »)
 *  .ydu-timeline       Liste numérotée   Chronologie (chaque ligne commence par l'heure en gras)
 *  .ydu-before-after   Groupe            Résultats : chiffre clé + tableau avant / après
 *  .ydu-tip-box        Groupe            Encadré conseil (titre + liste)
 *  .ydu-related-cases  Groupe            Cas similaires (titre + Colonnes de cartes)
 *  .ydu-schema         Image             Schéma centré avec légende
 *
 * Règle commune : dans les listes, chaque ligne commence par un texte en
 * gras (libellé, heure). C'est lui que le style met en forme.
 * Les sélecteurs « .rich-text » reproduisent le rendu dans l'éditeur.
 */

.ydu-eyebrow,
.ydu-case-summary,
.ydu-timeline,
.ydu-before-after,
.ydu-tip-box,
.ydu-related-cases,
.ydu-schema {
	--ydu-dark: #2c5566;
	--ydu-teal: #2b6a85;
	--ydu-green: #a4eb92;
	--ydu-green-text: #2f7a22;
	--ydu-bg: #f5fafa;
	--ydu-tip-bg: #f1fbee;
	--ydu-text: #303030;
	--ydu-title: #343434;
	--ydu-muted: #4d4d4d;
	--ydu-line: #dfe8eb;
}

/* --------------------------------------------------------------------------
   Compatibilité FlyingPress (« Lazy render »)
   FlyingPress ajoute content-visibility: auto et contain-intrinsic-size aux
   blocs situés sous la ligne de flottaison. La taille réservée s'applique aussi
   à la largeur : dans le conteneur d'Oxygen (en inline-block), elle élargissait
   tout le contenu sur les petits écrans. Le conteneur prend donc toute la
   largeur, et nos blocs, légers, ne sont plus affichés en différé.
   -------------------------------------------------------------------------- */
.blog-single-content .oxy-stock-content-styles {
	display: block;
}

.ydu-case-summary,
.ydu-case-summary .wp-block-group__inner-container,
.ydu-timeline,
.ydu-before-after,
.ydu-before-after .wp-block-group__inner-container,
.ydu-tip-box,
.ydu-tip-box .wp-block-group__inner-container,
.ydu-related-cases,
.ydu-related-cases .wp-block-group__inner-container,
.wp-block-image.ydu-schema {
	content-visibility: visible !important;
}

/* --------------------------------------------------------------------------
   Surtitre (motif « libellé + ligne verte » des cartes du hub)
   -------------------------------------------------------------------------- */
.ydu-eyebrow,
.ydu-related-cases .wp-block-column > p:first-of-type {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 14px;
	font-size: 13.5px;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--ydu-muted);
}

.ydu-eyebrow::after,
.ydu-related-cases .wp-block-column > p:first-of-type::after {
	content: "";
	flex: 1;
	min-width: 30px;
	height: 16px;
	background:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16'%3E%3Cpath d='M0 0 10 8 0 16v-3.2L5.8 8 0 3.2Z' fill='%23a4eb92'/%3E%3C/svg%3E") right center / 10px 16px no-repeat,
		linear-gradient(var(--ydu-green), var(--ydu-green)) left center / calc(100% - 4px) 2px no-repeat;
}

/* --------------------------------------------------------------------------
   1. Fiche d'intervention
   -------------------------------------------------------------------------- */
.ydu-case-summary {
	margin: 40px 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ydu-line);
	border-radius: 6px;
}

.ydu-case-summary .ydu-eyebrow {
	justify-content: space-between;
	margin: 0;
	padding: 16px 26px;
	background: var(--ydu-bg);
	border-bottom: 1px solid var(--ydu-line);
	font-weight: 600;
	color: var(--ydu-dark);
}

/* Badge « Résolu » */
.ydu-case-summary .ydu-eyebrow::after {
	content: "✓ Résolu";
	flex: none;
	min-width: 0;
	height: auto;
	padding: 3px 12px;
	border-radius: 20px;
	background: var(--ydu-green);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--ydu-dark);
}

.ydu-case-summary .wp-block-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ydu-case-summary .wp-block-list > li {
	display: flex;
	gap: 18px;
	margin: 0;
	padding: 15px 26px;
	border-bottom: 1px solid var(--ydu-line);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--ydu-text);
}

.ydu-case-summary .wp-block-list > li > .rich-text {
	display: flex;
	gap: 18px;
}

.ydu-case-summary .wp-block-list > li::before {
	content: none;
}

.ydu-case-summary .wp-block-list > li:nth-child(odd) {
	border-right: 1px solid var(--ydu-line);
}

.ydu-case-summary .wp-block-list > li:nth-last-child(-n+2) {
	border-bottom: 0;
}

.ydu-case-summary .wp-block-list > li > strong:first-child,
.ydu-case-summary .wp-block-list > li > .rich-text > strong:first-child {
	flex: 0 0 105px;
	margin-top: 2px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ydu-teal);
}

/* --------------------------------------------------------------------------
   2. Chronologie
   -------------------------------------------------------------------------- */
.ydu-timeline.wp-block-list {
	margin: 30px 0 40px;
	padding: 0;
	list-style: none;
}

.ydu-timeline.wp-block-list > li {
	position: relative;
	margin: 0;
	padding: 0 0 26px 200px;
	line-height: 1.6;
}

.ydu-timeline.wp-block-list > li:last-child {
	padding-bottom: 0;
}

/* Ligne verticale */
.ydu-timeline.wp-block-list > li::before {
	content: "";
	position: absolute;
	top: 12px;
	bottom: -12px;
	left: 166px;
	width: 2px;
	background: var(--ydu-line);
}

.ydu-timeline.wp-block-list > li:last-child::before {
	display: none;
}

/* Point */
.ydu-timeline.wp-block-list > li::after {
	content: "";
	position: absolute;
	top: 5px;
	left: 160px;
	box-sizing: border-box;
	width: 14px;
	height: 14px;
	border: 3px solid var(--ydu-teal);
	border-radius: 50%;
	background: #fff;
}

/* Heure */
.ydu-timeline.wp-block-list > li > strong:first-child,
.ydu-timeline.wp-block-list > li > .rich-text > strong:first-child {
	position: absolute;
	top: 0;
	left: 0;
	width: 140px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.6;
	text-align: right;
	color: var(--ydu-dark);
}

/* --------------------------------------------------------------------------
   3. Résultats avant / après
   Sélecteurs renforcés (.wp-block-table) : ils doivent passer devant les
   styles par défaut du bloc Tableau de WordPress (bordures pleines, trait
   de 3px sous l'en-tête), chargés après ce fichier.
   -------------------------------------------------------------------------- */
.ydu-before-after {
	margin: 60px 0;
}

/* Chiffre clé */
.ydu-before-after .ydu-before-after__highlight {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0 0 25px;
	font-size: 18px;
	font-weight: 400;
	color: var(--ydu-text);
}

.ydu-before-after .ydu-before-after__highlight strong {
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--ydu-dark);
}

.ydu-before-after .wp-block-table {
	margin: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ydu-line);
	border-radius: 6px;
}

.ydu-before-after .wp-block-table table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0;
	font-size: 16px;
	line-height: 1.5;
}

.ydu-before-after .wp-block-table thead,
.ydu-before-after .wp-block-table tbody,
.ydu-before-after .wp-block-table tfoot,
.ydu-before-after .wp-block-table tr {
	border: 0;
}

.ydu-before-after .wp-block-table th,
.ydu-before-after .wp-block-table td {
	border: 0;
	text-align: left;
	vertical-align: top;
}

/* En-tête */
.ydu-before-after .wp-block-table th {
	padding: 14px 24px;
	background: var(--ydu-bg);
	border-bottom: 1px solid var(--ydu-line);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ydu-muted);
}

.ydu-before-after .wp-block-table th:last-child {
	background: #e9f8e3;
	border-bottom-color: #d3efc8;
	color: var(--ydu-green-text);
}

/* Lignes : séparateurs horizontaux uniquement */
.ydu-before-after .wp-block-table td {
	padding: 18px 24px;
}

.ydu-before-after .wp-block-table tbody tr + tr td {
	border-top: 1px solid var(--ydu-line);
}

/* Colonne 1 : indicateur */
.ydu-before-after .wp-block-table td:first-child {
	width: 26%;
	font-weight: 600;
	color: var(--ydu-title);
}

/* Colonnes 2 et 3 : icône alignée sur la première ligne du texte */
.ydu-before-after .wp-block-table td:nth-child(n+2) {
	position: relative;
	padding-left: 50px;
}

.ydu-before-after .wp-block-table td:nth-child(n+2)::before {
	content: "";
	position: absolute;
	top: 24px;
	left: 24px;
	width: 13px;
	height: 13px;
	background: center / contain no-repeat;
}

/* Colonne 2 : avant */
.ydu-before-after .wp-block-table td:nth-child(2) {
	width: 34%;
	color: #6b6b6b;
}

.ydu-before-after .wp-block-table td:nth-child(2)::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%23c0614a' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Colonne 3 : après (bande verte continue) */
.ydu-before-after .wp-block-table td:nth-child(3) {
	background: #f6fcf3;
	font-weight: 500;
	color: var(--ydu-text);
}

.ydu-before-after .wp-block-table tbody tr + tr td:nth-child(3) {
	border-top-color: #dcf1d3;
}

.ydu-before-after .wp-block-table td:nth-child(3)::before {
	width: 15px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 13'%3E%3Cpath d='M1.5 7 6 11.2 14.5 1.8' fill='none' stroke='%232f7a22' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   4. Encadré conseil
   -------------------------------------------------------------------------- */
.ydu-tip-box {
	margin: 60px 0;
	padding: 38px 45px 30px;
	background: var(--ydu-tip-bg);
	border-left: 4px solid var(--ydu-green);
}

/* Surtitre : trait simple, sans flèche */
.ydu-tip-box .ydu-eyebrow::after {
	background: linear-gradient(var(--ydu-green), var(--ydu-green)) left center / 100% 2px no-repeat;
}

.ydu-tip-box .wp-block-heading {
	margin: 0 0 22px;
	font-size: 26px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--ydu-title);
}

.ydu-tip-box .wp-block-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ydu-tip;
}

.ydu-tip-box .wp-block-list > li {
	position: relative;
	margin: 0 0 14px;
	padding-left: 46px;
	line-height: 1.6;
	counter-increment: ydu-tip;
}

/* Liste numérotée : pastilles numérotées */
.ydu-tip-box ol.wp-block-list > li::before {
	content: counter(ydu-tip);
	position: absolute;
	top: -2px;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ydu-dark);
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: #fff;
}

/* Liste à puces : coches */
.ydu-tip-box ul.wp-block-list > li::before {
	content: "";
	position: absolute;
	top: 5px;
	left: 6px;
	width: 16px;
	height: 13px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 13'%3E%3Cpath d='M1.5 7 6 11.2 14.5 1.8' fill='none' stroke='%232b6a85' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   5. Cas similaires
   -------------------------------------------------------------------------- */
.ydu-related-cases {
	margin: 70px 0 20px;
}

.ydu-related-cases h2.wp-block-heading {
	margin: 0 0 25px;
	font-size: 26px;
	line-height: 1.25;
}

.ydu-related-cases .wp-block-columns.wp-block-columns {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 30px;
	margin: 0;
}

.ydu-related-cases .wp-block-column {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--ydu-bg);
	transition: box-shadow 0.3s;
}

.ydu-related-cases .wp-block-column:hover {
	box-shadow: 0 6px 20px rgba(44, 85, 102, 0.15);
}

.ydu-related-cases .wp-block-column > figure.wp-block-image {
	margin: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #222;
}

.ydu-related-cases .wp-block-column > figure img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s;
}

.ydu-related-cases .wp-block-column:hover > figure img {
	transform: scale(1.04);
}

.ydu-related-cases .wp-block-column > :not(figure) {
	margin-right: 25px;
	margin-left: 25px;
}

.ydu-related-cases .wp-block-column > p:first-of-type {
	margin: 22px 25px 8px;
}

.ydu-related-cases .wp-block-column > h3 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
}

.ydu-related-cases .wp-block-column > h3 a {
	color: var(--ydu-title);
	text-decoration: none;
	transition: color 0.3s;
}

/* Toute la carte est cliquable */
.ydu-related-cases .wp-block-column > h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ydu-related-cases .wp-block-column:hover > h3 a {
	color: var(--ydu-teal);
}

.ydu-related-cases .wp-block-column > p:last-child {
	margin-top: auto;
	margin-bottom: 25px;
	padding-top: 4px;
	font-size: 15.5px;
	line-height: 1.5;
}

.ydu-related-cases .wp-block-column > p:last-child > strong:first-child::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 11px;
	margin-right: 8px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 13'%3E%3Cpath d='M1.5 7 6 11.2 14.5 1.8' fill='none' stroke='%232b6a85' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* --------------------------------------------------------------------------
   6. Schéma (bloc Image avec la classe ydu-schema)
   -------------------------------------------------------------------------- */
.wp-block-image.ydu-schema {
	max-width: 720px;
	margin: 40px auto;
}

.wp-block-image.ydu-schema img {
	display: block;
	width: 100%;
	height: auto;
}

/* Thème classique : WordPress enveloppe l'image centrée
   (div.wp-block-image > figure.aligncenter, en display: table) */
.wp-block-image.ydu-schema .aligncenter {
	display: block;
	width: 100%;
	margin: 0;
}

.wp-block-image.ydu-schema .aligncenter > figcaption {
	display: block;
}

.wp-block-image.ydu-schema figcaption {
	margin-top: 12px;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	color: #666;
}

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
	/* Fiche d'intervention : une colonne, libellé au-dessus de la valeur */
	.ydu-case-summary {
		margin: 30px 0;
	}

	.ydu-case-summary .ydu-eyebrow {
		padding: 14px 18px;
	}

	.ydu-case-summary .wp-block-list {
		grid-template-columns: 1fr;
	}

	.ydu-case-summary .wp-block-list > li,
	.ydu-case-summary .wp-block-list > li > .rich-text {
		flex-direction: column;
		gap: 2px;
	}

	.ydu-case-summary .wp-block-list > li {
		padding: 13px 18px;
	}

	.ydu-case-summary .wp-block-list > li:nth-child(odd) {
		border-right: 0;
	}

	.ydu-case-summary .wp-block-list > li:nth-last-child(2) {
		border-bottom: 1px solid var(--ydu-line);
	}

	.ydu-case-summary .wp-block-list > li > strong:first-child,
	.ydu-case-summary .wp-block-list > li > .rich-text > strong:first-child {
		flex-basis: auto;
	}

	/* Chronologie : heure au-dessus du texte */
	.ydu-timeline.wp-block-list > li {
		padding-left: 32px;
	}

	.ydu-timeline.wp-block-list > li::before {
		left: 6px;
	}

	.ydu-timeline.wp-block-list > li::after {
		left: 0;
	}

	.ydu-timeline.wp-block-list > li > strong:first-child,
	.ydu-timeline.wp-block-list > li > .rich-text > strong:first-child {
		position: static;
		display: block;
		width: auto;
		text-align: left;
	}

	/* Avant / après : une carte par ligne */
	.ydu-before-after .ydu-before-after__highlight strong {
		font-size: 40px;
	}

	.ydu-before-after .wp-block-table thead {
		display: none;
	}

	.ydu-before-after .wp-block-table table,
	.ydu-before-after .wp-block-table tbody,
	.ydu-before-after .wp-block-table tr,
	.ydu-before-after .wp-block-table td {
		display: block;
		width: auto;
	}

	.ydu-before-after .wp-block-table tr {
		padding: 16px 18px;
	}

	.ydu-before-after .wp-block-table tbody tr + tr {
		border-top: 1px solid var(--ydu-line);
	}

	.ydu-before-after .wp-block-table td,
	.ydu-before-after .wp-block-table tbody tr + tr td,
	.ydu-before-after .wp-block-table td:nth-child(3) {
		padding: 3px 0;
		background: none;
		border: 0;
	}

	.ydu-before-after .wp-block-table td:first-child,
	.ydu-before-after .wp-block-table td:nth-child(2) {
		width: auto;
	}

	.ydu-before-after .wp-block-table td:first-child {
		margin-bottom: 4px;
	}

	.ydu-before-after .wp-block-table td:nth-child(n+2) {
		padding-left: 25px;
	}

	.ydu-before-after .wp-block-table td:nth-child(n+2)::before {
		top: 9px;
		left: 1px;
	}

	/* Encadré conseil */
	.ydu-tip-box {
		margin: 40px 0;
		padding: 28px 20px 20px;
	}

	.ydu-tip-box .wp-block-heading,
	.ydu-related-cases h2.wp-block-heading {
		font-size: 22px;
	}
}
