/* ------------------------------------------------------------------
   Lightbox / slider zdjec – Blocksy Child (janadamski.eu)
------------------------------------------------------------------ */

.ja-lb-trigger {
	cursor: zoom-in;
}

html.ja-lb-open {
	overflow: hidden;
}

.ja-lb {
	--ja-lb-bar: 54px;
	--ja-lb-thumbs: 92px;

	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	flex-direction: column;
	background: #0b0b0d;
	opacity: 0;
	transition: opacity 200ms ease;
	user-select: none;
}

.ja-lb.is-open {
	display: flex;
	opacity: 1;
}

.ja-lb *,
.ja-lb *::before,
.ja-lb *::after {
	box-sizing: border-box;
}

/* ---------- gorny pasek ---------- */

.ja-lb__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 var(--ja-lb-bar);
	padding: 0 12px 0 20px;
}

.ja-lb__counter {
	color: rgba(255, 255, 255, 0.72);
	font: 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
	letter-spacing: 0.04em;
}

.ja-lb__tools {
	display: flex;
	gap: 6px;
}

/* ---------- scena ze slajdami ---------- */

.ja-lb__stage {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
}

.ja-lb__track {
	display: flex;
	height: 100%;
	transition: transform 380ms cubic-bezier(0.33, 1, 0.68, 1);
	will-change: transform;
}

.ja-lb.is-dragging .ja-lb__track {
	transition: none;
}

.ja-lb__slide {
	display: flex;
	flex: 0 0 100%;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 4px clamp(12px, 5vw, 64px) 12px;
}

.ja-lb__imgwrap {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	max-width: 100%;
	overflow: hidden;
}

.ja-lb__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 2px;
	cursor: zoom-in;
	transition: transform 260ms cubic-bezier(0.33, 1, 0.68, 1);
}

.ja-lb.is-zoomed .ja-lb__img {
	cursor: grab;
}

.ja-lb.is-zoomed.is-dragging .ja-lb__img {
	cursor: grabbing;
	transition: none;
}

.ja-lb.is-zoomed .ja-lb__imgwrap {
	overflow: visible;
}

.ja-lb__caption {
	flex: 0 0 auto;
	max-width: 68ch;
	color: rgba(255, 255, 255, 0.85);
	font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
	text-align: center;
}

.ja-lb.is-zoomed .ja-lb__caption {
	opacity: 0;
}

/* ---------- przyciski ---------- */

.ja-lb__btn {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.ja-lb__btn:hover {
	background: rgba(255, 255, 255, 0.26);
}

.ja-lb__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.ja-lb__btn[hidden] {
	display: none;
}

.ja-lb__btn.is-active {
	background: rgba(255, 255, 255, 0.32);
}

.ja-lb__btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.1;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ja-lb__prev,
.ja-lb__next {
	position: absolute;
	top: 50%;
	z-index: 2;
	transform: translateY(-50%);
}

.ja-lb__prev { left: 14px; }
.ja-lb__next { right: 14px; }

.ja-lb__prev:hover,
.ja-lb__next:hover {
	transform: translateY(-50%) scale(1.06);
}

.ja-lb.is-zoomed .ja-lb__prev,
.ja-lb.is-zoomed .ja-lb__next {
	opacity: 0;
	pointer-events: none;
}

/* ---------- pasek miniatur ---------- */

.ja-lb__thumbs {
	display: flex;
	flex: 0 0 var(--ja-lb-thumbs);
	gap: 8px;
	align-items: center;
	justify-content: safe center;
	padding: 10px 16px 14px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
}

.ja-lb:not(.ja-lb--thumbs) .ja-lb__thumbs {
	display: none;
}

.ja-lb__thumbs::-webkit-scrollbar {
	height: 6px;
}

.ja-lb__thumbs::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.28);
}

.ja-lb__thumb {
	flex: 0 0 auto;
	width: 88px;
	height: 62px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.08);
	cursor: pointer;
	opacity: 0.5;
	outline-offset: 3px;
	transition: opacity 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.ja-lb__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ja-lb__thumb:hover {
	opacity: 0.85;
}

.ja-lb__thumb.is-active {
	opacity: 1;
	box-shadow: 0 0 0 2px #fff;
	transform: translateY(-2px);
}

.ja-lb__thumb:focus-visible {
	outline: 2px solid #fff;
}

/* ---------- male ekrany ---------- */

@media (max-width: 700px) {
	.ja-lb {
		--ja-lb-bar: 48px;
		--ja-lb-thumbs: 74px;
	}

	.ja-lb__btn { width: 38px; height: 38px; }
	.ja-lb__prev { left: 6px; }
	.ja-lb__next { right: 6px; }
	.ja-lb__thumb { width: 68px; height: 48px; }
	.ja-lb__caption { font-size: 13px; }
	.ja-lb__slide { padding-inline: 8px; }
}

@media (max-height: 480px) {
	.ja-lb__thumbs { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.ja-lb,
	.ja-lb__track,
	.ja-lb__img,
	.ja-lb__btn,
	.ja-lb__thumb {
		transition: none;
	}

	.ja-lb__thumbs {
		scroll-behavior: auto;
	}
}
