/* core.css — generated by bin/build-css.php from src/css/. Don't edit; edit the sources and rebuild. */

/* ── src/css/settings/_palette.css ── */

/* ==========================================================================
   SETTINGS — palette
   Generated by bin/build-css.php from src/Accent.php. Don't edit: change the
   lists in Accent.php and rebuild.

   --core-accent-<name>-base  your colour as it is (swatches, decoration)
   --core-accent-<name>       its readable shade, at least 4.5:1 for text
                                 on the page and on link buttons:
                                 light-dark(<light mode>, <dark mode>)
   --core-scheme-<name>       dark backgrounds
   ========================================================================== */

:root {
	/* Accents as they are */
	--core-accent-rose-base:    #fb7185;
	--core-accent-orange-base:  #fb923c;
	--core-accent-amber-base:   #fbbf24;
	--core-accent-lime-base:    #a3e635;
	--core-accent-green-base:   #4ade80;
	--core-accent-teal-base:    #2dd4bf;
	--core-accent-cyan-base:    #22d3ee;
	--core-accent-blue-base:    #60a5fa;
	--core-accent-indigo-base:  #818cf8;
	--core-accent-purple-base:  #c084fc;
	--core-accent-fuchsia-base: #e879f9;
	--core-accent-pink-base:    #f472b6;

	/* Readable accents; the light ones also for browsers without light-dark() */
	--core-accent-rose:    #c43f58;
	--core-accent-orange:  #ac5900;
	--core-accent-amber:   #8d6900;
	--core-accent-lime:    #527a00;
	--core-accent-green:   #00803f;
	--core-accent-teal:    #007d70;
	--core-accent-cyan:    #007a8b;
	--core-accent-blue:    #2b70c1;
	--core-accent-indigo:  #5e65cd;
	--core-accent-purple:  #8e52c6;
	--core-accent-fuchsia: #ac3ebd;
	--core-accent-pink:    #bc3f85;

	/* Dark backgrounds */
	--core-scheme-slate:   #0f172a;
	--core-scheme-soho:    #34343d;
	--core-scheme-ocean:   #183240;
}

