/* JS – Réalisations — v1.1.2
 * Grille à ratios fixes (aspect-ratio — aucune hauteur circulaire), légendes
 * en voile dégradé TOUJOURS visibles (tactile), colonnes 3/2/2 portées par le
 * plugin. Visionneuse : garde [hidden] AUTONOME (elle voyage en fin de body),
 * hauteurs en svh (jamais de vw), boutons préfixés .js-r (0,2,0).
 */

.js-r {
	--js-pad-x: 0px;
	--js-r-cols: 3;
	--js-r-gap: 16px;
	--js-r-radius: 16px;
	--js-r-accent: #4a7326;
	--js-r-accent2: #3e6d2c;
	--js-r-title: #000101;

	position: relative;
	max-width: 100%;
	overflow-x: clip;
	padding-left: var(--js-pad-x);
	padding-right: var(--js-pad-x);
	font-family: 'Noto Sans', sans-serif;
}
.js-r :where(ul, li, p, figure, figcaption) { margin: 0; padding: 0; list-style: none; }
.js-r :where(*) { min-width: 0; }
.js-r :where(span) { overflow-wrap: anywhere; }
.js-r button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; padding: 0; }
/* NB : reset (0,1,1) — toute règle de bouton ci-dessous est préfixée. */

/* ---------- Filtres ---------- */
.js-r__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-bottom: 24px;
}
.js-r__filters[hidden] { display: none !important; }
.js-r .js-r__chip {
	padding: 10px 19px;
	border-radius: 999px;
	border: 2px solid #e3e9dc;
	background: #ffffff;
	color: var(--js-r-title);
	font-family: 'Montserrat', sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.2;
	max-width: 100%;
	overflow-wrap: break-word;
	transition: border-color .22s ease, background .22s ease, color .22s ease, transform .22s ease;
}
.js-r .js-r__chip:hover { border-color: #a7c894; transform: translateY(-1px); }
.js-r .js-r__chip.is-active {
	border-color: var(--js-r-accent);
	background: linear-gradient(135deg, var(--js-r-accent), var(--js-r-accent2));
	color: #ffffff;
	box-shadow: 0 6px 14px rgba(62,109,44, .25);
}
.js-r .js-r__chip:focus-visible { outline: 2px solid var(--js-r-title); outline-offset: 2px; }

/* ---------- Grille ---------- */
.js-r__grid {
	display: grid;
	grid-template-columns: repeat(var(--js-r-cols), minmax(0, 1fr));
	gap: var(--js-r-gap);
}
.js-r__cell { min-width: 0; }
.js-r__cell[hidden] { display: none !important; }
.js-r__card {
	position: relative;
	display: block;
	border-radius: var(--js-r-radius);
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0,1,1, .08);
	transition: transform .3s ease, box-shadow .3s ease;
}
.js-r__card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0,1,1, .16); }
.js-r__card:focus-visible { outline: 3px solid var(--js-r-accent); outline-offset: 3px; }
/* GARDE ANTI-THÈME : Elementor pose `.elementor img { height:auto; }`
 * (0,1,1) qui bat un simple .js-r__img (0,1,0) — la photo reprenait sa
 * hauteur naturelle et laissait le bas de la carte vide. Sélecteur alourdi
 * + !important sur les propriétés de remplissage. */
.js-r .js-r__card .js-r__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	transition: transform .5s ease;
}
.js-r .js-r__card:hover .js-r__img { transform: scale(1.05); }

/* Ratios — aspect-ratio sur la carte : aucune hauteur circulaire. */
.js-r--r4-3 .js-r__card { aspect-ratio: 4 / 3; }
.js-r--r1-1 .js-r__card { aspect-ratio: 1 / 1; }
.js-r--r3-4 .js-r__card { aspect-ratio: 3 / 4; }
.js-r--rmixte .js-r__card { aspect-ratio: 4 / 3; }
/* Mosaïque : 1re et 6e cellules doublées (revient à la normale ≤767). */
@media (min-width: 768px) {
	.js-r--rmixte .js-r__cell:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
	.js-r--rmixte .js-r__cell:nth-child(6n + 1) .js-r__card { aspect-ratio: auto; height: 100%; }
	.js-r--rmixte .js-r__cell:nth-child(6n + 1) .js-r__card .js-r__img { height: 100% !important; }
}

/* Voile + légende TOUJOURS visibles (tactile). */
.js-r__veil {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,1,1, 0) 44%, rgba(0,1,1, .82));
	pointer-events: none;
}
.js-r__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	padding: 14px 16px;
	pointer-events: none;
}
.js-r__cap-title {
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.35;
}
.js-r__cap-meta {
	color: #cfe8c7;
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: .4px;
	margin-top: 3px !important;
}
.js-r__zoom {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: var(--js-r-accent2);
	opacity: 0;
	transform: scale(.7);
	transition: opacity .25s ease, transform .3s cubic-bezier(.3, 1.4, .5, 1);
	pointer-events: none;
}
.js-r__zoom svg { width: 16px; height: 16px; }
.js-r__card:hover .js-r__zoom, .js-r__card:focus-visible .js-r__zoom { opacity: 1; transform: scale(1); }

/* ---------- Mode CARROUSEL ---------- */
/* Piste en défilement interne scroll-snap : défilable nativement sans JS.
 * Les cellules gardent la grille implicite en colonnes de largeur (100% -
 * gaps) / cols. La mosaïque n'a pas cours ici (span forcé à 1). */
