/* chehol.org gallery lightbox */
.chlb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(10, 10, 10, 0.97);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
	-webkit-tap-highlight-color: transparent;
	touch-action: pan-y;
}

.chlb.is-open {
	opacity: 1;
	visibility: visible;
}

.chlb__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 64px 72px 72px;
	box-sizing: border-box;
}

.chlb__img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	user-select: none;
	-webkit-user-drag: none;
	opacity: 1;
	transition: opacity 0.18s ease;
}

.chlb__img.is-loading {
	opacity: 0;
}

.chlb__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 42px;
	height: 42px;
	margin: -21px 0 0 -21px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #ffc000;
	border-radius: 50%;
	animation: chlb-spin 0.8s linear infinite;
	display: none;
}

.chlb.is-loading .chlb__spinner {
	display: block;
}

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

.chlb__btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
	z-index: 2;
}

.chlb__btn:hover,
.chlb__btn:focus-visible {
	background: #ffc000;
	color: #111;
	outline: none;
}

.chlb__btn svg {
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.chlb__close {
	top: 12px;
	right: 12px;
}

.chlb__prev {
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
}

.chlb__next {
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
}

.chlb.is-single .chlb__prev,
.chlb.is-single .chlb__next,
.chlb.is-single .chlb__counter {
	display: none;
}

.chlb__bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 56px;
	padding: 8px 16px;
	box-sizing: border-box;
	color: rgba(255, 255, 255, 0.85);
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	text-align: center;
	pointer-events: none;
}

.chlb__counter {
	font-variant-numeric: tabular-nums;
	color: #ffc000;
	white-space: nowrap;
}

.chlb__caption:empty {
	display: none;
}

html.chlb-lock,
html.chlb-lock body {
	overflow: hidden !important;
}

@media (max-width: 600px) {
	.chlb__stage {
		padding: 56px 8px 64px;
	}

	.chlb__btn {
		width: 42px;
		height: 42px;
		background: rgba(0, 0, 0, 0.45);
	}

	.chlb__prev,
	.chlb__next {
		top: auto;
		bottom: 8px;
		transform: none;
	}

	.chlb__prev {
		left: 8px;
	}

	.chlb__next {
		right: 8px;
	}

	.chlb__bar {
		padding: 8px 60px;
	}
}

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