/**
 * Pods Gallery Slider – gallery & lightbox styles.
 *
 * All selectors are scoped under the plugin's own .pgs-* classes to avoid
 * collisions with the active theme or other plugins.
 */

/* ------------------------------------------------------------------ */
/* Container                                                          */
/* ------------------------------------------------------------------ */
.pgs-gallery {
	width: 100%;
	max-width: 1000px;
	margin: 0 auto 30px;
}

/* ------------------------------------------------------------------ */
/* Main slider – fixed 4:3 ratio                                      */
/* ------------------------------------------------------------------ */
.pgs-gallery .pgs-main {
	width: 100%;
	aspect-ratio: 4 / 3;
	margin-bottom: 8px;
	position: relative;
	overflow: hidden;
}

.pgs-gallery .pgs-main .swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 4px;
}

/* Navigation arrows – overlaid inside the image */
.pgs-gallery .pgs-main .swiper-button-prev,
.pgs-gallery .pgs-main .swiper-button-next {
	color: #ffffff;
	background: rgba( 0, 0, 0, 0 );
	border: none;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	z-index: 10;
	opacity: 0.8;
	transition: opacity 0.3s ease;
	cursor: pointer;
	margin: 0;
	padding: 0;
}

.pgs-gallery .pgs-main .swiper-button-prev:hover,
.pgs-gallery .pgs-main .swiper-button-next:hover {
	opacity: 1;
}

.pgs-gallery .pgs-main .swiper-button-prev {
	left: 3px;
}

.pgs-gallery .pgs-main .swiper-button-next {
	right: 3px;
}

.pgs-gallery .pgs-main .swiper-button-next::after,
.pgs-gallery .pgs-main .swiper-button-prev::after {
	font-size: 24px;
}

.pgs-gallery .pgs-main .swiper-button-prev:focus,
.pgs-gallery .pgs-main .swiper-button-next:focus {
	outline: 0;
}

/* ------------------------------------------------------------------ */
/* Thumbnails                                                         */
/* ------------------------------------------------------------------ */
.pgs-gallery .pgs-thumbs {
	width: 100%;
	height: auto;
	box-sizing: border-box;
}

.pgs-gallery .pgs-thumbs .swiper-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	transform: none !important;
	width: 100%;
}

.pgs-gallery .pgs-thumbs .swiper-slide {
	width: calc( ( 100% - 32px ) / 5 );
	aspect-ratio: 1 / 1;
	height: auto;
	opacity: 0.7;
	cursor: pointer;
	flex-shrink: 0;
	margin: 0 !important;
	transition: opacity 0.2s ease;
}

.pgs-gallery .pgs-thumbs .swiper-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 4px;
}

.pgs-gallery .pgs-thumbs .swiper-slide-thumb-active {
	opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Zoom icon                                                          */
/* ------------------------------------------------------------------ */
.pgs-gallery .pgs-main .pgs-zoom-icon {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 30px;
	height: 30px;
	background: rgba( 0, 0, 0, 0.2 );
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	cursor: zoom-in;
	transition: background 0.3s ease;
}

.pgs-gallery .pgs-main .pgs-zoom-icon:hover {
	background: rgba( 0, 0, 0, 0.4 );
}

.pgs-gallery .pgs-main .pgs-zoom-icon svg {
	display: block;
	width: 16px;
	height: 16px;
}

/* ------------------------------------------------------------------ */
/* Lightbox (Swiper-powered)                                          */
/* ------------------------------------------------------------------ */
.pgs-lightbox-open {
	overflow: hidden;
}

.pgs-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba( 0, 0, 0, 0.92 );
}

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

.pgs-lightbox__swiper {
	width: 100%;
	height: 100%;
}

.pgs-lightbox__swiper .swiper-slide {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 24px;
}

.pgs-lightbox__swiper .swiper-zoom-container {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pgs-lightbox__image {
	max-width: 92vw;
	max-height: 88vh;
	width: auto;
	height: auto;
	display: block;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.5 );
}

/* Per-slide loading spinner shown while the responsive image is fetched. */
.pgs-lightbox__spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border: 3px solid rgba( 255, 255, 255, 0.25 );
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: pgs-spin 0.8s linear infinite;
	pointer-events: none;
	z-index: 2;
}

.pgs-lightbox__swiper .swiper-slide.pgs-is-loading .pgs-lightbox__spinner {
	display: block;
}

.pgs-lightbox__swiper .swiper-slide.pgs-is-loading .pgs-lightbox__image {
	visibility: hidden;
}

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

@media ( prefers-reduced-motion: reduce ) {
	.pgs-lightbox__spinner {
		animation-duration: 1.6s;
	}
}

.pgs-lightbox__close,
.pgs-lightbox__nav {
	position: absolute;
	z-index: 10;
	background: rgba( 0, 0, 0, 0.4 );
	color: #ffffff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background 0.2s ease;
	padding: 0;
	line-height: 1;
}

.pgs-lightbox__close:hover,
.pgs-lightbox__nav:hover {
	background: rgba( 0, 0, 0, 0.7 );
}

.pgs-lightbox__close:focus,
.pgs-lightbox__nav:focus {
	outline: 2px solid rgba( 255, 255, 255, 0.7 );
	outline-offset: 2px;
}

.pgs-lightbox__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 30px;
}

.pgs-lightbox__nav {
	top: 50%;
	transform: translateY( -50% );
	width: 48px;
	height: 48px;
}

.pgs-lightbox__prev {
	left: 16px;
}

.pgs-lightbox__next {
	right: 16px;
}

.pgs-lightbox__nav::before {
	content: "";
	display: block;
	width: 12px;
	height: 12px;
	border-top: 2px solid #ffffff;
	border-right: 2px solid #ffffff;
}

.pgs-lightbox__prev::before {
	transform: rotate( -135deg );
	margin-left: 4px;
}

.pgs-lightbox__next::before {
	transform: rotate( 45deg );
	margin-right: 4px;
}

.pgs-lightbox__nav.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media ( max-width: 600px ) {
	.pgs-gallery .pgs-thumbs .swiper-slide {
		width: calc( ( 100% - 24px ) / 4 );
	}

	.pgs-lightbox__close {
		width: 40px;
		height: 40px;
		font-size: 26px;
	}

	.pgs-lightbox__nav {
		width: 40px;
		height: 40px;
	}
}
