/*
 * ReelShelf front end.
 *
 * Typography, buttons and page width come from the theme: headings and paragraphs are real theme
 * elements, buttons use the theme's button classes, and --rh-theme-* values (from theme.json on the
 * server, or measured by the script) fill in link colour, heading font, title size and corner rounding.
 * Presets only set colours: the base values below are the Dark style. Sections placed one after another share one surface, like a single page.
 */

/* ---------------------------------------------------------------- */
/* Tokens and presets                                                */
/* ---------------------------------------------------------------- */

.reelshelf {
	--rh-bg: #0e0e10;
	--rh-text: #f5f5f5;
	--rh-muted: #a1a1aa;
	--rh-line: rgba(255, 255, 255, 0.09);
	--rh-surface: rgba(255, 255, 255, 0.06);
	--rh-surface-hover: rgba(255, 255, 255, 0.12);
	--rh-accent: #e5484d;
	--rh-on-accent: #fff;
	--rh-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.75);
	--rh-ambient-opacity: 0.55;

	/* Frames follow the theme's rounding; widths and side padding follow its layout. */
	--rh-radius: var(--rh-theme-radius, 12px);
	--rh-radius-sm: calc(var(--rh-radius) * 0.7);
	--rh-max: var(--wp--style--global--wide-size, 1280px);
	--rh-gutter: max(16px, var(--wp--style--root--padding-right, clamp(16px, 4vw, 48px)));
	--rh-space: clamp(36px, 5vw, 72px);
	--rh-ease: cubic-bezier(0.22, 1, 0.36, 1);

	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	padding-block: var(--rh-space);
	background: var(--rh-bg);
	color: var(--rh-text);
	-webkit-font-smoothing: antialiased;
}

.reelshelf.rh-preset-light {
	--rh-bg: #fff;
	--rh-text: #0f172a;
	--rh-muted: #5b6678;
	--rh-line: rgba(15, 23, 42, 0.09);
	--rh-surface: #f1f4f8;
	--rh-surface-hover: #e6ebf2;
	--rh-accent: #2563eb;
	--rh-on-accent: #fff;
	--rh-shadow: 0 30px 70px -30px rgba(15, 23, 42, 0.35);
	--rh-ambient-opacity: 0.3;
	-webkit-font-smoothing: auto;
}

/* Takes the site's own colours: text colour from the theme, no background of its own. */
.reelshelf.rh-preset-theme {
	--rh-bg: transparent;
	--rh-text: currentColor;
	--rh-muted: color-mix(in srgb, currentColor 62%, transparent);
	--rh-line: color-mix(in srgb, currentColor 12%, transparent);
	--rh-surface: color-mix(in srgb, currentColor 6%, transparent);
	--rh-surface-hover: color-mix(in srgb, currentColor 12%, transparent);
	--rh-accent: var(--rh-theme-link, currentColor);
	--rh-on-accent: var(--rh-theme-bg, #fff);
	--rh-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.4);
	--rh-ambient-opacity: 0.3;
	-webkit-font-smoothing: auto;
}

.reelshelf *,
.reelshelf *::before,
.reelshelf *::after {
	box-sizing: inherit;
}

/* ---------------------------------------------------------------- */
/* Page flow                                                         */
/* ---------------------------------------------------------------- */

/* Themes put space between blocks; sections should join into one surface instead. */
.reelshelf.reelshelf:not(.rh-bare) {
	margin-block: 0;
}

.reelshelf:not(.rh-bare) + .reelshelf:not(.rh-bare) {
	padding-top: 0;
}

.reelshelf .rh-inner {
	position: relative;
	z-index: 1;
	max-width: var(--rh-max);
	margin-inline: auto;
	padding-inline: var(--rh-gutter);
}

/* Full width for shortcodes; blocks use the theme's own "Full width" alignment. */
.reelshelf.rh-full {
	width: 100vw;
	max-width: 100vw;
	margin-inline: calc(50% - 50vw);
}

