/* Video Carousel – front-end */
.vcar {
	--vcar-gap: 30px;
	--vcar-cols: 3.5;
	--vcar-gaps: 3;
	--vcar-radius: 0px;
	--vcar-speed: 500ms;
	--vcar-ratio: 1/1;
	--vcar-btn-bg: #0b1f3a;
	--vcar-btn-color: #fff;
	position: relative;
	width: 100%;
	box-sizing: border-box;
}
.vcar *, .vcar *::before, .vcar *::after { box-sizing: border-box; }

.vcar__viewport {
	overflow: hidden;
	width: 100%;
}
.vcar__track {
	display: flex;
	gap: var(--vcar-gap);
	transition: transform var(--vcar-speed) cubic-bezier(.25, .8, .25, 1);
	will-change: transform;
	touch-action: pan-y;
}
.vcar.is-dragging .vcar__track,
.vcar.is-ticking .vcar__track,
.vcar.is-jumping .vcar__track,
.vcar.is-jumping .vcar__slide { transition: none !important; }
.vcar.is-dragging .vcar__track { cursor: grabbing; }
.vcar.is-dragging .vcar__link { pointer-events: none; }

/* width = (viewport − gaps between visible slides) / columns  → 3.5 = 3 full + half */
.vcar__slide {
	flex: 0 0 calc((100% - var(--vcar-gap) * var(--vcar-gaps)) / var(--vcar-cols));
	min-width: 0;
	position: relative;
	aspect-ratio: var(--vcar-ratio);
	overflow: hidden;
	border-radius: var(--vcar-radius);
	background: #f1f1f1;
	user-select: none;
	-webkit-user-select: none;
}
.vcar--ratio-auto .vcar__slide { aspect-ratio: auto; background: none; }

.vcar__media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-drag: none;
	pointer-events: none;
}
.vcar--ratio-auto .vcar__media { height: auto; }
.vcar__slide--video .vcar__media[controls] { pointer-events: auto; }
/* Horizontal swipes belong to the carousel, vertical ones scroll the page */
.vcar__viewport, .vcar__slide, .vcar__media, .vcar__poster, .vcar__link, .vcar__play { touch-action: pan-y; }

/* Video poster layer: the <img> sits under the video, and the video is
   hidden until it is really playing. A paused video on iOS always shows the
   system play circle, so it must not be visible while paused. */
.vcar__slide--video { background: #111; }
.vcar__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	-webkit-user-drag: none;
}
.vcar__slide--has-poster .vcar__media {
	position: relative;
	opacity: .001;
	transition: opacity .25s ease;
}
.vcar__slide--has-poster.is-playing .vcar__media { opacity: 1; }
.vcar--ratio-auto .vcar__poster { position: absolute; }

/* Older iOS / Chrome: hide the built-in start button where CSS still can */
.vcar__slide--video .vcar__media:not([controls])::-webkit-media-controls-start-playback-button,
.vcar__slide--video .vcar__media:not([controls])::-webkit-media-controls-overlay-play-button {
	display: none !important;
	-webkit-appearance: none;
}

