.main-module-gallery {
	padding: 40px 0;
}

.main-module-gallery__intro {
	margin-bottom: 24px;
}

.bl-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.bl-gallery-item {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: 4px;
	aspect-ratio: 4 / 3;
	background: #f2f2f2;
	cursor: zoom-in;
}

.bl-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .3s ease, opacity .3s ease;
}

.bl-gallery-item:hover img,
.bl-gallery-item:focus img {
	transform: scale(1.04);
	opacity: .92;
}

.bl-gallery-item:focus {
	outline: 2px solid #a54843;
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.bl-gallery {
		grid-template-columns: repeat(2, 1fr);
		gap: 8px;
	}
}

/* ---------- Lightbox ---------- */

body.bl-lightbox-open {
	overflow: hidden;
}

.bl-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	animation: bl-lightbox-fade .2s ease;
}

.bl-lightbox[hidden] {
	display: none;
}

@keyframes bl-lightbox-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.bl-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .9);
	cursor: zoom-out;
}

.bl-lightbox__figure {
	position: relative;
	max-width: 92vw;
	max-height: 92vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.bl-lightbox__img {
	display: block;
	max-width: 92vw;
	max-height: 82vh;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	background: #111;
}

.bl-lightbox__caption {
	color: #fff;
	text-align: center;
	margin-top: 12px;
	font-size: 14px;
	max-width: 80vw;
}

.bl-lightbox__caption[hidden] {
	display: none;
}

.bl-lightbox__close,
.bl-lightbox__prev,
.bl-lightbox__next {
	position: absolute;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	border: 0;
	cursor: pointer;
	line-height: 1;
	z-index: 1;
	font-family: inherit;
	transition: background .15s ease, transform .15s ease;
}

.bl-lightbox__close:hover,
.bl-lightbox__prev:hover,
.bl-lightbox__next:hover {
	background: rgba(165, 72, 67, .95);
}

.bl-lightbox__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 28px;
	border-radius: 50%;
}

.bl-lightbox__prev,
.bl-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 64px;
	font-size: 36px;
}

.bl-lightbox__prev { left: 16px; }
.bl-lightbox__next { right: 16px; }

.bl-lightbox__prev:hover { transform: translateY(-50%) translateX(-2px); }
.bl-lightbox__next:hover { transform: translateY(-50%) translateX(2px); }

.bl-lightbox__prev[hidden],
.bl-lightbox__next[hidden] {
	display: none;
}

.bl-lightbox__counter {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	font-size: 13px;
	background: rgba(0, 0, 0, .55);
	padding: 4px 12px;
	border-radius: 12px;
}

.bl-lightbox__counter[hidden] {
	display: none;
}

.bl-lightbox__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: bl-lightbox-spin .8s linear infinite;
	pointer-events: none;
}

.bl-lightbox__spinner[hidden] {
	display: none;
}

@keyframes bl-lightbox-spin {
	to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
	.bl-lightbox__close { top: 8px; right: 8px; }
	.bl-lightbox__prev { left: 4px; width: 40px; height: 56px; }
	.bl-lightbox__next { right: 4px; width: 40px; height: 56px; }
}
