/**
 * FileBird ACF Gallery Styles
 * Alternating layout: Full → Half/Half → Full → Half/Half
 */

/* Gallery Container */
.fb-gallery {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	margin: 2rem 0;
}

/* Row Containers */
.fb-row {
	display: flex;
	width: 100%;
}

.fb-row--full {
	display: flex;
	width: 100%;
}

.fb-row--half {
	display: flex;
	gap: 24px;
	width: 100%;
}

/* Gallery Items */
.fb-item {
	position: relative;
	overflow: hidden;
	background: #f5f5f5;
	margin: 0;
}

.fb-item--full {
	width: 100%;
	aspect-ratio: 16 / 9;
}

.fb-item--half {
	width: 100%;
	aspect-ratio: 1 / 1;
}

.fb-row--half .fb-item--half {
	width: 50%;
}

/* Clickable Links */
.fb-acf-item-link,
a.glightbox {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fb-acf-item-link:hover,
a.glightbox:hover {
	transform: scale(1.01);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.fb-acf-item-link:focus,
a.glightbox:focus {
	outline: 3px solid #4CAF50;
	outline-offset: 2px;
}

/* Image Wrapper */
.fb-image-wrapper,
.fb-acf-image-wrapper {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}

.fb-image-wrapper img,
.fb-acf-image-wrapper img,
.fb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.fb-acf-item-link:hover .fb-image-wrapper img,
.fb-acf-item-link:hover .fb-acf-image-wrapper img,
a.glightbox:hover .fb-img {
	transform: scale(1.05);
}

/* Video Wrapper */
.fb-video-wrapper,
.fb-acf-video-wrapper {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
	background: #000;
}

.fb-video,
.fb-acf-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Video Play Overlay */
.fb-play-overlay,
.fb-acf-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 80px;
	height: 80px;
	background: rgba(0, 0, 0, 0.7);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: auto;
	cursor: pointer;
	transition: background 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
	z-index: 10;
}

.fb-acf-item-link:hover .fb-play-overlay,
.fb-acf-item-link:hover .fb-acf-play-overlay,
a.glightbox:hover .fb-play-overlay,
a.glightbox:hover .fb-acf-play-overlay {
	background: rgba(0, 0, 0, 0.85);
	transform: translate(-50%, -50%) scale(1.1);
}

.fb-play-icon,
.fb-acf-play-icon {
	color: #fff;
	width: 40px;
	height: 40px;
	pointer-events: none;
}

/* Video Playing State */
.fb-video.playing,
.fb-acf-video.playing {
	object-fit: contain;
}

.fb-video-wrapper.playing .fb-play-overlay,
.fb-acf-video-wrapper.playing .fb-acf-play-overlay {
	opacity: 0;
	pointer-events: none;
}

.fb-video-wrapper.playing .fb-video,
.fb-acf-video-wrapper.playing .fb-acf-video {
	z-index: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.fb-gallery {
		gap: 20px;
	}
	
	.fb-row--half {
		gap: 20px;
	}
	
	.fb-item--full {
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 767px) {
	.fb-gallery {
		gap: 16px;
		margin: 1.5rem 0;
	}
	
	.fb-row--half {
		flex-direction: column;
		gap: 16px;
	}

	.fb-row--half .fb-item--half {
		width: 100%;
	}
	
	.fb-item--full {
		aspect-ratio: 16 / 9;
	}
}

/* Loading State */
.fb-acf-item-link::before,
a.glightbox::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #4CAF50;
	border-radius: 50%;
	animation: fb-spin 0.8s linear infinite;
	opacity: 0;
	pointer-events: none;
	z-index: 1;
}

.fb-acf-item-link.loading::before,
a.glightbox.loading::before {
	opacity: 1;
}

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

/* Accessibility */
.fb-acf-item-link:focus-visible,
a.glightbox:focus-visible {
	outline: 3px solid #4CAF50;
	outline-offset: 3px;
}

/* GLightbox Custom Styles */
.fb-gallery .gslide-title,
.fb-acf-gallery .gslide-title {
	font-family: inherit;
	font-size: 16px;
	color: #fff;
}

.fb-gallery .gslide-description,
.fb-acf-gallery .gslide-description {
	font-family: inherit;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

/* Legacy Grid Layout Support (backwards compatibility) */
.fb-acf-gallery {
	width: 100%;
	margin: 2rem 0;
}

.fb-acf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.5rem;
	width: 100%;
}

.fb-acf-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: #f5f5f5;
	aspect-ratio: 1 / 1;
}


.description-bottom .gdesc-inner .gslide-desc {
	display: none !important;
}

.description-bottom .gdesc-inner .gslide-title {
	margin-top: 8px !important;
	margin-bottom: 8px !important;
}

.glightbox-clean .gslide-description {
	background-color: var(--e-global-color-secondary) !important;
}

.glightbox-clean .gslide-title {
	color: var(--e-global-color-e0f9d43) !important;
}