/**
 * Widget « FTI — Hero atterrissage ».
 *
 * Panneau de couleur (texte) accolé à une image. Desktop : panneau à gauche (largeur réglable via
 * --lhero-bgw, défaut 60 %), image à droite ; tablette / mobile : image en haut, panneau dessous. La
 * silhouette à languette est découpée par un clip-path vectoriel piloté en JavaScript (voir
 * fti-hero-landing.js) ; en attendant le script, un border-radius sert de repli. Couleurs pilotées par les
 * variables inline posées par le widget (--lhero-bg, --lhero-text).
 */

.elementor-widget-fti-hero-landing,
.elementor-widget-fti-hero-landing > .elementor-widget-container {
	width: 100%;
}

.fti-lhero {
	width: 100%;
}

.fti-lhero__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--layout-max, 1280px);
	margin-inline: auto;
	display: flex;
	flex-direction: column; /* mobile-first : empilé. */
}

.fti-lhero__inner *,
.fti-lhero__inner *::before,
.fti-lhero__inner *::after {
	box-sizing: border-box;
}

/* ---- Image (en haut en empilé) ------------------------------------------- */

.fti-lhero__media {
	position: relative;
	order: -1;
	aspect-ratio: 362 / 350; /* ratio mobile. */
	border-radius: 20px 20px 0 0; /* repli : bas carré (jointure avec le panneau). */
	overflow: hidden;
}

.fti-lhero__slides {
	position: absolute;
	inset: 0;
}

.fti-lhero__slide {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
}

.fti-lhero__slide.is-active {
	opacity: 1;
}

.fti-lhero--slide .fti-lhero__slide {
	transition: opacity 0.9s ease;
}

/* ---- Panneau de couleur + texte ------------------------------------------ */

