/* ==========================================================================
   A Loffre Zen — effets (front seulement).
   Tout est conditionné à la classe « alz-js », posée dans le <head> UNIQUEMENT si la personne accepte les
   animations (prefers-reduced-motion) ; « alz-go » lance les arrivées (posée par vapeur.js quand la
   première photo est prête, sinon par site.js, au plus tard 2,5 s après par le filet du <head>).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Arrivée sur l'accueil — elle se joue TOUTE SEULE au chargement, jamais au défilement :
   0,0 s  la vapeur se lève (vapeur.js) ; un filet d'or s'étire au-dessus de la signature
   0,3 s  la signature « A Loffre Zen » s'écrit de gauche à droite, avec un halo d'or qui s'éteint
   1,7 s  le titre monte, ligne par ligne, derrière un masque
   2,3 s  la phrase, puis les boutons, en fondu
   2,8 s  l'en-tête, la légende des photos et l'invitation à défiler
   -------------------------------------------------------------------------- */

.alz-js .alz-vapeur .wp-block-cover__inner-container > * {
	opacity: 0;
}

.alz-js.alz-go .alz-vapeur .wp-block-cover__inner-container > .is-style-surtitre {
	animation: alz-fondu-monte 1.2s var(--alz-courbe) 0.1s both;
}