/* Inside a theme's content column (a video's own page): no background, no extra padding. */
.reelshelf.rh-bare {
	--rh-gutter: 0px;
	padding-block: 0;
}

.reelshelf.rh-bare .rh-inner {
	max-width: none;
}

/* ---------------------------------------------------------------- */
/* Shared bits                                                       */
/* ---------------------------------------------------------------- */

.reelshelf .rh-eyebrow {
	margin: 0 0 8px;
	color: var(--rh-accent);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.3;
	text-transform: uppercase;
}

.reelshelf .rh-eyebrow[hidden] {
	display: none;
}

.reelshelf .rh-icon-button:focus-visible,
.reelshelf .rh-see-all:focus-visible,
.reelshelf .rh-stage-title a:focus-visible {
	outline: 2px solid var(--rh-accent);
	outline-offset: 3px;
}

/* Buttons are the theme's own (.wp-block-button__link). These only apply where a theme doesn't style them. */
:where(.reelshelf) .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

:where(.reelshelf .wp-block-button__link) {
	display: inline-block;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--rh-text);
	color: var(--rh-bg);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

:where(.reelshelf .is-style-outline) > :where(.wp-block-button__link) {
	border: 2px solid currentColor;
	background: transparent;
	color: inherit;
}

/* Dark and Light have their own backdrop, so the theme's button colours may not show up on it. */
.reelshelf:not(.rh-preset-theme) .wp-block-button__link {
	border-color: var(--rh-accent);
	background: var(--rh-accent);
	color: var(--rh-on-accent);
}

.reelshelf:not(.rh-preset-theme) .is-style-outline > .wp-block-button__link {
	border: 2px solid var(--rh-line);
	background: transparent;
	color: var(--rh-text);
}

.reelshelf .wp-block-button__link:disabled {
	opacity: 0.6;
	cursor: progress;
}

.reelshelf .rh-icon-button {
	all: unset;
	box-sizing: border-box;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rh-surface);
	color: var(--rh-text);
	box-shadow: inset 0 0 0 1px var(--rh-line);
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
}

.reelshelf .rh-icon-button:hover {
	background: var(--rh-surface-hover);
}

.reelshelf .rh-icon-button:disabled {
	opacity: 0.35;
	cursor: default;
}

.reelshelf .rh-icon-button svg {
	display: block;
}

.rh-duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 2;
	padding: 2px 6px;
	border-radius: 5px;
	background: rgba(0, 0, 0, 0.78);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.5;
}

/* ---------------------------------------------------------------- */
/* Section heads                                                     */
/* ---------------------------------------------------------------- */

.reelshelf .rh-section-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.reelshelf .rh-section-title {
	margin: 0;
	text-wrap: balance;
}

/* Row and grid titles use the theme's h3 size so they don't shout; the Heading block keeps its full h2 size. */
.reelshelf:not(.rh-heading) .rh-section-title {
	font-size: var(--rh-theme-title-size, clamp(1.25rem, 2vw, 1.6rem));
}

.reelshelf:not(.rh-preset-theme) :is(.rh-section-title, .rh-stage-title) {
	color: var(--rh-text);
}

.reelshelf .rh-section-tools {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: 16px;
}

.reelshelf .rh-arrows {
	display: flex;
	gap: 8px;
}

.reelshelf .rh-arrows[hidden] {
	display: none;
}

.reelshelf .rh-see-all {
	color: var(--rh-text);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.reelshelf .rh-see-all:hover {
	opacity: 1;
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* The Heading block on its own is a little larger. */
.reelshelf.rh-heading {
	padding-bottom: clamp(4px, 1vw, 12px);
}

.rh-heading .rh-section-head {
	margin-bottom: 0;
}


/* ---------------------------------------------------------------- */
/* Player                                                            */
/* ---------------------------------------------------------------- */

.reelshelf.rh-player {
	overflow: clip;
}

/* A soft glow of the video's own colours behind the player. */
.rh-ambient {
	position: absolute;
	inset: -15% -10% 0;
	z-index: 0;
	background-position: center;
	background-size: cover;
	filter: blur(80px) saturate(1.6);
	opacity: var(--rh-ambient-opacity);
	transform: translateZ(0);
	transition: background-image 0.8s ease;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 90%);
	mask-image: linear-gradient(to bottom, #000 35%, transparent 90%);
}

/* The whole video fits on screen, however wide the window. */
.rh-stage {
	width: min(100%, calc((100svh - 180px) * 16 / 9));
	min-width: min(100%, 560px);
	margin-inline: auto;
}

.rh-bare .rh-stage {
	width: 100%;
	min-width: 0;
}

.rh-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--rh-radius);
	background: #000;
	box-shadow: var(--rh-shadow), 0 0 0 1px var(--rh-line);
}

