/* ==========================================================================
   Lightbox
   ========================================================================== */

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

[data-oh-lightbox] img:focus-visible {
	outline: 2px solid var(--oh-color-primary);
	outline-offset: 3px;
}

.oh-lightbox-open,
.oh-lightbox-open body {
	overflow: hidden;
}

.oh-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 80px;
	background: rgba(10, 18, 20, 0.94);
	animation: oh-lightbox-in 0.25s ease;
}

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

.oh-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.oh-lightbox .oh-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 160px);
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}

.oh-lightbox__caption {
	max-width: 60ch;
	margin-top: 14px;
	font-size: 0.875rem;
	line-height: 1.5;
	text-align: center;
	color: rgba(255, 255, 255, 0.8);
}

.oh-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	margin: 0;
	transform: translateX(-50%);
	font-size: 0.8125rem;
	letter-spacing: 0.1em;
	color: rgba(255, 255, 255, 0.7);
}

.oh-lightbox .oh-lightbox__btn {
	position: absolute;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.oh-lightbox .oh-lightbox__btn:hover,
.oh-lightbox .oh-lightbox__btn:focus-visible {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
}

.oh-lightbox__close {
	top: 16px;
	right: 16px;
}

.oh-lightbox__prev {
	top: 50%;
	left: 16px;
	transform: translateY(-50%);
}

.oh-lightbox__next {
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
}

.oh-lightbox.is-single .oh-lightbox__prev,
.oh-lightbox.is-single .oh-lightbox__next {
	display: none;
}

@keyframes oh-lightbox-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.oh-lightbox {
		animation: none;
	}
}

@media (max-width: 767px) {
	.oh-lightbox {
		padding: 64px 12px 56px;
	}

	.oh-lightbox__prev,
	.oh-lightbox__next {
		top: auto;
		bottom: 8px;
		transform: none;
	}
}
