/* Page d'accueil — carrousel et section « La maison ».
   Conforme à maquette-page-accueil.html du 08/11/2026.
   Toutes les couleurs viennent de la palette. Aucun !important.

   Les transparences passent par color-mix() sur une couleur de la palette :
   aucune valeur hexadécimale ni rgba() n'est écrite en dur.

   TÉMOIN DE VERSION :
       getComputedStyle(document.documentElement).getPropertyValue('--mh-accueil') */

:root {
	--mh-accueil: "2026-12-05";
}

/* --- Pleine largeur ------------------------------------------------------
   .wp-site-blocks porte un padding latéral venu de theme.json. Les deux
   sections le reprennent en négatif pour toucher les bords, comme le fait
   déjà le bandeau d'annonce. */

.mh-hero,
.mh-maison {
	margin-left: calc( var(--wp--style--root--padding-left, 0px) * -1 );
	margin-right: calc( var(--wp--style--root--padding-right, 0px) * -1 );
}

/* --- Carrousel ---------------------------------------------------------- */

.mh-hero {
	position: relative;
	overflow: hidden;
	background-color: var(--wp--preset--color--color-1);
}

.mh-hero__piste {
	display: flex;
	transition: transform 0.7s cubic-bezier( 0.22, 0.61, 0.36, 1 );
}

.mh-hero__vue {
	position: relative;
	flex: 0 0 100%;
	aspect-ratio: 21 / 9;
	min-height: 420px;
}

.mh-hero__vue img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Voile de lisibilité du carrousel.
   Relève de la règle du 02/12/2026 : fonctionnel, pas décoratif. L'ombre
   seule ne suffisait pas sur une photographie claire et détaillée — un
   flacon de verre, par exemple.

   Dégradé horizontal, jamais de flou : un backdrop-filter sur une photo de
   produit donne un rendu bon marché et coûte cher au rendu sur mobile.
   Il s'éteint à 55 % de la largeur, donc la photographie reste nette et
   visible sur toute sa partie droite. */
.mh-hero__vue::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image: linear-gradient(
		to right,
		color-mix( in srgb, var(--wp--preset--color--page-text) 55%, transparent ) 0%,
		transparent 55%
	);
	pointer-events: none;
}

/* Contraste sombre : le texte est en encre, le voile doit donc éclaircir. */
.mh-hero__vue.is-sombre::after {
	background-image: linear-gradient(
		to right,
		color-mix( in srgb, var(--wp--preset--color--page-background) 60%, transparent ) 0%,
		transparent 55%
	);
}

.mh-hero__texte {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	max-width: 720px;
	/* Le même retrait que le reste de la page, jamais moins de 24px. Le
	   carrousel est pleine largeur : sans plancher, le texte venait coller
	   au bord sur un petit écran. */
	padding-inline: max( 24px, var(--wp--style--root--padding-left, 0px) );
	padding-block: 0;
}

@media (min-width: 901px) {
	.mh-hero__texte {
		padding-inline: clamp( 24px, 5vw, 86px );
	}
}

/* RÈGLE DE CHARTE — NE PAS RETIRER PAR RÉFLEXE.
   Arrêtée le 02/12/2026 : « aucune ombre décorative, une ombre fonctionnelle
   autorisée quand elle garantit la lisibilité d'un texte sur photo. »

   Ces deux ombres relèvent du second cas. Sans elles, un texte ivoire sur une
   photographie claire disparaît. Elles doivent rester des HALOS DIFFUS, jamais
   des ombres portées nettes : décalage de 1 à 2px pour un flou de 14 à 22px,
   soit un flou dix à quatorze fois le décalage, et une opacité sous 40 %.
   Augmenter le décalage ou réduire le flou les ferait voir comme des ombres,
   ce qui est exactement ce que la charte refuse. */
.mh-hero__sur {
	margin: 0 0 14px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 11.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--page-background);
	text-shadow: 0 1px 14px color-mix( in srgb, var(--wp--preset--color--page-text) 35%, transparent );
}

.mh-hero__titre {
	margin: 0 0 22px;
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-weight: 400;
	font-size: clamp( 34px, 4.4vw, 64px );
	line-height: 1.04;
	color: var(--wp--preset--color--page-background);
	text-shadow: 0 2px 22px color-mix( in srgb, var(--wp--preset--color--page-text) 40%, transparent );
}

