.ubcc-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
	margin: 0 0 40px;
}

.ubcc-gallery__item {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: #eee;
}

.ubcc-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease, opacity 0.4s;
}

.ubcc-gallery__item:hover img,
.ubcc-gallery__item:focus-visible img {
	transform: scale(1.06);
	opacity: 0.9;
}

/* Viewer */
.ubcc-lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 0, 0, 0.92);
	color: #fff;
}

.ubcc-lightbox::backdrop {
	background: transparent;
}

.ubcc-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	margin: 0;
	padding: 50px 70px;
}

.ubcc-lightbox__img {
	max-width: 100%;
	max-height: calc(100vh - 130px);
	object-fit: contain;
	box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.ubcc-lightbox__count {
	margin-top: 14px;
	font-size: 14px;
	opacity: 0.8;
}

.ubcc-lightbox button {
	position: absolute;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s;
}

.ubcc-lightbox button:hover,
.ubcc-lightbox button:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.ubcc-lightbox__close {
	top: 15px;
	right: 15px;
}

.ubcc-lightbox__close::before,
.ubcc-lightbox__close::after {
	content: "";
	position: absolute;
	top: 23px;
	left: 13px;
	width: 22px;
	height: 2px;
	background: #fff;
	transform: rotate(45deg);
}

.ubcc-lightbox__close::after {
	transform: rotate(-45deg);
}

.ubcc-lightbox__prev,
.ubcc-lightbox__next {
	top: 50%;
	margin-top: -24px;
}

.ubcc-lightbox__prev {
	left: 12px;
}

.ubcc-lightbox__next {
	right: 12px;
}

.ubcc-lightbox__prev::before,
.ubcc-lightbox__next::before {
	content: "";
	position: absolute;
	top: 18px;
	width: 12px;
	height: 12px;
	border: solid #fff;
	border-width: 0 0 3px 3px;
}

.ubcc-lightbox__prev::before {
	left: 19px;
	transform: rotate(45deg);
}

.ubcc-lightbox__next::before {
	left: 15px;
	transform: rotate(-135deg);
}

@media (max-width: 575.98px) {
	.ubcc-gallery {
		grid-template-columns: repeat(2, 1fr);
		gap: 6px;
	}

	.ubcc-lightbox__figure {
		padding: 60px 10px;
	}

	.ubcc-lightbox__prev,
	.ubcc-lightbox__next {
		top: auto;
		bottom: 15px;
		margin: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ubcc-gallery__item img {
		transition: none;
	}
}
