/* The page behind a modal dialog stays scrollable unless it is locked. The
   gutter keeps the layout from shifting when the scrollbar disappears. */
html:has(.c-lightbox[open]) {
	overflow: hidden;
	scrollbar-gutter: stable;
}

/* The dialog is created by lightbox.js on the first click. */
.c-lightbox {
	overscroll-behavior: contain;
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	padding: 0;
	border: 0;
	background: transparent;
	color: #ffffff;
}

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

.c-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}

.c-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.c-lightbox__button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #ffffff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

.c-lightbox__button[hidden] {
	display: none;
}

.c-lightbox__button:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.c-lightbox__button--close {
	top: var(--space-3);
	right: var(--space-3);
}

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

.c-lightbox__button--prev {
	left: var(--space-3);
}

.c-lightbox__button--next {
	right: var(--space-3);
}
