/**
 * Arnaud Photo — compléments au theme.json.
 * Mise en scène, animations et survols. Tout ce qui bouge est neutralisé
 * sous « prefers-reduced-motion » (bloc en fin de fichier).
 */

/* ====================================================== apparitions au scroll */

.reveal,
.reveal-group > * {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition:
		opacity 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
		transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1);
	transition-delay: var(--reveal-delay, 0ms);
}

.reveal.is-visible,
.reveal-group > .is-visible {
	opacity: 1;
	transform: none;
}

/* Sans JavaScript, rien ne doit rester invisible. */
html:not(.motion-ready) .reveal,
html:not(.motion-ready) .reveal-group > * {
	opacity: 1;
	transform: none;
}

/* ======================================================= barre de progression */

.scroll-progress {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 100;
	height: 2px;
	background: var(--wp--preset--color--accent, #b4551f);
	transform: scaleX(0);
	transform-origin: 0 50%;
	pointer-events: none;
}

/* ================================================================== en-tête */

.wp-site-blocks > header {
	position: sticky;
	top: 0;
	z-index: 90;
	transition: background-color 0.4s ease, border-color 0.4s ease, padding 0.4s ease;
}

.wp-site-blocks > header.is-scrolled {
	background-color: rgba(250, 249, 247, 0.88);
	-webkit-backdrop-filter: saturate(160%) blur(12px);
	backdrop-filter: saturate(160%) blur(12px);
}

/* Sur l'accueil, l'en-tête flotte au-dessus de la photo avant le défilement. */
body.home .wp-site-blocks > header {
	position: fixed;
	inset: 0 0 auto 0;
	background-color: transparent;
}

/* Le filet est porté par le groupe interne, pas par la partie de gabarit. */
body.home .wp-site-blocks > header:not(.is-scrolled) header,
body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-group {
	border-bottom-color: transparent !important;
}

/* Les classes de couleur de WordPress sont en !important : il faut les battre.
   Le menu déplié est exclu : il a son propre fond, et du blanc sur blanc
   rendrait les liens invisibles. */
body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-site-title a,
body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-site-tagline,
body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) a {
	color: #fff !important;
	text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
}

body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-site-tagline {
	opacity: 0.9;
}

body.home .wp-site-blocks > header:not(.is-scrolled) .wp-block-navigation__responsive-container-open svg {
	fill: #fff;
}

/* ============================================================ bandeau d'accueil */

.hero-cover {
	overflow: hidden;
}

.hero-cover .wp-block-cover__inner-container {
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
}

/* Lent travelling avant : la photo n'est jamais tout à fait immobile. */
.hero-cover .wp-block-cover__image-background {
	animation: slow-zoom 22s ease-out forwards;
}

@keyframes slow-zoom {
	from {
		transform: scale(1.12);
	}
	to {
		transform: scale(1);
	}
}

/* Le titre se déplie au chargement. */
.hero-cover h1 {
	animation: rise-in 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.hero-cover .wp-block-cover__inner-container > p {
	animation: rise-in 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) 0.18s both;
}

.hero-cover .wp-block-buttons {
	animation: rise-in 1.3s cubic-bezier(0.22, 0.61, 0.36, 1) 0.36s both;
}

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translate3d(0, 34px, 0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Invitation à faire défiler. */
.scroll-hint {
	position: absolute;
	left: 50%;
	bottom: 2.2rem;
	z-index: 3;
	width: 1px;
	height: 56px;
	margin-left: -0.5px;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
	overflow: hidden;
}

.scroll-hint::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.95);
	animation: hint-slide 2.4s ease-in-out infinite;
}

@keyframes hint-slide {
	0% {
		transform: translateY(-100%);
	}
	60%,
	100% {
		transform: translateY(100%);
	}
}

/* ================================================== sections photo plein cadre */

.full-bleed-media {
	position: relative;
	overflow: hidden;
}

.full-bleed-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Dans une section « duo », les deux colonnes doivent faire la même hauteur :
   « align-self: center » posé par l'éditeur les rétrécit, on le neutralise et
   on recentre le contenu à l'intérieur. */
