.pnp-video {
	--pnp-video-accent: #1f8a7a;
	--pnp-video-radius: 8px;

	position: relative;
	aspect-ratio: 16 / 9;
	width: 100%;
	overflow: hidden;
	border-radius: var(--pnp-video-radius);
	background: #000;
}

/* `all: unset` keeps theme button styles (padding, colours, hover) out. */
.pnp-video .pnp-video__start {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	cursor: pointer;
}

.pnp-video .pnp-video__start:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
}

.pnp-video__poster,
.pnp-video video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	background: #000;
}

.pnp-video__poster {
	object-fit: cover;
}

.pnp-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--pnp-video-accent);
	color: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, -50%);
	transition: transform 0.15s ease;
}

.pnp-video__play svg {
	margin-left: 3px;
}

.pnp-video__start:hover .pnp-video__play,
.pnp-video__start:focus-visible .pnp-video__play {
	transform: translate(-50%, -50%) scale(1.08);
}

.pnp-video__error {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	margin: 0;
	padding: 12px 16px;
	background: rgba(0, 0, 0, 0.82);
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

@media (max-width: 480px) {
	.pnp-video__play {
		width: 60px;
		height: 60px;
	}
}

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

/* Popup */

.pnp-video-dialog {
	/* Never taller than the window: the width follows from the free height. */
	width: min(1100px, 100vw - 32px, (100vh - 120px) * 16 / 9);
	max-width: none;
	max-height: none;
	margin: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	background: transparent;
	color: #fff;
}

.pnp-video-dialog::backdrop {
	background: rgba(6, 20, 18, 0.86);
}

.pnp-video-dialog .pnp-video {
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.pnp-video-dialog .pnp-video-dialog__close {
	all: unset;
	box-sizing: border-box;
	position: absolute;
	top: -52px;
	right: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	cursor: pointer;
}

.pnp-video-dialog .pnp-video-dialog__close:hover {
	background: rgba(255, 255, 255, 0.26);
}

.pnp-video-dialog .pnp-video-dialog__close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}
