/* ============================================================
   TK Hero Video — Plugin CSS
   Self-hosted hero video with a custom play/pause control that
   mirrors the site's slideshow controls (same icon set, same
   is-playing state, same --tk-accent theming). Self-contained:
   does not depend on the .tk-slider stylesheet.
   ============================================================ */

.tk-hero-video {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	padding: var(--tk-hv-pad-top, 0) var(--tk-hv-pad-x, 0) var(--tk-hv-pad-bottom, 0);
}

.tk-hero-video *,
.tk-hero-video *::before,
.tk-hero-video *::after {
	box-sizing: border-box;
}

/* ---- Media box ------------------------------------------------ */
.tk-hero-video__viewport {
	position: relative;
	width: 100%;
	aspect-ratio: var(--tk-ratio, 16 / 9);
	border-radius: var(--tk-radius, 10px);
	overflow: hidden;
	background-color: #000;
}

.tk-hero-video__el {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: var(--tk-hv-fit, cover);
	display: block;
}

/* Placeholder shown in the builder when no source is set yet. */
.tk-hero-video__empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	color: #fff;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	background: repeating-linear-gradient(45deg, #1b1b1b, #1b1b1b 12px, #242424 12px, #242424 24px);
}

/* ---- Controls bar (overlays the bottom of the video) ---------- */
.tk-hero-video__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 18px;
	pointer-events: none; /* container is click-through; children re-enable */
}

.tk-hero-video__controls > * {
	pointer-events: auto;
}

/* ---- Play / pause button -------------------------------------- */
.tk-hero-video__playpause {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--tk-control, #ffffff);
	border-radius: 50%;
	/* Frosted-glass circle: the video shows through, blurred. */
	background: rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: var(--tk-control, #ffffff);
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.tk-hero-video__playpause:hover {
	background: rgba(255, 255, 255, 0.22);
}

.tk-hero-video__playpause:active {
	transform: scale(0.94);
}

.tk-hero-video__playpause:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.tk-hero-video__playpause svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* Icon swap driven by the is-playing state on the root, matching
   the slideshow control: show PLAY when paused, PAUSE when playing. */
.tk-hero-video__playpause .tk-ico-pause { display: none; }
.tk-hero-video__playpause .tk-ico-play  { display: block; }
.tk-hero-video.is-playing .tk-hero-video__playpause .tk-ico-play  { display: none; }
.tk-hero-video.is-playing .tk-hero-video__playpause .tk-ico-pause { display: block; }

/* ---- Progress track (single continuous, click-to-seek) -------- */
.tk-hero-video__progress {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	min-width: 0;
}

.tk-hero-video__seg {
	position: relative;
	display: block;
	width: 100%;
	height: 5px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.35);
	cursor: pointer;
	overflow: hidden;
}

.tk-hero-video__seg:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.tk-hero-video__seg-fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--tk-accent, #5887DA);
	transition: width 0.12s linear;
}

/* ---- Screen-reader-only live region --------------------------- */
.tk-hero-video__live {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---- Reduced motion ------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.tk-hero-video__seg-fill,
	.tk-hero-video__playpause {
		transition: none;
	}
}
