/**
 * lz lightbox — styles for the theme's built-in image lightbox.
 * Overlay opacity matches the 0.8 the old plugin was configured with.
 */

html.lzlb-open {
	overflow: hidden;
}

.lzlb {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lzlb[hidden] {
	display: none;
}

.lzlb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.8 );
}

.lzlb__stage {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 3.5rem 1rem 3rem;
	pointer-events: none;
}

.lzlb__figure {
	position: relative;
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 0;
}

.lzlb__img {
	display: block;
	max-width: 100%;
	max-height: calc( 100vh - 8rem );
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 3px;
	box-shadow: 0 6px 32px rgba( 0, 0, 0, 0.5 );
	pointer-events: auto;
	opacity: 1;
	transition: opacity 0.18s ease;
}

.lzlb.is-loading .lzlb__img {
	opacity: 0;
}

.lzlb__caption {
	margin: 0.65rem 0 0;
	max-width: 70ch;
	color: #e6e6e6;
	font-size: 0.85rem;
	line-height: 1.4;
	text-align: center;
	pointer-events: auto;
}

.lzlb__caption[hidden] {
	display: none;
}

.lzlb__counter {
	position: absolute;
	bottom: 1rem;
	left: 50%;
	transform: translateX( -50% );
	margin: 0;
	color: #b9b9b9;
	font-size: 0.8rem;
	letter-spacing: 0.02em;
	pointer-events: auto;
}

.lzlb__counter[hidden] {
	display: none;
}

/* Controls */
.lzlb__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, 0.45 );
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	line-height: 0;
	pointer-events: auto;
	transition: background 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.lzlb__btn:hover,
.lzlb__btn:focus-visible {
	background: rgba( 255, 255, 255, 0.22 );
}

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

.lzlb__btn[hidden] {
	display: none;
}

/* Square viewBox + flex centring keeps the glyph optically centred. */
.lzlb__icon {
	display: block;
	width: 75%;
	height: 75%;
}

/* The close button is smaller than the arrows, so its icon is scaled up to
   land at the same rendered mark size. */
.lzlb__btn--close .lzlb__icon {
	width: 86%;
	height: 86%;
}

.lzlb__btn--close {
	top: 0.75rem;
	right: 0.9rem;
	width: 2.6rem;
	height: 2.6rem;
}

.lzlb__btn--prev,
.lzlb__btn--next {
	top: 50%;
	transform: translateY( -50% );
	width: 3rem;
	height: 3rem;
}

.lzlb__btn--prev {
	left: 0.9rem;
}

.lzlb__btn--next {
	right: 0.9rem;
}

/* Loading indicator */
.lzlb__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2.4rem;
	height: 2.4rem;
	margin: -1.2rem 0 0 -1.2rem;
	border: 3px solid rgba( 255, 255, 255, 0.25 );
	border-top-color: #fff;
	border-radius: 50%;
	opacity: 0;
	animation: lzlb-spin 0.7s linear infinite;
}

.lzlb.is-loading .lzlb__spinner {
	opacity: 1;
}

@keyframes lzlb-spin {
	to {
		transform: rotate( 360deg );
	}
}

@media ( max-width: 600px ) {
	.lzlb__stage {
		padding: 3rem 0.4rem 2.6rem;
	}

	.lzlb__btn--prev,
	.lzlb__btn--next {
		width: 2.5rem;
		height: 2.5rem;
	}

	.lzlb__btn--prev {
		left: 0.4rem;
	}

	.lzlb__btn--next {
		right: 0.4rem;
	}

	.lzlb__img {
		max-height: calc( 100vh - 7rem );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.lzlb__img,
	.lzlb__btn {
		transition: none;
	}

	.lzlb__spinner {
		animation-duration: 2s;
	}
}
