/*
 * services/panneaux — engagement 5 : aucun hexadecimal, replis compris. Cadre
 * sous .ivy-services--panneaux (PASSATION §3). Mecanisme de cards/eventail :
 * trois etats d'ouverture, zero JavaScript. Fiche R-05.
 */
.ivy-services--panneaux {
	--ivy-panneaux-ouvert: 2.4;
	--ivy-panneaux-gap: 12px;

	padding: clamp( 64px, 10vw, 144px ) clamp( 20px, 5vw, 72px );
	background: transparent;
	color: var( --ivy-section-color, rgb( 255 255 255 ) );
}

.ivy-services--panneaux .ivy-services__header { width: 100%; max-width: none; margin: 0 0 clamp( 32px, 5vw, 64px ); }
.ivy-services--panneaux .ivy-services__eyebrow { display: block; margin-bottom: 16px; color: var( --ivy-eyebrow-color, rgb( 255 255 255 / 68% ) ); font-size: var( --ivy-font-label ); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.ivy-services--panneaux .ivy-services__title { width: 100%; max-width: none; margin: 0; color: var( --ivy-title-color, rgb( 255 255 255 ) ); line-height: 1.02; letter-spacing: -.05em; }
.ivy-services--panneaux .ivy-services__text { width: 100%; max-width: none; margin: 20px 0 0; color: var( --ivy-text-color, rgb( 255 255 255 / 78% ) ); line-height: 1.6; }

.ivy-services--panneaux .ivy-services__band { display: flex; gap: var( --ivy-panneaux-gap ); margin: 0; padding: 0; list-style: none; }

.ivy-services--panneaux .ivy-services__panel {
	position: relative;
	display: flex;
	flex: 1 1 0;
	align-items: flex-end;
	min-width: 0;
	min-height: clamp( 380px, 46vw, 520px );
	overflow: hidden;
	border-radius: var( --ivy-radius-surface, 24px );
	background: var( --ivy-item-background-color, rgb( 30 36 42 ) );
	transition: flex-grow calc( 550ms * var( --ivy-motion, 1 ) ) cubic-bezier( .22, .61, .36, 1 );
}

.ivy-services--panneaux .ivy-services__media { position: absolute; z-index: 0; inset: 0; }
.ivy-services--panneaux .ivy-services__media img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Couche entre le media et le texte. Elle ne peint rien par defaut : le
   controle Elementor « Image overlay » est seul responsable de sa couleur,
   de son opacite ou de son degrade. */
.ivy-services--panneaux .ivy-services__panel::before { content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none; }

.ivy-services--panneaux .ivy-services__panel-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-width: 0; padding: clamp( 20px, 2vw, 28px ); }
.ivy-services--panneaux .ivy-services__number { margin-bottom: 8px; color: var( --ivy-item_number-color, rgb( 255 255 255 / 66% ) ); font-size: var( --ivy-font-label ); font-weight: 700; letter-spacing: .16em; }
.ivy-services--panneaux .ivy-services__item-title { margin: 0; color: var( --ivy-item_title-color, rgb( 255 255 255 ) ); line-height: 1.15; letter-spacing: -.02em; }
.ivy-services--panneaux .ivy-services__item-title a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
/* Toute la surface devient cliquable sans envelopper le panneau dans un <a>,
   qui avalerait l'image dans le nom accessible du lien. */
.ivy-services--panneaux .ivy-services__item-title a::after { content: ''; position: absolute; inset: 0; }
.ivy-services--panneaux .ivy-services__item-title a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* 0fr -> 1fr : hauteur inconnue animee sans mesure JavaScript. */
.ivy-services--panneaux .ivy-services__item-text { display: grid; grid-template-rows: 0fr; margin: 12px 0 0; overflow: hidden; color: var( --ivy-item_text-color, rgb( 255 255 255 / 82% ) ); font-size: var( --ivy-font-body ); line-height: 1.55; opacity: 0; transition: grid-template-rows calc( 480ms * var( --ivy-motion, 1 ) ) cubic-bezier( .22, .61, .36, 1 ), opacity calc( 280ms * var( --ivy-motion, 1 ) ) ease; }
.ivy-services--panneaux .ivy-services__item-text > * { min-height: 0; }

