/* Cinematic gallery lightbox (lightbox.js) */

body.zgb-lb-open { overflow: hidden; }

.zgb-lb {
	position: fixed; inset: 0; z-index: 1000;
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-rows: 1fr auto;
	grid-template-areas:
		"prev stage next"
		"thumbs thumbs thumbs";
	align-items: center;
	gap: var(--zgb-space-3);
	padding: clamp(1rem, 3vw, 2.5rem);
	background: rgba(16, 11, 9, .96);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	animation: zgbLbIn .25s var(--zgb-ease-out) both;
}
.zgb-lb[hidden] { display: none; }
@keyframes zgbLbIn { from { opacity: 0; } to { opacity: 1; } }

.zgb-lb__stage {
	grid-area: stage;
	margin: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: var(--zgb-space-4);
	min-height: 0; height: 100%;
}
.zgb-lb__img {
	max-width: min(92vw, 1400px);
	max-height: 78vh;
	object-fit: contain;
	border-radius: var(--zgb-radius-sm);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
	opacity: 0; transform: scale(.98);
	transition: opacity var(--zgb-dur) var(--zgb-ease-out), transform var(--zgb-dur) var(--zgb-ease-out);
}
.zgb-lb__img.is-loaded { opacity: 1; transform: none; }
.zgb-lb__caption {
	color: var(--zgb-cream); font-size: var(--zgb-fs-sm); text-align: center;
	max-width: 60ch; line-height: 1.5;
}

.zgb-lb__close {
	position: absolute; top: 14px; right: 18px; z-index: 2;
	background: none; border: 0; color: var(--zgb-cream);
	font-size: 2.4rem; line-height: 1; cursor: pointer;
	transition: transform var(--zgb-dur-fast) var(--zgb-ease-out), color var(--zgb-dur-fast);
}
.zgb-lb__close:hover { transform: rotate(90deg); color: var(--zgb-green-soft); }

.zgb-lb__counter {
	position: absolute; top: 20px; left: 22px;
	color: var(--zgb-green-soft); font-family: var(--zgb-font-head);
	font-size: var(--zgb-fs-sm); font-variant-numeric: tabular-nums; letter-spacing: .05em;
}

.zgb-lb__nav {
	background: rgba(247, 240, 230, .1); border: 0; color: var(--zgb-cream);
	width: 54px; height: 54px; border-radius: 50%; font-size: 1.9rem; cursor: pointer;
	transition: background var(--zgb-dur-fast) var(--zgb-ease-out), transform var(--zgb-dur-fast);
}
.zgb-lb__nav:hover { background: rgba(247, 240, 230, .25); }
.zgb-lb__nav:active { transform: scale(.92); }
.zgb-lb__prev { grid-area: prev; }
.zgb-lb__next { grid-area: next; }

.zgb-lb__thumbs {
	grid-area: thumbs;
	display: flex; gap: var(--zgb-space-2);
	overflow-x: auto; padding: var(--zgb-space-2);
	justify-content: center; scrollbar-width: thin;
}
.zgb-lb__thumb {
	flex: 0 0 auto;
	width: 64px; height: 48px;
	border: 2px solid transparent; border-radius: var(--zgb-radius-sm);
	background-size: cover; background-position: center;
	cursor: pointer; opacity: .55;
	transition: opacity var(--zgb-dur-fast), border-color var(--zgb-dur-fast), transform var(--zgb-dur-fast);
}
.zgb-lb__thumb:hover { opacity: .85; transform: translateY(-2px); }
.zgb-lb__thumb.is-active { opacity: 1; border-color: var(--zgb-green-soft); }

/* Gallery thumbnail zoom affordance (tile layout lives in components/gallery.css) */
.tour-gallery__zoom {
	position: absolute; bottom: 10px; right: 10px;
	width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
	background: rgba(16, 11, 9, .55); color: #fff; border-radius: 50%; font-size: 1.1rem;
	opacity: 0; transform: scale(.8);
	transition: opacity var(--zgb-dur-fast) var(--zgb-ease-out), transform var(--zgb-dur-fast) var(--zgb-ease-out);
}
.tour-gallery__item:hover .tour-gallery__zoom { opacity: 1; transform: none; }

@media (max-width: 768px) {
	.zgb-lb { grid-template-columns: 1fr; grid-template-areas: "stage" "thumbs"; }
	.zgb-lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; }
	.zgb-lb__prev { left: 8px; }
	.zgb-lb__next { right: 8px; }
	.zgb-lb__img { max-height: 70vh; }
}

@media (prefers-reduced-motion: reduce) {
	.zgb-lb, .zgb-lb__img, .zgb-lb__close, .zgb-lb__nav, .zgb-lb__thumb, .tour-gallery__zoom { transition: none; animation: none; }
	.zgb-lb__img { opacity: 1; transform: none; }
}
