/* Sticky header - Hk (livraison 232) : voir inc/elements/sticky-header-controls.php et inc/assets/js/sticky-header.js.
   Le script pose sur le conteneur : hk-sh-active (collé), hk-sh-top / hk-sh-scrolled, hk-sh-hidden.
   Rien ne s'applique tant que le script n'a pas posé hk-sh-active (appareil désactivé = en-tête normal). */

.hk-sh-on.hk-sh-active {
	position: fixed !important;
	top: var(--hk-sh-top, 0px) !important;
	left: 0;
	right: 0;
	width: 100% !important;
	max-width: 100%;
	margin-top: 0 !important;
	z-index: 999;
	box-sizing: border-box;
	--hk-sh-e: var(--hk-sh-ease, cubic-bezier(.22, .61, .36, 1));
	--hk-sh-hd2: var(--hk-sh-hd3, var(--hk-sh-hd, var(--hk-sh-dur2, var(--hk-sh-dur, .35s))));
	--hk-sh-sd2: var(--hk-sh-sd3, var(--hk-sh-sd, var(--hk-sh-hd2)));
	/* 235 : l'apparition (transform, opacité, flou, rideau) a sa propre durée et sa courbe */
	transition:
		transform var(--hk-sh-sd2) var(--hk-sh-e),
		opacity var(--hk-sh-sd2) var(--hk-sh-e),
		filter var(--hk-sh-sd2) var(--hk-sh-e),
		clip-path var(--hk-sh-sd2) var(--hk-sh-e),
		background-color var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		padding var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		min-height var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		box-shadow var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		border-color var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		backdrop-filter var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		-webkit-backdrop-filter var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1);
	will-change: transform;
}

/* disparition : durée et délai propres (le retour, lui, part sans délai) */
.hk-sh-on.hk-sh-active.hk-sh-hidden {
	transition:
		transform var(--hk-sh-hd2) var(--hk-sh-e) var(--hk-sh-hdl2, var(--hk-sh-hdl, 0s)),
		opacity var(--hk-sh-hd2) var(--hk-sh-e) var(--hk-sh-hdl2, var(--hk-sh-hdl, 0s)),
		filter var(--hk-sh-hd2) var(--hk-sh-e) var(--hk-sh-hdl2, var(--hk-sh-hdl, 0s)),
		clip-path var(--hk-sh-hd2) var(--hk-sh-e) var(--hk-sh-hdl2, var(--hk-sh-hdl, 0s)),
		background-color var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		padding var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		min-height var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		box-shadow var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		border-color var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		backdrop-filter var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1),
		-webkit-backdrop-filter var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1);
}

.hk-sh-spacer {
	display: block;
	width: 100%;
	pointer-events: none;
}

/* Masquer en descendant */
.hk-sh-on.hk-sh-active.hk-sh-hidden {
	transform: translate3d(0, calc(-100% - var(--hk-sh-top, 0px) - 2px), 0);
}

/* Transparent en haut de page */
.hk-sh-tr-on.hk-sh-active.hk-sh-top {
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border-bottom-color: transparent !important;
}

.hk-sh-tr-on.hk-sh-active.hk-sh-top::before {
	opacity: 0 !important; /* calque d'arrière-plan (overlay) d'Elementor */
}

/* Bordure et ombre au scroll */
.hk-sh-bd-on.hk-sh-active.hk-sh-scrolled {
	border-bottom: var(--hk-sh-bw, 1px) solid var(--hk-sh-bc, rgba(0, 0, 0, .12)) !important;
}

.hk-sh-sh-on.hk-sh-active.hk-sh-scrolled {
	box-shadow: 0 calc(var(--hk-sh-ss, 18px) / 3) var(--hk-sh-ss, 18px) var(--hk-sh-sc, rgba(0, 0, 0, .15)) !important;
}

/* Flou de ce qui passe derrière */
.hk-sh-blur-on.hk-sh-active.hk-sh-scrolled {
	-webkit-backdrop-filter: blur(var(--hk-sh-blur, 12px)) saturate(var(--hk-sh-sat, 140%)) brightness(var(--hk-sh-bri, 100%));
	backdrop-filter: blur(var(--hk-sh-blur, 12px)) saturate(var(--hk-sh-sat, 140%)) brightness(var(--hk-sh-bri, 100%));
}