.ivy-services--panneaux .ivy-services__panel:hover,
.ivy-services--panneaux .ivy-services__panel:focus-within,
.ivy-services--panneaux .ivy-services__band:not( :hover ):not( :focus-within ) .ivy-services__panel:first-child { flex-grow: var( --ivy-panneaux-ouvert ); }

.ivy-services--panneaux .ivy-services__panel:hover .ivy-services__item-text,
.ivy-services--panneaux .ivy-services__panel:focus-within .ivy-services__item-text,
.ivy-services--panneaux .ivy-services__band:not( :hover ):not( :focus-within ) .ivy-services__panel:first-child .ivy-services__item-text { grid-template-rows: 1fr; opacity: 1; }

/* Des-eventaillage, declare en LARGEUR et non en (hover: none). */
@media ( max-width: 1024px ) {
	.ivy-services--panneaux .ivy-services__band { display: grid; grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }

	.ivy-services--panneaux .ivy-services__panel,
	.ivy-services--panneaux .ivy-services__panel:hover,
	.ivy-services--panneaux .ivy-services__panel:focus-within,
	.ivy-services--panneaux .ivy-services__band:not( :hover ):not( :focus-within ) .ivy-services__panel:first-child { min-height: 320px; transition: none; }

	.ivy-services--panneaux .ivy-services__item-text,
	.ivy-services--panneaux .ivy-services__panel:hover .ivy-services__item-text,
	.ivy-services--panneaux .ivy-services__panel:focus-within .ivy-services__item-text,
	.ivy-services--panneaux .ivy-services__band:not( :hover ):not( :focus-within ) .ivy-services__panel:first-child .ivy-services__item-text { grid-template-rows: 1fr; opacity: 1; transition: none; }

	.ivy-services--panneaux .ivy-services__panel:nth-child( 3 ):last-child { grid-column: 1 / -1; }
}

@media ( max-width: 640px ) {
	.ivy-services--panneaux .ivy-services__band { grid-template-columns: minmax( 0, 1fr ); }
}

/* Engagement 8 : l'ouverture reste, le trajet tombe. */
@media ( prefers-reduced-motion: reduce ) {
	.ivy-services--panneaux .ivy-services__panel,
	.ivy-services--panneaux .ivy-services__item-text { transition: none; }
}

/* L'image suit le rayon de son cadre — media-rayon.spec.ts. */
.ivy-services--panneaux .ivy-services__media { border-radius: inherit; }

/* Le bouton de fin, centre sous les panneaux. Capsule pleine a l'accent :
 * la section peut etre claire ou sombre, l'accent se lit sur les deux. */
.ivy-services--panneaux .ivy-services__actions {
	margin-top: clamp( 32px, 4vw, 48px );
}

.ivy-services--panneaux .ivy-services__cta {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 8px 22px;
	border: 1px solid transparent;
	border-radius: var( --ivy-radius-action, 999px );
	background: var( --ivy-accent, rgb( 17 17 17 ) );
	color: var( --ivy-cta-color, var( --ivy-on-accent, rgb( 255 255 255 ) ) );
	font-weight: 700;
	text-decoration: none;
}

.ivy-services--panneaux .ivy-services__cta.ivy-button--icon {
	padding-inline-end: 8px;
}

.ivy-services--panneaux .ivy-services__cta:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* En-tete en deux colonnes (`header_layout: duo`) : label et titre a gauche,
 * texte a droite, cale en bas. Une colonne sous 900 px. */
.ivy-head-duo .ivy-services--panneaux .ivy-services__header {
	display: grid;
	grid-template-columns: minmax( 0, 7fr ) minmax( 0, 5fr );
	align-items: end;
	column-gap: clamp( 24px, 4vw, 48px );
}

.ivy-head-duo .ivy-services--panneaux .ivy-services__eyebrow,
.ivy-head-duo .ivy-services--panneaux .ivy-services__title {
	grid-column: 1;
	justify-self: start;
}

.ivy-head-duo .ivy-services--panneaux .ivy-services__text {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: end;
	margin: 0;
}

@media ( max-width: 900px ) {
	.ivy-head-duo .ivy-services--panneaux .ivy-services__header {
		grid-template-columns: minmax( 0, 1fr );
	}

	.ivy-head-duo .ivy-services--panneaux .ivy-services__text {
		grid-column: 1;
		grid-row: auto;
		margin-top: 20px;
	}
}
