/*
 * Leo Skull Tiled Gallery - Lightbox.
 */

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

.lstg-lightbox {
	--lstg-bg: #000;
	--lstg-fg: #fff;
	--lstg-muted: rgba(255, 255, 255, 0.7);
	--lstg-control: rgba(0, 0, 0, 0.45);
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--lstg-bg);
	color: var(--lstg-fg);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	overflow: hidden;
}

.lstg-lightbox--white {
	--lstg-bg: #fff;
	--lstg-fg: #111;
	--lstg-muted: rgba(0, 0, 0, 0.65);
	--lstg-control: rgba(255, 255, 255, 0.7);
}

.lstg-lightbox[open] {
	display: flex;
	flex-direction: column;
}

.lstg-lightbox::backdrop {
	background: var(--lstg-bg);
}

.lstg-lightbox [hidden] {
	display: none !important;
}

.lstg-lightbox__stage {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 16px 16px 8px;
	touch-action: pan-y pinch-zoom;
}

.lstg-lightbox__image {
	display: block;
	width: auto !important;
	height: auto !important;
	max-width: 100% !important;
	max-height: 100% !important;
	margin: 0 !important;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: contain;
	transition: opacity 0.15s ease;
}

.lstg-lightbox.is-loading .lstg-lightbox__image {
	opacity: 0.35;
}

.lstg-lightbox__footer {
	flex: 0 0 auto;
	max-height: 30vh;
	padding: 4px 64px 16px;
	overflow-y: auto;
	text-align: center;
}

.lstg-lightbox__counter {
	display: block;
	color: var(--lstg-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.lstg-lightbox__caption,
.lstg-lightbox__description {
	max-width: 70ch;
	margin: 4px auto 0;
	padding: 0;
	color: var(--lstg-fg);
	white-space: pre-line;
}

.lstg-lightbox__caption {
	font-weight: 600;
}

.lstg-lightbox__description {
	color: var(--lstg-muted);
}

.lstg-lightbox__fullsize {
	display: inline-block;
	margin-top: 6px;
	color: var(--lstg-muted) !important;
	font-size: 13px;
	text-decoration: underline;
}

.lstg-lightbox__fullsize:hover,
.lstg-lightbox__fullsize:focus-visible {
	color: var(--lstg-fg) !important;
}

.lstg-lightbox__button {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	min-width: 0;
	margin: 0;
	padding: 0 0 4px;
	border: 0;
	border-radius: 50%;
	background: var(--lstg-control);
	color: var(--lstg-fg);
	font-family: inherit;
	font-size: 34px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	text-decoration: none;
}

.lstg-lightbox__button:hover {
	background: var(--lstg-control);
	color: var(--lstg-fg);
	opacity: 0.8;
}

.lstg-lightbox__button:focus-visible,
.lstg-lightbox__fullsize:focus-visible {
	outline: 2px solid var(--lstg-fg);
	outline-offset: 2px;
}

.lstg-lightbox__close {
	top: 12px;
	right: 12px;
}

.lstg-lightbox__previous,
.lstg-lightbox__next {
	top: 50%;
	transform: translateY(-50%);
}

.lstg-lightbox__previous {
	left: 12px;
}

.lstg-lightbox__next {
	right: 12px;
}

@media (max-width: 600px) {
	.lstg-lightbox__stage {
		padding: 8px 0 4px;
	}

	.lstg-lightbox__footer {
		padding: 4px 16px 12px;
	}

	.lstg-lightbox__button {
		width: 40px;
		height: 40px;
		font-size: 28px;
	}

	.lstg-lightbox__previous {
		left: 4px;
	}

	.lstg-lightbox__next {
		right: 4px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lstg-lightbox__image {
		transition: none;
	}
}
