/* ===========================================================
   EAP – Bento Prestation
   Grille 4 colonnes, vedette 2x2 placée au centre.
   =========================================================== */

.eap-bento-prestation {
	--eap-bp-gap: 12px;
	--eap-bp-row: 220px;
	--eap-bp-radius: 4px;
	--eap-bp-overlay: rgba(0, 0, 0, 0.45);

	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-auto-rows: var(--eap-bp-row);
	grid-auto-flow: row dense;
	gap: var(--eap-bp-gap);
}

/* ---- Cellule générique ---- */
.eap-bp-item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--eap-bp-radius);
	text-decoration: none;
	min-height: 0;
	min-width: 0;
}

/* Réinitialise les titres (h2/h3…) injectés pour neutraliser le thème.
   Les controls Typographie / Couleur d'Elementor prennent ensuite le relais. */
.eap-bp-card-title,
.eap-bp-featured-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 700;
}

/* ---- Vedette : placement explicite sur 2 colonnes / 2 lignes, selon la position ---- */
.eap-bento-prestation.has-featured .eap-bp-featured {
	grid-row: 1 / span 2;
}
.eap-bento-prestation.pos-center .eap-bp-featured {
	grid-column: 2 / span 2;
}
.eap-bento-prestation.pos-left .eap-bp-featured {
	grid-column: 1 / span 2;
}
.eap-bento-prestation.pos-right .eap-bp-featured {
	grid-column: 3 / span 2;
}

.eap-bp-featured {
	background: #E30613;
}

.eap-bp-featured-inner {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	height: 100%;
	padding: clamp(24px, 3vw, 44px);
	box-sizing: border-box;
}

.eap-bp-featured-title {
	display: block;
	font-size: clamp(28px, 3vw, 44px);
	line-height: 1.05;
	color: #ffffff;
	margin-bottom: 18px;
}

.eap-bp-featured-excerpt {
	display: block;
	font-size: 16px;
	line-height: 1.5;
	color: #ffffff;
	opacity: 0.92;
}

.eap-bp-featured-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	align-self: flex-start;
	font-weight: 600;
	font-size: 15px;
	color: #ffffff;
	transition: color 0.25s ease, background-color 0.25s ease;
}

.eap-bp-arrow {
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	transition: transform 0.25s ease;
}

.eap-bp-featured:hover .eap-bp-arrow {
	transform: translate(3px, -3px);
}

/* ---- Cartes image ---- */
.eap-bp-card-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	transition: transform 0.5s ease;
	z-index: 0;
}

.eap-bp-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, var(--eap-bp-overlay) 0%, rgba(0, 0, 0, 0) 55%);
	transition: background 0.3s ease;
	z-index: 1;
}

.eap-bp-card:hover .eap-bp-card-bg {
	transform: scale(1.06);
}

.eap-bp-card-inner {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 18px 20px;
}

.eap-bp-card-title {
	font-size: 20px;
	line-height: 1.15;
	color: #ffffff;
}

.eap-bp-card-excerpt {
	font-size: 13px;
	line-height: 1.35;
	color: #ffffff;
	opacity: 0.9;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ===========================================================
   Animation au scroll (animations natives Elementor via .animated <nom>)
   Le masquage est piloté ici (CSS toujours chargé pour la grille), sans
   dépendre du timing de .elementor-invisible : une cellule reste cachée
   tant que le JS ne lui a pas ajouté la classe .animated.
   =========================================================== */
.eap-bento-prestation.eap-has-anim .eap-bp-item:not(.animated) {
	visibility: hidden;
}

.eap-bento-prestation .animated {
	animation-fill-mode: both;
}

@media (prefers-reduced-motion: reduce) {
	.eap-bento-prestation .eap-bp-item {
		visibility: visible !important;
		animation: none !important;
	}
}

/* ===========================================================
   Responsive
   =========================================================== */

/* Tablette : 2 colonnes, la vedette occupe toute la largeur sur 1 ligne haute */
@media (max-width: 1024px) {
	.eap-bento-prestation {
		grid-template-columns: repeat(2, 1fr);
	}
	.eap-bento-prestation.has-featured .eap-bp-featured {
		grid-column: 1 / span 2;
		grid-row: auto;
		min-height: var(--eap-bp-row);
	}
}

/* Mobile : 1 colonne, tout s'empile, la vedette redevient une carte pleine largeur */
@media (max-width: 600px) {
	.eap-bento-prestation {
		grid-template-columns: 1fr;
	}
	.eap-bento-prestation.has-featured .eap-bp-featured {
		grid-column: 1 / -1;
	}
	.eap-bp-featured-inner {
		gap: 16px;
	}
}