@supports (color: light-dark(#000, #fff)) {
	:root {
		--core-accent-rose:    light-dark(#c43f58, #fe8191);
		--core-accent-orange:  light-dark(#ac5900, #fb923c);
		--core-accent-amber:   light-dark(#8d6900, #fbbf24);
		--core-accent-lime:    light-dark(#527a00, #a3e635);
		--core-accent-green:   light-dark(#00803f, #4ade80);
		--core-accent-teal:    light-dark(#007d70, #2dd4bf);
		--core-accent-cyan:    light-dark(#007a8b, #22d3ee);
		--core-accent-blue:    light-dark(#2b70c1, #68aafb);
		--core-accent-indigo:  light-dark(#5e65cd, #98a4fb);
		--core-accent-purple:  light-dark(#8e52c6, #c691fd);
		--core-accent-fuchsia: light-dark(#ac3ebd, #ea81fa);
		--core-accent-pink:    light-dark(#bc3f85, #f781bd);
	}
}

/* ── src/css/settings/_theme.css ── */

/* ==========================================================================
   SETTINGS — theme
   Colours by role, for light and dark mode. Which mode applies follows
   color-scheme, which core/theme sets from the Panel (Home → Settings:
   Light, Dark, Automatic), together with the dark background (--core-scheme).
   The accent comes from core/accent (--core-color-accent, per page); without
   it links are blue (#0b5fff, a lighter blue in dark mode).

   --core-light-*   light mode
   --core-dark-*    dark mode, mixed from the dark background, so text
                    and lines keep its tint
   --core-theme-*   what components use: light-dark(light, dark)

   The shared names --fg --bg --muted --line --accent are for the site and
   all plugins (blogkit, linkit, micro, travel, speedruns): set from the
   roles above. To change the colours, change --core-light-* / --core-dark-*.

   Browsers without light-dark() (before 2024) get the light values.
   The dark mixes are mirrored in src/Palette.php (contrast of the accents);
   change both together.
   ========================================================================== */

:root {
	/* --core-scheme is set by core/theme from the Panel settings; these are
	   the defaults */
	--core-scheme: var(--core-scheme-slate);

	/* Light mode */
	--core-light-background: #fff;
	--core-light-text: #1a1a1a;
	--core-light-muted: #666;
	--core-light-line: #e5e5e5;

	/* Dark mode */
	--core-dark-background: var(--core-scheme);
	--core-dark-text: color-mix(in oklab, var(--core-dark-background), white 88%);
	--core-dark-muted: color-mix(in oklab, var(--core-dark-background), white 62%);
	--core-dark-line: color-mix(in oklab, var(--core-dark-background), white 18%);

	/* By role (light values; light-dark() versions below) */
	--core-theme-background: var(--core-light-background);
	--core-theme-text: var(--core-light-text);
	--core-theme-muted: var(--core-light-muted);
	--core-theme-line: var(--core-light-line);
	--core-theme-surface: var(--core-theme-background); /* cards */
}

/* Tonal scale of the page's accent, 10 % steps, the same in both modes.
   --core-color-accent-base is set by core/accent. For your site and other plugins. */
:root {
	--core-color-accent-lighter-6: color-mix(in oklab, var(--core-color-accent-base), white 60%);
	--core-color-accent-lighter-5: color-mix(in oklab, var(--core-color-accent-base), white 50%);
	--core-color-accent-lighter-4: color-mix(in oklab, var(--core-color-accent-base), white 40%);
	--core-color-accent-lighter-3: color-mix(in oklab, var(--core-color-accent-base), white 30%);
	--core-color-accent-lighter-2: color-mix(in oklab, var(--core-color-accent-base), white 20%);
	--core-color-accent-lighter-1: color-mix(in oklab, var(--core-color-accent-base), white 10%);
	--core-color-accent-darker-1: color-mix(in oklab, var(--core-color-accent-base), black 10%);
	--core-color-accent-darker-2: color-mix(in oklab, var(--core-color-accent-base), black 20%);
	--core-color-accent-darker-3: color-mix(in oklab, var(--core-color-accent-base), black 30%);
	--core-color-accent-darker-4: color-mix(in oklab, var(--core-color-accent-base), black 40%);
	--core-color-accent-darker-5: color-mix(in oklab, var(--core-color-accent-base), black 50%);
	--core-color-accent-darker-6: color-mix(in oklab, var(--core-color-accent-base), black 60%);
}

@supports (color: light-dark(#000, #fff)) {
	:root {
		--core-theme-background: light-dark(var(--core-light-background), var(--core-dark-background));
		--core-theme-text: light-dark(var(--core-light-text), var(--core-dark-text));
		--core-theme-muted: light-dark(var(--core-light-muted), var(--core-dark-muted));
		--core-theme-line: light-dark(var(--core-light-line), var(--core-dark-line));
	}
}

/* Shared names for the site and all plugins. After the comma: what applies
   when core/accent isn't on the page (a blue accent). Like any rule, these
   win over the site's own :root rules that come earlier in the page (a
   site's stylesheet in <head>) and lose against later ones. */
:root {
	--fg: var(--core-theme-text);
	--bg: var(--core-theme-background);
	--muted: var(--core-theme-muted);
	--line: var(--core-theme-line);
	--accent: var(--core-color-accent, #0b5fff);
}

/* ── src/css/settings/_tokens.css ── */

/* ==========================================================================
   SETTINGS — design tokens
   Every token is prefixed --core- so a plugin or site can override it, e.g.
   :root { --core-radius-l: 4px; }  or, in a plugin's own CSS,
   :root { --core-radius-l: var(--micro-radius-l); }

   Text, surface and line colours follow the shared names (--fg, --muted,
   --line, --bg), which _theme.css sets from the Panel's appearance (light
   and dark mode) and from the roles --core-theme-*; the fallbacks apply
   without them. A plugin maps these tokens to its own (e.g. micro:
   --core-color-text: var(--micro-color-text)).

   The accent is core's own: Indigo by default, the page's accent where
   the core/accent snippet is printed, an element's own where it has
   data-core-accent="<name>". The colours are in _palette.css.
   ========================================================================== */

:root {
	/* Colour */
	--core-color-text: var(--fg, #1a1a1a);
	--core-color-muted: var(--muted, #666);
	--core-color-surface: var(--bg, #fff);
	--core-color-accent: var(--core-accent-indigo);      /* readable: links, hover, focus ring */
	--core-color-accent-base: var(--core-accent-indigo-base); /* as chosen: decoration */
	--core-color-placeholder: color-mix(in srgb, var(--core-color-text) 8%, var(--core-color-surface));

	/* Video placeholder (the play button sits on a picture: always dark) */
	--core-video-bg: #000;
	--core-video-play: rgb(0 0 0 / 0.72);
	--core-video-play-hover: #000;
	--core-video-on-play: #fff;
	--core-video-play-size: 4rem;

	/* Image overlay (always dark, in light mode too) */
	--core-lightbox-bg: rgb(0 0 0 / 0.95);
	--core-lightbox-text: #fff;
	--core-lightbox-muted: rgb(255 255 255 / 0.72);
	--core-lightbox-control: rgb(255 255 255 / 0.14);
	--core-lightbox-control-hover: rgb(255 255 255 / 0.26);

	/* Space */
	--core-space-xs: 0.25rem;
	--core-space-s: 0.5rem;
	--core-space-m: 1rem;

	/* Shape */
	--core-radius-l: 12px;                               /* video frame */

	/* Type */
	--core-font-size-meta: 0.875rem;

	/* Measures */
	--core-control-size: 2.75rem;                        /* overlay buttons (44px touch targets) */
	--core-measure: 40rem;                               /* overlay caption */
}

/* ── src/css/components/_core-picture.css ── */

/* ==========================================================================
   COMPONENT — c-core-picture
   The <picture> around an image that is offered in AVIF, JPEG XL or WebP
   (core/image, Front::picture). It only holds the <source> elements and the
   <img>; display: contents takes it out of the layout, so the <img> and its
   own classes (c-…__image) behave as if it had no wrapper.

   The <source> elements are never shown. Browsers hide them by default, but
   inside a display: contents parent Chromium computes them as blocks, and in a
   flex or grid container (a card with a gap) every empty one would count as an
   item and add a gap.
   ========================================================================== */

.c-core-picture {
	display: contents;
}

.c-core-picture > source {
	display: none;
}

/* ── src/css/components/_core-figure.css ── */

/* ==========================================================================
   COMPONENT — c-core-figure
   The image block of the editor (Kirby's blocks field, rendered by core):
   an image, optionally a link around it, optionally a caption. Block margins
   are left to the host's text styles; core only takes away the browser's
   side indent.
   ========================================================================== */

.c-core-figure {
	margin-inline: 0;
}

.c-core-figure__link {
	display: block;
}

.c-core-figure__link[data-core-lightbox] {
	cursor: zoom-in;
}

.c-core-figure__link:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-figure__image {
	display: block;
	max-width: 100%;
	height: auto;
}

.c-core-figure__caption {
	margin-top: var(--core-space-s);
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

/* ── src/css/components/_core-gallery.css ── */

/* ==========================================================================
   COMPONENT — c-core-gallery
   The gallery block of the editor (Kirby's blocks field, rendered by core): a
   grid of thumbnails, each a link that opens the image overlay, and an
   optional caption. Block margins are left to the host's text styles.
   ========================================================================== */

.c-core-gallery {
	margin-inline: 0;
}

.c-core-gallery__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
	gap: var(--core-space-s);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* phones: two tiles per row (a single tile would be as wide as the screen); matches the 45vw in the sizes option */
@media (max-width: 30rem) {
	.c-core-gallery__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.c-core-gallery__item {
	margin: 0;
	padding: 0;
}

.c-core-gallery__link {
	display: block;
	cursor: zoom-in;
}

.c-core-gallery__link:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-gallery__image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.c-core-gallery__caption {
	margin-top: var(--core-space-s);
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

/* ── src/css/components/_core-video.css ── */

/* ==========================================================================
   COMPONENT — c-core-video
   The video: first the stored poster with a play button (a link to the
   platform), after a click the platform's player (assets/js/core-video.js).
   Both fill a 16:9 frame.
   ========================================================================== */

.c-core-video {
	margin: var(--core-space-m) 0 0;
}

.c-core-video__link,
.c-core-video__frame {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border: 0;
	border-radius: var(--core-radius-l);
	background: var(--core-video-bg);
}

.c-core-video__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.c-core-video__button {
	display: grid;
	position: absolute;
	top: 50%;
	left: 50%;
	place-items: center;
	width: var(--core-video-play-size);
	height: var(--core-video-play-size);
	border-radius: 50%;
	background: var(--core-video-play);
	color: var(--core-video-on-play);
	transform: translate(-50%, -50%);
}

.c-core-video__link:hover .c-core-video__button {
	background: var(--core-video-play-hover);
}

.c-core-video__link:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-video__note {
	margin-top: var(--core-space-s);
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

/* The editor's caption (video block), above the note */
.c-core-video__caption {
	margin-top: var(--core-space-s);
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

.c-core-video__caption + .c-core-video__note {
	margin-top: var(--core-space-xs);
}

/* State: the player is running, the note is no longer needed */
.c-core-video--playing .c-core-video__note {
	display: none;
}

@media (prefers-reduced-motion: no-preference) {
	.c-core-video__button {
		transition: transform 150ms ease-out, background-color 150ms ease-out;
	}

	.c-core-video__link:hover .c-core-video__button {
		transform: translate(-50%, -50%) scale(1.08);
	}
}

/* ── src/css/components/_core-playlist.css ── */

/* ==========================================================================
   COMPONENT — c-core-playlist
   The editor's video-playlist block: core's two-click player with a list of
   the playlist's videos. Wide screens: the list sits beside the player and is
   as tall as the player with its text (it scrolls); narrow screens: the list
   follows below the player. The playing row is marked (aria-current / is-current).
   ========================================================================== */

.c-core-playlist {
	display: grid;
	gap: var(--core-space-m);
	margin-inline: 0;
}

@media (min-width: 48rem) {
	.c-core-playlist {
		grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr);
	}
}

.c-core-playlist__stage {
	min-width: 0;
}

.c-core-playlist__video {
	margin-top: 0;
}

.c-core-playlist__now {
	margin-top: var(--core-space-s);
}

.c-core-playlist__now > p {
	margin: 0;
}

.c-core-playlist__now-title {
	font-weight: 600;
}

.c-core-playlist__now-meta,
.c-core-playlist__now-description {
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

.c-core-playlist__now-description {
	max-height: 10rem;          /* a long description scrolls instead of stretching the block */
	margin-top: var(--core-space-xs);
	overflow-y: auto;
	white-space: pre-line;
	overflow-wrap: anywhere;
}

.c-core-playlist__now-description:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-playlist__now-meta:empty,
.c-core-playlist__now-description:empty {
	display: none;
}

/* the list: below the player on narrow screens, beside it (and as tall as the
   player with its text) on wide ones */
.c-core-playlist__aside {
	position: relative;
	min-width: 0;
}

.c-core-playlist__list {
	max-height: 24rem;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}

@media (min-width: 48rem) {
	.c-core-playlist__aside {
		min-height: 14rem;
	}

	.c-core-playlist__list {
		position: absolute;
		inset: 0;
		max-height: none;
	}
}

.c-core-playlist__item {
	margin: 0;
	padding: 0;
}

.c-core-playlist__link {
	display: grid;
	grid-template-columns: 7rem minmax(0, 1fr);
	gap: var(--core-space-s);
	align-items: start;
	padding: var(--core-space-xs);
	border-radius: var(--core-radius-l);
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.c-core-playlist__link:hover {
	background: var(--core-color-placeholder);
}

/* a host's "a:hover { underline }" must not underline a whole row (one more class than the host's rule) */
.c-core-playlist .c-core-playlist__link:hover,
.c-core-playlist .c-core-playlist__link:focus-visible {
	text-decoration: none;
}

.c-core-playlist__link:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: -3px;
}

.c-core-playlist__link[aria-current="true"] {
	background: color-mix(in srgb, var(--core-color-accent-base) 18%, var(--core-color-surface));
	box-shadow: inset 3px 0 0 var(--core-color-accent);
}

.c-core-playlist__thumb {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border-radius: calc(var(--core-radius-l) / 2);
	background: var(--core-video-bg);
	object-fit: cover;
}

.c-core-playlist__thumb--empty {
	min-height: 0;
}

.c-core-playlist__text {
	display: grid;
	gap: 0.125rem;
	min-width: 0;
}

.c-core-playlist__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: var(--core-font-size-meta);
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow-wrap: anywhere;
}

.c-core-playlist__meta {
	color: var(--core-color-muted);
	font-size: 0.75rem;
}

/* ── src/css/components/_core-shorts.css ── */

/* ==========================================================================
   COMPONENT — c-core-shorts
   The editor's shorts-playlist block: a strip of vertical (9:16) cards. How
   many are visible follows the width of the block (container query, so it also
   works in a narrow article column): 1 on a phone (the next one peeks in),
   2, 3, 4 and 5 on wide ones. The rest is reached by swiping, with the buttons
   or the arrow keys. Native scroll-snap, no library.
   Each card is the stored poster with a play button (a link to the Short on
   YouTube); after a click the player replaces the poster (core-shorts.js).
   ========================================================================== */

.c-core-shorts {
	container-type: inline-size;
	margin: var(--core-space-m) 0 0;
}

.c-core-shorts__title {
	margin: 0 0 var(--core-space-s);
	font-weight: 600;
}

/* the buttons sit on this */
.c-core-shorts__viewport {
	position: relative;
}

.c-core-shorts__track {
	--core-shorts-gap: var(--core-space-m);
	--core-shorts-columns: 1;

	display: flex;
	gap: var(--core-shorts-gap);
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.c-core-shorts__track::-webkit-scrollbar {
	display: none;
}

/* the cards: a phone shows one and lets the next peek in; wider blocks show a whole number */
.c-core-shorts__item {
	flex: 0 0 min(78%, 18rem);
	margin: 0;
	padding: 0;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

@container (min-width: 30rem) {
	.c-core-shorts__track {
		--core-shorts-columns: 2;
	}
}

@container (min-width: 40rem) {
	.c-core-shorts__track {
		--core-shorts-columns: 3;
	}
}

@container (min-width: 52rem) {
	.c-core-shorts__track {
		--core-shorts-columns: 4;
	}
}

@container (min-width: 62rem) {
	.c-core-shorts__track {
		--core-shorts-columns: 5;
	}
}

@container (min-width: 30rem) {
	.c-core-shorts__item {
		flex-basis: calc((100% - (var(--core-shorts-columns) - 1) * var(--core-shorts-gap)) / var(--core-shorts-columns));
	}
}

.c-core-shorts__card {
	margin: 0;
}

.c-core-shorts__link,
.c-core-shorts__frame {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border: 0;
	border-radius: var(--core-radius-l);
	background: var(--core-video-bg);
	color: var(--core-video-on-play);
	text-decoration: none;
}

.c-core-shorts__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.c-core-shorts__button {
	display: grid;
	position: absolute;
	top: 50%;
	left: 50%;
	place-items: center;
	width: var(--core-video-play-size);
	height: var(--core-video-play-size);
	border-radius: 50%;
	background: var(--core-video-play);
	color: var(--core-video-on-play);
	transform: translate(-50%, -50%);
}

.c-core-shorts__link:hover .c-core-shorts__button {
	background: var(--core-video-play-hover);
}

.c-core-shorts__link:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

/* the title across the bottom of the picture, readable on any picture */
.c-core-shorts__name {
	position: absolute;
	inset: auto 0 0;
	display: -webkit-box;
	overflow: hidden;
	padding: var(--core-space-l, 1.5rem) var(--core-space-s) var(--core-space-s);
	background: linear-gradient(to top, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0));
	font-size: var(--core-font-size-meta);
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow-wrap: anywhere;
}

/* a host's "a:hover { underline }" must not underline the title */
.c-core-shorts .c-core-shorts__link:hover,
.c-core-shorts .c-core-shorts__link:focus-visible {
	text-decoration: none;
}

/* below the strip: the note on the left, previous / next on the right */
.c-core-shorts__foot {
	display: flex;
	gap: var(--core-space-m);
	align-items: center;
	justify-content: space-between;
	margin-top: var(--core-space-s);
}

.c-core-shorts__controls {
	display: flex;
	flex: none;
	gap: var(--core-space-s);
}

.c-core-shorts__nav {
	display: grid;
	place-items: center;
	width: var(--core-control-size);
	height: var(--core-control-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--core-video-play);
	color: var(--core-video-on-play);
	cursor: pointer;
}

.c-core-shorts__nav[hidden] {
	display: none;
}

.c-core-shorts__nav:hover:not(:disabled) {
	background: var(--core-video-play-hover);
}

.c-core-shorts__nav:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-shorts__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.c-core-shorts__caption {
	margin: var(--core-space-s) 0 0;
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

.c-core-shorts__note {
	margin: 0;
	color: var(--core-color-muted);
	font-size: var(--core-font-size-meta);
}

@media (prefers-reduced-motion: no-preference) {
	.c-core-shorts__button {
		transition: transform 150ms ease-out, background-color 150ms ease-out;
	}

	.c-core-shorts__link:hover .c-core-shorts__button {
		transform: translate(-50%, -50%) scale(1.08);
	}
}

/* ── src/css/components/_core-overlay.css ── */

/* ==========================================================================
   COMPONENT — c-core-overlay
   The fullscreen player (native <dialog>, built by assets/js/core-overlay.js) of
   the video block, the video playlist and the Shorts playlist. One slide per
   video in a vertical strip with scroll-snap (one slide for a single video):
   swiping up / down, the wheel and the buttons move between them.
   The picture's shape comes from two custom properties set per open:
   --core-overlay-w / --core-overlay-h (16 / 9, or 9 / 16 for Shorts).
   Phone:   the player is as wide (or as tall) as the screen allows, edge to edge.
   Desktop: as large as fits, with room around it, centred on the dark backdrop.
   Playlists show title and channel under the player.
   Desktop:   counter ………………… fullscreen close
   Phone:     close counter ………… fullscreen
                                              ▲
                          player              ▼
   ========================================================================== */

.c-core-overlay {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--core-lightbox-bg);
	color: var(--core-lightbox-text);
	overflow: hidden;
	overscroll-behavior: contain;
	-webkit-user-select: none;
	user-select: none;
}

.c-core-overlay::backdrop {
	background: var(--core-lightbox-bg);
}

/* the page behind does not scroll while the overlay is open */
html:has(.c-core-overlay[open]) {
	overflow: hidden;
}

/* the fullscreen button fullscreens this (a modal dialog cannot be fullscreened itself) */
.c-core-overlay__body {
	position: absolute;
	inset: 0;
	background: var(--core-lightbox-bg);
	color: var(--core-lightbox-text);
}

.c-core-overlay__body:fullscreen {
	background: #000;
}

.c-core-overlay__scroller {
	height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-snap-type: y mandatory;
	scrollbar-width: none;
	outline: 0;
}

.c-core-overlay__scroller::-webkit-scrollbar {
	display: none;
}

/* One screen per video. The slide is the container the player is sized from; the player's width
   is the smaller of the room across and what the room down allows at its shape. */
.c-core-overlay__slide {
	--core-overlay-room: 0rem;                   /* height kept for the caption */
	--core-overlay-pad-x: 0rem;
	--core-overlay-pad-y: 0rem;
	--core-overlay-width: min(100cqw - 2 * var(--core-overlay-pad-x), (100cqh - 2 * var(--core-overlay-pad-y) - var(--core-overlay-room)) * var(--core-overlay-w) / var(--core-overlay-h));

	display: flex;
	flex-direction: column;
	container-type: size;
	align-items: center;
	justify-content: center;
	height: 100%;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.c-core-overlay__slide.has-caption {
	--core-overlay-room: 5.5rem;
}

@media (min-width: 40rem) {
	.c-core-overlay__slide {
		--core-overlay-pad-x: 5rem;
		--core-overlay-pad-y: var(--core-space-m);
	}
}

.c-core-overlay__player {
	position: relative;
	flex: none;
	width: var(--core-overlay-width);
	aspect-ratio: var(--core-overlay-w) / var(--core-overlay-h);
	overflow: hidden;
	background: var(--core-video-bg);
}

@media (min-width: 40rem) {
	.c-core-overlay__player {
		border-radius: var(--core-radius-l);
	}
}

/* title and channel / date under the player (playlists) */
.c-core-overlay__caption {
	flex: none;
	box-sizing: border-box;
	width: var(--core-overlay-width);
	min-height: calc(var(--core-overlay-room) - var(--core-space-s));
	margin-top: var(--core-space-s);
	padding-inline: var(--core-space-s);
	-webkit-user-select: text;
	user-select: text;
}

@media (min-width: 40rem) {
	.c-core-overlay__caption {
		padding-inline: 0;
	}
}

.c-core-overlay__caption-title,
.c-core-overlay__caption-meta {
	margin: 0;
}

.c-core-overlay__caption-title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 600;
	line-height: 1.3;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow-wrap: anywhere;
}

.c-core-overlay__caption-meta {
	overflow: hidden;
	color: var(--core-lightbox-muted);
	font-size: var(--core-font-size-meta);
	text-overflow: ellipsis;
	white-space: nowrap;
}

.c-core-overlay__poster,
.c-core-overlay__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.c-core-overlay__poster {
	object-fit: cover;
}

/* The player is shown only once YouTube says it is there, so the poster stays until the video plays (no dark frame in
   between). The next item's player waits hidden in its slide, booted but not started. */
.c-core-overlay__frame {
	opacity: 1;
	transition: opacity 0.2s ease;
}

.c-core-overlay__frame.is-waiting {
	opacity: 0;
	pointer-events: none;
}

.c-core-overlay__frame.is-ahead {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.c-core-overlay__frame {
		transition: none;
	}
}

/* Lies over the middle of the player: swipes and the wheel reach the overlay (a cross-origin player would swallow them),
   a tap pauses / plays. YouTube's own controls stay reachable above and below it: the top bar (title, share, ...) is left
   free (3.5rem, or 15 % of a small player), and so is the bottom (6.5rem, or 32 %): the timeline and the icon row.
   It steps aside while the player has not started, so YouTube's own play button can be tapped. */
.c-core-overlay__gesture {
	position: absolute;
	inset: min(3.5rem, 15%) 0 min(6.5rem, 32%);
	touch-action: pan-y;
}

.c-core-overlay__slide.is-stalled .c-core-overlay__gesture {
	pointer-events: none;
}

.c-core-overlay__counter {
	position: absolute;
	top: max(var(--core-space-m), env(safe-area-inset-top));
	left: max(var(--core-space-m), env(safe-area-inset-left));
	margin: 0;
	padding: var(--core-space-xs) var(--core-space-s);
	border-radius: 999px;
	background: var(--core-lightbox-control);
	color: var(--core-lightbox-text);
	font-size: var(--core-font-size-meta);
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

/* read out by screen readers when the Short changes */
.c-core-overlay__title {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.c-core-overlay__button {
	display: grid;
	position: absolute;
	place-items: center;
	width: var(--core-control-size);
	height: var(--core-control-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--core-lightbox-control);
	color: var(--core-lightbox-text);
	cursor: pointer;
}

.c-core-overlay__button[hidden] {
	display: none;
}

.c-core-overlay__button:hover:not(:disabled) {
	background: var(--core-lightbox-control-hover);
}

.c-core-overlay__button:focus-visible {
	outline: 3px solid var(--core-color-accent);
	outline-offset: 2px;
}

.c-core-overlay__button:disabled {
	opacity: 0.3;
	cursor: default;
}

.c-core-overlay__button--close {
	top: max(var(--core-space-m), env(safe-area-inset-top));
	right: max(var(--core-space-m), env(safe-area-inset-right));
}

.c-core-overlay__button--fullscreen {
	top: max(var(--core-space-m), env(safe-area-inset-top));
	right: calc(max(var(--core-space-m), env(safe-area-inset-right)) + var(--core-control-size) + var(--core-space-s));
}

/* Phone: the close button sits left of the counter, away from the player's own top-right buttons (settings, share) */
@media (max-width: 39.9375rem) {
	.c-core-overlay__button--close {
		right: auto;
		left: max(var(--core-space-m), env(safe-area-inset-left));
	}

	.c-core-overlay__button--fullscreen {
		right: max(var(--core-space-m), env(safe-area-inset-right));
	}

	.c-core-overlay__counter {
		display: flex;
		align-items: center;
		box-sizing: border-box;
		height: var(--core-control-size);
		left: calc(max(var(--core-space-m), env(safe-area-inset-left)) + var(--core-control-size) + var(--core-space-s));
	}
}

/* previous / next sit on the right edge, in the middle */
.c-core-overlay__button--up,
.c-core-overlay__button--down {
	right: max(var(--core-space-m), env(safe-area-inset-right));
}

.c-core-overlay__button--up {
	top: calc(50% - var(--core-control-size) - var(--core-space-xs));
}

.c-core-overlay__button--down {
	top: calc(50% + var(--core-space-xs));
}

/* on a phone the player fills the width: the arrows sit on the picture, smaller and quiet */
@media (max-width: 39.99rem) {
	.c-core-overlay__button--up,
	.c-core-overlay__button--down {
		width: 2.25rem;
		height: 2.25rem;
		opacity: 0.7;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.c-core-overlay[open] {
		animation: c-core-overlay-in 160ms ease-out;
	}
}

@keyframes c-core-overlay-in {
	from {
		opacity: 0;
	}
}

/* ── src/css/components/_core-lightbox.css ── */

/* ==========================================================================
   COMPONENT — c-core-lightbox
   Image overlay (native <dialog>) built by assets/js/core-lightbox.js.
   Desktop:  counter ……… close      Phone:  counter … close
             ‹   image + text   ›            image + text
                                             ‹             ›
   ========================================================================== */

.c-core-lightbox {
	box-sizing: border-box;
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: var(--core-space-m);
	border: 0;
	background: var(--core-lightbox-bg);
	color: var(--core-lightbox-text);
	overflow: hidden;
	overscroll-behavior: contain;
	/* swipes and drags must not select text: dragging a selection would
	   cancel the next swipe */
	-webkit-user-select: none;
	user-select: none;
}

.c-core-lightbox[open] {
	display: grid;
	grid-template-columns: var(--core-control-size) minmax(0, 1fr) var(--core-control-size);
	grid-template-rows: auto minmax(0, 1fr);
	grid-template-areas:
		"counter counter close"
		"previous figure next";
	gap: var(--core-space-s) var(--core-space-m);
	align-items: center;
}

.c-core-lightbox::backdrop {
	background: var(--core-lightbox-bg);
}

.c-core-lightbox__counter {
	grid-area: counter;
	margin: 0;
	color: var(--core-lightbox-muted);
	font-size: var(--core-font-size-meta);
	font-variant-numeric: tabular-nums;
}

/* Image and text stay together, centred; an image taller than the room
   shrinks (object-fit keeps its proportions). */
.c-core-lightbox__figure {
	grid-area: figure;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--core-space-s);
	height: 100%;
	min-height: 0;
	margin: 0;
	touch-action: pan-y pinch-zoom; /* horizontal swipes go to the script */
}

.c-core-lightbox__image {
	display: block;
	flex: 0 1 auto;
	width: 100%;
	height: auto;
	min-height: 0;
	object-fit: contain;
}

/* State: the next image is still loading */
.c-core-lightbox__image.is-loading {
	opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
	.c-core-lightbox__image {
		transition: opacity 150ms ease-out;
	}
}

.c-core-lightbox__caption {
	flex: none;
	max-width: var(--core-measure);
	margin-inline: auto;
	text-align: center;
}

.c-core-lightbox__meta {
	margin: 0;
	color: var(--core-lightbox-muted);
	font-size: var(--core-font-size-meta);
}

.c-core-lightbox__text {
	margin: 0;
}

/* a caption under a meta line keeps a little distance */
.c-core-lightbox__meta:not([hidden]) + .c-core-lightbox__text {
	margin-top: var(--core-space-xs);
}

.c-core-lightbox__caption[hidden],
.c-core-lightbox__meta[hidden],
.c-core-lightbox__text[hidden],
.c-core-lightbox__counter[hidden],
.c-core-lightbox__button[hidden] {
	display: none;
}

.c-core-lightbox__button {
	display: grid;
	place-items: center;
	width: var(--core-control-size);
	height: var(--core-control-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--core-lightbox-control);
	color: inherit;
	cursor: pointer;
}

.c-core-lightbox__button:hover {
	background: var(--core-lightbox-control-hover);
}

.c-core-lightbox__button:focus-visible {
	outline: 3px solid var(--core-lightbox-text);
	outline-offset: 2px;
}

.c-core-lightbox__button:disabled {
	opacity: 0.3;
	cursor: default;
}

.c-core-lightbox__button--close {
	grid-area: close;
	justify-self: end;
}

.c-core-lightbox__button--previous {
	grid-area: previous;
}

.c-core-lightbox__button--next {
	grid-area: next;
}

/* Phone: buttons below the image, where thumbs reach them */
@media (max-width: 40em) {
	.c-core-lightbox[open] {
		grid-template-columns: 1fr 1fr;
		grid-template-rows: auto minmax(0, 1fr) auto;
		grid-template-areas:
			"counter close"
			"figure figure"
			"previous next";
		padding: var(--core-space-s);
	}

	.c-core-lightbox__button--next {
		justify-self: end;
	}
}

/* ── src/css/utilities/_core-accent.css ── */

/* ==========================================================================
   UTILITIES — accent
   Generated by bin/build-css.php from src/Accent.php. Don't edit.

   An element with data-core-accent="<name>" and everything in it uses that
   colour. Accent::attributes($page) prints the attribute. Components that
   keep the accent in their own token declare it on the element as well:
   :root, [data-core-accent] { --plugin-color-accent: var(--core-color-accent); }
   ========================================================================== */

[data-core-accent="rose"] {
	--core-color-accent: var(--core-accent-rose);
	--core-color-accent-base: var(--core-accent-rose-base);
}

[data-core-accent="orange"] {
	--core-color-accent: var(--core-accent-orange);
	--core-color-accent-base: var(--core-accent-orange-base);
}

[data-core-accent="amber"] {
	--core-color-accent: var(--core-accent-amber);
	--core-color-accent-base: var(--core-accent-amber-base);
}

[data-core-accent="lime"] {
	--core-color-accent: var(--core-accent-lime);
	--core-color-accent-base: var(--core-accent-lime-base);
}

[data-core-accent="green"] {
	--core-color-accent: var(--core-accent-green);
	--core-color-accent-base: var(--core-accent-green-base);
}

[data-core-accent="teal"] {
	--core-color-accent: var(--core-accent-teal);
	--core-color-accent-base: var(--core-accent-teal-base);
}

[data-core-accent="cyan"] {
	--core-color-accent: var(--core-accent-cyan);
	--core-color-accent-base: var(--core-accent-cyan-base);
}

[data-core-accent="blue"] {
	--core-color-accent: var(--core-accent-blue);
	--core-color-accent-base: var(--core-accent-blue-base);
}

[data-core-accent="indigo"] {
	--core-color-accent: var(--core-accent-indigo);
	--core-color-accent-base: var(--core-accent-indigo-base);
}

[data-core-accent="purple"] {
	--core-color-accent: var(--core-accent-purple);
	--core-color-accent-base: var(--core-accent-purple-base);
}

[data-core-accent="fuchsia"] {
	--core-color-accent: var(--core-accent-fuchsia);
	--core-color-accent-base: var(--core-accent-fuchsia-base);
}

[data-core-accent="pink"] {
	--core-color-accent: var(--core-accent-pink);
	--core-color-accent-base: var(--core-accent-pink-base);
}