/* Logo réduit : la hauteur d'origine est mesurée par le script (--hk-sh-lh) */
.hk-sh-logo-on.hk-sh-active .hk-sh-logo-img {
	transition: height var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1), width var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) cubic-bezier(.22, .61, .36, 1);
}

.hk-sh-logo-on.hk-sh-active.hk-sh-ready .hk-sh-logo-img {
	height: var(--hk-sh-lh) !important;
	width: auto !important;
	max-width: none !important;
}

.hk-sh-logo-on.hk-sh-active.hk-sh-ready.hk-sh-scrolled .hk-sh-logo-img {
	height: calc(var(--hk-sh-lh) * var(--hk-sh-ls, 70) / 100) !important;
}

/* ---------- 233 : couleur du logo ---------- */
.hk-sh-active .hk-sh-logo-img {
	transition-property: height, width, filter, opacity;
}

.hk-sh-lf-white.hk-sh-active.hk-sh-scrolled .hk-sh-logo-img,
.hk-sh-lft-white.hk-sh-active.hk-sh-top .hk-sh-logo-img {
	filter: brightness(0) invert(1);
}

.hk-sh-lf-black.hk-sh-active.hk-sh-scrolled .hk-sh-logo-img,
.hk-sh-lft-black.hk-sh-active.hk-sh-top .hk-sh-logo-img {
	filter: brightness(0);
}

.hk-sh-lf-invert.hk-sh-active.hk-sh-scrolled .hk-sh-logo-img,
.hk-sh-lft-invert.hk-sh-active.hk-sh-top .hk-sh-logo-img {
	filter: invert(1);
}

/* ---------- 233 : logo de remplacement (ajouté par le script à côté du logo) ---------- */
.hk-sh-lp {
	position: relative;
	display: inline-block;
	line-height: 0;
	max-width: 100%;
}

.hk-sh-logo-alt {
	position: absolute;
	top: 0;
	left: 0;
	height: 100% !important;
	width: auto !important;
	max-width: none !important;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) ease;
}

.hk-sh-la-scrolled.hk-sh-active.hk-sh-scrolled .hk-sh-logo-alt,
.hk-sh-la-top.hk-sh-active.hk-sh-top .hk-sh-logo-alt {
	opacity: 1;
}

.hk-sh-la-scrolled.hk-sh-active.hk-sh-scrolled .hk-sh-has-alt,
.hk-sh-la-top.hk-sh-active.hk-sh-top .hk-sh-has-alt {
	opacity: 0;
}

/* ---------- 233 : flèche « retour en haut » (même dessin que celle de FOLIO Scroll 2027) ---------- */
.hk-shu {
	position: fixed;
	right: var(--hk-shu-m, 36px);
	bottom: calc(var(--hk-shu-m, 36px) + env(safe-area-inset-bottom, 0px));
	z-index: 2147483000;
	display: block;
	padding: 14px 4px;
	line-height: 0;
	color: var(--hk-shu-c, #fff);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(10px);
	transition: opacity .45s cubic-bezier(.25, .74, .22, .99), transform .45s cubic-bezier(.25, .74, .22, .99), top .35s ease, visibility 0s linear .45s;
	-webkit-tap-highlight-color: transparent;
}

.hk-shu--tr {
	bottom: auto;
	top: var(--hk-shu-top, 100px);
	transform: translateY(-10px);
}

.hk-shu--blend {
	mix-blend-mode: difference;
}

.hk-shu.is-shown {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
	transition-delay: 0s;
}

.hk-shu svg {
	display: block;
	width: 46px;
	height: 9px;
	overflow: visible;
	transition: transform .4s cubic-bezier(.25, .74, .22, .99);
}

.hk-shu:hover svg,
.hk-shu:focus-visible svg {
	transform: translateY(-3px);
}

.hk-shu:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 2px;
}

/* ---------- 234 : élément encore à sa place normale (pas encore collé) ---------- */
.hk-sh-on.hk-sh-active.hk-sh-flow {
	position: relative !important;
	top: auto !important;
	transform: none !important;
}

.hk-sh-ov-on.hk-sh-active.hk-sh-flow {
	position: absolute !important;
}

