/* Hero de l'accueil : diapositives plein cadre sous 768 px, photo au-dessus du texte jusqu'à 1023 px, fondu enchaîné au-delà. */

.hero,
.hero * {
	box-sizing: border-box;
}

body .hero * {
	margin-block: 0;
}

.hero {
	--hero-p: var(--wp--preset--spacing--gouttiere);
	position: relative;
	overflow: hidden;
}

.hero__piste {
	display: flex;
	align-items: stretch;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	background: var(--wp--preset--color--texte);
}

.hero__piste::-webkit-scrollbar {
	display: none;
}

/* Diapositive (mobile) : photo plein cadre, voile sombre, textes centrés en bas. */
.hero-diapo {
	position: relative;
	flex: none;
	width: 100%;
	height: clamp(520px, 85svh, 720px);
	overflow: hidden;
	isolation: isolate;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.hero-diapo__media {
	position: absolute;
	inset: 0;
}

.hero-diapo__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--voile-sombre);
	pointer-events: none;
}

.hero-diapo__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--hero-position-mobile, 50% 50%);
}

.hero-diapo__emplacement {
	position: absolute;
	inset: 0;
	background: var(--wp--preset--gradient--rayures-blanches);
}

.hero-diapo__emplacement span {
	position: absolute;
	z-index: 1;
	top: 16px;
	left: 16px;
	max-width: calc(100% - 32px);
	padding: 5px 8px;
	border-radius: var(--wp--preset--border-radius--4, 4px);
	background: var(--wp--custom--couleur--blanc-90);
	color: var(--wp--preset--color--texte-secondaire);
	font-family: ui-monospace, Menlo, monospace;
	font-size: 10.5px;
	line-height: 1.45;
	letter-spacing: 0.03em;
}

.hero-diapo__decor {
	display: none;
}

.hero-diapo__contenu {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	max-width: 900px;
	margin: 0 auto;
	padding: 0 16px 76px;
}

.hero-diapo__textes {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	text-align: center;
}

.hero-diapo .is-style-sur-titre {
	color: var(--wp--preset--color--blanc);
}

.hero-diapo .hero-diapo__titre {
	max-width: 330px;
	color: var(--wp--preset--color--blanc);
	font-size: var(--wp--preset--font-size--titre-hero);
	font-weight: 380;
	line-height: 1.04;
	letter-spacing: -0.02em;
	text-shadow: var(--wp--custom--ombre-texte--hero);
	text-wrap: balance;
}

/* Ligne du titre à garder d'un seul tenant (« des Hauts-de-France ») à la taille normale du titre ; sur les très petits écrans, le titre rapetisse juste assez pour qu'elle tienne. */
.hero-diapo__textes:has(.hero-diapo__ligne) {
	container-type: inline-size;
}

.hero-diapo .hero-diapo__titre:has(.hero-diapo__ligne) {
	max-width: none;
	font-size: min(var(--wp--preset--font-size--titre-hero), 10.9cqi);
}

.hero-diapo__ligne {
	white-space: nowrap;
}

.hero-diapo__texte {
	display: none;
}

.hero-diapo .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.hero-diapo .wp-block-button .wp-block-button__link {
	gap: 10px;
	height: var(--wp--custom--hauteur--bouton-mobile);
	min-height: var(--wp--custom--hauteur--bouton-mobile);
	padding: 0 24px;
	border: 0;
	background: var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--texte);
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.hero-diapo .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--blanc);
	color: var(--wp--preset--color--blanc);
}

.hero-diapo .wp-block-button .wp-block-button__link:hover,
.hero-diapo .wp-block-button.is-style-outline .wp-block-button__link:hover {
	opacity: 0.9;
}

/* Tampon tournant (texte réglé dans le bloc). */
.hero__tampon {
	display: none;
}

.hero__tampon-texte {
	position: absolute;
	inset: 0;
	width: 124px;
	height: 124px;
	overflow: visible;
	animation: hero-tampon 48s linear infinite;
}

.hero__tampon-texte text {
	fill: var(--wp--preset--color--bleu);
	font-family: var(--wp--preset--font-family--dm-sans);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: 2.4px;
}

.hero__tampon-centre {
	position: absolute;
	inset: 30px;
	display: grid;
	place-items: center;
	border: 1px solid var(--wp--preset--color--bleu);
	border-radius: 50%;
	background: var(--wp--custom--couleur--blanc-40);
}

.hero__tampon-centre::before {
	content: "";
	width: 32px;
	height: 32px;
	background: var(--wp--preset--color--bleu);
	-webkit-mask: url(../../assets/images/icones/fait-main.svg) center / contain no-repeat;
	mask: url(../../assets/images/icones/fait-main.svg) center / contain no-repeat;
}

