/* ==========================================================================
   Nova Video Block — novafolio/video
   Premium video with poster, play button, lightbox + inline modes.
   ========================================================================== */

.nvf-video {
	--nvf-vid-ratio: 16/9;
	--nvf-vid-radius: 0px;
	--nvf-vid-max-w: 100%;
	--nvf-vid-play-color: #ffffff;
	--nvf-vid-play-bg: rgba(0, 0, 0, 0.45);
	--nvf-vid-play-size: 68px;
	position: relative;
	width: 100%;
	max-width: var(--nvf-vid-max-w);
	margin-inline: auto;
	border-radius: var(--nvf-vid-radius);
	overflow: hidden;
}

/* Full-width */
.nvf-video.alignfull {
	max-width: none;
}
.nvf-video.alignwide {
	max-width: var(--nvf-layout-wide-width, 1440px);
}

/* ── Player / Facade container ────────────────────────────────────────── */
.nvf-video__player,
.nvf-video__facade,
.nvf-video__trigger {
	position: relative;
	aspect-ratio: var(--nvf-vid-ratio);
	width: 100%;
	overflow: hidden;
	border-radius: inherit;
	background: #000;
}

.nvf-video__player iframe,
.nvf-video__player video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: none;
}

/* ── Poster image ─────────────────────────────────────────────────────── */
.nvf-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 1;
}

.nvf-video__poster-placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #1a1a2e, #16213e);
	z-index: 1;
}

/* ── Play button ──────────────────────────────────────────────────────── */
.nvf-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: var(--nvf-vid-play-size) !important;
	height: var(--nvf-vid-play-size) !important;
	min-width: var(--nvf-vid-play-size) !important;
	min-height: var(--nvf-vid-play-size) !important;
	border-radius: 50% !important;
	border: 2px solid rgba(255, 255, 255, 0.9) !important;
	background: var(--nvf-vid-play-bg) !important;
	color: var(--nvf-vid-play-color) !important;
	cursor: pointer;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	/* Reset every theme generic <button> property (specificities up to 0,4,1) */
	padding: 0 !important;
	font-size: 0 !important;  /* collapse text sizing — SVG uses % */
	font-family: inherit !important;
	font-weight: inherit !important;
	text-transform: none !important;
	line-height: 0 !important;
	box-shadow: none !important;
	text-indent: -9999px !important; /* hide any inherited text */
	overflow: visible !important;
	-webkit-appearance: none;
	appearance: none;
}
.nvf-video__play svg {
	width: 40%;
	height: 40%;
	margin-left: 4px; /* visual centering for play triangle */
	fill: currentColor;
	pointer-events: none;
	text-indent: 0;
	font-size: 16px; /* reset for SVG internal sizing */
	line-height: normal;
}
.nvf-video .nvf-video__play:hover {
	transform: translate(-50%, -50%) scale(1.1);
	background: color-mix(in srgb, var(--nvf-vid-play-bg), #000 10%) !important;
	border-color: rgba(255, 255, 255, 0.9) !important;
	color: var(--nvf-vid-play-color) !important;
}
.nvf-video__play:focus-visible {
	outline: 2px solid var(--nvf-vid-play-color);
	outline-offset: 4px;
}

/* ── Trigger (lightbox mode) ──────────────────────────────────────────── */
.nvf-video__trigger {
	cursor: pointer;
}
.nvf-video__trigger:hover .nvf-video__poster {
	filter: brightness(0.85);
	transition: filter 0.3s ease;
}

/* ── Facade (inline with poster) ──────────────────────────────────────── */
.nvf-video__facade {
	cursor: pointer;
}
.nvf-video__facade.is-playing {
	cursor: default;
}
.nvf-video__facade.is-playing .nvf-video__poster,
.nvf-video__facade.is-playing .nvf-video__play {
	display: none !important;
}

/* ── Lightbox overlay ─────────────────────────────────────────────────── */
.nvf-video-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.nvf-video-lightbox.is-active {
	opacity: 1;
	visibility: visible;
}
.nvf-video-lightbox__inner {
	position: relative;
	width: 90vw;
	max-width: 1100px;
	aspect-ratio: 16/9;
}
.nvf-video-lightbox__inner iframe,
.nvf-video-lightbox__inner video {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 8px;
}
.nvf-video-lightbox__close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	line-height: 1;
	padding: 4px;
}
.nvf-video-lightbox__close:hover {
	opacity: 0.7;
}

/* ── Placeholder (admin/editor) ───────────────────────────────────────── */
.nvf-video-placeholder {
	aspect-ratio: 16/9;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f0;
	border-radius: 8px;
	color: #888;
	font-size: 0.9rem;
}

/* ── Fallback color-mix ───────────────────────────────────────────────── */
@supports not (color: color-mix(in srgb, red, blue)) {
	.nvf-video__play:hover {
		background: rgba(0, 0, 0, 0.65);
	}
}

/* ── Editor parity ────────────────────────────────────────────────────── */
.block-editor-block-list__layout .nvf-video {
	margin-block: 0;
}
