/*
 * Sélections thématiques (« Nos sélections ») — bloc wlc/selections.
 * Mise en page « panorama » : mécanique de la section Services et loisirs du
 * Picouty (thème camping-des-fleurs, section .cdf-aqua), charte We Love
 * Camping. Couleurs via les variables CSS du thème (jamais d'hexa hors valeur
 * de repli de var()) ; les voiles utilisent des rgba() dérivés de l'encre
 * #1F1F1F, comme les ombres.
 */

.wlc-selections {
	margin: 1.5rem 0 2.5rem;
}

/* Titre visible éventuel : centré avec gouttières (le bloc est à la racine). */
.wlc-selections > .wlc-selections__title {
	max-width: 70ch;
	margin-inline: auto;
	padding-inline: 1.25rem;
	text-align: center;
}

/* Texte d'accueil : centré, largeur de lecture limitée (~70 caractères).
   Le groupe vit à la racine du template (hors conteneur #main) : il porte
   ses propres gouttières et marges verticales. */
.wlc-intro {
	max-width: 70ch;
	margin-inline: auto;
	margin-block: 2.5rem 2rem;
	padding-inline: 1.25rem;
	text-align: center;
}

/* ── Panorama pleine largeur ──────────────────────────────────────────────── */

/* Le bloc est placé à la racine du template (hors conteneur centré) : la
   pleine largeur est naturelle. JAMAIS de 100vw ici : cette unité inclut la
   barre de défilement et crée un débordement horizontal (vu le 2026-11-02). */
.wlc-sel-panorama {
	position: relative;
	width: 100%;
	overflow: hidden;
	isolation: isolate;
}

/* Photos empilées, plein cadre ; seule l'active est visible (fondu 0,5 s). */
.wlc-sel-bgs {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.wlc-sel-bgs img,
.wlc-sel-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.5s ease;
	will-change: opacity;
}

.wlc-sel-bg.is-active {
	opacity: 1;
}

/* ── Colonnes « fenêtres » ────────────────────────────────────────────────── */

.wlc-sel-cols {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	min-height: clamp(460px, 78vh, 720px);
}

.wlc-sel-col {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
	color: var(--wp--preset--color--white, #fff);
	text-align: center;
}

/* Photo propre à la colonne : mobile uniquement (desktop = panorama partagé). */
.wlc-sel-col-img {
	display: none;
}

/* Liserés blancs entre les fenêtres, par-dessus le fond. */
.wlc-sel-col:not(:first-child) {
	border-left: 5px solid var(--wp--preset--color--white, #fff);
}

/* Voile sombre (encre) : lisibilité AA du blanc sur photo. */
.wlc-sel-veil {
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(to top, rgba(31, 31, 31, 0.82) 0%, rgba(31, 31, 31, 0.28) 55%, rgba(31, 31, 31, 0.5) 100%);
	transition: background 0.5s ease;
}

/* Voile renforcé sur le thème actif (texte déplié). */
.wlc-sel-col.is-active .wlc-sel-veil {
	background: linear-gradient(to top, rgba(31, 31, 31, 0.9) 0%, rgba(31, 31, 31, 0.55) 60%, rgba(31, 31, 31, 0.7) 100%);
}

.wlc-sel-content {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: clamp(2rem, 4vw, 3.25rem) clamp(1rem, 2vw, 1.75rem);
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* Titre du thème = vrai bouton (onglet). */
.wlc-sel-title {
	margin: 0;
}

.wlc-sel-tab {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	color: var(--wp--preset--color--white, #fff);
	font: inherit;
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	font-weight: 700;
	line-height: 1.15;
}

/* Mise en évidence du thème actif : trait clair sous le titre. */
.wlc-sel-tab::after {
	content: "";
	display: block;
	width: 0;
	height: 3px;
	margin: 0.5rem auto 0;
	border-radius: 2px;
	background: var(--wp--preset--color--wlc-light, #8ED5D9);
	transition: width 0.3s ease;
}

.wlc-sel-col.is-active .wlc-sel-tab::after {
	width: 56px;
}

.wlc-sel-tab:focus-visible {
	outline: 2px solid var(--wp--preset--color--wlc-light, #8ED5D9);
	outline-offset: 4px;
	border-radius: 4px;
}

/* ── Bloc déplié du thème actif : description + compteur + bouton ─────────── */

.wlc-sel-reveal {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	margin-top: 0;
	transition: grid-template-rows 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.wlc-sel-reveal-inner {
	overflow: hidden;
	min-height: 0;
}

.wlc-sel-col.is-active .wlc-sel-reveal {
	grid-template-rows: 1fr;
	opacity: 1;
	margin-top: 1.1rem;
}

.wlc-sel-body {
	margin: 0 auto 1rem;
	max-width: 34ch;
	font-size: 0.98rem;
	line-height: 1.7;
	color: rgba(255, 255, 255, 0.95);
}

.wlc-sel-count-wrap {
	margin: 0;
}

/* Compteur-lien : bouton accent de la charte (texte blanc),
   zone cliquable confortable (≥ 44 px), chiffres alignés. */
.wlc-sel-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.5em 1.4em;
	background: var(--wp--preset--color--wlc-accent, #B53D29);
	color: var(--wp--preset--color--white, #fff);
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 600;
	font-variant-numeric: lining-nums;
	text-decoration: none;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.wlc-sel-count:hover,
.wlc-sel-count:focus-visible {
	background: var(--wp--preset--color--wlc-accent-dark, #9A3222);
	color: var(--wp--preset--color--white, #fff);
	text-decoration: underline;
}

.wlc-sel-count:focus-visible {
	outline: 2px solid var(--wp--preset--color--white, #fff);
	outline-offset: 3px;
}

.wlc-sel-count:active {
	transform: scale(0.97);
}

/* ── Tactile / petit écran : colonnes empilées, chacune sur sa photo ──────── */

@media (max-width: 900px) {
	.wlc-sel-bgs {
		display: none;
	}

	.wlc-sel-cols {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.wlc-sel-col {
		min-height: 340px;
		border-left: 0;
		border-top: 5px solid var(--wp--preset--color--white, #fff);
	}

	.wlc-sel-col-img {
		display: block;
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.wlc-sel-col:first-child {
		border-top: 0;
	}

	/* Tous les thèmes dépliés, voile renforcé partout (texte visible). */
	.wlc-sel-reveal {
		grid-template-rows: 1fr;
		opacity: 1;
		margin-top: 1rem;
	}

	.wlc-sel-veil {
		background: linear-gradient(to top, rgba(31, 31, 31, 0.88) 0%, rgba(31, 31, 31, 0.45) 60%, rgba(31, 31, 31, 0.6) 100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wlc-sel-bg,
	.wlc-sel-bgs img,
	.wlc-sel-veil,
	.wlc-sel-reveal,
	.wlc-sel-tab::after {
		transition: none;
	}
}