/* ---------- 234-235 : styles de disparition (le retour joue le même mouvement à l'envers) ---------- */
.hk-sh-active.hk-sh-hidden:is(.hk-sh-hfx-fade, .hk-sh-hfx-slide-fade, .hk-sh-hfx-lift, .hk-sh-hfx-scale, .hk-sh-hfx-blur, .hk-sh-hfx-curtain) {
	pointer-events: none;
}

.hk-sh-hfx-fade.hk-sh-active.hk-sh-hidden {
	transform: none;
	opacity: var(--hk-sh-hop, 0) !important;
}

.hk-sh-hfx-slide-fade.hk-sh-active.hk-sh-hidden {
	opacity: var(--hk-sh-hop, 0) !important;
}

.hk-sh-hfx-lift.hk-sh-active.hk-sh-hidden {
	transform: translate3d(0, -30%, 0);
	opacity: var(--hk-sh-hop, 0) !important;
}

.hk-sh-hfx-scale.hk-sh-active {
	transform-origin: 50% 0;
}

.hk-sh-hfx-scale.hk-sh-active.hk-sh-hidden {
	transform: scale(.92);
	opacity: var(--hk-sh-hop, 0) !important;
}

.hk-sh-hfx-blur.hk-sh-active.hk-sh-hidden {
	transform: none;
	filter: blur(10px);
	opacity: var(--hk-sh-hop, 0) !important;
}

/* rideau : la découpe laisse dépasser ombres et sous-menus tant que l'en-tête est visible */
.hk-sh-hfx-curtain.hk-sh-active {
	clip-path: inset(-50vh -50vw -100vh -50vw);
}

.hk-sh-hfx-curtain.hk-sh-active.hk-sh-hidden {
	transform: none;
	clip-path: inset(0 0 100% 0);
}

/* ---------- 234 : animation d'entrée au chargement de la page (jouée une seule fois : le script retire hk-sh-in à la fin, 237) ---------- */
@keyframes hk-sh-in-slide {
	from { transform: translate3d(0, -100%, 0); }
	to { transform: none; }
}

@keyframes hk-sh-in-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.hk-sh-in-slide.hk-sh-active.hk-sh-in {
	animation: hk-sh-in-slide calc(var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) * 2) cubic-bezier(.22, .61, .36, 1) var(--hk-sh-delay2, var(--hk-sh-delay, 0s)) both;
}

.hk-sh-in-fade.hk-sh-active.hk-sh-in {
	animation: hk-sh-in-fade calc(var(--hk-sh-dur2, var(--hk-sh-dur, .35s)) * 2) ease var(--hk-sh-delay2, var(--hk-sh-delay, 0s)) both;
}

@media (prefers-reduced-motion: reduce) {
	.hk-sh-on.hk-sh-active,
	.hk-sh-logo-on.hk-sh-active .hk-sh-logo-img,
	.hk-sh-logo-alt,
	.hk-shu,
	.hk-shu svg {
		transition-duration: 0s !important;
	}

	.hk-sh-on.hk-sh-in {
		animation: none !important;
	}
}

/* 242 / 257 : dans l'éditeur, un conteneur ignoré par le garde-fou (contenu FOLIO ou trop haut) est signalé par un petit badge discret.
   Le ::before des conteneurs Elementor sert de calque de fond (largeur et hauteur 100 %) : on le ramène à la taille d'une pastille
   transparente pour qu'il ne recouvre plus le contenu. */
body.elementor-editor-active .hk-sh-on.hk-sh-skip { outline: 1px dashed rgba(214, 54, 56, .55); outline-offset: -1px; }
body.elementor-editor-active .hk-sh-on.hk-sh-skip::before {
	content: "Sticky header ignoré : ce conteneur n’est pas un en-tête";
	position: absolute !important; z-index: 9999; top: 4px !important; left: 4px !important; right: auto !important; bottom: auto !important;
	width: auto !important; height: auto !important; min-height: 0 !important;
	padding: 2px 8px; font: 500 10px/1.4 sans-serif; color: #7a2b2c;
	background: rgba(255, 255, 255, .88) !important; background-image: none !important;
	border: 1px solid rgba(214, 54, 56, .45); border-radius: 99px;
	opacity: .85 !important; pointer-events: none; mix-blend-mode: normal;
}
body.elementor-editor-active .hk-sh-nw-on.hk-sh-skip { outline: none; }
body.elementor-editor-active .hk-sh-nw-on.hk-sh-skip::before { display: none !important; }
