/* Lightweight gallery lightbox. Namespaced under .lb- so it cannot collide
   with the legacy site styles in style1.css. */

.lb {
	position: fixed;
	inset: 0;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 12, 0.95);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.lb.is-open {
	opacity: 1;
	visibility: visible;
}

.lb-figure {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.lb-img {
	display: block;
	max-width: 94vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 3px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	background: #1b1b1f;
	opacity: 1;
	transition: opacity 0.15s ease;
}

.lb.is-loading .lb-img {
	opacity: 0.25;
}

.lb-caption {
	margin: 14px 8px 0;
	max-width: 80vw;
	color: #f2f2f4;
	font-size: 16px;
	line-height: 1.45;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.lb-counter {
	position: absolute;
	top: 18px;
	left: 20px;
	color: #d8d8dd;
	font-size: 14px;
	letter-spacing: 0.04em;
	font-variant-numeric: tabular-nums;
}

/* Controls */
.lb-btn {
	position: absolute;
	border: 0;
	margin: 0;
	padding: 0;
	cursor: pointer;
	color: #fff;
	background: rgba(24, 24, 28, 0.62);
	border-radius: 50%;
	line-height: 1;
	transition: background 0.15s ease, transform 0.15s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lb-btn:hover,
.lb-btn:focus-visible {
	background: rgba(60, 60, 68, 0.95);
}

.lb-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.lb-close {
	top: 12px;
	right: 14px;
	width: 44px;
	height: 44px;
	font-size: 26px;
}

.lb-prev,
.lb-next {
	top: 50%;
	margin-top: -26px;
	width: 52px;
	height: 52px;
	font-size: 34px;
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-prev span,
.lb-next span,
.lb-close span {
	display: block;
	margin-top: -4px;
}

.lb.is-single .lb-prev,
.lb.is-single .lb-next {
	display: none;
}

/* Loading indicator */
.lb-spinner {
	position: absolute;
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.lb.is-loading .lb-spinner {
	opacity: 1;
	animation: lb-spin 0.7s linear infinite;
}

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

/* Make the gallery tiles read as clickable */
[data-lightbox] a {
	cursor: zoom-in;
}

/* Touch and small screens: move the controls where thumbs can reach them. */
@media (max-width: 760px) {
	.lb-img { max-height: 68vh; }

	.lb-prev,
	.lb-next {
		top: auto;
		bottom: 18px;
		margin-top: 0;
		width: 56px;
		height: 56px;
	}

	.lb-prev { left: 12px; }
	.lb-next { right: 12px; }

	.lb-caption {
		max-width: 90vw;
	}

	.lb-counter {
		top: auto;
		bottom: 34px;
		left: 50%;
		transform: translateX(-50%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lb,
	.lb-img,
	.lb-btn {
		transition: none;
	}

	.lb.is-loading .lb-spinner {
		animation: none;
	}
}