@keyframes hero-tampon {
	to {
		transform: rotate(360deg);
	}
}

/* Jauges : une par diapositive, la jauge active se remplit pendant la durée d'affichage. */
.hero__navigation {
	position: absolute;
	z-index: 5;
	right: 0;
	bottom: 6px;
	left: 0;
	pointer-events: none;
}

.hero__navigation-interieur {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 20px;
}

.hero__points {
	display: flex;
	gap: 8px;
	pointer-events: auto;
}

.hero__point {
	position: relative;
	width: 56px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.hero__point::before,
.hero__point-remplissage {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	height: 2px;
	margin-top: -1px;
	border-radius: 2px;
}

.hero__point::before {
	right: 0;
	background: var(--wp--custom--couleur--blanc-40);
}

.hero__point-remplissage {
	width: 0;
	background: var(--wp--preset--color--blanc);
}

/* Tablette portrait : photo en haut (moitié de la largeur), textes dessous sur le fond pastel. */
@media (min-width: 768px) {
	.hero__piste {
		background: transparent;
	}

	.hero-diapo {
		display: flex;
		flex-direction: column;
		height: auto;
	}

	.hero-diapo__media {
		position: relative;
		flex: none;
		height: 50vw;
		overflow: hidden;
	}

	.hero-diapo__media::after {
		content: none;
	}

	.hero-diapo__image {
		object-position: var(--hero-position-tablette, 100% 50%);
	}

	.hero-diapo__emplacement {
		inset: 16px 36% 16px 16px;
		display: flex;
		align-items: flex-end;
		padding: 12px;
		border-radius: 14px;
	}

	.hero-diapo__emplacement span {
		position: static;
		max-width: none;
		background: var(--wp--custom--couleur--blanc-85);
		font-size: 10px;
	}

	.hero-diapo__decor {
		position: absolute;
		bottom: 0;
		left: 60%;
		display: block;
		width: 40%;
		height: 100%;
		overflow: hidden;
	}

	.hero-diapo__decor-image {
		position: absolute;
		top: 0;
		left: 50%;
		width: auto;
		max-width: none;
		height: 100%;
		mix-blend-mode: multiply;
		transform: translateX(-50%);
	}

	.hero-diapo__contenu {
		display: block;
		flex: 1;
		height: auto;
		max-width: none;
		margin: 0;
		padding: 32px 40px 80px;
	}

	.hero-diapo__textes {
		align-items: flex-start;
		gap: 12px;
		text-align: left;
	}

	.hero-diapo .is-style-sur-titre {
		color: var(--wp--preset--color--bleu);
	}

	.hero-diapo .hero-diapo__titre {
		max-width: none;
		color: var(--wp--preset--color--texte);
		line-height: 1.02;
		text-shadow: none;
	}

	.hero-diapo .hero-diapo__titre:has(.hero-diapo__ligne) {
		font-size: var(--wp--preset--font-size--titre-hero);
	}

	.hero-diapo__texte {
		display: block;
		max-width: 520px;
		color: var(--wp--preset--color--texte-secondaire);
		font-size: 16px;
		line-height: 1.5;
		text-wrap: pretty;
	}

	.hero-diapo .wp-block-buttons {
		justify-content: flex-start;
		margin-top: 6px;
	}

	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		width: 100%;
		max-width: 420px;
	}

	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) .wp-block-button__link {
		width: 100%;
		padding: 0 10px;
	}

	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) .a-fleche .wp-block-button__link::after {
		content: none;
	}

	.hero-diapo .wp-block-button .wp-block-button__link {
		background: var(--wp--preset--color--bleu);
		color: var(--wp--preset--color--blanc);
	}

	.hero-diapo .wp-block-button .wp-block-button__link:hover {
		background: var(--wp--preset--color--bleu-fonce);
		color: var(--wp--preset--color--blanc);
		opacity: 1;
	}

	.hero-diapo .wp-block-button.is-style-outline .wp-block-button__link,
	.hero-diapo .wp-block-button.is-style-outline .wp-block-button__link:hover {
		background: transparent;
		box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--bleu);
		color: var(--wp--preset--color--bleu);
	}

	.hero-diapo .a-fleche .wp-block-button__link::after {
		content: "";
		flex: none;
		width: 17px;
		height: 17px;
		background: currentColor;
		-webkit-mask: url(../../assets/images/icones/fleche-lien.svg) center / contain no-repeat;
		mask: url(../../assets/images/icones/fleche-lien.svg) center / contain no-repeat;
	}

	.hero__tampon {
		position: absolute;
		z-index: 4;
		top: calc(50vw - 53px);
		right: 40px;
		display: block;
		width: 124px;
		height: 124px;
		pointer-events: none;
		transform: scale(0.85);
		transform-origin: 100% 0;
	}

	.hero__navigation {
		bottom: 14px;
	}

	.hero__navigation-interieur {
		justify-content: flex-start;
		padding: 0 40px;
	}

	.hero__point::before {
		background: color-mix(in srgb, var(--wp--preset--color--texte) 16%, transparent);
	}

	.hero__point-remplissage {
		background: var(--wp--preset--color--texte);
	}
}

