/**
 * Sliding YouTube Gallery 1.7
 */

.jx-syg {
	--syg-accent: #2563eb;
	--syg-border: #e2e8f0;
	--syg-gap: 16px;
	--syg-radius: 16px;
	--syg-slide-height: 180px;
	--syg-speed: 500ms;
	--syg-image-fit: cover;
	--syg-ink: #0f172a;
	--syg-muted: #64748b;
	--syg-surface: #fff;
	--syg-shadow: 0 14px 35px rgba(15, 23, 42, 0.12);
	display: block;
	width: 100%;
	max-width: 100%;
	color: var(--syg-ink);
	font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.jx-syg *,
.jx-syg *::before,
.jx-syg *::after {
	box-sizing: border-box;
}

.jx-syg__stage {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) 44px;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.jx-syg__viewport {
	min-width: 0;
	overflow: hidden;
	border-radius: var(--syg-radius);
	touch-action: pan-y;
}

.jx-syg--vertical .jx-syg__viewport {
	touch-action: pan-x;
}

.jx-syg__track {
	display: flex;
	gap: var(--syg-gap);
	min-width: 0;
	transition: transform var(--syg-speed) cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.jx-syg--vertical .jx-syg__stage {
	grid-template: auto auto auto / minmax(0, 1fr);
	justify-items: center;
}

.jx-syg--vertical .jx-syg__track {
	flex-direction: column;
	width: 100%;
}

.jx-syg--vertical .jx-syg__viewport {
	width: 100%;
}

.jx-syg--vertical .jx-syg__arrow--prev {
	transform: rotate(90deg);
}

.jx-syg--vertical .jx-syg__arrow--next {
	transform: rotate(90deg);
}

.jx-syg--grid .jx-syg__stage {
	display: block;
}

.jx-syg--grid .jx-syg__viewport {
	overflow: visible;
}

.jx-syg--grid .jx-syg__track {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	transform: none !important;
}

.jx-syg__slide {
	flex: 0 0 auto;
	min-width: 0;
	height: var(--syg-slide-height);
	margin: 0;
}

.jx-syg--grid .jx-syg__slide {
	width: auto !important;
	height: var(--syg-slide-height);
}

.jx-syg__video {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	overflow: hidden;
	border: 1px solid var(--syg-border);
	border-radius: var(--syg-radius);
	background: #0f172a;
	color: #fff;
	cursor: pointer;
	box-shadow: var(--syg-shadow);
	isolation: isolate;
	text-align: left;
}

.jx-syg__video:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--syg-accent) 65%, white);
	outline-offset: 3px;
}

.jx-syg__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: var(--syg-image-fit);
	transition: transform 280ms ease, filter 280ms ease;
}

.jx-syg--greyscale .jx-syg__image {
	filter: grayscale(1);
}

.jx-syg__video:hover .jx-syg__image,
.jx-syg__video:focus-visible .jx-syg__image {
	transform: scale(1.035);
	filter: grayscale(0);
}

.jx-syg__shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, transparent 42%, rgba(2, 6, 23, 0.82) 100%);
	pointer-events: none;
}

.jx-syg__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: grid;
	width: 52px;
	height: 52px;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	background: color-mix(in srgb, var(--syg-accent) 88%, transparent);
	box-shadow: 0 8px 24px rgba(2, 6, 23, 0.3);
	transform: translate(-50%, -50%);
	transition: background 180ms ease, box-shadow 180ms ease;
}

.jx-syg__video:hover .jx-syg__play,
.jx-syg__video:focus-visible .jx-syg__play {
	background: var(--syg-accent);
	box-shadow: 0 10px 30px color-mix(in srgb, var(--syg-accent) 42%, transparent);
}

.jx-syg__play svg {
	width: 25px;
	height: 25px;
	fill: currentColor;
}

.jx-syg__title {
	position: absolute;
	right: 14px;
	bottom: 12px;
	left: 14px;
	z-index: 2;
	overflow: hidden;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 650;
	line-height: 1.35;
	text-overflow: ellipsis;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
	white-space: nowrap;
}