.alz-js .alz-vapeur .alz-signature .alz-signature__svg {
	-webkit-mask-image: linear-gradient(90deg, #000 44%, transparent 56%);
	mask-image: linear-gradient(90deg, #000 44%, transparent 56%);
	-webkit-mask-size: 260% 100%;
	mask-size: 260% 100%;
	-webkit-mask-position: 100% 0;
	mask-position: 100% 0;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
}

.alz-js.alz-go .alz-vapeur .wp-block-cover__inner-container > .alz-signature {
	opacity: 1;
}

.alz-js.alz-go .alz-vapeur .alz-signature .alz-signature__svg {
	animation:
		alz-ecrire 2.1s cubic-bezier(0.55, 0.08, 0.32, 1) 0.3s both,
		alz-halo 3.2s ease-out 0.3s both;
}

@keyframes alz-ecrire {
	from {
		-webkit-mask-position: 100% 0;
		mask-position: 100% 0;
	}
	to {
		-webkit-mask-position: 0% 0;
		mask-position: 0% 0;
	}
}

@keyframes alz-halo {
	0% { filter: drop-shadow(0 0 0 rgba(233, 210, 156, 0)) drop-shadow(0 6px 30px rgba(0, 0, 0, 0.45)); }
	45% { filter: drop-shadow(0 0 18px rgba(233, 210, 156, 0.55)) drop-shadow(0 6px 30px rgba(0, 0, 0, 0.45)); }
	100% { filter: drop-shadow(0 0 0 rgba(233, 210, 156, 0)) drop-shadow(0 6px 30px rgba(0, 0, 0, 0.45)); }
}

/* Titre : chaque ligne monte derrière un masque (site.js découpe le titre en lignes). */
.alz-js.alz-go .alz-vapeur .wp-block-cover__inner-container > h1 {
	opacity: 1;
}

.alz-js .alz-hero h1 .alz-ligne {
	display: block;
	overflow: clip;
	padding-bottom: 0.08em;
	margin-bottom: -0.08em;
}

.alz-js .alz-hero h1 .alz-ligne > span {
	display: block;
	transform: translateY(110%);
}

.alz-js.alz-go .alz-vapeur h1 .alz-ligne > span {
	animation: alz-ligne 1.25s var(--alz-courbe) both;
	animation-delay: calc(1.7s + var(--alz-i, 0) * 0.14s);
}

@keyframes alz-ligne {
	to { transform: translateY(0); }
}

.alz-js.alz-go .alz-vapeur .wp-block-cover__inner-container > p:not(.is-style-surtitre):not(.alz-signature) {
	animation: alz-fondu-monte 1.2s var(--alz-courbe) 2.3s both;
}

.alz-js.alz-go .alz-vapeur .wp-block-cover__inner-container > .wp-block-buttons {
	animation: alz-fondu-monte 1.2s var(--alz-courbe) 2.55s both;
}

.alz-js .alz-accueil .alz-entete,
.alz-js .alz-vapeur__legende,
.alz-js .alz-vapeur .alz-defiler {
	opacity: 0;
}

.alz-js.alz-go .alz-accueil .alz-entete {
	animation: alz-fondu-descend 1.2s var(--alz-courbe) 2.7s both;
}

.alz-js.alz-go .alz-vapeur__legende,
.alz-js.alz-go .alz-vapeur .alz-defiler {
	animation: alz-fondu 1.4s ease 3s both;
}

@keyframes alz-fondu {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes alz-fondu-monte {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes alz-fondu-descend {
	from { opacity: 0; transform: translateY(-14px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Sans WebGL : la photo se pose doucement (vapeur.js pose « alz-vapeur--simple »). */
.alz-js .alz-vapeur--simple .wp-block-cover__image-background {
	animation: alz-pose 3.2s var(--alz-courbe) both;
}

@keyframes alz-pose {
	from { opacity: 0; transform: scale(1.12); }
	to { opacity: 1; transform: scale(1); }
}

/* Avec WebGL, la photo d'origine reste dessous (repli, référencement) mais la toile la recouvre. */
.alz-vapeur.alz-vapeur--webgl .wp-block-cover__image-background {
	visibility: hidden;
}

/* --------------------------------------------------------------------------
   Premier écran des pages intérieures : la photo se pose, le titre monte.
   -------------------------------------------------------------------------- */

.alz-js .alz-hero--page .wp-block-cover__image-background {
	animation: alz-pose-lente 2.6s var(--alz-courbe) both;
}

@keyframes alz-pose-lente {
	from { transform: scale(1.14); filter: brightness(0.4); }
	to { transform: scale(1); filter: brightness(1); }
}

.alz-js .alz-hero--page .wp-block-cover__inner-container > * {
	animation: alz-fondu-monte 1.2s var(--alz-courbe) both;
	animation-delay: calc(0.35s + var(--alz-i, 0) * 0.12s);
}

.alz-js .alz-hero--page h1 .alz-ligne > span {
	animation: alz-ligne 1.25s var(--alz-courbe) both;
	animation-delay: calc(0.5s + var(--alz-i, 0) * 0.12s);
}

/* --------------------------------------------------------------------------
   Apparitions au défilement (site.js pose « alz-a-reveler », puis « est-revele »).
   -------------------------------------------------------------------------- */

.alz-js .alz-a-reveler {
	opacity: 0;
	transform: translateY(34px);
	transition: opacity 1.1s var(--alz-courbe), transform 1.3s var(--alz-courbe);
	transition-delay: calc(var(--alz-delai, 0) * 0.09s);
}

.alz-js .alz-a-reveler.est-revele {
	opacity: 1;
	transform: none;
}

/* Les photos se dévoilent par le bas, en se posant. */
.alz-js .alz-a-reveler.alz-revele-image {
	opacity: 1;
	transform: none;
	clip-path: inset(18% 0 0 0);
	overflow: clip; /* la photo agrandie pendant le dévoilement ne compte pas dans la largeur de la page */
	transition: clip-path 1.5s var(--alz-courbe-douce);
	transition-delay: calc(var(--alz-delai, 0) * 0.1s);
}

.alz-js .alz-a-reveler.alz-revele-image img {
	transform: scale(1.16);
	transition: transform 2.2s var(--alz-courbe);
	transition-delay: calc(var(--alz-delai, 0) * 0.1s);
}

.alz-js .alz-a-reveler.alz-revele-image.est-revele {
	clip-path: inset(0 0 0 0);
}

.alz-js .alz-a-reveler.alz-revele-image.est-revele img {
	transform: scale(1);
}

/* Parallaxe douce (mosaïques) : site.js pose --alz-decalage. */
.alz-js .alz-parallaxe {
	will-change: transform;
}

.alz-js .alz-parallaxe img {
	transform: translateY(var(--alz-decalage, 0)) scale(1.2);
	transition: none;
}

/* Bandeau défilant. */
.alz-js .alz-defilant__piste {
	animation: alz-defile 60s linear infinite;
}

.alz-defilant:hover .alz-defilant__piste {
	animation-play-state: paused;
}

@keyframes alz-defile {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

/* Menu : rideau qui descend, liens qui montent un par un. */
.alz-js body.alz-menu-ouvert .alz-menu {
	animation: alz-rideau 0.85s var(--alz-courbe-douce) both;
}

.alz-js body.alz-menu-fermeture .alz-menu {
	animation: alz-rideau-remonte 0.55s var(--alz-courbe-douce) both;
}

@keyframes alz-rideau {
	from { clip-path: inset(0 0 100% 0); }
	to { clip-path: inset(0 0 0 0); }
}

@keyframes alz-rideau-remonte {
	from { clip-path: inset(0 0 0 0); }
	to { clip-path: inset(0 0 100% 0); }
}

.alz-js body.alz-menu-ouvert .alz-menu__principal .wp-block-navigation-item {
	animation: alz-fondu-monte 0.9s var(--alz-courbe) both;
	animation-delay: calc(0.25s + var(--alz-i, 0) * 0.06s);
}

.alz-js body.alz-menu-ouvert :is(.alz-menu__secondaire, .alz-menu__cote) {
	animation: alz-fondu 1s ease 0.6s both;
}
