/*
 * « Chez Mamie Anna » — reproduction fidèle de l'ancien site Joomla/Nicepage.
 * Valeurs relevées le 2026-10-03 (voir sites/chambres-hotes-bessans/charte.md).
 * Les blocs ne portent que des classes `mamie-…` : tout le style est ici.
 */

body { overflow-x: clip; }

/* angles droits partout, comme l'ancien site (le starter arrondit les images) */
.mamie-page .wp-block-image img, .mamie-page .wp-block-gallery .wp-block-image img { border-radius: 0 !important; }
.mamie-page .mamie-portrait img { border-radius: 50% !important; }

/* ------------------------------------------------------------- en-tête */
.mamie-entete-site { padding: 0.5rem 0 0.75rem; }
.mamie-entete-site .mamie-marque { gap: 0; }
.mamie-logo {
	margin: 0;
	font-family: var(--wp--preset--font-family--logo);
	font-size: clamp(2.6rem, 6vw, 4.5rem);
	line-height: 1.1;
}
.mamie-logo a { color: var(--wp--preset--color--contrast-2); text-decoration: none; }
.mamie-logo a:hover { color: var(--wp--preset--color--primary); }
.mamie-slogan {
	margin: 0 !important;
	font-family: var(--wp--preset--font-family--antic);
	font-size: 1rem;
	color: var(--wp--preset--color--contrast-2);
}
.mamie-entete-site .wp-block-navigation { gap: 1.1rem; }
.mamie-entete-site .wp-block-navigation a { text-decoration: none; }
.mamie-entete-site .wp-block-navigation .current-menu-item > a,
.mamie-entete-site .wp-block-navigation a[aria-current="page"] { color: #1A1A1A; }
.mamie-entete-site .wp-block-navigation a:hover { color: var(--wp--preset--color--primary); }
.mamie-entete-site .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
	font-size: 0.85rem;
	text-transform: none;
	border: 0 !important;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

/* Sélecteur de langue (drapeaux, comme sur l'ancien site) */
.mamie-langue, .mamie-langue ul { display: flex; gap: 0.6rem; margin: 0; padding: 0; list-style: none; justify-content: center; }
.mamie-pied .mamie-langue { margin: 1.25rem auto 0 !important; }
.mamie-langue a { display: inline-flex; padding: 4px; }
.mamie-langue img { width: 18px !important; height: auto !important; }

/* --------------------------------------------------------- titres page */
.mamie-titre {
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--primary);
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	text-align: center;
	margin-bottom: 0.25rem;
}
.mamie-titre a { color: inherit; text-decoration: none; }
.mamie-sous-titre {
	font-family: var(--wp--preset--font-family--serif);
	color: var(--wp--preset--color--contrast-2);
	font-size: 1.5rem;
}
.mamie-capacite { text-align: center; font-size: 0.95rem; margin-top: 0 !important; }
.mamie-legende { text-align: center; font-size: 0.85rem; }
.mamie-centre, .mamie-centre p { text-align: center; }
.mamie-titre--gauche { text-align: left; color: var(--wp--preset--color--contrast-2); }

/* Mise en page des pages : contenu à la largeur de l'ancien site (≈ 940 px) */
.mamie-page > .wp-block-post-content > *:first-child { margin-top: var(--wp--preset--spacing--40); }
.mamie-page > .wp-block-post-content > *:last-child { margin-bottom: 0; }

/* ------------------------------------------------ en-tête de chambre */
.mamie-entete { align-items: center !important; margin-top: var(--wp--preset--spacing--40); }
.wp-block-column.mamie-entete__photo { flex: 0 0 171px !important; }
.mamie-portrait img {
	width: 151px; height: 151px;
	border-radius: 50%;
	object-fit: cover;
	display: block; margin: 0 auto;
}
.mamie-entete__texte > * { margin-left: auto; margin-right: auto; max-width: 620px; }
.mamie-entete--liste { margin-top: var(--wp--preset--spacing--30); }
.mamie-entete--liste .mamie-titre { font-size: clamp(1.4rem, 2.4vw, 1.8rem); }