.wp-block-columns.alignfull > .wp-block-column.is-vertically-aligned-center {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Colonne image d'une section « duo » : elle occupe toute la hauteur du texte. */
.media-column {
	align-self: stretch;
	overflow: hidden;
}

.media-column figure,
.media-column img {
	height: 100%;
	margin: 0;
}

.media-column img {
	width: 100%;
	object-fit: cover;
	min-height: 420px;
	transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.media-column:hover img {
	transform: scale(1.05);
}

/* ================================================================= galeries */

.wp-block-gallery.has-nested-images figure.wp-block-image {
	overflow: hidden;
	position: relative;
}

.gallery-uniform .wp-block-image img,
.gallery-uniform figure.wp-block-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 3 / 2;
	display: block;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	transition:
		transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1),
		filter 0.6s ease;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
	transform: scale(1.07);
}

/* Voile progressif au survol, pour détacher l'image de ses voisines. */
.wp-block-gallery.has-nested-images figure.wp-block-image::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0) 55%);
	opacity: 0;
	transition: opacity 0.5s ease;
}

.wp-block-gallery.has-nested-images figure.wp-block-image:hover::after {
	opacity: 1;
}

/* ===================================================== cartes de destination */

.destination-card {
	position: relative;
	display: block;
	overflow: hidden;
	margin: 0;
}

.destination-card img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.destination-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(10, 12, 14, 0.72), rgba(10, 12, 14, 0.05) 60%);
	transition: opacity 0.5s ease;
	pointer-events: none;
}

.destination-card:hover img,
.destination-card:focus-within img {
	transform: scale(1.06);
}

.destination-card:hover::after,
.destination-card:focus-within::after {
	opacity: 0.78;
}

/* Titre posé sur l'image. */
.destination-tile {
	position: relative;
}

.destination-tile .destination-label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 1.4rem 1.5rem;
	pointer-events: none;
}

.destination-tile .destination-label h2,
.destination-tile .destination-label h3 {
	margin: 0;
	color: #fff;
}

.destination-tile .destination-label h2 a,
.destination-tile .destination-label h3 a {
	color: #fff;
	text-decoration: none;
	pointer-events: auto;
}

.destination-tile .destination-label p {
	margin: 0.25rem 0 0;
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.75rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	transform: translateY(6px);
	opacity: 0;
	transition: opacity 0.45s ease, transform 0.45s ease;
}

.destination-tile:hover .destination-label p,
.destination-tile:focus-within .destination-label p {
	opacity: 1;
	transform: none;
}

/* ================================================================ compteurs */

.stat-row {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5rem 4rem;
}

.stat-item .stat-number {
	display: block;
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.75rem, 6vw, 4.5rem);
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.stat-item .stat-label {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	opacity: 0.7;
}

/* ================================================================== bandeau */

.marquee {
	overflow: hidden;
	width: 100%;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
	display: flex;
	width: max-content;
	gap: 14px;
	animation: marquee-scroll 64s linear infinite;
}

.marquee:hover .marquee__track {
	animation-play-state: paused;
}

.marquee__track img {
	display: block;
	height: 230px;
	width: auto;
	flex: 0 0 auto;
	object-fit: cover;
}

@keyframes marquee-scroll {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		/* La piste contient deux fois la même suite : -50 % boucle sans saut. */
		transform: translate3d(-50%, 0, 0);
	}
}

/* ============================================================ façade vidéo */

.video-facade {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	margin: 0;
	padding: 0;
	border: 0;
	overflow: hidden;
	cursor: pointer;
	background-color: var(--wp--preset--color--night, #0e1012);
	background-size: cover;
	background-position: center;
}

.video-facade iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-facade::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
	transition: background 0.4s ease;
}

.video-facade:hover::after {
	background: rgba(0, 0, 0, 0.18);
}

.video-facade.is-playing::after,
.video-facade.is-playing .video-facade__play,
.video-facade.is-playing .video-facade__note {
	display: none;
}

.video-facade__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 92px;
	height: 92px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.94);
	transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.35s ease;
}

.video-facade__play::before {
	content: "";
	width: 0;
	height: 0;
	margin-left: 7px;
	border-style: solid;
	border-width: 14px 0 14px 23px;
	border-color: transparent transparent transparent #111315;
}

/* Halo qui pulse pour signaler que c'est cliquable. */
.video-facade__play::after {
	content: "";
	position: absolute;
	inset: -14px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	animation: pulse-ring 2.6s ease-out infinite;
}

@keyframes pulse-ring {
	0% {
		transform: scale(0.9);
		opacity: 0.85;
	}
	70%,
	100% {
		transform: scale(1.25);
		opacity: 0;
	}
}