.mh-hero__cta {
	align-self: flex-start;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--wp--preset--color--page-background);
	color: var(--wp--preset--color--page-background);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 13px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
}

.mh-hero__cta:hover {
	opacity: 0.78;
}

/* Contraste sombre : photographie claire, texte en noir tiède, sans ombre. */
.mh-hero__vue.is-sombre .mh-hero__sur,
.mh-hero__vue.is-sombre .mh-hero__titre,
.mh-hero__vue.is-sombre .mh-hero__cta {
	color: var(--wp--preset--color--page-text);
	text-shadow: none;
}

.mh-hero__vue.is-sombre .mh-hero__cta {
	border-bottom-color: var(--wp--preset--color--page-text);
}

.mh-hero__fleche {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: color-mix( in srgb, var(--wp--preset--color--page-background) 86%, transparent );
	color: var(--wp--preset--color--page-text);
	cursor: pointer;
	transform: translateY( -50% );
	transition: background-color 0.2s ease;
}

.mh-hero__fleche:hover {
	background-color: var(--wp--preset--color--page-background);
}

.mh-hero__fleche:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.mh-hero__fleche--p {
	left: 18px;
}

.mh-hero__fleche--s {
	right: 18px;
}

.mh-hero__puces {
	position: absolute;
	bottom: 20px;
	left: 50%;
	z-index: 3;
	display: flex;
	gap: 9px;
	transform: translateX( -50% );
}

.mh-hero__puce {
	width: 34px;
	height: 3px;
	padding: 0;
	border: 0;
	background-color: color-mix( in srgb, var(--wp--preset--color--page-background) 45%, transparent );
	cursor: pointer;
}

.mh-hero__puce[aria-current] {
	background-color: var(--wp--preset--color--page-background);
}

.mh-hero__puce:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

@media (max-width: 900px) {
	.mh-hero__vue {
		aspect-ratio: 4 / 5;
		min-height: 0;
	}

	/* Le texte prend toute la largeur : un voile horizontal ne le couvre
	   plus. Il descend donc en bas de la vue, et le voile devient vertical
	   — le haut de la photographie reste intact, ce qui vaut mieux qu'un
	   voile uniforme qui l'aurait ternie entièrement. */
	.mh-hero__texte {
		max-width: none;
		justify-content: flex-end;
		padding-bottom: 34px;
	}

	.mh-hero__vue::after {
		background-image: linear-gradient(
			to top,
			color-mix( in srgb, var(--wp--preset--color--page-text) 62%, transparent ) 0%,
			color-mix( in srgb, var(--wp--preset--color--page-text) 24%, transparent ) 42%,
			transparent 72%
		);
	}

	.mh-hero__vue.is-sombre::after {
		background-image: linear-gradient(
			to top,
			color-mix( in srgb, var(--wp--preset--color--page-background) 70%, transparent ) 0%,
			color-mix( in srgb, var(--wp--preset--color--page-background) 30%, transparent ) 42%,
			transparent 72%
		);
	}
}

/* --- La maison ---------------------------------------------------------- */

.mh-maison {
	border-top: 1px solid var(--wp--preset--color--grey);
	border-bottom: 1px solid var(--wp--preset--color--grey);
	background-color: var(--wp--preset--color--color-1);
	color: var(--wp--preset--color--page-text);
}

.mh-maison__in {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	align-items: center;
	gap: clamp( 32px, 5vw, 72px );
	/* La bande est pleine largeur : centrer sur min(94vw,1680px) la cale sur
	   le viewport, alors que le reste de la page se cale sur la boîte de
	   contenu — .wp-site-blocks moins son padding racine. D'où la troisième
	   borne, qui fait coïncider les deux. Sans elle, le texte de cette
	   section démarre une trentaine de pixels avant le titre des sections
	   voisines. */
	max-width: min(
		94vw,
		1680px,
		calc( 100vw - var(--wp--style--root--padding-left, 0px) - var(--wp--style--root--padding-right, 0px) )
	);
	margin: 0 auto;
	padding: clamp( 44px, 5vw, 74px ) 0;
}

