/* Video Embed block */

.video-embed--inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.video-embed--wrap {
	position: relative;
	width: 100%;
	max-width: 1081px;
}

.video-embed--frame {
	position: relative;
	width: 100%;
	max-width: 1081px;
	aspect-ratio: 1081 / 608;
	background: #000;
	overflow: hidden;
}

/* Slim control bar fixed to the frame's own bottom edge — reads as part of
   the player itself (like a native video toolbar) instead of a separate
   button floating in the surrounding background. */
.video-embed--toolbar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
	z-index: 2;
	pointer-events: none; /* only the button inside is interactive */
}
.video-embed--toolbar > * { pointer-events: auto; }

.video-embed--expand {
	width: 32px;
	height: 32px;
	border-radius: 4px;
	border: 0;
	background: transparent;
	color: var(--cmcf-white);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.video-embed--expand:hover,
.video-embed--expand:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	color: var(--cmcf-secondary);
}

.video-embed--lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	z-index: 9999;
}
.video-embed--lightbox-box {
	position: relative;
	width: min(1600px, 90vw);
	aspect-ratio: 1081 / 608;
	background: #000;
}
.video-embed--lightbox-box .video-embed--iframe,
.video-embed--lightbox-box .video-embed--video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.video-embed--lightbox-close {
	position: absolute;
	top: -48px;
	right: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid var(--cmcf-white);
	background: transparent;
	color: var(--cmcf-white);
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.video-embed--lightbox-close:hover { background: var(--cmcf-white); color: var(--cmcf-deep); }
body.cmcf-lightbox-open { overflow: hidden; }

@media (max-width: 860px) {
	.video-embed--lightbox-box { width: min(1600px, 92vw); }
	.video-embed--lightbox-close { top: -44px; }
}

/* The signature double frame draws a 4px white outer border + inset ::before.
   Keep media clipped inside it. The toolbar is positioned separately (it
   pins to the bottom edge only, not a full inset). */
.video-embed--frame > *:not(.video-embed--toolbar) {
	position: absolute;
	inset: 0;
}

.video-embed--trigger {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: #000;
	cursor: pointer;
}

.video-embed--poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.video-embed--play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background: var(--cmcf-secondary);
	color: var(--cmcf-deep);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32px;
	line-height: 1;
	transition: transform 0.2s ease, background 0.2s ease;
	box-shadow: var(--cmcf-shadow-arrow);
}

.video-embed--play i,
.video-embed--play svg {
	color: var(--cmcf-deep);
	fill: currentColor;
	margin-left: 4px; /* optical centering of the play triangle */
}

.video-embed--trigger:hover .video-embed--play,
.video-embed--trigger:focus-visible .video-embed--play {
	transform: translate(-50%, -50%) scale(1.06);
	background: var(--cmcf-white);
}

.video-embed--iframe,
.video-embed--video {
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
	background: #000;
}

.video-embed--caption {
	font-family: var(--cmcf-font-body);
	font-size: var(--cmcf-fs-body);
	text-align: center;
	margin: 20px 0 0;
	max-width: 1081px;
}

.cmcf-bg-green .video-embed--caption { color: var(--cmcf-white); }

@media (max-width: 860px) {
	.video-embed--play {
		width: 60px;
		height: 60px;
		font-size: 22px;
	}
}