.jx-syg__arrow,
.jx-syg__close {
	display: inline-grid;
	width: 44px;
	height: 44px;
	padding: 0;
	place-items: center;
	border: 1px solid var(--syg-border);
	border-radius: 50%;
	background: var(--syg-surface);
	color: var(--syg-ink);
	cursor: pointer;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
	transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.jx-syg__arrow svg,
.jx-syg__close svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.jx-syg__arrow:hover,
.jx-syg__arrow:focus-visible,
.jx-syg__close:hover,
.jx-syg__close:focus-visible {
	border-color: var(--syg-accent);
	background: color-mix(in srgb, var(--syg-accent) 10%, white);
	color: var(--syg-accent);
	outline: none;
}

.jx-syg__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.jx-syg__dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 7px;
	margin-top: 14px;
}

.jx-syg__dot {
	width: 10px;
	height: 10px;
	min-width: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--syg-muted) 42%, transparent);
	cursor: pointer;
	transition: width 180ms ease, background 180ms ease;
}

.jx-syg__dot.is-active {
	width: 28px;
	background: var(--syg-accent);
}

.jx-syg__dot:focus-visible {
	outline: 2px solid var(--syg-accent);
	outline-offset: 3px;
}

.jx-syg__modal[hidden] {
	display: none;
}

.jx-syg__modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	padding: clamp(16px, 4vw, 48px);
	place-items: center;
	opacity: 0;
	transition: opacity 180ms ease;
}

.jx-syg__modal.is-open {
	opacity: 1;
}

.jx-syg__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(2, 6, 23, 0.82);
	backdrop-filter: blur(8px);
	cursor: pointer;
}

.jx-syg__dialog {
	position: relative;
	z-index: 1;
	width: min(var(--syg-video-width, 960px), 100%);
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: clamp(12px, 2vw, 20px);
	background: #020617;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
	transform: translateY(12px);
	transition: transform 180ms ease;
}

.jx-syg__modal.is-open .jx-syg__dialog {
	transform: translateY(0);
}

.jx-syg__dialog-bar {
	display: flex;
	min-height: 60px;
	align-items: center;
	gap: 16px;
	justify-content: space-between;
	padding: 8px 10px 8px 20px;
	background: #0f172a;
	color: #f8fafc;
}

.jx-syg__dialog-bar h3 {
	overflow: hidden;
	margin: 0;
	color: inherit;
	font-size: clamp(0.95rem, 2vw, 1.12rem);
	font-weight: 650;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.jx-syg__close {
	flex: 0 0 44px;
	border-color: rgba(255, 255, 255, 0.16);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	box-shadow: none;
}

.jx-syg__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.jx-syg__player iframe {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.jx-syg-modal-open {
	overflow: hidden;
}

.jx-syg-empty {
	padding: 1rem;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	color: #64748b;
}

@media (max-width: 639px) {
	.jx-syg__stage {
		grid-template-columns: minmax(0, 1fr);
	}

	.jx-syg--horizontal .jx-syg__viewport {
		grid-row: 1;
		grid-column: 1;
	}

	.jx-syg--horizontal .jx-syg__arrow {
		z-index: 3;
		grid-row: 1;
		grid-column: 1;
		background: color-mix(in srgb, var(--syg-surface) 88%, transparent);
	}

	.jx-syg--horizontal .jx-syg__arrow--prev {
		justify-self: start;
		margin-left: 8px;
	}

	.jx-syg--horizontal .jx-syg__arrow--next {
		justify-self: end;
		margin-right: 8px;
	}

	.jx-syg__title {
		font-size: 0.84rem;
	}

	.jx-syg__modal {
		padding: 10px;
	}

	.jx-syg__dialog-bar {
		padding-left: 14px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jx-syg__track,
	.jx-syg__image,
	.jx-syg__play,
	.jx-syg__arrow,
	.jx-syg__dot,
	.jx-syg__modal,
	.jx-syg__dialog {
		transition: none !important;
	}
}
