/**
 * Boksiowo Portal Engine PRO — Gallery module styles.
 */

.bpe-gallery__grid {
	display: grid;
	grid-template-columns: repeat(var(--bpe-gallery-columns, 3), 1fr);
	gap: 8px;
	margin: 0 0 1.5em;
	padding: 0;
	list-style: none;
}

.bpe-gallery__item {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: 4px;
}

.bpe-gallery__trigger {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: zoom-in;
}

.bpe-gallery__trigger img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.bpe-gallery__trigger:hover img,
.bpe-gallery__trigger:focus-visible img {
	transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
	.bpe-gallery__trigger img {
		transition: none;
	}

	.bpe-gallery__trigger:hover img,
	.bpe-gallery__trigger:focus-visible img {
		transform: none;
	}
}

@media (max-width: 782px) {
	.bpe-gallery__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.bpe-gallery__dialog {
		padding: 16px;
	}
}

.bpe-gallery__dialog {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 40px;
}

.bpe-gallery__dialog[hidden] {
	display: none;
}

.bpe-gallery__figure {
	max-width: 90vw;
	max-height: 90vh;
	margin: 0;
	text-align: center;
}

.bpe-gallery__image {
	max-width: 100%;
	max-height: 80vh;
	object-fit: contain;
}

.bpe-gallery__caption {
	margin-top: 10px;
	color: #f0f0f1;
	font-size: 0.9rem;
}

.bpe-gallery__close,
.bpe-gallery__prev,
.bpe-gallery__next {
	position: absolute;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
}

.bpe-gallery__close:hover,
.bpe-gallery__prev:hover,
.bpe-gallery__next:hover {
	background: rgba(255, 255, 255, 0.25);
}

.bpe-gallery__close {
	top: 16px;
	right: 16px;
}

.bpe-gallery__prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.bpe-gallery__next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

body.bpe-gallery-open {
	overflow: hidden;
}