.rh-bare .rh-frame {
	border-radius: var(--rh-radius-sm);
	box-shadow: none;
}

.rh-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.reelshelf .rh-play {
	all: unset;
	position: absolute;
	inset: 0;
	display: block;
	cursor: pointer;
}

.rh-play img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1s var(--rh-ease), filter 0.4s;
}

.rh-play::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 40%);
	pointer-events: none;
}

.rh-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: grid;
	place-items: center;
	width: clamp(60px, 7vw, 84px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--rh-accent);
	color: var(--rh-on-accent);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	transform: translate(-50%, -50%);
	transition: transform 0.4s var(--rh-ease);
}

.rh-play-icon svg {
	width: 42%;
	height: 42%;
	margin-left: 6%;
}

.rh-play:hover img {
	transform: scale(1.015);
	filter: brightness(0.9);
}

.rh-play:hover .rh-play-icon,
.rh-play:focus-visible .rh-play-icon {
	transform: translate(-50%, -50%) scale(1.08);
}

.rh-play:focus-visible .rh-play-icon {
	outline: 3px solid #fff;
	outline-offset: 4px;
}

/* Title, details and buttons under the video. */
.rh-stage-info {
	display: grid;
	gap: 16px 48px;
	margin-top: clamp(20px, 2.5vw, 32px);
}

@media (min-width: 900px) {
	.rh-stage-info {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
		align-items: start;
	}
}

.reelshelf .rh-stage-title {
	margin: 0;
	font-size: calc(var(--rh-theme-title-size, 1.5rem) * 1.3);
	text-wrap: balance;
}

.reelshelf .rh-stage-title a {
	color: inherit;
	text-decoration: none;
}

.reelshelf .rh-stage-title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.reelshelf .rh-stage-meta {
	margin: 10px 0 0;
	color: var(--rh-muted);
	font-size: 0.9rem;
	font-variant-numeric: tabular-nums;
}

.reelshelf .rh-stage-excerpt {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: var(--rh-muted);
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.reelshelf .rh-stage-excerpt:empty {
	display: none;
}

.reelshelf .rh-stage-actions {
	margin: 20px 0 0;
}

/* The mini-player. The script holds the video's space so the page doesn't jump. */
.reelshelf.rh-has-dock {
	z-index: 99999;
}

.rh-dock-bar {
	display: none;
}

.rh-stage.is-docked .rh-dock {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99999;
	width: min(380px, calc(100vw - 32px));
	overflow: hidden;
	border-radius: 12px;
	background: #111;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
	animation: rh-dock-in 0.4s var(--rh-ease);
}

.rh-stage.is-docked .rh-frame {
	border-radius: 0;
	box-shadow: none;
}

.rh-stage.is-docked .rh-dock-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 8px 6px 4px;
	color: #fff;
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	transition: background-color 0.2s;
}

.rh-stage.is-docked .rh-dock-bar:hover {
	background: rgba(255, 255, 255, 0.07);
}

