/**
 * Site-wide image lightbox modal.
 */

.rfy-lightbox__trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
	font: inherit;
	color: inherit;
	text-align: inherit;
	text-decoration: none;
}

.rfy-lightbox__trigger:focus-visible {
	outline: 2px solid var(--rfy-accent);
	outline-offset: 3px;
}

.rfy-lightbox__trigger img {
	display: block;
	width: 100%;
}

body.rfy-lightbox-open {
	overflow: hidden;
}

.rfy-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

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

.rfy-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 10, 8, 0.92);
}

.rfy-lightbox__dialog {
	position: relative;
	z-index: 1;
	width: min(1100px, 100%);
	max-height: calc(100vh - 32px);
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.rfy-lightbox__close {
	position: absolute;
	inset-block-start: -8px;
	inset-inline-end: -8px;
	z-index: 3;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	background: rgba(43, 26, 16, 0.85);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background var(--rfy-transition), transform var(--rfy-transition);
}

.rfy-lightbox__close:hover {
	background: var(--rfy-accent);
	color: var(--rfy-primary-dark);
	transform: scale(1.05);
}

.rfy-lightbox__counter {
	margin: 0 0 12px;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	min-height: 1.25rem;
}

.rfy-lightbox__swiper {
	width: 100%;
	overflow: hidden;
	border-radius: var(--rfy-radius-lg);
}

.rfy-lightbox__slide {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: min(72vh, 720px);
}

.rfy-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: min(72vh, 720px);
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
	border-radius: var(--rfy-radius-md);
	box-shadow: var(--rfy-shadow-lg);
}

.rfy-lightbox__swiper .swiper-button-next,
.rfy-lightbox__swiper .swiper-button-prev {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	border: 1px solid var(--rfy-line);
	box-shadow: var(--rfy-shadow-md);
	color: var(--rfy-primary-dark);
}

.rfy-lightbox__swiper .swiper-button-next:hover,
.rfy-lightbox__swiper .swiper-button-prev:hover {
	background: var(--rfy-accent);
}

.rfy-lightbox__swiper .swiper-button-next::after,
.rfy-lightbox__swiper .swiper-button-prev::after {
	font-size: 16px;
	font-weight: 900;
}

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

	.rfy-lightbox__close {
		inset-block-start: 4px;
		inset-inline-end: 4px;
	}

	.rfy-lightbox__slide {
		min-height: min(64vh, 560px);
	}

	.rfy-lightbox__img {
		max-height: min(64vh, 560px);
	}

	.rfy-lightbox__swiper .swiper-button-next,
	.rfy-lightbox__swiper .swiper-button-prev {
		display: none;
	}
}
