/* Lightbox. One native dialog per page, built by js/lightbox.js on the
first click of a photo from launchpad_lightbox_image(). Loaded only on
pages with such photos. The dialog is its own backdrop: a near black
sheet over the whole viewport, the photo contained in it, the buttons
on top. */

/* The link around a photo: it takes the place of the image in its tile,
so it fills what the image filled. */
.lp-lightbox-trigger {
	display: block;
	height: 100%;
	border-radius: inherit;
	cursor: zoom-in;
}

.lp-lightbox-trigger:focus-visible {
	outline: 2px solid var(--border-focus, #615ff8);
	outline-offset: 3px;
}

html.lp-lightbox-open {
	overflow: hidden;
}

.lp-lightbox {
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgb(10 12 18 / 0.94);
	color: #fff;
	overscroll-behavior: contain;
}

.lp-lightbox::backdrop {
	background: transparent;
}

.lp-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.lp-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 4.5rem 5rem;
	box-sizing: border-box;
}

.lp-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	min-height: 0;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	user-select: none;
	-webkit-user-drag: none;
}

.lp-lightbox__caption {
	max-width: 60ch;
	font-size: 15px;
	line-height: 1.4;
	text-align: center;
	color: rgb(255 255 255 / 0.85);
}

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

.lp-lightbox__count {
	position: absolute;
	top: 1.5rem;
	left: 50%;
	margin: 0;
	transform: translateX(-50%);
	font-size: 14px;
	letter-spacing: 0.04em;
	color: rgb(255 255 255 / 0.75);
}

.lp-lightbox__button {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgb(255 255 255 / 0.35);
	border-radius: 50%;
	background: rgb(255 255 255 / 0.08);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lp-lightbox__button:hover {
	background: rgb(255 255 255 / 0.2);
	border-color: #fff;
}

.lp-lightbox__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.lp-lightbox__button svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

.lp-lightbox__button--close {
	top: 1rem;
	right: 1rem;
}

.lp-lightbox__button--previous,
.lp-lightbox__button--next {
	top: 50%;
	transform: translateY(-50%);
}

.lp-lightbox__button--previous {
	left: 1rem;
}

.lp-lightbox__button--next {
	right: 1rem;
}

/* One photo: nothing to step through. */
.lp-lightbox.is-single .lp-lightbox__count,
.lp-lightbox.is-single .lp-lightbox__button--previous,
.lp-lightbox.is-single .lp-lightbox__button--next {
	display: none;
}

/* Phones: the photo takes the width, the step buttons sit at the foot. */
@media screen and (max-width: 765px) {
	.lp-lightbox__figure {
		padding: 4rem 0.75rem 5.5rem;
	}

	.lp-lightbox__button--previous,
	.lp-lightbox__button--next {
		top: auto;
		bottom: 1.25rem;
		transform: none;
	}

	.lp-lightbox__button--previous {
		left: calc(50% - 60px);
	}

	.lp-lightbox__button--next {
		right: calc(50% - 60px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lp-lightbox__button {
		transition: none;
	}
}