.rh-dock-text {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.rh-dock-text .rh-dock-title {
	flex: none;
}

.rh-dock-hint {
	overflow: hidden;
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.7rem;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rh-stage.is-learned .rh-dock-hint {
	display: none;
}

.reelshelf .rh-dock-bar .rh-dock-grip {
	width: 28px;
	height: 36px;
	border-radius: 6px;
	background: transparent;
	color: rgba(255, 255, 255, 0.85);
	cursor: grab;
}

.reelshelf .rh-dock-bar:hover .rh-dock-grip {
	background: transparent;
	color: #fff;
}

/* Resize from the top-left corner: the side facing into the page. Always visible, so it's findable. */
.rh-dock-resize {
	display: none;
}

.reelshelf .rh-stage.is-docked .rh-dock-resize {
	all: unset;
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 5;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	box-sizing: border-box;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
	color: #fff;
	cursor: nwse-resize;
	touch-action: none;
	transition: background-color 0.2s, transform 0.2s var(--rh-ease);
}

.reelshelf .rh-stage.is-docked .rh-dock-resize:hover,
.reelshelf .rh-stage.is-dragging .rh-dock-resize {
	background: var(--rh-accent);
	color: var(--rh-on-accent);
	transform: scale(1.1);
}

.reelshelf .rh-stage.is-docked .rh-dock-resize:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* The first time, the resize button pulses a couple of times to get noticed. */
.reelshelf .rh-stage.is-docked:not(.is-learned) .rh-dock-resize {
	animation: rh-pulse 1.4s ease-out 0.6s 2;
}

@keyframes rh-pulse {
	0% {
		box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 0 rgba(255, 255, 255, 0.55);
	}
	100% {
		box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 0 0 14px rgba(255, 255, 255, 0);
	}
}

/* While dragging: YouTube's iframe mustn't catch the pointer, and nothing should animate. */
.rh-stage.is-dragging .rh-dock {
	animation: none;
}

.rh-stage.is-dragging iframe {
	pointer-events: none;
}

.rh-stage.is-dragging .rh-dock-bar,
.rh-stage.is-dragging .rh-dock-grip {
	cursor: grabbing;
}

.rh-dock-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	font-size: 0.82rem;
	font-weight: 600;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.reelshelf .rh-dock-bar .rh-icon-button {
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	box-shadow: none;
}

.reelshelf .rh-dock-bar .rh-icon-button:hover {
	background: rgba(255, 255, 255, 0.2);
}

@keyframes rh-dock-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
}

/* ---------------------------------------------------------------- */
/* Cards                                                             */
/* ---------------------------------------------------------------- */

.reelshelf :where(ul[role="list"]) {
	margin: 0;
	padding: 0;
	list-style: none;
}

.reelshelf .rh-card-item {
	margin: 0;
	padding: 0;
}

.reelshelf .rh-card {
	display: block;
	color: inherit;
	text-decoration: none;
	outline: none;
}

.rh-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--rh-radius-sm);
	background: var(--rh-surface);
	transition: transform 0.5s var(--rh-ease), box-shadow 0.5s var(--rh-ease);
}

/* A hairline ring, drawn on top of the image. */
.rh-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px var(--rh-line);
	pointer-events: none;
	transition: box-shadow 0.25s;
}

.rh-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--rh-ease), filter 0.4s;
}

.rh-thumb-play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.85);
	transition: opacity 0.25s, transform 0.4s var(--rh-ease);
}

.rh-thumb-play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent #fff;
	transform: translate(-50%, -50%);
}

