/*
Theme Name: Les Lèbres
Description: Thème vitrine léger pour le gîte Les Lèbres (Beaulieu, Ardèche). Thème « blocs » : textes, photos, couleurs et tarifs se modifient dans l'éditeur de site de WordPress.
Version: 1.1.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: les-lebres
*/

/* ---------- Petits libellés en capitales ---------- */
.surtitre {
	font-family: var(--wp--preset--font-family--jost);
	font-size: 11px !important;
	letter-spacing: 0.24em;
	text-transform: uppercase;
	font-weight: 400;
	color: var(--wp--preset--color--brun, #6B5A48);
}

/* ---------- Boutons fins à contour ---------- */
.wp-block-button__link {
	transition: background-color .2s ease, color .2s ease;
}
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background-color: var(--wp--preset--color--encre, #2B2622) !important;
	color: var(--wp--preset--color--blanc) !important;
}
.is-style-clair .wp-block-button__link {
	border-color: var(--wp--preset--color--blanc) !important;
	color: var(--wp--preset--color--blanc) !important;
}
.is-style-clair .wp-block-button__link:hover,
.is-style-clair .wp-block-button__link:focus {
	background-color: var(--wp--preset--color--blanc) !important;
	color: var(--wp--preset--color--encre, #2B2622) !important;
}

/* ---------- Vague blanche en bas de la grande photo ---------- */
.vague-bas {
	position: relative;
	overflow: hidden;
}
.vague-bas::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 110px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 120' preserveAspectRatio='none'%3E%3Cpath d='M0,70 C180,30 330,95 520,72 C720,48 860,8 1060,40 C1220,66 1330,52 1440,36 L1440,120 L0,120 Z' fill='%23ffffff'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
	pointer-events: none;
	z-index: 2;
}

/* ---------- Vague beige en haut du pied de page ---------- */
.vague-haut {
	position: relative;
}
.vague-haut::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -79px;
	height: 80px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C160,40 260,20 420,38 C580,56 700,30 860,22 C1040,12 1180,46 1440,30 L1440,90 L0,90 Z' fill='%23F3EEE6'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
	pointer-events: none;
}
.vague-haut-marge {
	margin-top: 100px !important;
}

/* ---------- Bandes de couleur derrière les photos ----------
   À choisir dans l'éditeur : bloc Groupe > Styles. */
[class*="is-style-bande-"] {
	position: relative;
	isolation: isolate;
}
[class*="is-style-bande-"]::before {
	content: "";
	position: absolute;
	z-index: -1;
	pointer-events: none;
}
.is-style-bande-sable::before {
	left: calc(-1 * var(--wp--style--root--padding-left, 0px));
	width: 72%;
	top: 90px;
	bottom: -40px;
	background: var(--wp--preset--color--sable);
}
.is-style-bande-sauge::before {
	right: calc(-1 * var(--wp--style--root--padding-right, 0px));
	width: 58%;
	top: -48px;
	bottom: -48px;
	background: var(--wp--preset--color--sauge);
}
.is-style-bande-argile::before {
	left: calc(-1 * var(--wp--style--root--padding-left, 0px));
	right: calc(-1 * var(--wp--style--root--padding-right, 0px));
	top: 120px;
	bottom: -56px;
	background: var(--wp--preset--color--argile);
}

/* ---------- Mosaïques de photos ---------- */
.mosaique {
	gap: 4px !important;
}
.mosaique .wp-block-image,
.mosaique .wp-block-image img {
	width: 100%;
	height: 100%;
	margin: 0;
}
.mosaique .wp-block-image img {
	object-fit: cover;
}
.mosaique-300 .wp-block-image img { height: 300px; }
.mosaique-380 .wp-block-image img { height: 380px; }
.carte-decouverte .wp-block-image img {
	height: 220px;
	width: 100%;
	object-fit: cover;
}

/* ---------- Tableau des tarifs ---------- */
.tarifs table {
	border-collapse: collapse;
	width: 100%;
}
.tarifs td {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--trait);
	padding: 10px 0;
}
.tarifs td:last-child {
	text-align: right;
	font-family: var(--wp--preset--font-family--cormorant);
	font-size: 20px;
	font-weight: 500;
}