.mh-maison__sur {
	margin: 0 0 14px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 11.5px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.mh-maison__titre {
	margin: 0 0 18px;
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-weight: 400;
	font-size: clamp( 26px, 2vw + 16px, 40px );
	line-height: 1.12;
	color: var(--wp--preset--color--page-text);
}

.mh-maison__p {
	margin: 0 0 14px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 16.5px;
	line-height: 1.65;
	color: var(--wp--preset--color--page-text);
}

.mh-maison__vue {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background-color: var(--wp--preset--color--color-1);
}

.mh-maison__vue img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Le lien de section, repris de la maquette. */
.mh-lien {
	display: inline-block;
	margin-top: 10px;
	padding-bottom: 3px;
	border-bottom: 1px solid var(--wp--preset--color--page-text);
	color: var(--wp--preset--color--page-text);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

.mh-lien:hover {
	border-bottom-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

@media (max-width: 900px) {
	.mh-maison__in {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mh-hero__piste {
		transition: none;
	}

	.mh-hero__fleche {
		transition: none;
	}
}

/* --- Entête de section --------------------------------------------------
   Partagée par les trois entrées et, au lot 3, par la sélection. */

/* Pas de padding latéral ici : .wp-site-blocks en pose déjà un, et la page
   catégorie n'en ajoute aucun. En remettre 24px alignerait le contenu
   d'accueil 24px plus à l'intérieur que la grille de la boutique — un
   décalage visible en passant d'une page à l'autre. La maquette en met,
   mais elle n'a pas le padding racine de WordPress. */
.mh-sect {
	max-width: min( 94vw, 1680px );
	margin: 0 auto;
	padding: 64px 0 0;
}

/* La dernière section ne doit pas coller au pied de page terracotta.
   80px, soit un peu plus que les 64px qui séparent deux sections : la
   rupture de couleur demande davantage d'air qu'un simple enchaînement. */
.mh-sect:last-child {
	padding-bottom: 80px;
}

.mh-sect__h {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 24px;
	margin: 0 0 26px;
}

.mh-sect__h2 {
	margin: 0;
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-weight: 400;
	font-size: clamp( 24px, 1.5vw + 16px, 34px );
	line-height: 1.1;
	color: var(--wp--preset--color--page-text);
}

.mh-sect__sous {
	margin: 7px 0 0;
	max-width: 60ch;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 15px;
	color: var(--wp--preset--color--desactive-texte);
}

/* --- Les trois entrées de catégorie ------------------------------------- */

.mh-portes {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 10px;
}

.mh-porte {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background-color: var(--wp--preset--color--color-1);
	color: inherit;
	text-decoration: none;
}

.mh-porte img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier( 0.2, 0.6, 0.2, 1 );
}

@media (hover: hover) {
	.mh-porte:hover img {
		transform: scale( 1.04 );
	}
}

/* Voile de lisibilité — relève de la règle du 02/12/2026 : il n'est pas
   décoratif, il garantit que le nom de catégorie reste lisible quelle que
   soit la photographie. Sans lui, un nom ivoire sur un fond clair disparaît.
   Les transparences viennent de la palette, par color-mix. */
.mh-porte::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image: linear-gradient(
		to top,
		color-mix( in srgb, var(--wp--preset--color--page-text) 55%, transparent ) 0%,
		color-mix( in srgb, var(--wp--preset--color--page-text) 12%, transparent ) 42%,
		transparent 70%
	);
	pointer-events: none;
}

.mh-porte__lg {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2;
	display: block;
	padding: 26px 24px;
}

.mh-porte__nom {
	display: block;
	margin: 0 0 6px;
	font-family: var(--wp--preset--font-family--bodoni-moda);
	font-weight: 400;
	font-size: 26px;
	line-height: 1.1;
	color: var(--wp--preset--color--page-background);
}

/* Une seule ligne, quelle que soit la largeur : c'est le CSS qui coupe, pas
   le PHP, qui ne peut pas savoir combien de caractères tiennent. */
.mh-porte__ligne {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 13.5px;
	line-height: 1.5;
	color: color-mix( in srgb, var(--wp--preset--color--page-background) 90%, transparent );
}

.mh-porte__cta {
	display: inline-block;
	margin-top: 12px;
	padding-bottom: 3px;
	border-bottom: 1px solid var(--wp--preset--color--page-background);
	font-family: var(--wp--preset--font-family--inter);
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--page-background);
}

.mh-porte:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

@media (max-width: 820px) {
	.mh-portes {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mh-porte img {
		transition: none;
	}
}

/* --- Rail de la sélection -----------------------------------------------
   Les cartes sont celles de la grille boutique : leur habillage vit dans
   category.css, et rien n'est redéfini ici. Seul le rail est décrit. */

.mh-rail {
	position: relative;
}

.mh-rail__piste {
	display: grid;
	grid-auto-flow: column;
	/* 4,2 colonnes et non 4 : la carte suivante dépasse d'un cinquième.
	   Un bord d'image coupé dit mieux qu'une flèche qu'il y a une suite. */
	grid-auto-columns: calc( ( 100% - 4 * 10px ) / 4.2 );
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.mh-rail__piste::-webkit-scrollbar {
	display: none;
}

.mh-rail__piste > * {
	scroll-snap-align: start;
}

.mh-rail__fleche {
	position: absolute;
	top: calc( 50% - 46px );
	z-index: 4;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--wp--preset--color--grey);
	border-radius: 50%;
	background-color: var(--wp--preset--color--page-background);
	color: var(--wp--preset--color--page-text);
	cursor: pointer;
	transform: translateY( -50% );
	transition: background-color 0.2s ease;
}

.mh-rail__fleche:hover {
	background-color: var(--wp--preset--color--color-1);
}

.mh-rail__fleche:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

.mh-rail__fleche[hidden] {
	display: none;
}

.mh-rail__fleche--p {
	left: -16px;
}

.mh-rail__fleche--s {
	right: -16px;
}

@media (max-width: 1100px) {
	.mh-rail__piste {
		grid-auto-columns: calc( ( 100% - 3 * 10px ) / 3.2 );
	}
}

/* Les flèches restaient masquées sous 900px : plus rien n'indiquait alors
   qu'il y avait une suite. Elles restent, en plus petit, posées sur le bord
   des images plutôt qu'en dehors du rail. */
@media (max-width: 900px) {
	.mh-rail__fleche {
		width: 34px;
		height: 34px;
	}

	.mh-rail__fleche--p {
		left: 4px;
	}

	.mh-rail__fleche--s {
		right: 4px;
	}
}

@media (max-width: 760px) {
	.mh-rail__piste {
		grid-auto-columns: calc( ( 100% - 2 * 10px ) / 2.2 );
	}
}

@media (prefers-reduced-motion: reduce) {
	.mh-rail__fleche {
		transition: none;
	}

	.mh-rail__piste {
		scroll-behavior: auto;
	}
}

/* --- Angles : 2px partout, déclaré explicitement ------------------------
   La section « Angles » de style.css reprend les sélecteurs du parent pour
   la boutique et le blog. Les éléments d'accueil n'y figurent pas, et aucune
   règle du thème ne leur imposait de rayon — ils héritaient donc de ce qui
   traîne ailleurs, vraisemblablement des styles globaux enregistrés en base
   par l'éditeur de site, que theme.json ne peut pas contredire.

   Plutôt que de courir après la source, chaque élément déclare son angle.
   Le thème ne dépend plus de l'absence d'une règle étrangère.

   Les conteneurs en overflow:hidden et leur image portent la même valeur :
   une image arrondie dans un conteneur carré laisse voir le fond dans les
   coins, ce qui se lit exactement comme un angle arrondi. */

.mh-hero__vue img,
.mh-maison__vue,
.mh-maison__vue img,
.mh-porte,
.mh-porte img {
	border-radius: 2px;
}

/* --- Barre de progression du rail ---------------------------------------
   Fine, discrète, et absente quand il n'y a rien à faire défiler : le
   script la masque alors. */

.mh-rail__jauge {
	position: relative;
	height: 2px;
	margin-top: 16px;
	background-color: var(--wp--preset--color--grey);
	border-radius: 2px;
	overflow: hidden;
}

.mh-rail__jauge[hidden] {
	display: none;
}

.mh-rail__jauge span {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	display: block;
	background-color: var(--wp--preset--color--page-text);
	border-radius: 2px;
	transition: transform 0.15s linear;
}

@media (prefers-reduced-motion: reduce) {
	.mh-rail__jauge span {
		transition: none;
	}
}
