/**
 * ODP Lightbox — image and gallery viewer.
 *
 * Rewritten from scratch; the geometry follows what the previous viewer
 * displayed on this site: full-screen overlay at 90 % black, dark box capped
 * to 90 % × 80 % (90 % at 980 px and up), white cross at the top right, white
 * chevrons 60 px wide on each side, caption under the image.
 *
 * Everything is scoped under .odp-lb so the theme never inherits a rule.
 */

/* ---------------------------------------------------------------- container */

.odp-lb {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	text-align: center;
	cursor: zoom-out;
	overflow: hidden;
	z-index: 2147483647;
	overscroll-behavior-x: none;
	touch-action: pan-y;
}

.odp-lb:not([open]) {
	display: none;
}

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

.odp-lb * {
	box-sizing: border-box;
}

/* A modal dialog paints its own backdrop; the dark layer below replaces it so
   the fade-in stays identical and both the dialog API and the fallback share
   the same rendering. */
.odp-lb::backdrop {
	background: transparent;
}

.odp-lb__scrim {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	background: rgba(0, 0, 0, 0.9);
	cursor: zoom-out;
	opacity: 0;
	transition: opacity 250ms linear;
}

.odp-lb--open .odp-lb__scrim {
	opacity: 1;
}

/* ------------------------------------------------------------------ content */

.odp-lb__content {
	position: relative;
	z-index: 1;
	display: block;
	max-width: 90%;
	max-height: 80%;
	padding: 0;
	border: 0;
	background: #000;
	text-align: left;
	cursor: auto;
	overflow: visible;
	animation: odp-lb-fadein 0.5s;
}

@media screen and (min-width: 980px) {
	.odp-lb__content {
		max-height: 90%;
	}
}

.odp-lb__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 80vh;
	opacity: 1;
	transition: opacity 100ms linear;
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

@media screen and (min-width: 980px) {
	.odp-lb__img {
		max-height: 90vh;
	}
}

/* ------------------------------------------------------------------ caption */

.odp-lb__caption {
	position: absolute;
	top: 100%;
	left: 0;
	max-width: 100%;
	color: #fff;
	font-size: 16px;
	font-weight: lighter;
	line-height: 1.25;
	text-align: left;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.odp-lb__caption:hover,
.odp-lb__caption:focus {
	overflow: visible;
	white-space: normal;
}

.odp-lb__content a {
	color: #fff;
	text-decoration: underline;
}

.odp-lb__content a:hover,
.odp-lb__content a:focus {
	text-decoration: none;
}

/* ------------------------------------------------------------------ buttons */

.odp-lb .odp-lb__close,
.odp-lb .odp-lb__nav {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	background-image: none;
	box-shadow: none;
	color: #fff;
	text-transform: none;
	text-shadow: none;
	cursor: pointer;
	line-height: 0;
}

.odp-lb .odp-lb__close:focus-visible,
.odp-lb .odp-lb__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.odp-lb .odp-lb__close svg,
.odp-lb .odp-lb__nav svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.odp-lb .odp-lb__close {
	position: fixed;
	top: 25px;
	right: 25px;
	z-index: 3;
	width: 30px;
	height: 30px;
	overflow: hidden;
	opacity: 0.6;
}

.odp-lb .odp-lb__close:hover,
.odp-lb .odp-lb__close:focus {
	opacity: 1;
}

.odp-lb .odp-lb__nav {
	position: fixed;
	top: 50%;
	z-index: 3;
	width: 60px;
	height: 60px;
	margin-top: -30px;
	overflow: hidden;
	opacity: 0.4;
	-webkit-user-select: none;
	user-select: none;
}

.odp-lb .odp-lb__nav:hover,
.odp-lb .odp-lb__nav:focus {
	opacity: 1;
}

.odp-lb .odp-lb__nav--prev {
	left: 10px;
}

.odp-lb .odp-lb__nav--next {
	right: 10px;
}

.odp-lb--single .odp-lb__nav {
	display: none;
}

/* ------------------------------------------------------------- gallery swap */

.odp-lb--swapping .odp-lb__img {
	opacity: 0.2;
	transition: opacity 200ms linear;
}

/* ---------------------------------------------------------- loading state */

/*
 * Same idea as WP Featherlight: while the image is being fetched, the content
 * box becomes the spinning ring and what it holds is hidden. 10em at font-size
 * 10px is the 100 px circle the previous viewer drew.
 */
.odp-lb--loading .odp-lb__content {
	width: 10em;
	height: 10em;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 8px solid #909090;
	border-left-color: #fff;
	border-radius: 50%;
	background: transparent;
	font-size: 10px;
	animation: odp-lb-spin 1s linear infinite;
}

.odp-lb--loading .odp-lb__img,
.odp-lb--loading .odp-lb__caption,
.odp-lb--loading .odp-lb__close,
.odp-lb--loading .odp-lb__nav {
	visibility: hidden;
}

/* ------------------------------------------------------ screen reader status */

.odp-lb__status {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------------------------------------------------------------- markers */

[data-featherlight] img {
	cursor: zoom-in;
}

/* --------------------------------------------------------------- keyframes */

@keyframes odp-lb-fadein {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes odp-lb-spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

/* --------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
	.odp-lb__scrim,
	.odp-lb__img {
		transition: none;
	}

	.odp-lb__content,
	.odp-lb--loading .odp-lb__content {
		animation: none;
	}
}
