/* standard/deluxe lightbox */

html.lb-lock,
html.lb-lock body { overflow: hidden; }

.gallery a { cursor: zoom-in; }

.lb-overlay {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	background: #000;
	color: #fff;
	-webkit-user-select: none;
	user-select: none;
}
.lb-overlay.is-open { display: block; }

.lb-stage {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 4.5rem 4.5rem 5.5rem;
	box-sizing: border-box;
	/* let clicks in the empty margins fall through to the overlay (close),
	   and never let the stage steal clicks from the arrow/close buttons */
	pointer-events: none;
}

.lb-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	opacity: 0;              /* hidden instantly on navigate (no transition here) */
	pointer-events: auto;
}
/* fade only IN, once the new image has loaded — never leave the old one lingering */
.lb-img.is-loaded { opacity: 1; transition: opacity .25s ease; }

.lb-caption {
	margin-top: .9rem;
	font-size: .8rem;
	line-height: 1.35;
	text-align: center;
	max-width: 60ch;
	opacity: .8;
}

/* controls */
.lb-btn {
	position: absolute;
	z-index: 2;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	opacity: .7;
	transition: opacity .2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}
.lb-btn:hover,
.lb-btn:focus-visible { opacity: 1; }

.lb-close {
	top: 1rem;
	right: 1.25rem;
	font-size: 2.4rem;
	width: 2.6rem;
	height: 2.6rem;
}

.lb-prev,
.lb-next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 3.2rem;
	width: 3.4rem;
	height: 4.4rem;
}
.lb-prev { left: .5rem; }
.lb-next { right: .5rem; }

/* bottom bar: play/pause + counter */
.lb-bar {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	bottom: 1.1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	pointer-events: none;
}
.lb-bar .lb-play,
.lb-bar .lb-count { pointer-events: auto; }

.lb-play {
	position: relative; /* positioning context for the ring */
	width: 2.6rem;
	height: 2.6rem;
	border: 0;
	border-radius: 50%;
}

/* progress ring around the play button — fills over one slide interval */
.lb-ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	transform: rotate(-90deg); /* start the fill at 12 o'clock */
}
.lb-ring circle {
	fill: none;
	stroke-width: 1.5;
}
.lb-ring-track { stroke: rgba(255, 255, 255, .15); }
.lb-ring-fill {
	stroke: rgba(255, 255, 255, .24);       /* just a hair above the track */
	stroke-dasharray: 100.53;               /* 2·π·16 ≈ circumference */
	stroke-dashoffset: 100.53;              /* empty by default */
	opacity: 0;
}
.lb-overlay.is-playing .lb-ring-fill {
	opacity: 1;
	animation: lb-ring-fill var(--lb-delay, 3500ms) linear both;
}
@keyframes lb-ring-fill {
	from { stroke-dashoffset: 100.53; }
	to   { stroke-dashoffset: 0; }
}

.lb-ico { width: 1.15rem; height: 1.15rem; fill: currentColor; display: block; }
.lb-ico--pause { display: none; }
.lb-overlay.is-playing .lb-ico--play { display: none; }
.lb-overlay.is-playing .lb-ico--pause { display: block; }

.lb-count {
	font-size: .8rem;
	font-variant-numeric: tabular-nums;
	opacity: .8;
	min-width: 4ch;
}

@media (max-width: 640px) {
	.lb-stage { padding: 3.5rem 1rem 5rem; }
	.lb-prev, .lb-next { font-size: 2.4rem; width: 2.2rem; }
	.lb-prev { left: 0; }
	.lb-next { right: 0; }
}
