/* =========================================================================
 * Video Carousel Pro — frontend styles
 * Colours/fonts come from CSS variables set inline per-carousel.
 * ====================================================================== */

.vcp-carousel {
	--vcp-bg: #1a1814;
	--vcp-accent: #c9a24b;
	--vcp-arrow-color: #ffffff;
	--vcp-radius: 14px;

	box-sizing: border-box;
	width: 100%;
	max-width: 1180px;
	margin: 0 auto;
	padding: 16px;
	background: var(--vcp-bg);
	border-radius: var(--vcp-radius);
	overflow: hidden;
}
.vcp-carousel *,
.vcp-carousel *::before,
.vcp-carousel *::after { box-sizing: border-box; }

/* Defensive reset — themes love styling buttons globally. */
.vcp-carousel button {
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	border: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	line-height: 1;
	cursor: pointer;
	text-shadow: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	min-width: 0;
	min-height: 0;
	width: auto;
	height: auto;
	border-radius: 0;
}
.vcp-carousel button:focus { outline: none; }
.vcp-carousel button:focus-visible { outline: 2px solid var(--vcp-accent); outline-offset: 2px; }

/* ---- Optional heading ---- */
.vcp-heading {
	text-align: center;
	margin: 0 0 12px;
	font-family: var(--vcp-heading-font, inherit);
	font-size: var(--vcp-heading-size, 18px);
	color: var(--vcp-heading-color, #cfc7b8);
	font-weight: var(--vcp-heading-weight, 400);
	line-height: 1.3;
}

/* ---- Viewport ---- */
.vcp-viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: calc(var(--vcp-radius) - 4px);
}

.vcp-track {
	position: relative;
	width: 100%;
	min-height: 220px;
}

/* ---- Slides ---- */
.vcp-slide {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	aspect-ratio: 16 / 9;
	transform: translate(-50%, -50%) scale(0.96);
	opacity: 0;
	pointer-events: none;
	transition: transform .45s cubic-bezier(.22,.61,.36,1), opacity .45s ease;
	will-change: transform, opacity;
}
.vcp-slide.is-active {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
	pointer-events: auto;
	z-index: 5;
}

/* ---- Media frame ---- */
.vcp-media {
	position: relative;
	width: 100%;
	height: 100%;
	border-radius: calc(var(--vcp-radius) - 2px);
	overflow: hidden;
	background: #000;
	box-shadow: 0 0 0 1px var(--vcp-accent),
		0 12px 32px rgba(0,0,0,.45);
}

.vcp-poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.vcp-poster-blank { background: linear-gradient(135deg, #2a2620, #14110d); }

/* ---- Play button ---- */
.vcp-play {
	position: absolute !important;
	inset: 0;
	margin: auto !important;
	width: 68px !important;
	height: 68px !important;
	display: grid !important;
	place-items: center;
	background: rgba(0, 0, 0, .45) !important;
	border-radius: 50% !important;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	transition: transform .2s ease, background .2s ease;
}
.vcp-play::before {
	content: "";
	display: block;
	width: 0;
	height: 0;
	border-left: 18px solid #fff;
	border-top: 11px solid transparent;
	border-bottom: 11px solid transparent;
	margin-left: 4px;
}
.vcp-play svg { display: none; }
.vcp-play:hover {
	background: var(--vcp-accent) !important;
	transform: scale(1.08);
}
.vcp-slide:not(.is-active) .vcp-play { display: none !important; }

/* iframe / video injected on play */
.vcp-media iframe,
.vcp-media video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background: #000;
}

/* ---- Controls row ---- */
.vcp-controls {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 16px;
}
.vcp-controls-center {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	text-align: center;
}

/* ---- Arrows ---- */
.vcp-carousel .vcp-arrow {
	flex: 0 0 auto;
	width: 42px !important;
	height: 42px !important;
	display: grid !important;
	place-items: center;
	color: var(--vcp-arrow-color) !important;
	background: rgba(255, 255, 255, .06) !important;
	border: 1px solid rgba(255, 255, 255, .12) !important;
	border-radius: 50% !important;
	opacity: .9;
	transition: opacity .2s ease, transform .2s ease, background .2s ease, border-color .2s ease;
}
.vcp-carousel .vcp-arrow:hover {
	opacity: 1;
	background: var(--vcp-accent) !important;
	border-color: var(--vcp-accent) !important;
	transform: scale(1.06);
}
.vcp-carousel .vcp-arrow:active { transform: scale(.94); }
.vcp-carousel .vcp-arrow svg { display: block; width: 18px; height: 18px; }

/* ---- Active title ---- */
.vcp-title-bar {
	width: 100%;
	margin: 0;
	padding: 0 4px;
}
.vcp-active-title {
	font-family: var(--vcp-title-font, inherit);
	font-size: var(--vcp-title-size, 22px);
	color: var(--vcp-title-color, #e9e2d4);
	font-weight: var(--vcp-title-weight, 600);
	text-transform: var(--vcp-title-transform, none);
	line-height: 1.3;
	display: inline-block;
}

/* ---- Dots ---- */
.vcp-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
}
.vcp-carousel .vcp-dot {
	width: 8px !important;
	height: 8px !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .25) !important;
	border: 0 !important;
	flex: 0 0 auto;
	transition: background .2s ease, transform .2s ease, width .2s ease;
}
.vcp-carousel .vcp-dot:hover { background: rgba(255, 255, 255, .5) !important; }
.vcp-carousel .vcp-dot.is-active {
	background: var(--vcp-accent) !important;
	width: 24px !important;
	border-radius: 4px !important;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
	.vcp-carousel { padding: 12px; }
	.vcp-heading {
		font-size: clamp(14px, 4vw, var(--vcp-heading-size, 18px));
		margin-bottom: 10px;
	}
	.vcp-controls { gap: 10px; margin-top: 12px; }
	.vcp-controls-center { gap: 8px; }
	.vcp-carousel .vcp-arrow { width: 36px !important; height: 36px !important; }
	.vcp-carousel .vcp-arrow svg { width: 16px; height: 16px; }
	.vcp-play {
		width: 56px !important;
		height: 56px !important;
	}
	.vcp-play::before {
		border-left-width: 15px;
		border-top-width: 9px;
		border-bottom-width: 9px;
	}
	.vcp-active-title {
		font-size: clamp(14px, 4.2vw, var(--vcp-title-size, 22px));
	}
	.vcp-carousel .vcp-dot.is-active { width: 20px !important; }
}

@media (max-width: 400px) {
	.vcp-carousel { padding: 10px; }
	.vcp-controls { gap: 8px; margin-top: 10px; }
	.vcp-carousel .vcp-arrow { width: 32px !important; height: 32px !important; }
	.vcp-carousel .vcp-arrow svg { width: 14px; height: 14px; }
	.vcp-play {
		width: 48px !important;
		height: 48px !important;
	}
	.vcp-play::before {
		border-left-width: 13px;
		border-top-width: 8px;
		border-bottom-width: 8px;
	}
}
