/*
 * UV Tour Gallery — GetYourGuide-style photo mosaic (desktop) + full-width
 * swipeable carousel (mobile) + a shared fullscreen lightbox.
 * Design tokens (--uv-*) are inherited from booking-modal.css :root.
 */

.uv-gallery {
	position: relative;
	margin: 0 0 1.75rem;
	font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* Absolutely fill any tile/slide. The img is anchored (inset:0) so it ignores
   the <button>'s intrinsic sizing; height is forced because theme/Elementor
   ship an `img { height:auto }` reset at equal specificity that loads after. */
.uv-gallery .uv-gallery__tile img,
.uv-gallery .uv-gallery__slide img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	display: block;
	object-fit: cover;
	transition: transform 400ms var(--uv-transition, cubic-bezier(0.4, 0, 0.2, 1));
}

/* ---------- Desktop mosaic ---------- */
.uv-gallery__mosaic {
	position: relative; /* containing block for the "Show all photos" button */
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	grid-template-rows: 1fr 1fr;
	gap: 8px;
	aspect-ratio: 16 / 9;
	max-height: 460px;
	border-radius: var(--uv-radius, 14px);
	overflow: hidden;
}

/* the four side thumbs flow straight into the mosaic grid */
.uv-gallery__grid { display: contents; }

.uv-gallery__tile {
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	cursor: pointer;
	overflow: hidden;
	background: var(--uv-bg-soft, #f3eede);
}

.uv-gallery__tile:hover img { transform: scale(1.045); }
.uv-gallery__tile:focus-visible { outline: 3px solid var(--uv-accent, #5965ed); outline-offset: -3px; }

.uv-gallery__tile--lead {
	grid-row: 1 / span 2;
	grid-column: 1;
}

/* single-photo tours: just the lead image, full frame */
.uv-gallery--single .uv-gallery__mosaic {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}
.uv-gallery--single .uv-gallery__tile--lead { grid-row: 1; grid-column: 1; }

.uv-gallery__more {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(12, 10, 20, 0.46);
	color: #fff;
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: .02em;
	pointer-events: none;
}

.uv-gallery__show-all {
	position: absolute;
	right: 14px;
	bottom: 14px;
	display: inline-flex;
	align-items: center;
	gap: .45em;
	padding: .62em 1.1em;
	background: #fff;
	color: var(--uv-fg, #15121f);
	border: 1px solid var(--uv-border, #e6dfcd);
	border-radius: 999px;
	font: 600 .85rem/1 "Plus Jakarta Sans", system-ui, sans-serif;
	cursor: pointer;
	box-shadow: var(--uv-shadow-soft, 0 1px 3px rgba(12, 10, 20, .14));
	transition: background var(--uv-transition, 200ms ease);
}
.uv-gallery__show-all:hover { background: var(--uv-bg-soft, #f3eede); }
.uv-gallery__show-all i.ph { font-size: 1.05em; }
.uv-gallery--single .uv-gallery__show-all { display: none; }

/* ---------- Mobile carousel (hidden on desktop) ---------- */
.uv-gallery__carousel { display: none; }
.uv-gallery__counter { display: none; }

@media (max-width: 768px) {
	.uv-gallery__mosaic { display: none; }

	/* Full-bleed: break out of the Elementor column padding so the photos run
	   edge-to-edge across the screen. Works for any centered container. */
	.uv-gallery {
		width: 100vw;
		max-width: 100vw;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
	}

	.uv-gallery__carousel {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		border-radius: 0;
	}
	.uv-gallery__carousel::-webkit-scrollbar { display: none; }

	.uv-gallery__slide {
		position: relative;
		flex: 0 0 100%;
		width: 100%;
		aspect-ratio: 4 / 3;
		margin: 0;
		padding: 0;
		border: 0;
		cursor: pointer;
		overflow: hidden;
		scroll-snap-align: center;
		background: var(--uv-bg-soft, #f3eede);
	}

	.uv-gallery__counter {
		display: block;
		position: absolute;
		right: 12px;
		bottom: 12px;
		padding: .3em .72em;
		background: rgba(12, 10, 20, 0.66);
		color: #fff;
		border-radius: 999px;
		font: 600 .8rem/1 "Plus Jakarta Sans", system-ui, sans-serif;
		pointer-events: none;
	}
}

/* ---------- Lightbox ---------- */
.uv-glb {
	position: fixed;
	inset: 0;
	z-index: 99996; /* below the booking modal (99999), above the page */
	display: flex;
	flex-direction: column;
	background: rgba(12, 10, 20, 0.93);
	opacity: 0;
	pointer-events: none;
	transition: opacity 200ms ease;
}
.uv-glb.is-open { opacity: 1; pointer-events: auto; }

.uv-glb__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	color: #fff;
	font: 600 .9rem/1 "Plus Jakarta Sans", system-ui, sans-serif;
}
.uv-glb__count { opacity: .85; letter-spacing: .03em; }
.uv-glb__close {
	display: inline-flex;
	padding: .25rem;
	background: transparent;
	border: 0;
	color: #fff;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.uv-glb__stage {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 1rem 1.5rem;
}
.uv-glb__img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: var(--uv-radius-sm, 8px);
	user-select: none;
	-webkit-user-drag: none;
}

.uv-glb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 1.5rem;
	cursor: pointer;
	transition: background 200ms ease;
}
.uv-glb__nav:hover { background: rgba(255, 255, 255, 0.30); }
.uv-glb__nav--prev { left: 1.25rem; }
.uv-glb__nav--next { right: 1.25rem; }

@media (max-width: 768px) {
	.uv-glb__nav { width: 40px; height: 40px; font-size: 1.25rem; }
	.uv-glb__nav--prev { left: .5rem; }
	.uv-glb__nav--next { right: .5rem; }
}
