/* Self-hosted video player (inc/self-hosted-video.php). Loaded only on pages that use it. */

.pixated-video {
	position: relative;
}

.pixated-video__frame {
	position: relative;
	overflow: hidden;
	border-radius: 16px;
	background: #000;
}

.pixated-video__frame video {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--pv-ratio, 9 / 16);
	object-fit: cover;
}

.pixated-video--player .pixated-video__frame {
	border-radius: 12px;
}

/*
 * Tap to play: the whole frame is the button.
 * Two classes deep so it beats the Elementor kit's ".elementor-kit-26028 button"
 * (brand-blue background, padding, font), which would otherwise fill the frame.
 */
.pixated-video .pixated-video__toggle {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-size: inherit;
	line-height: 1;
	cursor: pointer;
}

.pixated-video .pixated-video__toggle:hover,
.pixated-video .pixated-video__toggle:focus,
.pixated-video .pixated-video__toggle:active {
	background: transparent;
	box-shadow: none;
}

.pixated-video__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(64px, 30%, 125px);
	aspect-ratio: 125 / 80;
	border-radius: 8px;
	background: rgba(43, 0, 255, 0.92);
	transition: transform 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.pixated-video__icon::before {
	content: '';
	width: 0;
	height: 0;
	margin-left: 6%;
	border-style: solid;
	border-width: 0.6em 0 0.6em 1em;
	border-color: transparent transparent transparent #fff;
	font-size: clamp(14px, 2vw, 20px);
}

.pixated-video .pixated-video__toggle:hover .pixated-video__icon,
.pixated-video .pixated-video__toggle:focus-visible .pixated-video__icon {
	background: #2b00ff;
	transform: scale(1.06);
}

.pixated-video .pixated-video__toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
}

.pixated-video.is-playing .pixated-video__icon {
	opacity: 0;
}

/* Widths per section, matching style-services.css breakpoints. */
.success-stories-video .pixated-video__frame,
.tik_tok_swipe_slider .pixated-video-player .pixated-video__frame {
	width: 320px;
	max-width: 100%;
	margin: 0 auto;
}

.after_before_slider .pixated-video-player .pixated-video__frame {
	width: 358px;
	max-width: 100%;
	margin: 0 auto;
}

@media (max-width: 1400px) {
	.after_before_slider .pixated-video-player .pixated-video__frame {
		width: 320px;
	}
}

@media (max-width: 991px) {
	.after_before_slider .pixated-video-player .pixated-video__frame {
		width: 260px;
	}
}

@media (max-width: 767px) {
	.success-stories-video .pixated-video__frame {
		width: 260px;
	}

	.tik_tok_swipe_slider .pixated-video-player .pixated-video__frame,
	.after_before_slider .pixated-video-player .pixated-video__frame {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pixated-video__icon {
		transition: none;
	}
}
