/**
 * framework/video-thumb — poster facade plus the shared lightbox.
 *
 * One lightbox element is created per page by view.js, not per block, so these
 * .fw-lightbox rules are page furniture rather than block internals.
 */

.fw-video-thumb {
	margin: 0;
	--fw-video-thumb-ratio: 3/2;
}

.fw-video-thumb__trigger {
	position: relative;
	display: block;
	aspect-ratio: var(--fw-video-thumb-ratio);
	overflow: hidden;
	background: rgba(0, 0, 0, 0.08);
	text-decoration: none;
	cursor: pointer;
}

.fw-video-thumb--rounded .fw-video-thumb__trigger {
	border-radius: var(--fw-video-thumb-radius, 10px);
}

.fw-video-thumb__poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.fw-video-thumb__trigger:hover .fw-video-thumb__poster {
	transform: scale(1.03);
}

.fw-video-thumb__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--fw-video-thumb-play-bg, rgba(178, 95, 85, 0.92));
	color: #fff;
	transition: transform 0.25s ease, background-color 0.25s ease;
	pointer-events: none;
}

.fw-video-thumb__play svg { margin-left: 4px; }

.fw-video-thumb__trigger:hover .fw-video-thumb__play,
.fw-video-thumb__trigger:focus-visible .fw-video-thumb__play {
	transform: translate(-50%, -50%) scale(1.08);
	background: var(--fw-video-thumb-play-bg-hover, rgba(178, 95, 85, 1));
}

.fw-video-thumb__caption {
	margin-block-start: 0.75rem;
	font-size: 0.95rem;
	text-align: center;
}

.fw-video-thumb__empty {
	margin: 0;
	padding: 1rem;
	border: 1px dashed currentColor;
	border-radius: 4px;
	font-size: 0.9rem;
	opacity: 0.75;
}

/* --- lightbox ---------------------------------------------------------- */

.fw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: grid;
	place-items: center;
	padding: 5vmin;
	background: rgba(0, 0, 0, 0.85);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.fw-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.fw-lightbox__frame {
	position: relative;
	width: min(100%, 1100px);
	aspect-ratio: 16 / 9;
	background: #000;
}

.fw-lightbox__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.fw-lightbox__close {
	position: absolute;
	top: -3rem;
	right: 0;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.fw-lightbox__close:hover { opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
	.fw-video-thumb__poster,
	.fw-video-thumb__play,
	.fw-lightbox { transition: none; }
}
