/**
 * Cookie-Compliant Video - styles (v2.1.0)
 *
 * One class scheme, shared by the content filter and the Elementor widget.
 * Elementor style controls target .ccv-placeholder, .ccv-placeholder-overlay,
 * .ccv-play-icon and .ccv-consent-message - keep those names stable.
 *
 *   .ccv-video-container.ccv-aspect-16-9 | .ccv-aspect-4-3   (+ .ccv-has-poster, + .ccv-active)
 *     .ccv-frame > iframe.ccv-iframe
 *     .ccv-placeholder
 *       img.ccv-poster
 *       .ccv-placeholder-overlay
 *         .ccv-play-icon > svg
 *         p.ccv-consent-message
 */

/* Root: responsive box via padding-bottom hack (works in every browser, no aspect-ratio support needed). */
.ccv-video-container {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	height: 0;
	overflow: hidden;
	background-color: #000;
}

.ccv-video-container.ccv-aspect-16-9 {
	padding-bottom: 56.25%;
}

.ccv-video-container.ccv-aspect-4-3 {
	padding-bottom: 75%;
}

/* Frame, iframe and placeholder all fill the box. */
.ccv-video-container .ccv-frame,
.ccv-video-container .ccv-iframe,
.ccv-video-container .ccv-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}

.ccv-video-container .ccv-iframe {
	border: 0;
	display: block;
}

/* Placeholder: the dark panel. Clickable, keyboard reachable. */
.ccv-video-container .ccv-placeholder {
	display: block;
	background-color: #1a1a2e;
	cursor: pointer;
	z-index: 1;
	-webkit-user-select: none;
	user-select: none;
}

.ccv-video-container .ccv-placeholder:focus {
	outline: none;
}

.ccv-video-container .ccv-placeholder:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: -3px;
}

/* Optional self-hosted poster (never a YouTube thumbnail). */
.ccv-video-container .ccv-poster {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

/* Overlay: centres icon + message. Transparent on the plain panel, tinted over a poster. */
.ccv-video-container .ccv-placeholder-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	background-color: transparent;
	transition: background-color 0.25s ease;
}

.ccv-video-container.ccv-has-poster .ccv-placeholder-overlay {
	background-color: rgba(0, 0, 0, 0.45);
}

.ccv-video-container .ccv-placeholder:hover .ccv-placeholder-overlay,
.ccv-video-container .ccv-placeholder:focus-visible .ccv-placeholder-overlay {
	background-color: rgba(0, 0, 0, 0.25);
}

.ccv-video-container.ccv-has-poster .ccv-placeholder:hover .ccv-placeholder-overlay,
.ccv-video-container.ccv-has-poster .ccv-placeholder:focus-visible .ccv-placeholder-overlay {
	background-color: rgba(0, 0, 0, 0.6);
}

/* Play glyph (inline SVG). */
.ccv-video-container .ccv-play-icon {
	display: block;
	width: 72px;
	height: 72px;
	margin: 0 0 16px;
	line-height: 0;
	transition: transform 0.25s ease;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.ccv-video-container .ccv-play-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.ccv-video-container .ccv-placeholder:hover .ccv-play-icon,
.ccv-video-container .ccv-placeholder:focus-visible .ccv-play-icon {
	transform: scale(1.08);
}

/* Consent message. */
.ccv-video-container .ccv-consent-message {
	margin: 0;
	padding: 0 24px;
	max-width: 80%;
	color: #ffffff;
	font-size: 16px;
	line-height: 1.5;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Active: iframe has its src, hide the placeholder entirely. */
.ccv-video-container.ccv-active .ccv-placeholder {
	display: none;
}

.ccv-video-container.ccv-active .ccv-iframe {
	animation: ccv-fade-in 0.35s ease-in;
}

@keyframes ccv-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* Editor-only notice when the URL is invalid (never rendered on the live site). */
.ccv-editor-notice {
	padding: 16px 20px;
	background: #fdf2f2;
	color: #7a1f1f;
	border: 1px solid #f3c2c2;
	border-radius: 4px;
	font-size: 14px;
}

/* Small screens. */
@media (max-width: 767px) {
	.ccv-video-container .ccv-play-icon {
		width: 56px;
		height: 56px;
		margin-bottom: 12px;
	}

	.ccv-video-container .ccv-consent-message {
		font-size: 14px;
		max-width: 92%;
		padding: 0 16px;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.ccv-video-container .ccv-placeholder-overlay,
	.ccv-video-container .ccv-play-icon,
	.ccv-video-container.ccv-active .ccv-iframe {
		transition: none;
		animation: none;
	}
}
