/**
 * Gallery lightbox — fullscreen viewer with wipe transition.
 */

.westeck-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.92);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 200ms ease, visibility 0s linear 200ms;
}

.westeck-gallery-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 200ms ease, visibility 0s linear 0s;
}

.westeck-gallery-lightbox__close {
	position: absolute;
	top: 24px;
	right: 24px;
	z-index: 4;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 0;
	background: rgba(150, 150, 150, 0.2);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	color: var(--white, #fff);
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.westeck-gallery-lightbox__close:focus-visible {
	outline: 2px solid var(--white, #fff);
	outline-offset: 2px;
}

.westeck-gallery-lightbox__stage {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 80px 120px;
	box-sizing: border-box;
}

.westeck-gallery-lightbox__layers {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
}

.westeck-gallery-lightbox__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	user-select: none;
	-webkit-user-drag: none;
}

.westeck-gallery-lightbox__img--wipe {
	z-index: 2;
	clip-path: inset(0 0 0 0);
	transition: clip-path 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.westeck-gallery-lightbox__img--wipe.is-wipe-from-right {
	clip-path: inset(0 100% 0 0);
}

.westeck-gallery-lightbox__img--wipe.is-wipe-from-left {
	clip-path: inset(0 0 0 100%);
}

.westeck-gallery-lightbox__img--wipe.is-wipe-instant {
	transition: none;
}

/* Navigation — matches testimonials block controls */
.westeck-gallery-lightbox .swiper-button-prev,
.westeck-gallery-lightbox .swiper-button-next {
	color: var(--white, #fff);
	width: 81px;
	height: 123px;
	position: absolute;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0;
	overflow: hidden;
	margin-top: 0;
	z-index: 10;
	background: rgba(150, 150, 150, 0.2);
	box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	-webkit-mask-image: url('../img/pagination.svg');
	mask-image: url('../img/pagination.svg');
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-mode: alpha;
	mask-mode: alpha;
}

.westeck-gallery-lightbox .swiper-button-prev::before,
.westeck-gallery-lightbox .swiper-button-next::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: url('../img/pagination-outline.svg');
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
	pointer-events: none;
	z-index: 2;
}

.westeck-gallery-lightbox .swiper-button-prev .swiper-navigation-icon,
.westeck-gallery-lightbox .swiper-button-next .swiper-navigation-icon {
	display: none !important;
}

.westeck-gallery-lightbox .swiper-button-prev::after,
.westeck-gallery-lightbox .swiper-button-next::after {
	font-size: calc(var(--text-body, 21px) - 1px);
	font-weight: 700;
	z-index: 3;
}

.westeck-gallery-lightbox .swiper-button-prev:focus-visible,
.westeck-gallery-lightbox .swiper-button-next:focus-visible {
	background: rgba(255, 255, 255, 0.6);
}

.westeck-gallery-lightbox .swiper-button-prev {
	left: 32px;
	right: auto;
	transform: translateY(-50%) scaleX(-1);
}

.westeck-gallery-lightbox .swiper-button-prev::after {
	transform: scaleX(-1);
}

.westeck-gallery-lightbox .swiper-button-next {
	right: 32px;
	left: auto;
	transform: translateY(-50%);
}

.westeck-gallery-lightbox.is-transitioning .swiper-button-prev,
.westeck-gallery-lightbox.is-transitioning .swiper-button-next {
	pointer-events: none;
}

body.westeck-gallery-lightbox-open {
	overflow: hidden;
}

.westeck-gallery-lightbox:not(.has-multiple) .swiper-button-prev,
.westeck-gallery-lightbox:not(.has-multiple) .swiper-button-next {
	display: none;
}

.westeck-gallery-lightbox.is-at-start .swiper-button-prev {
	display: none;
}

.westeck-gallery-lightbox.is-at-end .swiper-button-next {
	display: none;
}

.wp-block-gallery figure img,
.wp-block-gallery .blocks-gallery-item img {
	cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
	.westeck-gallery-lightbox__img--wipe {
		transition: none;
	}
}

@media screen and (max-width: 1024px) {
	.westeck-gallery-lightbox__stage {
		padding: 72px 16px;
	}

	.westeck-gallery-lightbox .swiper-button-prev,
	.westeck-gallery-lightbox .swiper-button-next {
		width: calc(81px * 0.5);
		height: calc(123px * 0.5);
	}

	.westeck-gallery-lightbox .swiper-button-prev::after,
	.westeck-gallery-lightbox .swiper-button-next::after {
		font-size: calc((var(--text-body, 21px) - 1px) * 0.5);
	}

	.westeck-gallery-lightbox .swiper-button-prev {
		left: 8px;
	}

	.westeck-gallery-lightbox .swiper-button-next {
		right: 8px;
	}
}
