/* BAB Gallery — mosaïque + visionneuse. Sans dépendance. */
.bab-gallery {
	--bab-gap: 10px;
	columns: var(--bab-cols, 3);
	column-gap: var(--bab-gap);
	margin: 0 0 var(--bab-gap);
}
/* Mise en page JS (ordre gauche → droite, colonnes équilibrées) */
.bab-gallery.is-laid {
	columns: auto;
	display: flex;
	gap: var(--bab-gap);
	align-items: flex-start;
}
.bab-gallery__col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--bab-gap);
}
.bab-gallery__item {
	display: block;
	break-inside: avoid;
	margin-bottom: var(--bab-gap);
	overflow: hidden;
	background: #e9eef1;
	cursor: zoom-in;
}
.bab-gallery.is-laid .bab-gallery__item { margin-bottom: 0; }
.bab-gallery__img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .4s ease;
}
.bab-gallery__item:hover .bab-gallery__img,
.bab-gallery__item:focus-visible .bab-gallery__img { transform: scale(1.04); }
.bab-gallery__item:focus-visible { outline: 3px solid #0b3144; outline-offset: 2px; }

@media (max-width: 980px) { .bab-gallery { columns: 2; } }
@media (max-width: 767px) { .bab-gallery { columns: 1; } }

/* Visionneuse */
.bab-lightbox {
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(5, 18, 26, .95);
	color: #fff;
	overscroll-behavior: contain;
}
.bab-lightbox::backdrop { background: rgba(5, 18, 26, .95); }
.bab-lightbox__stage {
	position: absolute;
	inset: 56px 64px 56px;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
}
.bab-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	user-select: none;
}
.bab-lightbox button {
	position: absolute;
	border: 0;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	font-size: 26px;
	line-height: 48px;
	cursor: pointer;
	padding: 0;
}
.bab-lightbox button:hover,
.bab-lightbox button:focus-visible { background: rgba(255, 255, 255, .28); outline: none; }
.bab-lightbox__close { top: 8px; right: 12px; }
.bab-lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.bab-lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }
.bab-lightbox__count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	text-align: center;
	font-size: 14px;
	opacity: .8;
}
@media (max-width: 767px) {
	.bab-lightbox__stage { inset: 56px 0; }
	.bab-lightbox__prev, .bab-lightbox__next { top: auto; bottom: 8px; transform: none; }
}
/* Pas de miroir RTL pour la mosaïque ni la visionneuse */
html[dir="rtl"] .bab-lightbox__prev { left: 8px; right: auto; }
html[dir="rtl"] .bab-lightbox__next { right: 8px; left: auto; }
@media (prefers-reduced-motion: reduce) { .bab-gallery__img { transition: none; } }
