/**
 * Vibrant Video - Frontend Styles
 *
 * Shared by every block in the module. Mobile first, desktop from 1024px,
 * the same breakpoint the header, hero, CTA and news use.
 *
 * @author  Accent - https://accentinteractive.nl
 * @package Vibrant
 * @since   1.0.0
 */

/* ==========================================================================
   Tokens and page frame
   ========================================================================== */

.vb-video,
.vb-video__header,
.vb-video__list-wrap,
.vb-video__meta,
.vb-video__player,
.vb-video__transcript,
.vb-video__panel {
	--vb-vd-bg: var(--wp--preset--color--white, #FFFFFF);
	--vb-vd-cream: var(--wp--preset--color--cream-50, #FBF9F3);
	--vb-vd-text: var(--wp--preset--color--green-900, #1D261F);
	--vb-vd-text-muted: var(--wp--preset--color--green-700, #525F55);
	--vb-vd-accent: var(--wp--preset--color--terracotta, #A23E2B);
	--vb-vd-surface: var(--wp--preset--color--green-100, #E5ECE6);
	--vb-vd-surface-alt: var(--wp--preset--color--rose-200, #F2E5E6);
	--vb-vd-border: var(--wp--preset--color--green-200, #DFE5E0);

	--vb-vd-font-display: var(--wp--preset--font-family--fraunces, "Fraunces", Georgia, serif);
	--vb-vd-font-body: var(--wp--preset--font-family--sora, "Sora", sans-serif);

	--vb-vd-shadow: 0 4px 12px rgba(29, 38, 31, 0.02);
	--vb-vd-gutter: 20px;
}

/* The wrapper the templates use. */
.vb-video {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 20px;
	/*
	 * The gutter sits inside the max width, so the cap has to include it to
	 * land on a 1280px content box, in line with the header and the footer.
	 */
	max-width: calc(1280px + 2 * var(--vb-vd-gutter));
	margin-inline: auto;
	padding: 20px var(--vb-vd-gutter) 40px;
	color: var(--vb-vd-text);
}

.vb-video *,
.vb-video *::before,
.vb-video *::after {
	box-sizing: border-box;
}

/* Focus is never removed, only restyled, per WCAG 2.4.7. */
.vb-video a:focus-visible,
.vb-video button:focus-visible,
.vb-video [role="tab"]:focus-visible,
.vb-video [tabindex]:focus-visible {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ==========================================================================
   Breadcrumbs
   ==========================================================================
   Styles the parent theme's vibrant/breadcrumbs block, which already draws
   the separator with an ::after on every item but the last. Nothing is added
   here, only recoloured. */

.vb-video .vb-breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video .vb-breadcrumbs__item {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.6875rem;
	line-height: 1.27;
	color: var(--vb-vd-text-muted);
}

.vb-video .vb-breadcrumbs__item:not(:last-child)::after {
	margin: 0;
	color: var(--vb-vd-text-muted);
}

.vb-video .vb-breadcrumbs__link {
	color: var(--vb-vd-text-muted);
	text-decoration: none;
	box-shadow: none;
}

.vb-video .vb-breadcrumbs__link:hover,
.vb-video .vb-breadcrumbs__link:focus-visible {
	color: var(--vb-vd-accent);
	text-decoration: underline;
}

.vb-video .vb-breadcrumbs__current {
	font-weight: 700;
	color: var(--vb-vd-text);
}

/* ==========================================================================
   Archive header
   ========================================================================== */

.vb-video__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.vb-video__header .vb-video__title,
.vb-video .vb-video__title {
	margin: 0;
	width: 100%;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: clamp(2rem, 1.3rem + 2.2vw, 3rem);
	line-height: 1.22;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
	text-wrap: balance;
}

.vb-video__intro {
	margin: 0;
	width: 100%;
	max-width: 800px;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--vb-vd-text-muted);
}

/* ==========================================================================
   Filter bar
   ========================================================================== */

.vb-video__filters {
	width: 100%;
	margin-top: 8px;
}

.vb-video__filter-list {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__filter-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__filter {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 100px;
	font-family: var(--vb-vd-font-body);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.23;
	color: var(--vb-vd-text-muted);
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vb-video__filter:hover {
	border-color: var(--vb-vd-text);
	color: var(--vb-vd-text);
}

.vb-video__filter.is-current {
	background: var(--vb-vd-text);
	border-color: var(--vb-vd-text);
	color: var(--vb-vd-bg);
}

/* ==========================================================================
   Layout: list plus sidebar
   ==========================================================================
   One column on mobile, so the order in the markup is the order on screen:
   list, pagination, sidebar. On desktop the sidebar moves to a second column
   on the first row without the markup changing. */

.vb-video__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	align-items: start;
	gap: 32px;
	width: 100%;
}

.vb-video__grid > .vb-video__sidebar {
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin-block-start: 0;
	min-width: 0;
}

.vb-video__content {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

/* ==========================================================================
   Category cards
   ==========================================================================
   A category set to show its subcategories renders the Card Grid module in
   place of the list. The cards are that page's navigation, so the topic
   sidebar next to them would only repeat the same links in a second shape;
   it steps aside and the grid takes the full width.

   Written with :has() on the grid, so nothing outside this block needs a
   class of its own. Where :has() is missing the sidebar simply stays, which
   is a narrower grid, not a broken page. */

.vb-video__cards {
	min-width: 0;
}

/* The grid block is built to be a full width band of its own, with its own
   padding and background. Here it sits inside a page that already has both,
   so both are dropped and it becomes plain content. */
.vb-video__cards .wp-block-vibrant-card-grid {
	padding: 0;
	background: transparent;
}

.vb-video__grid:has(> .vb-video__cards) {
	grid-template-columns: minmax(0, 1fr);
}

.vb-video__grid:has(> .vb-video__cards) > .vb-video__sidebar {
	display: none;
}

/* ==========================================================================
   Archive list
   ========================================================================== */

.vb-video__list-wrap {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
}

.vb-video__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
}

.vb-video__card {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 16px;
	margin: 0;
	padding: 20px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 20px;
	box-shadow: var(--vb-vd-shadow);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vb-video__card:hover {
	border-color: var(--vb-vd-accent);
	box-shadow: 0 6px 18px rgba(29, 38, 31, 0.06);
}

.vb-video__card-media {
	flex: 0 0 96px;
	width: 96px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--vb-vd-surface);
}

.vb-video__card-image,
.vb-video__card-media img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 96px;
	object-fit: cover;
	object-position: center;
}

.has-no-image .vb-video__card-media {
	display: none;
}

.vb-video__card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.vb-video__card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.vb-video__card-arrow {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	margin-inline-start: auto;
	width: 16px;
	height: 16px;
	color: var(--vb-vd-accent);
}

.vb-video__card-arrow svg {
	width: 16px;
	height: 16px;
}

.vb-video__card-text {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.vb-video__card-title {
	margin: 0;
	width: 100%;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: 1.125rem;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
}

.vb-video__card-link {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

/* The whole card is clickable through the title link. */
.vb-video__card-link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.vb-video__card-link:focus-visible {
	outline: none;
}

.vb-video__card-link:focus-visible::after {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 2px;
	border-radius: 20px;
}

.vb-video__card-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0;
	width: 100%;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--vb-vd-text-muted);
}

.has-no-excerpt .vb-video__card-excerpt {
	display: none;
}

.vb-video__empty {
	margin: 0;
	font-family: var(--vb-vd-font-body);
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--vb-vd-text-muted);
}

/* ==========================================================================
   Badges
   ==========================================================================
   One badge per category the video is in. Two colours, chosen from the
   category slug so a category keeps one colour everywhere. Both are checked
   against the terracotta text: 6.2:1 on the green and 6.5:1 on the rose, well
   past the 4.5:1 that WCAG 1.4.3 asks. */

.vb-video__badges {
	display: flex;
	flex: 0 1 auto;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.vb-video__badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 10px;
	background: var(--vb-vd-surface);
	border-radius: 6px;
	font-family: var(--vb-vd-font-body);
	font-weight: 700;
	font-size: 0.6875rem;
	line-height: 1.27;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--vb-vd-accent);
}

.vb-video__badge.is-variant-1 {
	background: var(--vb-vd-surface-alt);
}

/*
 * On a single the badge links to its category archive. Kept at 24px high for
 * WCAG 2.5.8, and the focus ring is drawn outside the pill.
 */
.vb-video .vb-video__badge.is-link {
	min-height: 24px;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.vb-video .vb-video__badge.is-link:hover,
.vb-video .vb-video__badge.is-link:focus-visible {
	background: var(--vb-vd-accent);
	color: var(--vb-vd-bg);
}

.vb-video .vb-video__badge.is-link:focus-visible {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 2px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.vb-video__pagination {
	width: 100%;
}

.vb-video__pages {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__page {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__page .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 38px;
	padding: 10px 16px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 8px;
	font-family: var(--vb-vd-font-body);
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-vd-text);
	text-decoration: none;
	box-shadow: none;
}

.vb-video__page .page-numbers:hover {
	border-color: var(--vb-vd-text);
}

.vb-video__page .page-numbers.current {
	background: var(--vb-vd-accent);
	border-color: var(--vb-vd-accent);
	font-weight: 700;
	color: var(--vb-vd-bg);
}

.vb-video__page .page-numbers.dots {
	border-color: transparent;
	background: none;
}

/*
 * The step links carry a word and a chevron. From tablet up the word is the
 * label and the chevron is hidden; on a narrow screen that swaps around so
 * the whole set fits on one row. The label only moves out of sight, so a
 * screen reader still hears "Vorige" and "Volgende".
 */
.vb-video__page-icon {
	display: none;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

.vb-video__page-icon.is-back {
	transform: scaleX(-1);
}

@media (max-width: 599px) {

	.vb-video__pages {
		flex-wrap: nowrap;
		gap: 4px;
	}

	.vb-video__page {
		min-width: 0;
	}

	/* Square, so a number and a chevron read as the same kind of button. */
	.vb-video__page .page-numbers {
		width: 38px;
		min-width: 0;
		height: 38px;
		padding: 0;
	}

	.vb-video__page.is-dots .page-numbers {
		width: auto;
		padding-inline: 2px;
	}

	.vb-video__page-icon {
		display: block;
	}

	.vb-video__page-label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		border: 0;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* ==========================================================================
   Sidebar panels
   ========================================================================== */

.vb-video__panel {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 20px;
	margin: 0;
	padding: 24px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 20px;
}

.vb-video__panel-title {
	margin: 0;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: 1.25rem;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
}

/* Topic links */

.vb-video__topic-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__topic-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vb-video__topic-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 12px;
	font-family: var(--vb-vd-font-body);
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-vd-text);
	text-decoration: none;
	box-shadow: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.vb-video__topic-link:hover {
	background: var(--vb-vd-cream);
	border-color: var(--vb-vd-accent);
}

.vb-video__topic-icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	color: var(--vb-vd-accent);
}

/* Related videos */

.vb-video__related-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.vb-video__related-card {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin: 0;
	padding: 16px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 16px;
	box-shadow: var(--vb-vd-shadow);
	transition: border-color 0.2s ease;
}

.vb-video__related-card:hover {
	border-color: var(--vb-vd-accent);
}

.vb-video__related-media {
	position: relative;
	display: flex;
	flex: 0 0 100px;
	align-items: center;
	justify-content: center;
	width: 100px;
	height: 75px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--vb-vd-surface);
}

.vb-video__related-image,
.vb-video__related-media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.vb-video__related-play {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 50%;
	color: var(--vb-vd-accent);
}

.vb-video__related-play svg {
	width: 10px;
	height: 10px;
}

.vb-video__related-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.vb-video__related-meta {
	display: none;
}

.vb-video__related-duration {
	flex: 0 0 auto;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.6875rem;
	line-height: 1.27;
	color: var(--vb-vd-text-muted);
	white-space: nowrap;
}

.vb-video__related-title {
	overflow-wrap: anywhere;
	margin: 0;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: 0.9375rem;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
}

.vb-video__related-link {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.vb-video__related-link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.vb-video__related-link:focus-visible {
	outline: none;
}

.vb-video__related-link:focus-visible::after {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 2px;
	border-radius: 16px;
}

/* ==========================================================================
   Single: head
   ========================================================================== */

.vb-video__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.vb-video__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.vb-video__duration {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.75rem;
	line-height: 1.25;
	color: var(--vb-vd-text-muted);
}

/*
 * Mobile drops the "Duur:" prefix and puts a bullet in front of the time,
 * as in the design. The bullet is decorative CSS content, the time itself is
 * always in the markup.
 */
.vb-video__duration-prefix {
	display: none;
}

.vb-video__duration::before {
	content: "\2022";
	margin-right: 2px;
	color: var(--vb-vd-text-muted);
}

.vb-video__head .wp-block-post-title,
.vb-video--single .wp-block-post-title {
	margin: 0;
	width: 100%;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: clamp(2rem, 1.3rem + 2.2vw, 3rem);
	line-height: 1.22;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
	text-wrap: balance;
}

/* ==========================================================================
   Single: player
   ==========================================================================
   A poster with a play button until someone clicks. See player/render.php
   for why the iframe is not there from the start. */

.vb-video__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--vb-vd-surface);
	border: 1px solid var(--vb-vd-border);
	border-radius: 16px;
}

.vb-video__poster {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	isolation: isolate;
	text-decoration: none;
	box-shadow: none;
	background: transparent;
}

/* The dark wash sits between the still and the controls. */
.vb-video__poster::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 0, 0, 0.2);
	pointer-events: none;
}

.vb-video__poster-image {
	position: absolute;
	inset: 0;
	z-index: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.vb-video__play {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	color: var(--vb-vd-accent);
	transition: transform 0.2s ease, background-color 0.2s ease;
}

.vb-video__poster:hover .vb-video__play,
.vb-video__poster:focus-visible .vb-video__play {
	background: #FFFFFF;
	transform: scale(1.06);
}

.vb-video__play-icon {
	width: 16px;
	height: 16px;
}

.vb-video__timecode {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 6px;
	font-family: var(--vb-vd-font-body);
	font-weight: 700;
	font-size: 0.75rem;
	line-height: 1.25;
	color: #FFFFFF;
	font-variant-numeric: tabular-nums;
}

.vb-video__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.vb-video__player.is-playing {
	background: #000000;
}

/* ==========================================================================
   Single: transcript
   ========================================================================== */

.vb-video__transcript {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
}

/* Language switcher. On mobile the design drops the box and the globe and
   puts a small caps label above the pills. */

.vb-video__lang-bar {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
}

.vb-video__lang-intro {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--vb-vd-font-body);
	color: var(--vb-vd-text-muted);
}

.vb-video__lang-icon {
	display: none;
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.vb-video__lang-text.is-wide {
	display: none;
}

.vb-video__lang-text.is-narrow {
	display: inline;
	font-weight: 700;
	font-size: 0.75rem;
	line-height: 1.25;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.vb-video__lang-options {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px;
}

.vb-video__lang {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 6px 12px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 100px;
	font-family: var(--vb-vd-font-body);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.23;
	color: var(--vb-vd-text-muted);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vb-video__lang:hover {
	border-color: var(--vb-vd-text);
	color: var(--vb-vd-text);
}

.vb-video__lang.is-current,
.vb-video__lang[aria-selected="true"] {
	background: var(--vb-vd-accent);
	border-color: var(--vb-vd-accent);
	color: #FFFFFF;
}

/* Transcript panel */

.vb-video__transcript-panel {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 20px;
	padding: 24px;
	background: var(--vb-vd-bg);
	border: 1px solid var(--vb-vd-border);
	border-radius: 20px;
}

/*
 * Title row: the title and the translate button on one line, the button
 * pushed to the far end. On a narrow screen the button drops under the title
 * rather than squeezing it, which is what the wrap is for.
 */
.vb-video__transcript-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
}

.vb-video__transcript-title {
	margin: 0;
	font-family: var(--vb-vd-font-display);
	font-weight: 900;
	font-size: 1.5rem;
	line-height: 1.25;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
}

/* Translate button. Quieter than the language pills: it is an offer, not the
   way the transcript is meant to be read. */

.vb-video__translate {
	display: inline-flex;
	flex: 0 0 auto;
}

.vb-video__translate-button {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 6px 14px;
	background: transparent;
	border: 1px solid var(--vb-vd-border);
	border-radius: 100px;
	font-family: var(--vb-vd-font-body);
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1.23;
	color: var(--vb-vd-accent);
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.vb-video__translate-button:hover {
	border-color: var(--vb-vd-accent);
	background: var(--vb-vd-surface-alt);
}

.vb-video__translate-button:focus-visible {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 2px;
}

/* Waiting on the translation: still readable, still focusable, clearly not
   listening for another click. */
.vb-video__translate-button[aria-disabled="true"] {
	color: var(--vb-vd-text-muted);
	border-color: var(--vb-vd-border);
	cursor: progress;
}

/*
 * The live region. Announced, never seen, and never display:none - a screen
 * reader has to be watching it before the text lands in it. Spelled out here
 * rather than borrowed from the block library, because whether a message is
 * heard at all should not depend on another stylesheet loading.
 */
.vb-video__translate-live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Status message. A notice with its own shape, not a line of grey text: what
   it says about the transcript below it is worth seeing. */

.vb-video__translate-notice {
	display: flex;
	/* One short sentence: the icon sits on the middle of the message, not on
	   the top of it. */
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--vb-vd-border);
	border-radius: 12px;
	background: var(--vb-vd-cream);
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--vb-vd-text);
}

.vb-video__translate-notice .vb-video__translate-icon {
	display: none;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
}

/* One icon per state, each a different shape, so the state reads without
   colour vision. */
.vb-video__translate-notice.is-busy .vb-video__translate-icon.is-busy,
.vb-video__translate-notice.is-done .vb-video__translate-icon.is-done,
.vb-video__translate-notice.is-error .vb-video__translate-icon.is-error {
	display: block;
}

.vb-video__translate-notice.is-busy .vb-video__translate-icon.is-busy {
	color: var(--vb-vd-text-muted);
	animation: vb-video-spin 0.9s linear infinite;
}

.vb-video__translate-notice.is-done {
	border-color: var(--vb-vd-border);
	background: var(--vb-vd-surface);
}

.vb-video__translate-notice.is-done .vb-video__translate-icon.is-done {
	color: var(--vb-vd-text);
}

.vb-video__translate-notice.is-error {
	border-color: var(--vb-vd-accent);
	background: var(--vb-vd-surface-alt);
}

.vb-video__translate-notice.is-error .vb-video__translate-icon.is-error {
	color: var(--vb-vd-accent);
}

@keyframes vb-video-spin {

	to {
		transform: rotate(360deg);
	}
}

/* Author styles beat the browser's own [hidden] rule, so say it again for
   the parts that are hidden until javascript has something to offer. */
.vb-video__translate[hidden],
.vb-video__translate-button[hidden],
.vb-video__translate-notice[hidden] {
	display: none;
}

.vb-video__transcript-body {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Author styles override the browser's native [hidden] rule, so repeat it
   explicitly for the inactive language panels. */
.vb-video__transcript-body[hidden] {
	display: none;
}

.vb-video__transcript-body:focus-visible {
	outline: 2px solid var(--vb-vd-accent);
	outline-offset: 4px;
	border-radius: 4px;
}

.vb-video__transcript-body p {
	margin: 0;
	font-family: var(--vb-vd-font-body);
	font-weight: 400;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--vb-vd-text-muted);
}

.vb-video__transcript-body h3,
.vb-video__transcript-heading {
	margin: 0;
	font-family: var(--vb-vd-font-body);
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1.29;
	letter-spacing: 0;
	text-transform: none;
	color: var(--vb-vd-text);
}

/*
 * A heading belongs with the paragraph under it, so the gap above it is the
 * paragraph rhythm and the gap below it is tight.
 */
.vb-video__transcript-body h3 + p,
.vb-video__transcript-heading + p {
	margin-top: -12px;
}

.vb-video__transcript-body[dir="rtl"] {
	text-align: right;
}

/*
 * The words someone searched for, marked after arriving from the search.
 * An underline as well as a background, so the mark is not made of colour
 * alone and survives a high contrast mode that drops backgrounds.
 */
.vb-video__transcript-hit {
	padding: 0 0.15em;
	border-radius: 3px;
	background: var(--vb-vd-surface-alt);
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Only shown when javascript is off, see the noscript rule in the block. */
.vb-video__transcript-lang {
	display: none;
}

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (min-width: 1024px) {

	.vb-video,
	.vb-video__header,
	.vb-video__list-wrap,
	.vb-video__meta,
	.vb-video__player,
	.vb-video__transcript,
	.vb-video__panel {
		--vb-vd-gutter: clamp(24px, 5.5vw, 80px);
	}

	.vb-video {
		gap: 24px;
		padding: 24px var(--vb-vd-gutter) 80px;
	}

	/* Breadcrumbs */

	.vb-video .vb-breadcrumbs__list,
	.vb-video .vb-breadcrumbs__item {
		gap: 8px;
	}

	.vb-video .vb-breadcrumbs__item {
		font-size: 0.8125rem;
		line-height: 1.23;
	}

	/* Header */

	.vb-video__header {
		gap: 16px;
	}

	.vb-video__intro {
		font-size: 1.125rem;
		line-height: 1.6;
	}

	.vb-video__filters {
		margin-top: 20px;
	}

	.vb-video__filter-list {
		gap: 12px;
	}

	/* Layout */

	.vb-video__grid {
		grid-template-columns: minmax(0, 1fr) 360px;
		gap: 48px;
	}

	.vb-video__sidebar {
		grid-column: 2;
		grid-row: 1;
		gap: 32px;
	}

	.vb-video__content {
		grid-column: 1;
		grid-row: 1;
		gap: 32px;
	}

	/* Archive list */

	.vb-video__list {
		gap: 24px;
	}

	.vb-video__card {
		gap: 20px;
		padding: 28px;
	}

	.vb-video__card-media {
		flex-basis: 120px;
		width: 120px;
		border-radius: 12px;
	}

	.vb-video__card-image,
	.vb-video__card-media img {
		min-height: 117px;
	}

	.vb-video__card-body {
		gap: 16px;
	}

	.vb-video__card-title {
		font-size: 1.375rem;
	}

	/* Pagination */

	.vb-video__pagination {
		padding-top: 24px;
	}

	.vb-video__page {
		display: flex;
	}

	/* Panels */

	.vb-video__panel {
		border-radius: 24px;
	}

	.vb-video__panel-title {
		font-size: 1.375rem;
	}

	.vb-video--archive .vb-video__panel {
		gap: 24px;
		padding: 32px;
	}

	.vb-video__topic-list {
		gap: 12px;
	}

	.vb-video__related-list {
		gap: 16px;
	}

	.vb-video__related-badge,
	.vb-video__panel--related .vb-video__badge {
		font-size: 0.5625rem;
		line-height: 1.22;
	}

	.vb-video__related-play {
		width: 28px;
		height: 28px;
	}

	.vb-video__related-play svg {
		width: 16px;
		height: 16px;
	}

	/* Single head */

	.vb-video__head {
		gap: 20px;
	}

	.vb-video__meta {
		gap: 16px;
	}

	.vb-video__duration {
		font-weight: 600;
		font-size: 0.8125rem;
		line-height: 1.23;
	}

	.vb-video__duration-prefix {
		display: inline;
	}

	.vb-video__duration::before {
		content: none;
		margin-right: 0;
	}

	/* Player */

	.vb-video__player {
		border-radius: 24px;
	}

	.vb-video__play {
		width: 80px;
		height: 80px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.19);
	}

	.vb-video__play-icon {
		width: 24px;
		height: 24px;
	}

	.vb-video__timecode {
		right: 24px;
		bottom: 24px;
	}

	/* Transcript */

	.vb-video__transcript {
		gap: 32px;
	}

	.vb-video__lang-bar {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		gap: 16px;
		padding: 16px;
		background: var(--vb-vd-bg);
		border: 1px solid var(--vb-vd-border);
		border-radius: 16px;
	}

	.vb-video__lang-icon {
		display: block;
	}

	.vb-video__lang-text.is-wide {
		display: inline;
		font-weight: 600;
		font-size: 0.875rem;
		line-height: 1.29;
	}

	.vb-video__lang-text.is-narrow {
		display: none;
	}

	.vb-video__lang-options {
		flex-wrap: nowrap;
		justify-content: flex-end;
	}

	.vb-video__lang {
		background: var(--vb-vd-cream);
	}

	.vb-video__lang.is-current,
	.vb-video__lang[aria-selected="true"] {
		background: var(--vb-vd-accent);
	}

	.vb-video__transcript-panel {
		gap: 24px;
		padding: 32px;
		border-radius: 24px;
	}

	.vb-video__transcript-head {
		flex-wrap: nowrap;
		gap: 16px;
	}

	.vb-video__transcript-title {
		font-size: 1.75rem;
	}

	.vb-video__translate-notice {
		font-size: 0.875rem;
	}

	.vb-video__transcript-body {
		gap: 20px;
	}

	.vb-video__transcript-body p {
		font-size: 1rem;
	}

	.vb-video__transcript-body h3,
	.vb-video__transcript-heading {
		font-size: 1rem;
		line-height: 1.25;
	}

	.vb-video__transcript-body h3 + p,
	.vb-video__transcript-heading + p {
		margin-top: -14px;
	}
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

	.vb-video *,
	.vb-video *::before,
	.vb-video *::after {
		transition-duration: 0.01ms !important;
	}

	.vb-video__poster:hover .vb-video__play,
	.vb-video__poster:focus-visible .vb-video__play {
		transform: none;
	}

	/*
	 * The spinner still has to say "working", so it slows to a crawl instead
	 * of stopping: a frozen spinner reads as a stuck page.
	 */
	.vb-video__translate-notice.is-busy .vb-video__translate-icon.is-busy {
		animation-duration: 4s;
	}
}