.reelshelf .rh-card:hover .rh-thumb,
.reelshelf .rh-card:focus-visible .rh-thumb {
	transform: translateY(-3px);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

.reelshelf .rh-card:hover .rh-thumb img {
	transform: scale(1.05);
}

.reelshelf .rh-card:hover .rh-thumb-play,
.reelshelf .rh-card:focus-visible .rh-thumb-play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.reelshelf .rh-card:focus-visible .rh-thumb::after {
	box-shadow: inset 0 0 0 2px var(--rh-accent);
}

.reelshelf .rh-card:focus-visible .rh-thumb {
	outline: 2px solid var(--rh-accent);
	outline-offset: 3px;
}

/* The video playing in the player. */
.rh-now {
	position: absolute;
	left: 8px;
	bottom: 8px;
	z-index: 2;
	display: none;
	padding: 3px 8px;
	border-radius: 5px;
	background: var(--rh-accent);
	color: var(--rh-on-accent);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.5;
	text-transform: uppercase;
}

.reelshelf .rh-card[aria-current] .rh-now {
	display: block;
}

.reelshelf .rh-card[aria-current] .rh-thumb::after {
	box-shadow: inset 0 0 0 2px var(--rh-accent);
}

.reelshelf .rh-card[aria-current] .rh-thumb img {
	filter: brightness(0.7);
}

.reelshelf .rh-card[aria-current] .rh-thumb-play {
	display: none;
}

.rh-card-text {
	display: block;
	padding: 12px 2px 0;
}

.reelshelf .rh-card-label {
	display: block;
	margin-bottom: 4px;
	color: var(--rh-accent);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.reelshelf .rh-card-title {
	display: -webkit-box;
	overflow: hidden;
	color: var(--rh-text);
	font-family: var(--rh-theme-heading-font, inherit);
	font-size: 0.98rem;
	font-weight: var(--rh-theme-heading-weight, 600);
	line-height: 1.35;
	text-wrap: pretty;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.reelshelf .rh-card-meta {
	display: block;
	margin-top: 4px;
	color: var(--rh-muted);
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- */
/* Rows and Shorts                                                   */
/* ---------------------------------------------------------------- */

/* The rail runs to the edge of the section, so cards slide off the side like a streaming app. */
.rh-rail {
	margin-inline: calc(var(--rh-gutter) * -1);
	padding-inline: var(--rh-gutter);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-padding-inline: var(--rh-gutter);
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.rh-rail::-webkit-scrollbar {
	display: none;
}

.reelshelf .rh-track {
	display: flex;
	gap: clamp(12px, 1.6vw, 20px);
	padding-block: 6px 10px;
}

.reelshelf .rh-track > .rh-card-item {
	flex: 0 0 clamp(220px, 23vw, 300px);
	scroll-snap-align: start;
}

.reelshelf.rh-shorts .rh-track > .rh-card-item {
	flex-basis: clamp(140px, 14vw, 190px);
}

.rh-card-short .rh-thumb {
	aspect-ratio: 9 / 16;
	border-radius: 14px;
}

.rh-card-short .rh-card-title {
	font-size: 0.9rem;
}

@media (pointer: coarse) {
	.reelshelf .rh-arrows {
		display: none;
	}
}

/* ---------------------------------------------------------------- */
/* Grid                                                              */
/* ---------------------------------------------------------------- */

.reelshelf .rh-grid-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
	gap: clamp(24px, 3vw, 40px) clamp(14px, 2vw, 24px);
}

.rh-grid .rh-card-short .rh-thumb {
	aspect-ratio: 16 / 9;
	border-radius: var(--rh-radius-sm);
}

.reelshelf .rh-more-wrap {
	justify-content: center;
	margin-top: clamp(32px, 4vw, 48px);
}

/* ---------------------------------------------------------------- */
/* Shorts viewer                                                     */
/* ---------------------------------------------------------------- */

.rh-shorts-viewer {
	padding: 0;
	overflow: visible;
	border: 0;
	background: transparent;
}

.rh-shorts-viewer::backdrop {
	background: rgba(5, 5, 8, 0.9);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.rh-shorts-frame {
	position: relative;
	height: min(88vh, 780px);
	max-width: calc(100vw - 32px);
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border-radius: 18px;
	background: #000;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.rh-shorts-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.rh-shorts-close {
	all: unset;
	position: fixed;
	top: 16px;
	right: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s;
}

.rh-shorts-close:hover {
	background: rgba(255, 255, 255, 0.22);
}

.rh-shorts-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- */
/* A video's own page                                                */
/* ---------------------------------------------------------------- */

.rh-single-meta {
	margin-top: 0.75em;
	font-size: 0.9rem;
	opacity: 0.75;
}

.rh-single-description {
	margin-top: 1.5em;
}

.reelshelf.rh-bare.rh-row {
	margin-top: 3em;
}

/* About, chapters and transcript: inside the theme's content column, in its own type and colours. */
.rh-extra {
	margin-top: 2em;
}

.rh-extra h2 {
	margin-bottom: 0.6em;
}

.rh-chapters ol {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 4px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rh-chapters a {
	display: flex;
	gap: 12px;
	padding: 6px 8px;
	margin-inline: -8px;
	border-radius: 6px;
	color: inherit;
	text-decoration: none;
}

.rh-chapters a:hover,
.rh-chapters a:focus-visible {
	background: color-mix(in srgb, currentColor 7%, transparent);
}

.rh-time {
	flex: none;
	min-width: 3.2em;
	color: var(--rh-theme-link, inherit);
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.rh-transcript summary {
	cursor: pointer;
	font-weight: 600;
}

.rh-transcript-body {
	max-height: 520px;
	margin-top: 0.75em;
	padding-right: 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.rh-transcript-body p {
	margin: 0 0 0.8em;
}

.rh-transcript-body .rh-time {
	margin-right: 6px;
	font-size: 0.85em;
	text-decoration: none;
}

/* ---------------------------------------------------------------- */
/* Search inside videos                                              */
/* ---------------------------------------------------------------- */

.reelshelf .rh-search-form {
	display: flex;
	gap: 10px;
	max-width: 720px;
}

.reelshelf .rh-search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 0.7em 1em;
	border: 1px solid var(--rh-line);
	border-radius: var(--rh-radius-sm);
	background: var(--rh-surface);
	color: var(--rh-text);
	font: inherit;
}

.reelshelf .rh-search-form input[type="search"]:focus-visible {
	outline: 2px solid var(--rh-accent);
	outline-offset: 2px;
}

.reelshelf .rh-search-count,
.reelshelf .rh-search-none {
	margin: 24px 0 12px;
	color: var(--rh-muted);
}

.reelshelf .rh-results {
	display: grid;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.reelshelf .rh-result {
	display: grid;
	grid-template-columns: minmax(120px, 220px) 1fr;
	gap: 16px;
	align-items: start;
}

.reelshelf .rh-result-thumb img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--rh-radius-sm);
}

.reelshelf .rh-result-title {
	display: block;
	color: var(--rh-text);
	font-family: var(--rh-theme-heading-font, inherit);
	font-weight: var(--rh-theme-heading-weight, 600);
	text-decoration: none;
}

.reelshelf .rh-result-title:hover {
	text-decoration: underline;
}

.reelshelf .rh-moments {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.reelshelf .rh-moments a {
	display: flex;
	gap: 10px;
	padding: 4px 0;
	color: var(--rh-muted);
	font-size: 0.92em;
	text-decoration: none;
}

.reelshelf .rh-moments a:hover {
	color: var(--rh-text);
}

.reelshelf .rh-moments .rh-time {
	color: var(--rh-accent);
}

.reelshelf mark {
	padding: 0 2px;
	border-radius: 3px;
	background: color-mix(in srgb, var(--rh-accent) 25%, transparent);
	color: inherit;
}

@media (max-width: 599px) {
	.reelshelf .rh-result {
		grid-template-columns: 1fr;
	}
}

/* ---------------------------------------------------------------- */
/* Small screens, admin note, reduced motion                         */
/* ---------------------------------------------------------------- */

@media (max-width: 599px) {
	.reelshelf .rh-section-head {
		align-items: center;
	}

	.reelshelf .rh-stage-actions .wp-block-button {
		flex: 1 1 auto;
	}

	.reelshelf .rh-stage-actions .wp-block-button__link {
		width: 100%;
		text-align: center;
	}
}

.reelshelf.rh-empty {
	padding: 16px 20px;
	border: 1px dashed currentColor;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
	.reelshelf *,
	.reelshelf *::before,
	.reelshelf *::after {
		transition: none !important;
		animation: none !important;
	}

	.reelshelf .rh-card:hover .rh-thumb,
	.reelshelf .rh-card:focus-visible .rh-thumb,
	.reelshelf .rh-card:hover .rh-thumb img,
	.rh-play:hover img {
		transform: none;
	}
}