/* ---------- Mobile ---------- */
@media (max-width: 781px) {
	.vague-bas::after { height: 50px; }
	.is-style-bande-sable::before { width: 100%; }
	.is-style-bande-sauge::before { width: 100%; top: auto; height: 60%; }
	.mosaique-300 .wp-block-image img,
	.mosaique-380 .wp-block-image img { height: 240px; }
}

/* ---------- Espacements des sections ---------- */
.section { padding-bottom: 120px; }
.section-haut { padding-top: 90px; }
.entete-hero { border-bottom: 1px solid rgba(255, 255, 255, 0.45); padding-top: 14px; padding-bottom: 14px; }
.hero-centre { padding-top: 80px; padding-bottom: 200px; }
.hero-sous-titre { font-size: 12px !important; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 400; }
.texte-doux { color: var(--wp--preset--color--texte-doux); font-size: 14px; }
.decale-droite { margin-left: auto !important; max-width: 820px; }
.pied { padding-top: 24px; padding-bottom: 28px; }
.pied-bas { border-top: 1px solid #DDD3C4; padding-top: 14px; font-size: 11px; }
.logo-lignes svg { width: 96px; height: 56px; display: block; margin: 0 auto; }
.carte-decouverte > * { width: 100%; margin: 0 !important; } .carte-decouverte { gap: 10px !important; }
.entete-page { padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--wp--preset--color--trait); }
html { scroll-behavior: smooth; }

/* Le bloc Couverture utilise déjà ::after (hauteur minimale) : on neutralise cet effet. */
.wp-block-cover.vague-bas::after {
	display: block;
	min-height: 0 !important;
	font-size: inherit;
}
.wp-block-table.tarifs td,
.wp-block-table.tarifs th {
	padding: 10px 0;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--trait);
}
.wp-block-table.tarifs td:first-child { padding-right: 16px; }

/* =====================================================================
   Photos : agrandissement au clic (visionneuse) et diaporamas
   ===================================================================== */

/* ---------- Photos cliquables ---------- */
img.zoomable { cursor: zoom-in; }
img.zoomable:focus-visible {
	outline: 2px solid var(--wp--preset--color--encre, #2B2622);
	outline-offset: 3px;
}

/* ---------- Visionneuse plein écran ---------- */
html.visionneuse-ouverte,
html.visionneuse-ouverte body { overflow: hidden; }

.visionneuse,
.visionneuse * { box-sizing: border-box; }
.visionneuse {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 56px 72px 24px;
	background: rgba(30, 26, 22, 0.97);
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.visionneuse[hidden] { display: none; }
.visionneuse.est-ouverte { opacity: 1; }
.visionneuse-scene {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.visionneuse-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
	transition: opacity .25s ease, transform .25s ease;
	user-select: none;
}
.visionneuse-img.est-en-chargement { opacity: 0; transform: scale(.985); }
.visionneuse-bas {
	flex: 0 0 auto;
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	padding-top: 14px;
	color: rgba(255, 255, 255, .82);
	font-family: var(--wp--preset--font-family--jost);
	font-size: 13px;
	letter-spacing: .04em;
	max-width: 1100px;
}
.visionneuse-bas p { margin: 0; }
.visionneuse-compteur { letter-spacing: .2em; white-space: nowrap; }

.visionneuse button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 50%;
	background: rgba(30, 26, 22, .35);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}
.visionneuse button[hidden] { display: none; }
.visionneuse button:hover,
.visionneuse button:focus-visible {
	background: rgba(255, 255, 255, .16);
	border-color: #fff;
	outline: none;
}
.visionneuse button svg,
.diapo-fleche svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
}
.visionneuse-fermer { top: 14px; right: 14px; }
.visionneuse-fleche { top: 50%; transform: translateY(-50%); }
.visionneuse-prec { left: 14px; }
.visionneuse-suiv { right: 14px; }

@media (max-width: 781px) {
	.visionneuse { padding: 64px 0 16px; }
	.visionneuse-bas { padding: 12px 16px 0; }
	.visionneuse-fleche { top: auto; bottom: 64px; transform: none; width: 44px; height: 44px; }
	.visionneuse-prec { left: 12px; }
	.visionneuse-suiv { right: 12px; }
	.visionneuse-scene { padding-bottom: 64px; }
}

