.nis-lightbox-open {
	overflow: hidden !important;
}

.nis-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.92);
	box-sizing: border-box;
}

.nis-gallery-lightbox[aria-hidden="false"] {
	display: flex;
}

.nis-gallery-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(1200px, 100%);
	height: calc(100% - 32px);
	min-width: 0;
}

.nis-gallery-lightbox__image-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-width: 0;
}

.nis-gallery-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.nis-gallery-lightbox__button {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 1px solid rgba(255,255,255,.45);
	border-radius: 50%;
	background: rgba(0,0,0,.5);
	color: #fff;
	font: inherit;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}

.nis-gallery-lightbox__button:hover,
.nis-gallery-lightbox__button:focus-visible {
	background: rgba(255,255,255,.16);
	border-color: #fff;
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.nis-gallery-lightbox__close {
	top: 0;
	right: 0;
	font-size: 34px;
}

.nis-gallery-lightbox__prev {
	left: 0;
	top: 50%;
	transform: translateY(-50%);
}

.nis-gallery-lightbox__next {
	right: 0;
	top: 50%;
	transform: translateY(-50%);
}

.nis-gallery-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	padding: 6px 10px;
	border-radius: 3px;
	background: rgba(0,0,0,.55);
	color: #fff;
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
}

.nis-gallery-lightbox__caption {
	position: absolute;
	left: 50%;
	bottom: 34px;
	transform: translateX(-50%);
	max-width: min(760px, calc(100% - 100px));
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

.nis-lightbox-target {
	cursor: zoom-in;
}

@media (max-width: 640px) {
	.nis-gallery-lightbox {
		padding: 12px;
	}
	.nis-gallery-lightbox__stage {
		height: calc(100% - 12px);
	}
	.nis-gallery-lightbox__button {
		width: 44px;
		height: 44px;
	}
	.nis-gallery-lightbox__prev {
		left: 4px;
	}
	.nis-gallery-lightbox__next {
		right: 4px;
	}
	.nis-gallery-lightbox__caption {
		max-width: calc(100% - 24px);
		bottom: 38px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nis-gallery-lightbox__button {
		transition: none;
	}
}
