/**
 * Click-to-enlarge for doc screenshots.
 *
 * Plain CSS, like toc.css: the Tailwind build only sees classes that existed
 * the last time it ran, so anything new here would render unstyled until a
 * rebuild.
 */

.ox-zoomable {
	cursor: zoom-in;
}

.ox-zoomable:focus-visible {
	outline: 2px solid #0ad2ad;
	outline-offset: 3px;
}

/* Freeze the page behind the overlay. */
.ox-lightbox-open,
.ox-lightbox-open body {
	overflow: hidden;
}

.ox-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2.5rem 1.25rem;
	background: rgba(2, 6, 23, 0.9);
	overflow: auto;
	overscroll-behavior: contain;
}

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

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

.ox-lightbox__img {
	display: block;
	max-width: 95vw;
	max-height: 85vh;
	width: auto;
	height: auto;
	border-radius: 0.5rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
	cursor: zoom-in;
}

/* Second click: true pixel size, pan by scrolling the overlay. */
.ox-lightbox.is-zoomed {
	align-items: flex-start;
	justify-content: flex-start;
}

.ox-lightbox.is-zoomed .ox-lightbox__img {
	max-width: none;
	max-height: none;
	cursor: zoom-out;
}

.ox-lightbox__caption {
	max-width: min(70ch, 95vw);
	color: #e2e8f0;
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: center;
}

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

.ox-lightbox__close {
	position: fixed;
	top: 0.85rem;
	right: 1rem;
	z-index: 1;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.75rem;
	line-height: 1;
	color: #e2e8f0;
	background: rgba(15, 23, 42, 0.75);
	border: 1px solid rgba(148, 163, 184, 0.35);
	border-radius: 9999px;
	cursor: pointer;
}

.ox-lightbox__close:hover,
.ox-lightbox__close:focus-visible {
	color: #0ad2ad;
	border-color: #0ad2ad;
}

@media (max-width: 640px) {
	.ox-lightbox {
		padding: 3.5rem 0.75rem 1.5rem;
	}

	.ox-lightbox__img {
		max-height: 78vh;
	}
}