/* ------------------------------------------------- grilles photo / texte */
/* Cellules jointives, comme les u-layout-cell de Nicepage (50/50 ; 60/40 sur l'accueil) */
.mamie-duo { gap: 0 !important; margin-top: 0 !important; margin-bottom: 0 !important; align-items: stretch !important; }
.home .mamie-duo > .wp-block-column:has(.mamie-photo) { flex: 0 0 60% !important; }
.mamie-duo + .mamie-duo { margin-top: 0 !important; }
.mamie-duo > .wp-block-column { display: flex; flex-direction: column; justify-content: center; flex: 0 0 50%; min-width: 0; box-sizing: border-box; }
.home .mamie-duo > .wp-block-column:not(:has(.mamie-photo)) { flex: 0 0 40% !important; }
.mamie-photo { margin: 0; overflow: hidden; height: 100%; }
.mamie-photo img {
	width: 100%;
	height: 100%;
	min-height: 340px;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}
.mamie-photo:hover img { transform: scale(1.08); } /* u-effect-hover-zoom */
.mamie-texte { padding: 2rem 2.5rem; }
.mamie-duo--inverse .mamie-texte:not(.mamie-centre) { padding-left: 3.5rem; }

/* Encadré gris à texte blanc (u-palette-…-base de Nicepage) */
.mamie-encart-gris {
	background: var(--wp--preset--color--base-2);
	color: #fff;
	text-align: center;
	font-family: var(--wp--preset--font-family--antic);
	font-size: clamp(1rem, 1.3vw, 1.25rem);
	line-height: 1.6;
	padding: 2.5rem 2rem;
	height: 100%;
	display: flex; flex-direction: column; justify-content: center;
	box-sizing: border-box;
}
.mamie-encart-gris p { margin: 0.6rem 0; }