.js-r--carrousel .js-r__grid {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--js-r-cols) - 1) * var(--js-r-gap)) / var(--js-r-cols));
	grid-template-columns: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	padding-bottom: 4px;
}
.js-r--carrousel .js-r__grid::-webkit-scrollbar { display: none; }
.js-r--carrousel .js-r__cell { scroll-snap-align: start; }
.js-r--carrousel .js-r__cell:nth-child(6n + 1) { grid-column: auto; grid-row: auto; }
.js-r--carrousel .js-r__cell:nth-child(6n + 1) .js-r__card { height: auto; }
.js-r--carrousel.js-r--r4-3 .js-r__cell:nth-child(6n + 1) .js-r__card { aspect-ratio: 4 / 3; }
.js-r--carrousel.js-r--rmixte .js-r__cell .js-r__card { aspect-ratio: 4 / 3; }

/* Barre de contrôles : puces à gauche, flèches groupées à droite. */
.js-r__nav[hidden] { display: none !important; }
.js-r--no-arrows .js-r__arrows { display: none; }
.js-r--no-dots .js-r__dots { display: none; }
.js-r--no-arrows.js-r--no-dots .js-r__nav { display: none; }
.js-r__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 18px;
}
.js-r__dots { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.js-r .js-r__dot {
	width: 9px;
	height: 9px;
	border-radius: 999px;
	background: #c9d4cd;
	padding: 0;
	transition: background .22s ease, width .25s ease;
}
.js-r .js-r__dot.is-active { width: 26px; background: linear-gradient(135deg, var(--js-r-accent), var(--js-r-accent2)); }
.js-r .js-r__dot:focus-visible { outline: 2px solid var(--js-r-title); outline-offset: 2px; }
.js-r__arrows { display: flex; gap: 10px; flex: 0 0 auto; }
.js-r .js-r__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 999px;
	background: #ffffff;
	border: 1.5px solid #e3e9dc;
	color: var(--js-r-accent2);
	transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.js-r .js-r__arrow:hover {
	background: linear-gradient(135deg, var(--js-r-accent), var(--js-r-accent2));
	border-color: transparent;
	color: #ffffff;
	transform: translateY(-2px);
}
.js-r .js-r__arrow:focus-visible { outline: 2px solid var(--js-r-title); outline-offset: 2px; }
.js-r__arrow svg { width: 17px; height: 17px; }

/* Défauts responsive PORTÉS PAR LE PLUGIN (3/2/2). */
@media (max-width: 1024px) { .js-r { --js-r-cols: 2; } }
@media (max-width: 767px)  { .js-r { --js-r-cols: 2; --js-r-gap: 10px; } .js-r__cap-title { font-size: 13px; } .js-r__cap-meta { font-size: 11px; } }

/* ---------- Visionneuse (fin de body — garde [hidden] AUTONOME). ---------- */
.js-r__lb[hidden] { display: none !important; }
.js-r__lb {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.js-r__lb-veil {
	position: absolute;
	inset: 0;
	background: rgba(0,1,1, .88);
	backdrop-filter: blur(4px);
}
.js-r__lb-figure {
	position: relative;
	max-width: min(1100px, 100%);
	max-height: 88svh;
	display: flex;
	flex-direction: column;
	animation: js-r-pop .4s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes js-r-pop { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.js-r__lb-img {
	display: block;
	max-width: 100%;
	max-height: 66svh;
	width: auto;
	height: auto;
	margin: 0 auto;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.js-r__lb-caption {
	text-align: center;
	padding: 14px 10px 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.js-r__lb-title { color: #ffffff; font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 16px; }
.js-r__lb-meta { color: #c6ea9e; font-size: 13px; font-weight: 600; letter-spacing: .4px; }

.js-r .js-r__lb-btn, .js-r__lb .js-r__lb-btn {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .12);
	color: #ffffff;
	backdrop-filter: blur(3px);
	transition: background .22s ease, transform .22s ease;
	border: 0;
	cursor: pointer;
	padding: 0;
	font: inherit;
}
.js-r__lb .js-r__lb-btn:hover { background: rgba(255, 255, 255, .25); transform: scale(1.06); }
.js-r__lb .js-r__lb-btn:focus-visible { outline: 2px solid #ffffff; outline-offset: 3px; }
.js-r__lb-btn svg { width: 19px; height: 19px; }
.js-r__lb-close { top: 18px; right: 18px; }
.js-r__lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.js-r__lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.js-r__lb .js-r__lb-prev:hover, .js-r__lb .js-r__lb-next:hover { transform: translateY(-50%) scale(1.06); }
.js-r__lb-thumbs {
	position: absolute;
	bottom: 56px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	max-width: min(92%, 640px);
	overflow-x: auto;
	scrollbar-width: none;
	padding: 4px;
}
.js-r__lb-thumbs::-webkit-scrollbar { display: none; }
.js-r__lb-thumbs:empty { display: none; }
.js-r__lb .js-r__lb-thumb {
	flex: 0 0 auto;
	width: 56px;
	height: 42px;
	border-radius: 8px;
	overflow: hidden;
	opacity: .5;
	border: 2px solid transparent;
	padding: 0;
	transition: opacity .22s ease, border-color .22s ease, transform .22s ease;
}
.js-r__lb .js-r__lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.js-r__lb .js-r__lb-thumb:hover { opacity: .85; }
.js-r__lb .js-r__lb-thumb.is-active { opacity: 1; border-color: #c6ea9e; transform: scale(1.06); }
.js-r__lb .js-r__lb-thumb:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }

.js-r__lb-count {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	background: rgba(255, 255, 255, .12);
	border-radius: 999px;
	padding: 7px 16px;
	backdrop-filter: blur(3px);
}
@media (max-width: 640px) {
	.js-r__lb { padding: 12px; }
	.js-r__lb-prev { left: 6px; }
	.js-r__lb-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.js-r *, .js-r *::before, .js-r *::after,
	.js-r__lb, .js-r__lb * { transition: none !important; animation: none !important; }
}
