/**
 * The installation video popup.
 *
 * Nothing in this file applies until video-modal.js adds .spu-vm-open to the
 * page, and the overlay it styles does not exist in the markup until a visitor
 * clicks the video panel. With scripts blocked or this file missing, the panel
 * stays the plain link the approved design describes, so the page at rest is
 * byte-identical either way.
 *
 * Every colour, radius and shadow below is lifted from the approved design:
 * the navy #05213E and lime #D2DE3A of the play button, the 14px radius of the
 * video panel itself, and its 0 10px 30px rgba(0,0,0,0.3) shadow.
 */

.spu-vm {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 76px 24px 24px;
	background: rgba(5, 33, 62, 0.88);
	opacity: 0;
	transition: opacity 200ms ease;
}

.spu-vm.is-visible {
	opacity: 1;
}

/* The page must not scroll behind the popup. Restored on close. */
html.spu-vm-open,
html.spu-vm-open body {
	overflow: hidden;
}

/* The box carries the close button, which sits above the video. The frame
   inside it clips the video to the design's 14px corners, so the button has to
   live outside that clipping or it is cut off. */
.spu-vm__box {
	position: relative;
	width: 100%;
	/* Never taller than the screen: the second term is the widest a 16:9 video
	   can be and still fit the height left over after the padding above. */
	max-width: min( 1100px, calc( ( 100vh - 116px ) * 16 / 9 ) );
}

.spu-vm__frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 14px;
	overflow: hidden;
	background: #000000;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spu-vm__frame video,
.spu-vm__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.spu-vm__close {
	position: absolute;
	top: -52px;
	right: 0;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #D2DE3A;
	color: #05213E;
	cursor: pointer;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spu-vm__close:focus-visible {
	outline: 3px solid #FFFFFF;
	outline-offset: 2px;
}

/* On a phone there is no room above the video, so the button sits on it. */
@media (max-width: 760px) {
	.spu-vm {
		padding: 16px;
	}

	.spu-vm__box {
		max-width: min( 1100px, calc( ( 100vh - 48px ) * 16 / 9 ) );
	}

	.spu-vm__close {
		top: 8px;
		right: 8px;
	}
}

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