/* HDKN Immersif : section pilotée par le scroll.
   Sans la classe hf-imm-on (animations réduites, économiseur de données, pas d'images),
   la section reste une ouverture classique : image d'affiche et textes empilés. */

:root { --hf-head: 0px; }

html, body { overflow-x: clip; }

.hf-immersif { position: relative; }

.hf-immersif .hf-immersif__stage {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background-color: #0F2A44;
	background-image: var(--hf-poster, none);
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

/* Vignette douce + voile pour garder les textes lisibles sur n'importe quelle image */
.hf-immersif .hf-immersif__stage::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(120% 90% at 50% 45%, rgba(10, 31, 51, 0) 55%, rgba(10, 31, 51, .45) 100%);
}

.hf-immersif .hf-immersif__stage::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(15, 42, 68, .78) 0%, rgba(15, 42, 68, .5) 42%, rgba(15, 42, 68, 0) 72%),
		linear-gradient(0deg, rgba(15, 42, 68, .55) 0%, rgba(15, 42, 68, 0) 38%);
}

.hf-immersif__canvas {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	display: block;
}

/* ---------- Séquence active ---------- */

.hf-imm-on .hf-immersif { min-height: var(--hf-len, 520svh); }

.hf-imm-on .hf-immersif .hf-immersif__stage {
	position: sticky;
	top: var(--hf-head);
	height: calc(100svh - var(--hf-head));
	min-height: 0;
}

.hf-imm-on .hf-immersif .hf-step {
	position: absolute !important;
	left: clamp(20px, 6vw, 96px);
	right: clamp(20px, 6vw, 96px);
	bottom: clamp(72px, 14vh, 140px);
	width: auto !important;
	max-width: 680px;
	margin: 0 !important;
	opacity: 0;
	visibility: hidden;
	transform: translateY(24px);
	transition: opacity .7s ease, transform .7s ease, visibility 0s linear .7s;
}

.hf-imm-on .hf-immersif .hf-step.is-active {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .7s ease, transform .7s ease, visibility 0s;
}

/* Révélation des textes, élément par élément */
.hf-imm-on .hf-immersif .hf-step > .elementor-element {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
}
.hf-imm-on .hf-immersif .hf-step.is-active > .elementor-element { opacity: 1; transform: none; }
.hf-imm-on .hf-immersif .hf-step.is-active > .elementor-element:nth-child(2) { transition-delay: .1s; }
.hf-imm-on .hf-immersif .hf-step.is-active > .elementor-element:nth-child(3) { transition-delay: .2s; }
.hf-imm-on .hf-immersif .hf-step.is-active > .elementor-element:nth-child(4) { transition-delay: .3s; }

/* Chapitres : points et libellés à droite, compteur sur mobile */
.hf-chapters {
	position: absolute;
	right: clamp(16px, 3vw, 40px);
	top: 50%;
	z-index: 3;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
/* Chaque ligne cale son bouton à droite : les points restent alignés quelle que soit la longueur du libellé */
.hf-immersif .hf-chapters li {
	display: flex;
	justify-content: flex-end;
	margin: 0;
	padding: 0;
	list-style: none;
}
.hf-immersif .hf-chapters button,
.hf-immersif .hf-chapters button:hover,
.hf-immersif .hf-chapters button:focus {
	all: unset;
	background: none !important;
	border: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	min-height: 32px;
	margin-left: auto;
	cursor: pointer;
	color: rgba(255, 255, 255, .7);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .01em;
}
.hf-chapters button span {
	opacity: 0;
	transform: translateX(6px);
	transition: opacity .35s ease, transform .35s ease;
	white-space: nowrap;
	text-shadow: 0 1px 8px rgba(10, 31, 51, .6);
}
.hf-chapters button i {
	display: block;
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .55);
	transition: height .35s ease, background-color .35s ease;
}
.hf-chapters button:hover span,
.hf-chapters button:focus-visible span,
.hf-chapters button[aria-current="step"] span { opacity: 1; transform: none; }
.hf-chapters button[aria-current="step"] { color: #fff; }
.hf-chapters button[aria-current="step"] i { height: 26px; background: #79D024; }
.hf-chapters button:focus-visible { outline: 3px solid #79D024; outline-offset: 4px; border-radius: 6px; }

.hf-counter {
	position: absolute;
	left: clamp(20px, 6vw, 96px);
	top: 24px;
	z-index: 3;
	display: none;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .08em;
	font-variant-numeric: tabular-nums;
}
.hf-counter b { color: #79D024; font-weight: 800; }


/* Lien « Passer l'intro », indicateur de défilement, barre de progression */
.hf-skip {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .16);
	border: 1px solid rgba(255, 255, 255, .45);
	color: #fff !important;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none !important;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.hf-skip:hover, .hf-skip:focus-visible { background: rgba(255, 255, 255, .28); }
.hf-skip:focus-visible { outline: 3px solid #79D024; outline-offset: 3px; }

.hf-hint {
	position: absolute;
	left: 50%;
	bottom: 24px;
	z-index: 2;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	transition: opacity .5s ease;
	pointer-events: none;
}
.hf-hint svg { animation: hf-bob 2s ease-in-out infinite; }
.hf-hint.is-hidden { opacity: 0; }
@keyframes hf-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

.hf-progress {
	position: absolute;
	left: 0;
	bottom: 0;
	z-index: 2;
	height: 4px;
	width: 100%;
	background: rgba(255, 255, 255, .18);
	pointer-events: none;
}
.hf-progress span {
	display: block;
	height: 100%;
	width: 100%;
	background: #79D024;
	transform-origin: left center;
	transform: scaleX(0);
}

/* ---------- Mode statique (animations réduites, données réduites, pas d'images) ---------- */

html:not(.hf-imm-on) .hf-immersif .hf-immersif__stage {
	min-height: 70svh;
	justify-content: flex-end;
}
html:not(.hf-imm-on) .hf-immersif .hf-step { position: relative; }
html:not(.hf-imm-on) .hf-hint,
html:not(.hf-imm-on) .hf-progress,
html:not(.hf-imm-on) .hf-chapters,
html:not(.hf-imm-on) .hf-counter { display: none; }

/* ---------- Mobile : voile par le bas, textes en bas d'écran ---------- */

@media (max-width: 767px), (max-aspect-ratio: 1/1) {
	.hf-immersif .hf-immersif__stage::before {
		background:
			linear-gradient(0deg, rgba(15, 42, 68, .88) 0%, rgba(15, 42, 68, .6) 38%, rgba(15, 42, 68, 0) 70%);
	}
	.hf-imm-on .hf-immersif .hf-step {
		left: 20px;
		right: 20px;
		bottom: 112px;
		max-width: none;
	}
	.hf-skip { top: 12px; right: 12px; font-size: 14px; padding: 0 14px; }
	.hf-chapters { display: none; }
	.hf-counter { display: block; left: 20px; top: 22px; }
	.hf-hint { bottom: 90px; }
	.hf-progress { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
	.hf-hint svg { animation: none; }
}
