/**
 * Extra Gallery Frontend Styles
 * Owl Carousel + FSLightbox Integration
 *
 * @package Riode_Extra_Gallery
 */

/* Gallery Container */
.riode-extra-gallery {
	margin-top: 30px;
	margin-bottom: 30px;
	clear: both;
}

.riode-extra-gallery .extra-gallery-title {
	margin-bottom: 20px;
	font-size: 24px;
	font-weight: 600;
	text-align: center;
	color: #333;
}

/* Owl Carousel Container */
.riode-extra-gallery .extra-gallery-carousel {
	margin-top: 15px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s 0.3s;
}

/* Show carousel after Owl is initialized */
.riode-extra-gallery .extra-gallery-carousel.owl-loaded {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s;
}

/* Gallery Item (Owl Carousel Item) */
.riode-extra-gallery .extra-gallery-carousel .owl-stage {
	display: flex;
}

.riode-extra-gallery .extra-gallery-carousel .owl-item {
	display: flex;
	justify-content: center;
}

.riode-extra-gallery .extra-gallery-item {
	position: relative;
	overflow: visible;
	border-radius: 0;
	padding: 0;
	background: transparent;
	box-shadow: none !important;
	transition: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.riode-extra-gallery .extra-gallery-item:hover {
	transform: none;
	box-shadow: none;
}

/* Gallery Link */
.riode-extra-gallery .extra-gallery-link {
	display: block;
	line-height: 0;
	cursor: pointer;
	text-decoration: none;
	border: 0;
	background: transparent;
	padding: 0;
	width: 100%;
}

/* Gallery Thumbnail Image */
.riode-extra-gallery .extra-gallery-thumb {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

/* Owl Carousel Navigation Arrows */
.riode-extra-gallery .owl-nav button {
	background: rgba(0, 0, 0, 0.12) !important;
	color: #222 !important;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.riode-extra-gallery .owl-nav button:hover {
	background: rgba(0, 0, 0, 0.2) !important;
}

.riode-extra-gallery .owl-nav button i {
	font-size: 20px;
}

.riode-extra-gallery .owl-nav .owl-prev {
	left: -20px;
}

.riode-extra-gallery .owl-nav .owl-next {
	right: -20px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
	.riode-extra-gallery .extra-gallery-title {
		font-size: 20px;
		margin-bottom: 15px;
	}

	.riode-extra-gallery .owl-nav button {
		width: 32px;
		height: 32px;
	}

	.riode-extra-gallery .owl-nav button i {
		font-size: 16px;
	}
}


/* Fallback if Owl Carousel fails to load (after timeout) */
.riode-extra-gallery .extra-gallery-carousel.fallback-visible {
	opacity: 1;
	visibility: visible;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.riode-extra-gallery .extra-gallery-carousel.fallback-visible .extra-gallery-item {
	flex: 0 0 calc(16.666% - 10px);
	max-width: 160px;
}

/* Hidden PhotoSwipe gallery (do not display on page) */
.riode-extra-gallery .extra-gallery-photoswipe {
	display: none !important;
	visibility: hidden !important;
	position: absolute !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	clip: rect(0 0 0 0) !important;
	z-index: -9999 !important;
}

.riode-extra-gallery .extra-gallery-photoswipe * {
	display: none !important;
}

@media (max-width: 767px) {
	.riode-extra-gallery .extra-gallery-carousel.fallback-visible .extra-gallery-item {
		flex: 0 0 calc(50% - 5px);
		max-width: 50%;
	}
}

@media (min-width: 768px) and (max-width: 991px) {
	.riode-extra-gallery .extra-gallery-carousel.fallback-visible .extra-gallery-item {
		flex: 0 0 calc(25% - 7.5px);
		max-width: 25%;
	}
}

/* Make sure hidden PhotoSwipe overlay is not visible after close */
.pswp[aria-hidden="true"] {
	display: none !important;
}

