/**
 * Self-hosted video (inc/video.php + assets/js/lts-video.js): 16:9 frame, poster, and a
 * play cue in the bottom-left corner (Dusk pill, Tide disc, length) so it never sits on the
 * speaker's face. The whole poster is the button. White on Tide is 3.6:1, above the 3:1
 * non-text minimum for the icon; Base text on Dusk is well above 4.5:1. The button's name
 * comes from aria-label.
 */

.wp-block-video .lts-video__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wp--preset--color--contrast);
}

.wp-block-video .lts-video__media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Inside the split-video slot: same box as the embed it replaces. */
.lts-split-video .lts-split-video__media .wp-block-video {
	width: 100%;
	margin: 0;
}

.lts-split-video .lts-split-video__media .lts-video__frame {
	border-radius: 8px;
}

/* Speaker caption: "<strong>Name</strong><br>Role", left-aligned under the frame. */
.wp-block-video .wp-element-caption {
	margin-block: 1.25rem 0;
	color: var(--wp--preset--color--body-ink);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	text-align: start;
}

.wp-block-video .wp-element-caption strong {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}

.lts-video__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	width: 100%;
	padding: clamp(0.75rem, 2.5%, 1.5rem);
	border: 0;
	background: linear-gradient(
		to top,
		color-mix(in srgb, var(--wp--preset--color--contrast) 45%, transparent),
		transparent 40%
	);
	cursor: pointer;
}

.lts-video__play[hidden] {
	display: none;
}

.lts-video__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.375rem 1.125rem 0.375rem 0.375rem;
	border-radius: 999px;
	color: var(--wp--preset--color--base);
	background: var(--wp--preset--color--secondary);
	box-shadow: 0 0 0 0.25rem
		color-mix(in srgb, var(--wp--preset--color--tint) 45%, transparent);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.lts-video__disc {
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	transition: background-color 0.2s ease;
}

/* The triangle's visual centre sits right of its box centre. */
.lts-video__disc svg {
	margin-inline-start: 0.15rem;
}

.lts-video__length {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.lts-video__play:hover .lts-video__pill {
	transform: scale(1.04);
	box-shadow: 0 0 0 0.35rem
		color-mix(in srgb, var(--wp--preset--color--tint) 70%, transparent);
}

.lts-video__play:hover .lts-video__disc {
	background: var(--wp--preset--color--accent-2);
}

.lts-video__play:focus-visible {
	outline: none;
}

.lts-video__play:focus-visible .lts-video__pill {
	outline: 3px solid var(--wp--preset--color--tint);
	outline-offset: 0.5rem;
}

@media (max-width: 781px) {
	.lts-video__pill {
		gap: 0.5rem;
		padding-inline-end: 0.875rem;
	}

	.lts-video__disc {
		width: 2.5rem;
		height: 2.5rem;
	}

	.lts-video__disc svg {
		width: 18px;
		height: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lts-video__pill,
	.lts-video__disc {
		transition: none;
	}

	.lts-video__play:hover .lts-video__pill {
		transform: none;
	}
}