.fti-lhero__panel {
	display: flex;
	align-items: center;
	background: var(--lhero-bg, #3889ff);
	color: var(--lhero-text, #ffffff);
	border-radius: 0 0 20px 20px; /* repli : haut carré (jointure avec l'image). */
	/* Chevauchement de 2px sous l'image (empilé) : ferme la couture au demi-pixel qui laisserait voir le fond
	   de page à la jointure pendant un resize. 1px (= 2 px physiques en retina) ne suffisait pas sur certaines
	   largeurs/zoom où l'arrondi laisse >1 px physique : on passe à 2px. Bords jointifs carrés + couleur pleine
	   = recouvrement invisible. Annulé en desktop (côte à côte). */
	margin-top: -2px;
}

/* Anti-flash : le script découpe la silhouette (cible variable selon le breakpoint) puis marque la
   section « data-lhero-ready ». Tant que ce n'est pas fait, on masque l'image et le panneau pour ne
   pas laisser voir le basculement du repli (border-radius) vers le tracé du script. Filet de sécurité :
   révélation automatique après 1,2 s si le script ne venait pas — le border-radius de repli reste alors
   en place, donc le hero est présent. visibility (et non display) : la place est réservée, aucun reflow. */
.fti-lhero:not( [data-lhero-ready] ) .fti-lhero__media,
.fti-lhero:not( [data-lhero-ready] ) .fti-lhero__panel {
	visibility: hidden;
	opacity: 0;
	/* Filet de sécurité : révélation + fondu après 1,2 s si le script ne venait pas. */
	animation: fti-lhero-clip-reveal 0.45s ease 1.2s forwards;
}
/* À la pose du masque (section « data-lhero-ready »), image et panneau apparaissent en fondu
   (le fondu croisé des slides, sur .fti-lhero__slide, n'est pas affecté). */
.fti-lhero[data-lhero-ready] .fti-lhero__media,
.fti-lhero[data-lhero-ready] .fti-lhero__panel {
	animation: fti-lhero-clip-reveal 0.45s ease both;
}
@keyframes fti-lhero-clip-reveal {
	from { opacity: 0; }
	to   { opacity: 1; visibility: visible; }
}
@media ( prefers-reduced-motion: reduce ) {
	.fti-lhero:not( [data-lhero-ready] ) .fti-lhero__media,
	.fti-lhero:not( [data-lhero-ready] ) .fti-lhero__panel,
	.fti-lhero[data-lhero-ready] .fti-lhero__media,
	.fti-lhero[data-lhero-ready] .fti-lhero__panel {
		animation-duration: 0s;
	}
}

.fti-lhero__text {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 30px;
}

/* Sélecteur à 2 classes (0,2,0) pour avoir priorité sur le style par défaut du kit Elementor
   (.elementor-kit-6 h1, 0,1,1) : la couleur suit le panneau coloré (--lhero-text, blanc). */
.fti-lhero__panel .fti-lhero__title {
	margin: 0;
	color: inherit;
	font-family: var(--font-title, "Aptos", system-ui, sans-serif);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.5px;
	font-size: var(--text-h1-sm, 40px);
}

.fti-lhero__lead {
	margin: 0;
	color: inherit;
	font-family: var(--font-body, "Aptos", system-ui, sans-serif);
	font-weight: 700;
	line-height: 1.3;
	font-size: var(--text-lead-sm, 18px);
}

.fti-lhero__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	align-self: flex-start;
	margin-top: 8px;
	height: 56px;
	padding: 0 28px;
	border-radius: 9999px;
	background: var(--color-surface-lightest, #ffffff);
	color: var(--p-brand-secondary, #3889ff) !important;
	font-family: var(--font-body, "Aptos", system-ui, sans-serif);
	font-weight: 700;
	font-size: var(--text-body-sm, 16px);
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.35s ease, color 0.35s ease;
}

.fti-lhero__btn span,
.fti-lhero__btn:link,
.fti-lhero__btn:visited {
	color: var(--p-brand-secondary, #3889ff) !important;
}

.fti-lhero__btn:hover,
.fti-lhero__btn:focus-visible {
	background: var(--p-brand-primary, #123347);
	color: var(--color-text-inverse, #ffffff) !important;
}

.fti-lhero__btn:hover span,
.fti-lhero__btn:focus-visible span {
	color: var(--color-text-inverse, #ffffff) !important;
}

.fti-lhero__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.fti-lhero__arrow {
	flex: 0 0 auto;
}

/* ---- Tablette ------------------------------------------------------------- */

@media ( min-width: 768px ) {

	.fti-lhero__media {
		aspect-ratio: 704 / 350;
		border-radius: 30px 30px 0 0; /* bas carré (jointure). */
	}

	.fti-lhero__panel {
		border-radius: 0 0 30px 30px; /* haut carré (jointure). */
	}

	.fti-lhero__text {
		padding: 40px;
	}

	.fti-lhero__panel .fti-lhero__title {
		font-size: var(--text-h1-md, 52px);
	}

	.fti-lhero__lead {
		font-size: var(--text-lead-md, 23px);
	}

	.fti-lhero__btn {
		font-size: var(--text-body-md, 18px);
	}
}

/* ---- Desktop : panneau et image côte à côte ------------------------------ */

@media ( min-width: 1025px ) {

	.fti-lhero__inner {
		flex-direction: row;
		align-items: stretch;
		min-height: 800px;
	}

	.fti-lhero__panel {
		order: 1;
		width: var(--lhero-bgw, 60%);
		border-radius: 40px 0 0 40px; /* droite carrée (jointure avec l'image). */
		margin-top: 0; /* pas de chevauchement vertical en côte à côte. */
	}

	.fti-lhero__media {
		order: 2;
		/* Chevauchement latéral de 2px sous le bord droit du panneau (côte à côte) : ferme la couture au
		   demi-pixel qui laisserait voir le fond de page à la jointure pendant un resize, exactement comme
		   le -2px vertical en empilé. L'image est tirée de 2px vers la gauche et sa largeur est augmentée
		   d'autant pour que le bord droit reste calé. Bords jointifs carrés + image pleine = recouvrement
		   invisible. */
		width: calc(100% - var(--lhero-bgw, 60%) + 2px);
		margin-left: -2px;
		aspect-ratio: auto; /* la hauteur s'aligne sur le panneau (étirement flex). */
		border-radius: 0 40px 40px 0; /* gauche carrée (jointure avec le panneau). */
	}

	.fti-lhero__text {
		padding: 60px;
		/* La languette recreuse le haut-gauche de 80 px : on ajoute 80 px au padding haut pour recentrer le
		   texte dans la partie pleine du panneau (décalage net de +40 px, soit la moitié de la languette). */
		padding-top: 140px;
		gap: 24px;
	}

	.fti-lhero__panel .fti-lhero__title {
		font-size: var(--text-h1-lg, 72px);
		line-height: 1;
	}

	.fti-lhero__lead {
		font-size: var(--text-lead-lg, 24px);
		line-height: 1.3;
	}

	.fti-lhero__btn {
		font-size: var(--text-body-lg, 20px);
	}
}

/* ---- Accessibilité : réduction des animations ----------------------------- */

@media ( prefers-reduced-motion: reduce ) {

	.fti-lhero--slide .fti-lhero__slide {
		transition: none;
	}
}
