.rw-main-photo,
.rw-main-open {
	aspect-ratio: 1 / 1;
}

.rw-main-open {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
}

.rw-main-open .rw-main-img {
	width: 100% !important;
	height: 100% !important;
	object-fit: contain !important;
}

body.rw-lightbox-lock {
	overflow: hidden !important;
}

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

.rw-lightbox {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: grid;
	box-sizing: border-box;
	place-items: center;
	padding: clamp(12px, 2.25vw, 36px);
	background: rgba(12, 12, 12, 0.94);
	color: #fbfbfb;
}

.rw-lightbox__panel {
	position: relative;
	display: flex;
	width: min(1280px, 100%);
	height: min(900px, calc(100dvh - clamp(24px, 4.5vw, 72px)));
	align-items: stretch;
	justify-content: stretch;
	overflow: hidden;
	border: 1px solid rgba(251, 251, 251, 0.34);
	background: #d1d2d4;
}

.rw-lightbox__image {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	padding: clamp(56px, 5vw, 84px) clamp(72px, 8vw, 128px) clamp(72px, 6vw, 100px);
	box-sizing: border-box;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.rw-lightbox .rw-lightbox__control,
.rw-lightbox .rw-lightbox__control:hover,
.rw-lightbox .rw-lightbox__control:focus,
.rw-lightbox .rw-lightbox__control:active {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	width: 52px !important;
	height: 52px !important;
	align-items: center;
	justify-content: center;
	margin: 0;
	-webkit-appearance: none;
	appearance: none;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	box-shadow: none !important;
	font-size: 0 !important;
	line-height: 0 !important;
	text-decoration: none !important;
	transform: none !important;
	cursor: pointer;
	transition: background-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.rw-lightbox .rw-lightbox__control::before,
.rw-lightbox .rw-lightbox__control::after {
	content: "";
	display: block;
	background: currentColor;
}

.rw-lightbox .rw-lightbox__nav {
	top: calc(50% - 26px);
	background: #383838 !important;
	color: #fbfbfb !important;
}

.rw-lightbox .rw-lightbox__nav::before {
	width: 30px;
	height: 30px;
	-webkit-mask: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 7L19 15L11 23' stroke='black' stroke-width='1.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / 30px 30px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg width='30' height='30' viewBox='0 0 30 30' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 7L19 15L11 23' stroke='black' stroke-width='1.4' stroke-linecap='square' stroke-linejoin='miter'/%3E%3C/svg%3E") center / 30px 30px no-repeat;
}

.rw-lightbox .rw-lightbox__nav--prev {
	left: clamp(16px, 2vw, 28px);
}

.rw-lightbox .rw-lightbox__nav--prev::before {
	transform: rotate(180deg);
}

.rw-lightbox .rw-lightbox__nav--next {
	right: clamp(16px, 2vw, 28px);
	background: #fbfbfb !important;
	color: #1c1c1c !important;
}

.rw-lightbox .rw-lightbox__close,
.rw-lightbox .rw-lightbox__close:hover,
.rw-lightbox .rw-lightbox__close:focus,
.rw-lightbox .rw-lightbox__close:active {
	top: clamp(16px, 2vw, 28px);
	right: clamp(16px, 2vw, 28px);
	width: 48px !important;
	height: 48px !important;
	background: #fbfbfb !important;
	color: #1c1c1c !important;
	transform: none !important;
}

.rw-lightbox .rw-lightbox__close::before,
.rw-lightbox .rw-lightbox__close::after {
	position: absolute;
	width: 23px;
	height: 1px;
}

.rw-lightbox .rw-lightbox__close::before {
	transform: rotate(45deg);
}

.rw-lightbox .rw-lightbox__close::after {
	transform: rotate(-45deg);
}

.rw-lightbox .rw-lightbox__control:hover {
	background: #ffd676 !important;
	color: #1c1c1c !important;
}

.rw-lightbox .rw-lightbox__control:focus-visible {
	outline: 2px solid #ffd676 !important;
	outline-offset: 3px;
}

.rw-lightbox .rw-lightbox__nav:disabled,
.rw-lightbox .rw-lightbox__nav:disabled:hover {
	background: #383838 !important;
	color: #fbfbfb !important;
	opacity: 0.3;
	cursor: default;
}

.rw-lightbox .rw-lightbox__nav[hidden],
.rw-lightbox__count[hidden] {
	display: none !important;
}

.rw-lightbox__count {
	position: absolute;
	z-index: 2;
	left: clamp(16px, 2vw, 28px);
	bottom: clamp(16px, 2vw, 28px);
	margin: 0;
	padding: 9px 12px 8px;
	background: #1c1c1c;
	color: #fbfbfb;
	font: 400 12px/1 var(--st-font-body, "Fixel Display", sans-serif);
	letter-spacing: 0.06em;
}

@media (max-width: 640px) {
	.rw-lightbox {
		padding: 0;
	}

	.rw-lightbox__panel {
		width: 100%;
		height: 100dvh;
		border: 0;
	}

	.rw-lightbox__image {
		padding: max(72px, env(safe-area-inset-top)) 16px max(104px, calc(88px + env(safe-area-inset-bottom)));
	}

	.rw-lightbox .rw-lightbox__control,
	.rw-lightbox .rw-lightbox__control:hover,
	.rw-lightbox .rw-lightbox__control:focus,
	.rw-lightbox .rw-lightbox__control:active {
		width: 48px !important;
		height: 48px !important;
	}

	.rw-lightbox .rw-lightbox__close {
		top: max(16px, env(safe-area-inset-top));
		right: 16px;
	}

	.rw-lightbox .rw-lightbox__nav {
		top: auto;
		bottom: max(16px, env(safe-area-inset-bottom));
		transform: none !important;
	}

	.rw-lightbox .rw-lightbox__nav--prev {
		left: auto;
		right: calc(50% + 4px);
	}

	.rw-lightbox .rw-lightbox__nav--next {
		right: calc(50% - 52px);
	}

	.rw-lightbox__count {
		left: 16px;
		bottom: max(25px, calc(25px + env(safe-area-inset-bottom)));
	}
}

@media (prefers-reduced-motion: reduce) {
	.rw-lightbox *,
	.rw-main-img,
	.rw-main-transition {
		scroll-behavior: auto !important;
		transition: none !important;
		animation: none !important;
	}
}
