/* Album and in-content gallery lightbox. Loaded only on those views. */

.lightbox {
	--focus: var(--white);
	border: 0;
	padding: 0;
	max-width: none;
	max-height: none;
	width: 100%;
	height: 100%;
	margin: 0;
	background: rgba(10, 16, 13, 0.97);
	color: var(--white);
}

.lightbox::backdrop {
	background: rgba(10, 16, 13, 0.9);
}

.lightbox[open] {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-rows: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem;
}

.lightbox__bar {
	grid-column: 1 / -1;
	grid-row: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.lightbox__count {
	margin: 0;
	font: 800 1.15rem / 1 var(--font-display);
}

.lightbox__nav {
	grid-row: 2;
}

.lightbox__nav--prev {
	grid-column: 1;
}

.lightbox__nav--next {
	grid-column: 3;
}

.lightbox__fig {
	grid-column: 2;
	grid-row: 2;
	display: grid;
	justify-items: center;
	gap: 0.75rem;
	min-width: 0;
	max-height: 100%;
	margin: 0;
	touch-action: pan-y;
}

.lightbox__fig img {
	max-width: 100%;
	max-height: calc(100svh - 9.5rem);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: var(--r-sm);
}

.lightbox__fig figcaption {
	font-size: var(--fs-sm);
	color: rgba(255, 255, 255, 0.85);
	text-align: center;
	max-width: 50rem;
}

@media (max-width: 640px) {
	.lightbox__nav {
		width: 44px;
		height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lightbox,
	.lightbox * {
		transition: none;
		animation: none;
	}
}
