/**
 * JIT Gallery Showcase — frontend
 */

.jit-gallery-showcase {
	--jit-gallery-radius: 16px;
	--jit-gallery-gap: 12px;
	--jit-gallery-accent: #1665b1;
	--jit-gallery-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
	--jit-gallery-thumb-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
	max-width: 100%;
	margin: 0 auto;
}

.jit-gallery-showcase__title {
	margin: 0 0 20px;
	font-size: clamp(1.35rem, 2vw, 1.75rem);
	font-weight: 700;
	color: #0f172a;
	text-align: center;
}

.jit-gallery-showcase__stage {
	position: relative;
	border-radius: var(--jit-gallery-radius);
	overflow: hidden;
	box-shadow: var(--jit-gallery-shadow);
	background: #f1f5f9;
}

.jit-gallery-showcase__main {
	position: relative;
	width: 100%;
	padding-top: var(--jit-gallery-ratio, 56.25%);
}

.jit-gallery-showcase__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transform: scale(1.02);
	transition: opacity 0.45s ease, transform 0.55s ease;
	pointer-events: none;
}

.jit-gallery-showcase__slide.is-active {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
	z-index: 1;
}

.jit-gallery-showcase__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
}

.jit-gallery-showcase__thumbs-wrap {
	margin-top: var(--jit-gallery-gap);
}

.jit-gallery-showcase__thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: var(--jit-gallery-gap);
}

.jit-gallery-showcase__thumb {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 2px solid transparent;
	border-radius: calc(var(--jit-gallery-radius) - 4px);
	overflow: hidden;
	cursor: pointer;
	background: #e2e8f0;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
	aspect-ratio: 16 / 10;
	opacity: 0.82;
}

.jit-gallery-showcase__thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(15, 23, 42, 0.18));
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.jit-gallery-showcase__thumb:hover {
	transform: translateY(-3px);
	box-shadow: var(--jit-gallery-thumb-shadow);
	opacity: 1;
}

.jit-gallery-showcase__thumb:hover::after {
	opacity: 1;
}

.jit-gallery-showcase__thumb.is-active {
	border-color: var(--jit-gallery-accent);
	box-shadow: 0 0 0 3px rgba(22, 101, 177, 0.18), var(--jit-gallery-thumb-shadow);
	opacity: 1;
	transform: translateY(-2px);
}

.jit-gallery-showcase__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.jit-gallery-empty {
	padding: 16px;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	color: #64748b;
	text-align: center;
	background: #f8fafc;
}

@media (max-width: 849px) {
	.jit-gallery-showcase {
		--jit-gallery-gap: 8px;
		--jit-gallery-radius: 12px;
	}

	.jit-gallery-showcase__thumbs {
		display: flex;
		overflow-x: auto;
		gap: var(--jit-gallery-gap);
		padding-bottom: 4px;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.jit-gallery-showcase__thumb {
		flex: 0 0 28%;
		min-width: 96px;
		scroll-snap-align: start;
	}
}

@media (max-width: 549px) {
	.jit-gallery-showcase__thumb {
		flex-basis: 34%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jit-gallery-showcase__slide,
	.jit-gallery-showcase__thumb {
		transition: none;
	}
}