/* ---------- Diaporamas : bloc Galerie, style « Diaporama » ou « Défilé » ----------
   --par-vue : nombre de photos visibles en même temps. */
.wp-block-gallery.is-style-diaporama { --par-vue: 1; }
.wp-block-gallery.is-style-defile { --par-vue: 3; }
@media (max-width: 999px) { .wp-block-gallery.is-style-defile { --par-vue: 2; } }
@media (max-width: 599px) { .wp-block-gallery.is-style-defile { --par-vue: 1; } }

.wp-block-gallery.diapo {
	display: block !important;
	position: relative;
}
.diapo-fenetre { position: relative; }
.diapo-piste {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}
.diapo-piste::-webkit-scrollbar { display: none; }
.diapo-piste.est-glisse { scroll-snap-type: none; cursor: grabbing; }
.diapo-piste.est-glisse img { pointer-events: none; }

.wp-block-gallery.diapo .diapo-piste > figure.wp-block-image:not(#_) {
	flex: 0 0 calc((100% - (var(--par-vue) - 1) * 4px) / var(--par-vue)) !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	scroll-snap-align: start;
}
.wp-block-gallery.diapo .diapo-piste > figure.wp-block-image:not(#_) img {
	display: block;
	width: 100% !important;
	height: 380px !important;
	max-width: none;
	object-fit: cover;
	flex: none;
}
.wp-block-gallery.is-style-diaporama.diapo .diapo-piste > figure.wp-block-image:not(#_) img {
	height: auto !important;
	aspect-ratio: 3 / 2;
}
@media (max-width: 781px) {
	.wp-block-gallery.is-style-defile.diapo .diapo-piste > figure.wp-block-image:not(#_) img { height: 280px !important; }
}

.diapo-fleche {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .8);
	border-radius: 50%;
	background: rgba(43, 38, 34, .28);
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur(2px);
	transition: background-color .2s ease, opacity .2s ease;
}
.diapo-fleche[hidden] { display: none; }
.diapo-fleche:hover,
.diapo-fleche:focus-visible {
	background: rgba(43, 38, 34, .6);
	outline: none;
}
.diapo-prec { left: 14px; }
.diapo-suiv { right: 14px; }
@media (hover: hover) and (min-width: 782px) {
	.diapo-fleche { opacity: 0; }
	.diapo:hover .diapo-fleche,
	.diapo-fleche:focus-visible { opacity: 1; }
}

.diapo-points {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px;
	margin-top: 14px;
}
.diapo-points[hidden] { display: none; }
.diapo-point {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	position: relative;
}
.diapo-point::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 7px;
	height: 7px;
	margin: -3.5px 0 0 -3.5px;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--brun, #6B5A48);
	background: transparent;
	transition: background-color .2s ease, transform .2s ease;
}
.diapo-point.est-actif::before {
	background: var(--wp--preset--color--brun, #6B5A48);
	transform: scale(1.15);
}
.diapo-point:focus-visible { outline: 1px solid var(--wp--preset--color--encre, #2B2622); border-radius: 50%; }

/* Sur le site, avant le chargement du script : déjà une seule rangée
   (évite que la page « saute »). Dans l'éditeur, toutes les photos restent visibles. */
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-diaporama:not(.diapo),
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-defile:not(.diapo) {
	flex-wrap: nowrap !important;
	overflow: hidden;
	gap: 4px !important;
}
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-diaporama:not(.diapo) > figure.wp-block-image:not(#_),
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-defile:not(.diapo) > figure.wp-block-image:not(#_) {
	flex: 0 0 calc((100% - (var(--par-vue) - 1) * 4px) / var(--par-vue)) !important;
	width: auto !important;
	margin: 0 !important;
}
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-defile:not(.diapo) > figure.wp-block-image:not(#_) img {
	height: 380px !important;
	object-fit: cover;
}
body:not(.editor-styles-wrapper) .wp-block-gallery.is-style-diaporama:not(.diapo) > figure.wp-block-image:not(#_) img {
	aspect-ratio: 3 / 2;
	height: auto !important;
	object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
	.visionneuse, .visionneuse-img, .diapo-fleche, .diapo-point::before { transition: none; }
}
