/* =========================================================
   Lightbox — assets/js/lightbox.js builds this markup on
   the first click. Nothing here applies until then.
   ========================================================= */

.bv-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(0.5rem, 2vw, 1.5rem);
	padding: clamp(1rem, 4vw, 3rem);
	background: rgb(0 0 0 / 0.92);
}

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

/* The page behind must not scroll under the overlay. */
.bv-lightbox-open,
.bv-lightbox-open body {
	overflow: hidden;
}

.bv-lightbox__figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	max-width: 100%;
	max-height: 100%;
	min-width: 0;
}

.bv-lightbox__img {
	display: block;
	max-width: 100%;
	/* Room for the caption underneath without the image being cropped. */
	max-height: calc(100vh - 8rem);
	width: auto;
	height: auto;
	object-fit: contain;
	background: rgb(255 255 255 / 0.04);
}

.bv-lightbox__caption {
	margin: 0;
	max-width: 68ch;
	text-align: center;
	color: rgb(255 255 255 / 0.82);
	font-size: 0.9rem;
	line-height: 1.5;
}

.bv-lightbox__caption[hidden] {
	display: none;
}

.bv-lightbox__count {
	position: absolute;
	left: 50%;
	bottom: clamp(0.5rem, 2vw, 1.25rem);
	transform: translateX(-50%);
	margin: 0;
	color: rgb(255 255 255 / 0.6);
	font-size: 0.8rem;
	letter-spacing: 0.06em;
}

.bv-lightbox__count[hidden] {
	display: none;
}

.bv-lightbox__close,
.bv-lightbox__nav {
	flex: none;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 0.1);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease;
}

.bv-lightbox__close:hover,
.bv-lightbox__nav:hover {
	background: rgb(255 255 255 / 0.22);
}

/* Visible focus is the whole point on a dark overlay — the default ring
   disappears against black. */
.bv-lightbox__close:focus-visible,
.bv-lightbox__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.bv-lightbox__close {
	position: absolute;
	top: clamp(0.5rem, 2vw, 1.25rem);
	right: clamp(0.5rem, 2vw, 1.25rem);
	width: 44px;
	height: 44px;
	font-size: 1.6rem;
}

.bv-lightbox__nav {
	/* 44px minimum touch target. */
	width: 44px;
	height: 44px;
	font-size: 1.8rem;
}

.bv-lightbox__nav[hidden] {
	display: none;
}

/* Gallery and band triggers should look clickable. */
.bv-gallery__item,
.bv-band__media a {
	cursor: zoom-in;
}

@media (max-width: 640px) {
	.bv-lightbox {
		padding: 0.75rem;
	}
	/* Arrows move off the sides and under the picture, where they do not
	   overlap it on a narrow screen. */
	.bv-lightbox__nav {
		position: absolute;
		bottom: clamp(0.5rem, 2vw, 1.25rem);
	}
	.bv-lightbox__nav--prev {
		left: 1rem;
	}
	.bv-lightbox__nav--next {
		right: 1rem;
	}
	.bv-lightbox__img {
		max-height: calc(100vh - 10rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.bv-lightbox__close,
	.bv-lightbox__nav {
		transition: none;
	}
}