/* Small play hint – only on the poster, only when the video needs a tap */
.vcar .vcar__play {
	--vcar-play: 40px;
	position: absolute;
	z-index: 2;
	box-sizing: border-box !important;
	width: var(--vcar-play) !important;
	height: var(--vcar-play) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	aspect-ratio: 1 / 1;
	flex: none;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(0, 0, 0, .45) !important;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	box-shadow: none;
	color: #fff !important;
	font-size: 0 !important;
	line-height: 0 !important;
	letter-spacing: 0;
	text-indent: 0;
	cursor: pointer;
	display: none;
	align-items: center;
	justify-content: center;
	-webkit-appearance: none;
	appearance: none;
	transition: transform .2s ease, background-color .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.vcar .vcar__play svg { display: block; flex: none; width: 50% !important; height: 50% !important; margin: 0 !important; fill: currentColor; }
.vcar .vcar__play:hover, .vcar .vcar__play:focus { transform: scale(1.08); background: rgba(0, 0, 0, .6) !important; }
.vcar .vcar__slide--paused .vcar__play { display: flex; }
.vcar__slide--paused:not(:has(a.vcar__link)) { cursor: pointer; }
.vcar.is-dragging .vcar__play { pointer-events: none; }

.vcar--play-center .vcar__play { top: 50%; left: 50%; margin: calc(var(--vcar-play) / -2) 0 0 calc(var(--vcar-play) / -2) !important; }
.vcar--play-top-left .vcar__play { top: 10px; left: 10px; }
.vcar--play-top-right .vcar__play { top: 10px; right: 10px; }
.vcar--play-bottom-left .vcar__play { bottom: 10px; left: 10px; }

@media (max-width: 767px) {
	.vcar .vcar__play { --vcar-play: 32px; }
	.vcar--play-top-left .vcar__play, .vcar--play-bottom-left .vcar__play { left: 8px; }
	.vcar--play-top-right .vcar__play { right: 8px; }
	.vcar--play-top-left .vcar__play, .vcar--play-top-right .vcar__play { top: 8px; }
	.vcar--play-bottom-left .vcar__play { bottom: 8px; }
}

/* Center mode focus */
.vcar--focus .vcar__slide {
	opacity: .45;
	transform: scale(.92);
	transition: opacity var(--vcar-speed) ease, transform var(--vcar-speed) ease;
}
.vcar--focus .vcar__slide.is-active { opacity: 1; transform: none; }

/* Continuous mode: dots make no sense */
.vcar--ticker .vcar__dots { display: none; }

/* Link overlay + button */
.vcar__link {
	position: absolute;
	inset: 0;
	display: flex;
	padding: clamp(10px, 4%, 20px);
	text-decoration: none !important;
	z-index: 1;
	align-items: flex-end;
}
.vcar__slide--video .vcar__media[controls] ~ .vcar__link { bottom: 48px; }
.vcar__link--static { pointer-events: none; }
.vcar--btn-bottom-left   .vcar__link { justify-content: flex-start; }
.vcar--btn-bottom-center .vcar__link { justify-content: center; }
.vcar--btn-bottom-right  .vcar__link { justify-content: flex-end; }
.vcar--btn-center        .vcar__link { justify-content: center; align-items: center; }

.vcar__btn {
	display: inline-block;
	background: var(--vcar-btn-bg);
	color: var(--vcar-btn-color);
	font-weight: 700;
	font-size: clamp(13px, 1.4vw, 20px);
	letter-spacing: .02em;
	line-height: 1.2;
	padding: .7em 1.1em;
	transition: transform .2s ease, filter .2s ease;
}
.vcar__link:hover .vcar__btn,
.vcar__link:focus-visible .vcar__btn { transform: translateY(-2px); filter: brightness(1.2); }
.vcar__link:focus-visible { outline: 3px solid var(--vcar-btn-bg); outline-offset: -3px; }

/* Arrows */
.vcar__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 40px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 2px;
	background: rgba(255, 255, 255, .35);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease, opacity .2s ease;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}
.vcar__arrow:hover { background: rgba(0, 0, 0, .35); }
.vcar__arrow svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.vcar__arrow--prev { left: 12px; }
.vcar__arrow--next { right: 12px; }
.vcar__arrow[disabled] { opacity: 0; pointer-events: none; }
.vcar.is-static .vcar__arrow,
.vcar.is-static .vcar__dots { display: none; }

/* Dots */
.vcar__dots {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
}
.vcar__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #cfcfcf;
	cursor: pointer;
	transition: background .2s ease, transform .2s ease;
}
.vcar__dot.is-active { background: var(--vcar-btn-bg); transform: scale(1.25); }

@media (max-width: 767px) {
	.vcar__arrow { width: 32px; height: 42px; }
	.vcar__arrow svg { width: 20px; height: 20px; }
	.vcar__arrow--prev { left: 6px; }
	.vcar__arrow--next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
	.vcar__track { transition-duration: 1ms; }
}
