/*
 * Bloc « 4 cartes » sur fond deux tons. SPECIFIQUE a ce bloc + primitive de carte .mx-carte-valeur.
 *
 * Fond PLEINE LARGEUR deux tons : BLANC en haut, ORANGE en bas, ligne NETTE (hard-stop) reconstruite en
 * CSS (bande solide ancree en bas, methode §4, comme le bloc slider). Contenu contraint. Les 4 cartes
 * (opaques, grey-ultralight) CHEVAUCHENT la ligne : leur bas plonge dans l'orange, l'orange reste visible
 * dans les gouttieres et sous les cartes. Cotes reprises de la maquette (a verifier au rendu).
 */

.mx-4-cartes {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	--mx-4c-hover-shift: 40px; /* descente MAX des cartes non survolees (reglable) */
	background-color: var(--wp--preset--color--white); /* ton du haut */
	padding-block-start: var(--wp--preset--spacing--55); /* 80 */
	padding-block-end: var(--wp--preset--spacing--55); /* 80 : espace sous les cartes, tout en orange */
	color: var(--wp--preset--color--grey-dark);
}

/* Ton du bas (orange), bord a bord, ancre en bas -> ligne NETTE avec le blanc. Hauteur = espace sous les
   cartes (80) + chevauchement des cartes (55) : la ligne coupe les cartes pres de leur bas (cote Figma). */
.mx-4-cartes::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 135px; /* cote Figma (80 + 55) */
	background-color: var(--wp--preset--color--orange-dark);
	z-index: 0;
}

/* Contenu contraint et centre, au-dessus du fond deux tons. */
.mx-4-cartes__inner {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	max-width: var(--wp--style--global--wide-size, 1400px);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--60); /* 104 */
}

.mx-4-cartes__head {
	margin-block-end: var(--wp--preset--spacing--45); /* 32 : ecart en-tete / cartes */
}

.mx-4-cartes__title {
	margin: 0;
	color: var(--wp--preset--color--grey-dark);
}

.mx-4-cartes__eyebrow {
	margin: 0 0 var(--wp--preset--spacing--20) 0; /* 8 */
}

/* Grille des 4 cartes : colonnes egales, meme hauteur (bas alignes -> ligne uniforme). */
.mx-4-cartes__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: stretch;
	gap: var(--wp--preset--spacing--40); /* 24 */
}

/* Cellule = COLONNE pleine hauteur : c'est la ZONE DE SURVOL FIXE (elle ne bouge jamais). La carte a
   l'interieur peut se translater (survol) sans que la cible du hover se deplace -> pas de clignotement. */
.mx-4-cartes__cell {
	flex: 1 1 0;
	min-width: 0;
	display: flex; /* la carte remplit la hauteur de la cellule */
}

/* ---- Primitive : carte « valeur » (icone + titre + texte), fond clair, sur fond deux tons ---- */
.mx-carte-valeur {
	flex: 1 1 auto; /* remplit la cellule */
	min-width: 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--30); /* 16 */
	padding: var(--wp--preset--spacing--45); /* 32 (cote Figma) */
	background-color: var(--wp--preset--color--grey-ultralight);
	border-radius: var(--mx-radius-s); /* 4 */
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); /* legere elevation (lisibilite sur les deux tons) */
}

.mx-carte-valeur__icone {
	display: block;
	width: 44px; /* cote Figma */
	height: 44px;
}

.mx-carte-valeur__icone img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: left center;
}

.mx-carte-valeur__titre {
	margin: 0;
	font-family: var(--wp--preset--font-family--urbanist);
	font-weight: 700; /* CAP Bold (cote Figma) */
	font-size: var(--wp--preset--font-size--md); /* 16 */
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--wp--preset--color--grey-dark);
}

.mx-carte-valeur__texte {
	margin: 0;
	font-family: var(--wp--preset--font-family--titillium);
	font-size: var(--wp--preset--font-size--md); /* 16 */
	line-height: 1.3;
	color: var(--wp--preset--color--grey-middle); /* AA sur grey-ultralight */
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
	/* 2 x 2 : les cartes passent en deux colonnes. */
	.mx-4-cartes__grid {
		flex-wrap: wrap;
	}
	.mx-4-cartes__cell {
		flex: 1 1 calc(50% - var(--wp--preset--spacing--40) / 2);
	}
}

@media (max-width: 680px) {
	.mx-4-cartes__inner {
		padding-inline: var(--wp--preset--spacing--40); /* 24 */
	}
	.mx-4-cartes__grid {
		flex-direction: column;
	}
	.mx-4-cartes__cell {
		flex: 1 1 auto;
	}
	/* Bande orange plus discrete quand les cartes sont empilees. */
	.mx-4-cartes {
		padding-block-end: var(--wp--preset--spacing--50); /* 40 */
	}
	.mx-4-cartes::after {
		height: 96px;
	}
}
