/* ============================================================
   ROI Estate — Global Lightbox
   Aktivuje se přes data-lightbox="group-name" na <a> nebo <img>.
   3-slide carousel (prev / curr / next) s plynulým swipem.
   ============================================================ */

body.re-lightbox-lock { overflow: hidden; }

.re-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(1.6rem, 3vw, 4rem);
	background: rgba(10, 16, 32, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.re-lightbox--open {
	display: flex;
	opacity: 1;
}

.re-lightbox__stage {
	position: relative;
	margin: 0;
	width: 100%;
	max-width: min(110rem, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.4rem;
}

.re-lightbox__viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	touch-action: pan-y; /* horizontal gesto si bere náš pointer handler */
}

.re-lightbox__track {
	display: flex;
	transform: translate3d(-100%, 0, 0);
	will-change: transform;
}

.re-lightbox__slide {
	flex: 0 0 100%;
	width: 100%;
	height: auto;
	max-height: calc(100svh - 14rem);
	object-fit: contain;
	border-radius: 0.6rem;
	background: #0a1020;
	user-select: none;
	-webkit-user-select: none;
	-webkit-user-drag: none;
	pointer-events: none; /* aby native image-drag nezachytával naše gesto */
	transition: opacity 0.25s ease;
}

.re-lightbox__slide--curr {
	box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.re-lightbox--loading .re-lightbox__slide--curr { opacity: 0.3; }

.re-lightbox__caption {
	max-width: 80ch;
	margin: 0;
	text-align: center;
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--font, "Source Sans 3", sans-serif);
	font-size: var(--text-s, 1.42rem);
	line-height: 1.5;
}

.re-lightbox__counter {
	position: absolute;
	top: 1.6rem;
	left: 50%;
	transform: translateX(-50%);
	padding: 0.5rem 1.2rem;
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 5rem;
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--font, "Source Sans 3", sans-serif);
	font-size: 1.3rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	pointer-events: none;
}

/* ---- Tlačítka ---- */
.re-lightbox__close,
.re-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4.8rem;
	height: 4.8rem;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #fff;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.re-lightbox__close:hover,
.re-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.18);
	border-color: rgba(255, 255, 255, 0.32);
}
.re-lightbox__close:focus-visible,
.re-lightbox__nav:focus-visible {
	outline: 2px solid #ceaa62;
	outline-offset: 3px;
}
.re-lightbox__close svg,
.re-lightbox__nav svg {
	width: 2.4rem;
	height: 2.4rem;
}

.re-lightbox__close {
	top: 1.6rem;
	right: 1.6rem;
}

.re-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 5.4rem;
	height: 5.4rem;
}
.re-lightbox__nav:hover { transform: translateY(-50%) scale(1.05); }
.re-lightbox__nav--prev { left: clamp(1rem, 3vw, 3rem); }
.re-lightbox__nav--next { right: clamp(1rem, 3vw, 3rem); }

@media (max-width: 640px) {
	.re-lightbox__nav {
		top: auto;
		bottom: 1.6rem;
		transform: none;
		width: 4.4rem;
		height: 4.4rem;
	}
	.re-lightbox__nav:hover { transform: scale(1.05); }
	.re-lightbox__nav--prev { left: 25%; }
	.re-lightbox__nav--next { right: 25%; }
	.re-lightbox__counter { top: auto; bottom: 2.4rem; left: 50%; }
	.re-lightbox__slide { max-height: calc(100svh - 18rem); }
}

/* Vizuální feedback pro trigger */
[data-lightbox] {
	cursor: zoom-in;
}
[data-lightbox]:focus-visible {
	outline: 2px solid var(--primary, #3564F2);
	outline-offset: 4px;
	border-radius: 0.4rem;
}
