/**
 * Lightbox styling.
 *
 * @package Kerststal
 */

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

.kerststal-lightbox {
	box-sizing: border-box;
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 3rem 4rem;
	border: 0;
	background: transparent;
	color: #fff;
}

.kerststal-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.88);
}

.kerststal-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: kerststal-lightbox-fade 0.2s ease-out;
}

.kerststal-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	width: 100%;
	height: 100%;
	margin: 0;
}

.kerststal-lightbox__image {
	display: block;
	max-width: 100%;
	min-height: 0;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.kerststal-lightbox__caption {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.25rem;
	max-width: 60rem;
	font-family: var(--wp--preset--font-family--body, inherit);
	text-align: center;
	color: var(--wp--preset--color--base, #fff);
}

.kerststal-lightbox__caption:empty,
.kerststal-lightbox__caption span:empty {
	display: none;
}

.kerststal-lightbox__caption a {
	color: inherit;
}

.kerststal-lightbox__counter {
	font-size: 0.85em;
	opacity: 0.75;
}

.kerststal-lightbox__button {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: 2.5rem;
	line-height: 1;
	cursor: pointer;
}

.kerststal-lightbox__button:hover,
.kerststal-lightbox__button:focus-visible {
	background: rgba(0, 0, 0, 0.75);
}

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

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

.kerststal-lightbox__close {
	top: 0.5rem;
	right: 0.5rem;
}

.kerststal-lightbox__prev,
.kerststal-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.kerststal-lightbox__prev {
	left: 0.5rem;
}

.kerststal-lightbox__next {
	right: 0.5rem;
}

@media (max-width: 600px) {
	.kerststal-lightbox {
		padding: 3.5rem 0.5rem;
	}

	.kerststal-lightbox__prev,
	.kerststal-lightbox__next {
		top: auto;
		bottom: 0.5rem;
		transform: none;
	}
}

@keyframes kerststal-lightbox-fade {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kerststal-lightbox[open] {
		animation: none;
	}
}
