/*
 * Gallery Lightbox
 * Custom full-screen lightbox replacing Popup Maker for post galleries.
 * Enqueued only on pages that contain a [gallery] shortcode via filters-hooks.php.
 */

/* ── Thumbnails ──────────────────────────────────────────── */
.gallery .item {
	cursor: pointer;
}
.gallery .img-wrap {
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.gallery .item:hover .img-wrap {
	opacity: 0.85;
	transform: scale(1.02);
}

/* ── Overlay ─────────────────────────────────────────────── */
.kp-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.96);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}
.kp-gallery-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}
body.kp-lightbox-open {
	overflow: hidden;
}

/* ── Close button ────────────────────────────────────────── */
.kp-lightbox-close {
	position: absolute;
	top: 9px;
	right: 92px;
	z-index: 10;
	background: none;
	border: none;
	color: #fff;
	font-size: 62px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	opacity: 0.9;
	transition: opacity 0.15s;
}
.kp-lightbox-close:hover {
	opacity: 1;
}

/* ── Inner layout (padding zones for X / arrows / pagination) */
.kp-lightbox-inner {
	position: relative;
	width: 100%;
	height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 68px 100px 52px;
	box-sizing: border-box;
}

/* ── Swiper ──────────────────────────────────────────────── */
.kp-lightbox-swiper {
	width: 100%;
	height: 100%;
}
.kp-lightbox-slide {
	display: flex;
	flex-direction: column;
	height: 100%;
}
.kp-slide-img-wrap {
	flex: 1;
	min-height: 0;
	overflow: hidden;
}
.kp-slide-img-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
.kp-lightbox-caption {
	flex-shrink: 0;
	color: #fff;
	font-size: 13px;
	text-align: center;
	padding: 8px 0 0;
	opacity: 0.75;
	margin: 0;
}

/* ── Arrows (in the 100px side padding zones) ────────────── */
.kp-gallery-lightbox .swiper-button-next,
.kp-gallery-lightbox .swiper-button-prev {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 100px;
	margin-top: 0;
}
.kp-gallery-lightbox .swiper-button-prev { left: 0; }
.kp-gallery-lightbox .swiper-button-next { right: 0; }

/* ── Pagination (in the 52px bottom zone) ────────────────── */
.kp-lightbox-pagination {
	position: absolute !important;
	bottom: 16px;
	left: 0;
	right: 0;
	text-align: center;
	color: #fff;
	font-size: 14px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 767px) {
	.kp-lightbox-inner {
		padding: 56px 56px 44px;
	}
	.kp-gallery-lightbox .swiper-button-next,
	.kp-gallery-lightbox .swiper-button-prev {
		width: 56px;
	}
	.kp-lightbox-close {
		right: 56px;
		font-size: 40px;
	}
}