.video-facade:hover .video-facade__play,
.video-facade:focus-visible .video-facade__play {
	transform: translate(-50%, -50%) scale(1.09);
	background: #fff;
}

.video-facade:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent, #b4551f);
	outline-offset: 3px;
}

.video-facade__note {
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 2;
	max-width: 100%;
	margin: 0;
	padding: 0.6rem 0.9rem;
	color: rgba(255, 255, 255, 0.86);
	background: rgba(0, 0, 0, 0.45);
	font-size: 0.75rem;
	line-height: 1.4;
}

/* ================================================================== divers */

.wp-block-navigation a {
	text-decoration: none;
	position: relative;
}

.wp-block-navigation a::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.45em;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: 100% 50%;
	transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wp-block-navigation a:hover::after,
.wp-block-navigation .current-menu-item a::after {
	transform: scaleX(1);
	transform-origin: 0 50%;
}

/* Le bouton se remplit depuis la gauche. */
.wp-block-button__link {
	position: relative;
	overflow: hidden;
	z-index: 0;
	transition: color 0.4s ease;
}

.wp-block-button__link::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--accent, #b4551f);
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.wp-block-button__link:hover::before {
	transform: scaleX(1);
}

.wp-block-button__link:hover {
	color: #fff;
}

/* Titres de section : filet animé au-dessus. */
.section-kicker {
	display: flex;
	align-items: center;
	gap: 0.9rem;
}

.section-kicker::before {
	content: "";
	width: 3rem;
	height: 1px;
	background: currentColor;
	opacity: 0.5;
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.2s;
}

.is-visible .section-kicker::before,
.section-kicker.is-visible::before {
	transform: scaleX(1);
}

/* Accessibilité : cible tactile suffisante sur les petits liens. */
@media (max-width: 600px) {
	.wp-block-navigation .wp-block-navigation-item__content {
		padding-block: 0.35rem;
	}

	.media-column img {
		min-height: 280px;
	}

	.marquee__track img {
		height: 150px;
	}

	.destination-card img {
		aspect-ratio: 4 / 3;
	}
}

/* =========================================== respect des préférences système */

@media (prefers-reduced-motion: reduce) {
	.reveal,
	.reveal-group > * {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	.hero-cover .wp-block-cover__image-background,
	.hero-cover h1,
	.hero-cover .wp-block-cover__inner-container > p,
	.hero-cover .wp-block-buttons,
	.scroll-hint::after,
	.video-facade__play::after {
		animation: none !important;
	}

	.marquee__track {
		animation: none !important;
	}

	.wp-block-gallery.has-nested-images figure.wp-block-image img,
	.destination-card img,
	.media-column img,
	.video-facade__play,
	.wp-block-button__link::before,
	.wp-block-navigation a::after,
	.section-kicker::before {
		transition: none !important;
	}

	.wp-block-gallery.has-nested-images figure.wp-block-image:hover img,
	.destination-card:hover img,
	.media-column:hover img {
		transform: none !important;
	}

	.scroll-progress {
		display: none;
	}
}

/* Sur petit écran, la ligne de métiers ferait passer l'en-tête sur trois lignes. */
@media (max-width: 600px) {
	.wp-site-blocks > header .wp-block-site-tagline {
		display: none;
	}
}

/* ======================================================= menu mobile déplié */

/* Panneau sombre : cohérent avec le pied de page et les bandes de chiffres,
   et surtout impossible à confondre avec du texte clair sur fond clair. */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--night, #0e1012) !important;
	padding: 5rem 1.75rem 3rem;
}

.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation__responsive-container.is-menu-open a,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--base, #faf9f7) !important;
	text-shadow: none !important;
}

/* Des cibles tactiles confortables, et une taille lisible :
   13 px convenaient à la barre du haut, pas à un menu plein écran. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 1.15rem 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.5rem;
	letter-spacing: 0.02em;
	text-transform: none;
}

/* Le soulignement animé de la barre du haut n'a pas de sens ici. */
.wp-block-navigation__responsive-container.is-menu-open a::after {
	display: none;
}

.wp-block-navigation__responsive-container.is-menu-open .current-menu-item .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent, #b4551f) !important;
}

/* Croix de fermeture : elle doit se voir sur le fond sombre. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	top: 1.4rem;
	right: 1.4rem;
	color: var(--wp--preset--color--base, #faf9f7) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* Empêche la page de défiler derrière le menu ouvert. */
body:has(.wp-block-navigation__responsive-container.is-menu-open) {
	overflow: hidden;
}