/* ------------------------------------------------------ bandes pleines */
.mamie-bande-grise, .mamie-bande-bordeaux {
	color: #fff;
	text-align: center;
	padding: 2.25rem var(--wp--preset--spacing--30);
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
.mamie-bande-grise { background: var(--wp--preset--color--base-2); font-size: clamp(0.95rem, 1.2vw, 1.125rem); }
.mamie-bande-bordeaux { background: var(--wp--preset--color--primary); font-size: 0.85rem; line-height: 2; padding-top: 2.5rem; padding-bottom: 3.5rem; }
.mamie-bande-bordeaux p, .mamie-bande-grise p { margin: 0 0 0.25rem; }
.mamie-bande-photos { padding: 1.1rem var(--wp--preset--spacing--30); }
.mamie-galerie.wp-block-gallery { gap: 0 !important; max-width: 1140px; margin: 0 auto !important; }
.mamie-galerie.wp-block-gallery .wp-block-image { width: calc(100% / 3) !important; margin: 0 !important; }
.mamie-galerie.wp-block-gallery .wp-block-image img { aspect-ratio: 305 / 260; object-fit: cover; }
.mamie-acces { text-align: left; }
.mamie-acces > * { max-width: 1140px; }

/* ---------------------------------------------------- widgets ITEA / OS */
.mamie-itea-grille { margin: 2rem auto !important; gap: 1.5rem !important; }
.mamie-itea-grille > .wp-block-column:first-child { flex-basis: 60% !important; }
.mamie-itea-grille > .wp-block-column:last-child { flex-basis: 40% !important; }
.mamie-itea { width: 100%; height: 400px; border: 0; display: block; }
.mamie-dispo { text-align: center; margin: 1.5rem auto 2rem; font-size: 0.9rem; }
.mamie-carte { width: 100%; height: 360px; border: 0; }

/* ----------------------------------------------------------- accueil */
.mamie-carrousel.wp-block-gallery {
	position: relative;
	display: block !important;
	margin: 0 0 2rem !important;
	overflow: hidden;
}
/* hauteur portée par la figure : la galerie « is-cropped » étire l'image en flex */
.mamie-carrousel .wp-block-image {
	margin: 0 !important;
	width: 100% !important;
	height: clamp(240px, 42.3vw, 900px); /* 806 px pour 1905 px sur l'ancien site */
}
.mamie-carrousel .wp-block-image img {
	width: 100%;
	height: 100% !important;
	flex: none !important;
	object-fit: cover;
}
/* sans JavaScript : la première photo seulement */
.mamie-carrousel:not(.is-pret) > .wp-block-image:not(:first-child) { display: none; }
.mamie-carrousel .mamie-piste { display: flex; transition: transform 0.8s ease; }
.mamie-carrousel .mamie-piste > .wp-block-image { flex: 0 0 100%; }
.mamie-carrousel figcaption.wp-element-caption {
	position: absolute; inset: auto 0 18% 0;
	background: none !important;
	color: #fff;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.4rem, 3vw, 2.6rem);
	text-align: center;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
	padding: 0 1rem;
}
.mamie-carrousel__fleche {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 48px; height: 72px;
	background: none; border: 0; cursor: pointer;
	color: #fff; font-size: 0;
}
.mamie-carrousel__fleche::before {
	content: ""; display: block; width: 26px; height: 26px; margin: auto;
	border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}
.mamie-carrousel__fleche--suiv { right: 0.5rem; }
.mamie-carrousel__fleche--suiv::before { transform: rotate(-135deg); }
.mamie-carrousel__fleche--prec { left: 0.5rem; }
.mamie-carrousel__tirets {
	position: absolute; left: 0; right: 0; bottom: 14px;
	display: flex; justify-content: center; gap: 6px;
}
.mamie-carrousel__tirets button {
	width: 28px; height: 14px; padding: 6px 0; border: 0; background: none; cursor: pointer;
}
.mamie-carrousel__tirets button::before {
	content: ""; display: block; height: 2px; background: rgba(255, 255, 255, 0.55);
}
.mamie-carrousel__tirets button[aria-current="true"]::before { background: #fff; }
.mamie-carrousel button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Bandes photo en parallaxe (u-parallax) */
.mamie-parallaxe.wp-block-cover { min-height: 500px; margin: 0 !important; padding: 20px 0; overflow: hidden; }
.mamie-parallaxe .wp-block-cover__inner-container > .mamie-duo { max-width: 1140px; margin: 0 auto !important; }
.mamie-parallaxe .wp-block-cover__image-background { height: 135% !important; top: -17.5% !important; will-change: transform; }
.mamie-parallaxe .mamie-encart-gris { background: rgba(179, 179, 179, 0.92); }
.mamie-parallaxe--bandeau.wp-block-cover { min-height: 358px; }
.mamie-bandeau {
	background: rgba(77, 77, 77, 0.78);
	color: #fff;
	font-family: var(--wp--preset--font-family--antic);
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-size: clamp(0.95rem, 1.6vw, 1.2rem);
	text-align: center;
	padding: 1.6rem 1rem;
	max-width: 930px !important;
	margin: 0 auto;
}
.mamie-langues {
	font-family: var(--wp--preset--font-family--antic);
	font-style: italic;
	color: var(--wp--preset--color--primary);
	font-size: clamp(1.5rem, 2.6vw, 2.1rem);
	text-align: center;
	line-height: 1.3;
	margin: 1.5rem auto !important;
}

/* ----------------------------------------------------------- contact */
.mamie-contact { margin-top: var(--wp--preset--spacing--40) !important; }
.mamie-tel a, .mamie-email a { color: inherit; }

/* ------------------------------------------------------- pied de page */
.mamie-pied {
	background: var(--wp--preset--color--contrast-2);
	color: #fff;
	font-family: var(--wp--preset--font-family--antic);
	font-size: 0.85rem;
	padding: 2.5rem var(--wp--preset--spacing--30) 1.5rem;
	margin-top: 0 !important;
}
.mamie-pied a { color: #fff; }
.mamie-pied__nom { font-family: var(--wp--preset--font-family--serif); font-size: 1.15rem; line-height: 1.3; }
.mamie-pied__colonnes { gap: 2rem !important; }
.mamie-pied .mamie-logo-label img { width: 82px; margin: 0 auto; }
.mamie-pied .mamie-logo-insta img { width: 64px; margin: 0 auto; }
.mamie-pied .mamie-logo-booking img { width: 165px; margin: 0 auto; }
.mamie-pied .wp-block-separator { border-color: rgba(255, 255, 255, 0.7); opacity: 1; margin: 1rem auto; max-width: 1140px; }
.mamie-pied__legal { text-align: center; margin: 0.6rem auto !important; }
.mamie-pied__legal a { color: var(--wp--preset--color--accent); text-decoration: none; }
.mamie-pied__legal a:hover { text-decoration: underline; }
.mamie-pied__legal--fort { font-weight: 700; font-family: var(--wp--preset--font-family--sans); }

/* Bouton rond « haut de page » */
.mamie-haut {
	position: fixed; right: 18px; bottom: 18px; z-index: 50;
	width: 54px; height: 54px; border-radius: 50%;
	background: var(--wp--preset--color--primary);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.mamie-haut::before {
	content: ""; position: absolute; left: 50%; top: 56%;
	width: 18px; height: 18px; margin: -9px 0 0 -9px;
	border-left: 2px solid #fff; border-top: 2px solid #fff;
	transform: rotate(45deg);
}
.mamie-haut.is-visible { opacity: 1; visibility: visible; }
.mamie-haut:focus-visible { outline: 3px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* -------------------------------------------------------- animations
 * Celles de l'ancien site (animate.css via Nicepage), 1 s, au défilement.
 * Activées seulement si le JS tourne et que l'utilisateur n'a pas demandé
 * de réduire les animations : sinon tout reste visible et immobile.
 */
.mamie-js .mamie-anim-jack:not(.mamie-vu),
.mamie-js .mamie-anim-gauche:not(.mamie-vu),
.mamie-js .mamie-anim-haut:not(.mamie-vu),
.mamie-js .mamie-anim-bas:not(.mamie-vu) { opacity: 0; }
.mamie-js .mamie-anim-jack.mamie-vu { animation: mamie-jack 1s both; }
.mamie-js .mamie-anim-gauche.mamie-vu { animation: mamie-gauche 1s both; }
.mamie-js .mamie-anim-haut.mamie-vu { animation: mamie-haut 1s both; }
.mamie-js .mamie-anim-bas.mamie-vu { animation: mamie-bas 1s both; }

@keyframes mamie-jack { /* jackInTheBox */
	from { opacity: 0; transform: scale(0.1) rotate(30deg); transform-origin: center bottom; }
	50% { transform: rotate(-10deg); }
	70% { transform: rotate(3deg); }
	to { opacity: 1; transform: scale(1); }
}
@keyframes mamie-gauche { /* slideIn depuis la gauche */
	from { opacity: 0; transform: translate3d(-100%, 0, 0); }
	to { opacity: 1; transform: none; }
}
@keyframes mamie-haut { /* fadeIn vers le bas */
	from { opacity: 0; transform: translate3d(0, -100%, 0); }
	to { opacity: 1; transform: none; }
}
@keyframes mamie-bas { /* slideIn vers le haut */
	from { opacity: 0; transform: translate3d(0, 100%, 0); }
	to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- mobile */
@media (max-width: 781px) {
	.mamie-entete-site .mamie-ligne { flex-wrap: nowrap !important; align-items: center !important; }
	.mamie-logo { font-size: 2.15rem; white-space: nowrap; }
	.mamie-slogan { font-size: 0.85rem; }
	.mamie-entete { flex-direction: column; }
	.wp-block-column.mamie-entete__photo { flex-basis: auto !important; }
	.mamie-duo { gap: 0 !important; }
	.mamie-duo > .wp-block-column,
	.home .mamie-duo > .wp-block-column:has(.mamie-photo),
	.home .mamie-duo > .wp-block-column:not(:has(.mamie-photo)) { flex: 0 0 100% !important; }
	.mamie-photo img { min-height: 0; height: auto; aspect-ratio: 4 / 3; }
	.mamie-texte { padding: 1.5rem 1rem; }
	.mamie-duo--inverse { flex-direction: column-reverse; }
	.mamie-duo--inverse .mamie-texte:not(.mamie-centre) { padding-left: 1rem; }
	.mamie-encart-gris { padding: 1.75rem 1.25rem; }
	.mamie-parallaxe.wp-block-cover { min-height: 0; padding: 1.25rem 0.75rem; }
	.mamie-itea-grille > .wp-block-column { flex-basis: 100% !important; }
	.mamie-galerie.wp-block-gallery .wp-block-image { width: 50% !important; }
	.mamie-carrousel__fleche { width: 36px; }
	.mamie-haut { width: 46px; height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.mamie-photo img, .mamie-carrousel .mamie-piste { transition: none; }
	.mamie-photo:hover img { transform: none; }
}
