/* ============================================================
   TCM Fullscreen Video Slider
   ============================================================ */

/* Wrapper ---------------------------------------------------- */
.tcm-video-slider {
	position: relative;
	width: 100%;
	height: 100vh;
	overflow: hidden;
	background: #000;
	-webkit-tap-highlight-color: transparent;
	/* CSS custom properties for Elementor to override without fighting inline styles */
	--tcm-frame-size: 15px;
	--tcm-frame-color: #ffffff;
}

/* Prevent Elementor widget wrapper from adding baseline gap below the slider */
.elementor-widget-tcm-video-slider > .elementor-widget-container {
	display: block;
}

/* ── Passepartout Frame --------------------------------------- */
.tcm-vs-frame {
	position: absolute;
	inset: 0;
	z-index: 20;
	pointer-events: none;
	box-sizing: border-box;
	border-style: solid;
	border-width: var(--tcm-frame-size, 15px);
	border-color: var(--tcm-frame-color, #ffffff);
	/* Transition only border-width so color stays consistent */
	transition: border-width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Higher specificity (3 classes) beats any single-class rule including Elementor's */
.tcm-video-slider.is-playing .tcm-vs-frame {
	border-width: 0;
}

/* ── Slides Track -------------------------------------------- */
.tcm-vs-track {
	position: absolute;
	inset: 0;
}

.tcm-vs-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.9s ease;
}

.tcm-vs-slide.is-active {
	opacity: 1;
}

/* ── Background Video ---------------------------------------- */
.tcm-vs-bg-video {
	/* Force fill — override any Elementor/theme global that adds height:auto */
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
}

/* ── Poster (for embed-only slides) -------------------------- */
.tcm-vs-poster {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
}

/* ── Full-screen Play Video (injected by JS in play mode) ---- */
.tcm-vs-play-video {
	position: absolute !important;
	inset: 0 !important;
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	/* Contain so nothing is cropped during proper playback */
	object-fit: contain !important;
	z-index: 5;
	background: #000;
}

/* ── Embed iFrame (injected by JS in play mode) -------------- */
.tcm-vs-play-iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100vw;
	height: 56.25vw;   /* 16:9 */
	min-height: 100%;
	min-width: 177.78vh;
	transform: translate(-50%, -50%);
	border: none;
	z-index: 5;
}

/* ── Static Overlay ------------------------------------------ */
.tcm-vs-overlay {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.3);
	pointer-events: none; /* clicks pass through except for the button */
	transition: opacity 0.4s ease;
}

.tcm-video-slider.is-playing .tcm-vs-overlay {
	opacity: 0;
	pointer-events: none;
}

.tcm-vs-content {
	max-width: 680px;
	padding: 40px 60px;
	text-align: center;
}

.tcm-vs-heading {
	color: #fff;
	margin: 0 0 12px;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.tcm-vs-subheading {
	color: rgba(255, 255, 255, 0.85);
	margin: 0 0 32px;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* ── Play Button --------------------------------------------- */
.tcm-vs-play-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 28px;
	color: #fff;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.6);
	cursor: pointer;
	font: inherit;
	letter-spacing: 0.02em;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
	pointer-events: auto; /* parent has pointer-events:none */
}

.tcm-vs-play-btn:hover {
	background: rgba(255, 255, 255, 0.3);
	border-color: rgba(255, 255, 255, 0.9);
	transform: scale(1.02);
}

.tcm-vs-play-btn:active {
	transform: scale(0.98);
}

.tcm-vs-play-icon {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.tcm-vs-btn-label {
	transition: opacity 0.2s ease;
}

.tcm-vs-btn-label.is-fading {
	opacity: 0;
}

/* ── Close Button (play mode only) --------------------------- */
.tcm-vs-close {
	position: absolute;
	top: 24px;
	right: 24px;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	/* delay so it appears after the frame finishes opening */
	transition: opacity 0.3s ease 0.5s, background 0.2s ease;
}

.tcm-vs-close:hover {
	background: rgba(0, 0, 0, 0.7);
}

.tcm-video-slider.is-playing .tcm-vs-close {
	opacity: 1;
	pointer-events: auto;
}

/* ── Dots ---------------------------------------------------- */
.tcm-vs-dots {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 25;
	display: flex;
	gap: 10px;
	transition: opacity 0.35s ease;
}

.tcm-video-slider.is-playing .tcm-vs-dots {
	opacity: 0;
	pointer-events: none;
}

.tcm-vs-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: none;
	padding: 0;
	background: rgba(255, 255, 255, 0.45);
	cursor: pointer;
	transition: background 0.25s ease, transform 0.25s ease;
}

.tcm-vs-dot.is-active {
	background: #fff;
	transform: scale(1.4);
}

/* ── Progress Bar -------------------------------------------- */
.tcm-vs-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: rgba(255, 255, 255, 0.15);
	z-index: 25;
	transition: opacity 0.3s ease;
}

.tcm-video-slider.is-playing .tcm-vs-progress {
	opacity: 0;
}

.tcm-vs-progress-fill {
	height: 100%;
	width: 0%;
	background: #fff;
}

/* ── Responsive ---------------------------------------------- */
@media (max-width: 767px) {
	.tcm-vs-content {
		padding: 24px 28px;
	}

	.tcm-vs-close {
		top: 16px;
		right: 16px;
	}

	.tcm-vs-dots {
		bottom: 16px;
	}
}
