/* Shared gallery viewer (provider profile + event hub). */

.bgl-gallery-viewer .gallery-viewer {
	display: grid;
	grid-template-columns: 1fr 240px;
	gap: 16px;
	align-items: start;
}

.bgl-gallery-viewer .gallery-main-wrap {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: rgba(248, 223, 186, 0.25);
	aspect-ratio: 16 / 9;
}

.bgl-gallery-viewer .gallery-main {
	width: 100%;
	height: 100%;
	position: relative;
}

.bgl-gallery-viewer .gallery-main img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	cursor: zoom-in;
}

.bgl-gallery-viewer .gallery-main iframe {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

.bgl-gallery-viewer .gallery-main-col {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.bgl-gallery-viewer .gallery-caption {
	font-size: 0.85rem;
	color: #555;
	margin: 8px 0 0;
	min-height: 1.2em;
}

.bgl-gallery-viewer .gallery-play-overlay {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	background: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.bgl-gallery-viewer .gallery-play-overlay i {
	font-size: 1.4rem;
	color: #003842;
	margin-left: 4px;
}

.bgl-gallery-viewer .gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.45);
	border: none;
	color: #fff;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 5;
	transition: background 0.2s ease, opacity 0.2s ease;
	opacity: 0.8;
}

.bgl-gallery-viewer .gallery-arrow:hover {
	background: rgba(0, 0, 0, 0.7);
	opacity: 1;
}

.bgl-gallery-viewer .gallery-arrow:disabled {
	opacity: 0.25;
	cursor: default;
}

.bgl-gallery-viewer .gallery-arrow-prev { left: 10px; }
.bgl-gallery-viewer .gallery-arrow-next { right: 10px; }
.bgl-gallery-viewer .gallery-arrow i { font-size: 0.85rem; }

.bgl-gallery-viewer .gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	overflow-y: auto;
	align-content: start;
}

/* Video-only galleries: stack thumbs in the sidebar instead of a tight multi-column row. */
.bgl-gallery-viewer .gallery-viewer.is-all-videos .gallery-thumbs {
	grid-template-columns: 1fr;
}

.bgl-gallery-viewer .gallery-thumb {
	aspect-ratio: 1 / 1;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	position: relative;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
}

.bgl-gallery-viewer .gallery-thumb.active {
	border-color: #e05a00;
}

main.event-hub-page .bgl-gallery-viewer .gallery-thumb.active {
	border-color: var(--event-accent, #428583);
}

main.event-hub-page .bgl-gallery-viewer .gallery-thumb:hover {
	border-color: color-mix(in srgb, var(--event-accent, #428583) 50%, transparent);
}

.bgl-gallery-viewer .gallery-thumb:hover {
	border-color: rgba(224, 90, 0, 0.5);
}

.bgl-gallery-viewer .gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bgl-gallery-viewer .gallery-thumb .thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.bgl-gallery-viewer .gallery-thumb .thumb-play i {
	font-size: 0.65rem;
	color: #003842;
	margin-left: 2px;
}

.gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 28, 35, 0.55);
	padding: 40px 80px;
	opacity: 0;
	transition: opacity 0.18s ease;
}

.gallery-lightbox.is-open {
	opacity: 1;
}

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

.gallery-lightbox-content {
	position: relative;
	max-width: 1100px;
	width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.gallery-lightbox-media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}

.gallery-lightbox-media img {
	max-width: 100%;
	max-height: calc(100vh - 200px);
	width: auto;
	height: auto;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	display: block;
	background: #f5f5f5;
}

.gallery-lightbox-caption {
	font-family: 'Fustat', 'Manrope', sans-serif;
	font-size: 0.95rem;
	color: #fff;
	max-width: 720px;
	text-align: center;
	margin: 0;
	padding: 8px 16px;
	line-height: 1.5;
	background: rgba(0, 28, 35, 0.7);
	border-radius: 999px;
}

.gallery-lightbox-caption:empty {
	display: none;
}

.gallery-lightbox-counter {
	font-family: 'Fustat', 'Manrope', sans-serif;
	font-size: 0.7rem;
	color: rgba(255, 255, 255, 0.85);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	background: rgba(0, 28, 35, 0.6);
	padding: 4px 10px;
	border-radius: 999px;
}

.gallery-lightbox-counter:empty {
	display: none;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
	position: absolute;
	background: rgba(0, 28, 35, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
	z-index: 2;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:not(:disabled):hover {
	background: rgba(0, 28, 35, 0.85);
}

.gallery-lightbox-close {
	top: 24px;
	right: 24px;
	width: 44px;
	height: 44px;
}

.gallery-lightbox-close i {
	font-size: 1.2rem;
}

.gallery-lightbox-arrow {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
}

.gallery-lightbox-arrow:not(:disabled):hover {
	transform: translateY(-50%) scale(1.06);
}

.gallery-lightbox-arrow:disabled {
	opacity: 0.25;
	cursor: default;
}

.gallery-lightbox-arrow-prev { left: 24px; }
.gallery-lightbox-arrow-next { right: 24px; }
.gallery-lightbox-arrow i { font-size: 1.4rem; }

@media (max-width: 768px) {
	.bgl-gallery-viewer .gallery-viewer {
		grid-template-columns: 1fr;
	}

	.bgl-gallery-viewer .gallery-thumbs {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		gap: 12px;
		overflow-x: auto;
		overflow-y: visible;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		padding-bottom: 4px;
	}

	.bgl-gallery-viewer .gallery-thumb {
		flex: 0 0 min(42%, 200px);
		scroll-snap-align: start;
	}

	.bgl-gallery-viewer .gallery-viewer.is-all-videos .gallery-thumbs {
		grid-template-columns: unset;
	}

	.gallery-lightbox { padding: 20px 12px; }
	.gallery-lightbox-content { gap: 10px; }
	.gallery-lightbox-media img { max-height: calc(100vh - 180px); }
	.gallery-lightbox-arrow { width: 40px; height: 40px; }
	.gallery-lightbox-arrow-prev { left: 8px; }
	.gallery-lightbox-arrow-next { right: 8px; }
	.gallery-lightbox-arrow i { font-size: 1.1rem; }
	.gallery-lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
	.gallery-lightbox-close i { font-size: 1rem; }
	.gallery-lightbox-caption { font-size: 0.88rem; }
}