/* À partir de 1024 px : diapositives superposées en fondu, voile blanc à gauche, textes dans une grille 5/7. */
@media (min-width: 1024px) {
	.hero__piste {
		position: relative;
		display: block;
		height: 580px;
		overflow: hidden;
	}

	.hero-diapo {
		position: absolute;
		z-index: 1;
		inset: 0;
		display: block;
		width: auto;
		opacity: 0;
		pointer-events: none;
		transition: opacity var(--wp--custom--transition--fondu);
	}

	.hero-diapo.est-active,
	.hero:not(.est-pret) .hero-diapo:first-child {
		z-index: 2;
		opacity: 1;
		pointer-events: auto;
	}

	.hero-diapo__media {
		position: absolute;
		inset: 0;
		height: auto;
	}

	.hero-diapo__media::after {
		content: "";
		background: var(--wp--preset--gradient--voile-blanc-tablette);
	}

	.hero-diapo--emplacement .hero-diapo__media::after {
		content: none;
	}

	.hero-diapo__image {
		object-position: var(--hero-position, 50% 50%);
	}

	.hero-diapo__emplacement {
		inset: auto;
		top: 64px;
		left: calc((100% - min(100%, 1440px)) / 2 + var(--hero-p) + (min(100%, 1440px) - 2 * var(--hero-p) - 40px) * 5 / 12 + 40px);
		width: 440px;
		height: 470px;
		padding: 18px;
		border-radius: 16px;
	}

	.hero-diapo__emplacement span {
		padding: 7px 10px;
		font-size: 11px;
	}

	.hero-diapo__decor {
		right: calc((100% - min(100%, 1440px)) / 2 + var(--hero-p));
		left: auto;
		width: 252px;
		height: 420px;
	}

	.hero-diapo__decor-image {
		left: -84px;
		width: 420px;
		height: 420px;
		transform: none;
	}

	.hero-diapo__contenu {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: center;
		gap: 40px;
		height: 100%;
		max-width: 1440px;
		margin: 0 auto;
		padding: 0 var(--hero-p);
	}

	.hero-diapo__textes {
		gap: 24px;
		padding-bottom: 56px;
	}

	.hero-diapo .hero-diapo__titre {
		line-height: 0.98;
		letter-spacing: -0.025em;
	}

	/* La ligne peut dépasser la colonne de texte, sur la partie éclaircie de la photo. */
	.hero-diapo .hero-diapo__titre:has(.hero-diapo__ligne) {
		width: max-content;
	}

	.hero-diapo__texte {
		max-width: 440px;
		font-size: 18px;
		line-height: 1.55;
		text-wrap: wrap;
	}

	.hero-diapo .wp-block-buttons,
	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) {
		display: flex;
		gap: 12px;
		width: auto;
		max-width: none;
		margin-top: 0;
	}

	.hero-diapo .wp-block-button .wp-block-button__link,
	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) .wp-block-button__link {
		gap: 12px;
		width: auto;
		height: var(--wp--custom--hauteur--bouton);
		min-height: var(--wp--custom--hauteur--bouton);
		padding: 0 28px;
	}

	.hero-diapo .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link {
		padding: 0 24px;
	}

	.hero-diapo .a-fleche .wp-block-button__link::after,
	.hero-diapo .wp-block-buttons:has(> .wp-block-button + .wp-block-button) .a-fleche .wp-block-button__link::after {
		content: "";
		width: 18px;
		height: 18px;
	}

	.hero__tampon {
		top: 40px;
		right: var(--hero-p);
		transform: none;
	}

	.hero__navigation {
		bottom: 36px;
	}

	.hero__navigation-interieur {
		padding: 0 var(--hero-p);
	}

	.hero__point {
		height: 18px;
	}
}

@media (min-width: 1280px) {
	.hero__piste {
		height: 640px;
	}

	.hero-diapo__media::after {
		background: var(--wp--preset--gradient--voile-blanc);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero__tampon-texte {
		animation: none;
	}

	.hero-diapo {
		transition: none;
	}
}
