/* Delta Video Popup — no backdrop on purpose: the page stays scrollable,
   selectable and clickable while the video is on screen. */

.dvp {
	--dvp-anim: 700ms;
	--dvp-mini-w: 320px;
	--dvp-gap: 24px;
	--dvp-w: min(720px, 90vw);
	/* inline --dvp-mini-w comes from the admin setting; clamped so it never eats a phone screen */
	--dvp-mw: min(var(--dvp-mini-w), 55vw);
	--dvp-ease: cubic-bezier(0.22, 1, 0.36, 1);

	position: fixed;
	z-index: 999999;
	left: 50%;
	top: 50%;
	width: var(--dvp-w);
	aspect-ratio: 16 / 9;
	transform: translate(-50%, -50%) scale(0.94);
	opacity: 0;
	background: #000;
	border-radius: 12px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
	transition:
		left var(--dvp-anim) var(--dvp-ease),
		top var(--dvp-anim) var(--dvp-ease),
		width var(--dvp-anim) var(--dvp-ease),
		transform 320ms var(--dvp-ease),
		opacity 320ms ease;
}

.dvp[hidden] {
	display: none;
}

.dvp.is-in {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Bottom-right preview, YouTube style. */
.dvp.is-mini {
	width: var(--dvp-mw);
	left: calc(100% - var(--dvp-mw) - var(--dvp-gap));
	top: calc(100% - var(--dvp-mw) * 0.5625 - var(--dvp-gap));
	transform: translate(0, 0) scale(1);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.dvp-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	cursor: pointer;
}

/* Close button — every property forced with !important because themes style
   `button` aggressively (padding, gradients, uppercase, min-width, pseudo-elements). */
#dvp .dvp-close,
#dvp button.dvp-close {
	/* placement */
	position: absolute !important;
	top: -14px !important;
	right: -14px !important;
	bottom: auto !important;
	left: auto !important;
	z-index: 3 !important;
	float: none !important;
	clear: none !important;

	/* box */
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	max-height: none !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: visible !important;
	vertical-align: middle !important;

	/* text */
	font: 700 22px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	text-align: center !important;
	text-indent: 0 !important;
	text-shadow: none !important;
	white-space: nowrap !important;
	word-spacing: normal !important;
	color: #fff !important;

	/* skin */
	background: #111 !important;
	background-image: none !important;
	background-color: #111 !important;
	border: 2px solid #fff !important;
	border-radius: 50% !important;
	outline: none !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
	opacity: 1 !important;
	filter: none !important;
	transform: none !important;
	transition: background-color 150ms ease, transform 150ms ease !important;

	/* behaviour */
	cursor: pointer !important;
	pointer-events: auto !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-webkit-tap-highlight-color: transparent !important;
	user-select: none !important;
	visibility: visible !important;
}

/* Themes love adding icons/labels through pseudo-elements — kill them. */
#dvp .dvp-close::before,
#dvp .dvp-close::after {
	content: none !important;
	display: none !important;
}

#dvp .dvp-close:hover,
#dvp .dvp-close:focus,
#dvp .dvp-close:focus-visible,
#dvp .dvp-close:active {
	background: #e11d48 !important;
	background-color: #e11d48 !important;
	background-image: none !important;
	color: #fff !important;
	border-color: #fff !important;
	transform: scale(1.1) !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
	outline: none !important;
	text-decoration: none !important;
}

/* Nudge the button inside the frame on the small preview so it never clips. */
#dvp.is-mini .dvp-close {
	top: -12px !important;
	right: -12px !important;
	width: 28px !important;
	height: 28px !important;
	font-size: 19px !important;
}

@media (max-width: 600px) {
	.dvp {
		--dvp-gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dvp {
		transition-duration: 1ms;
	}
}
