/*
 * Groove Site — documentation. Loads on pages in a docs tree (and in the
 * editor, for the callouts).
 *
 * Calmer than the landing page: the same paper, ink, mono labels and 2px
 * rules, but no scroll gradients and no reveals. Every colour is a preset
 * variable, so dark mode comes from global.css.
 *
 * Layout, wide to narrow:
 *   >= 64rem  on-page TOC | article (one column where there is no TOC)
 *   <  64rem  one column; the TOC is a bar pinned to the top, naming the
 *             section being read, that opens the list as a popover
 * The guides themselves are links in the header (blocks/site-nav).
 *
 * No content-visibility here: skipped sections have estimated heights, and
 * a jump to #heading would land in the wrong place as they resolve.
 */

.gs-docs {
	--gs-docs-top: calc(var(--gs-header-h) + var(--gs-rule));
	--gs-docs-side-w: 16rem;
	--gs-docs-measure: 70ch;
	--gs-docs-gap: var(--wp--preset--spacing--50);

	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: var(--gs-docs-gap);
	/* Full width, then capped: the page is a flex column (global.css), where
	   auto margins alone would shrink it to its content. */
	inline-size: 100%;
	max-inline-size: var(--wp--style--global--wide-size, 84rem);
	margin-inline: auto;
	padding-inline: var(--wp--preset--spacing--gutter);
}

.admin-bar .gs-docs {
	--gs-docs-top: calc(var(--gs-header-h) + var(--gs-rule) + var(--wp-admin--admin-bar--height, 32px));
}

/* Narrow, the header scrolls away (global.css); only the admin bar may stay. */
@media (max-width: 47.99rem) {
	.gs-docs {
		--gs-docs-top: 0px;
	}

	.admin-bar .gs-docs {
		--gs-docs-top: var(--wp-admin--admin-bar--height, 46px);
	}
}

@media (max-width: 600px) {
	.admin-bar .gs-docs {
		--gs-docs-top: 0px;
	}
}

.gs-docs > *,
.gs-docs__main > * {
	margin-block: 0;
}

/* Pinned to the top: left in place, one after the footer (docs.js's live
   region) adds a strip of page below it. */
.gs-visually-hidden {
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Shared: small mono uppercase labels, as in the source's spec lists. */
.gs-docs :is(.gs-docs-toc__label, .gs-docs-toc__heading, .gs-docs-pager__label, .gs-docs-pager__updated),
.gs-callout__label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---------------------------------------------------------------- sidebar */

.gs-docs:not(:has(.gs-docs-toc)) > .gs-docs__sidebar {
	display: none;
}

.gs-docs__sidebar > * {
	margin-block: 0;
}

/*
 * Narrow: the sidebar is the TOC bar, full-bleed paper tint pinned to the
 * top while the article scrolls under it. Tint, not a rule, sets it apart.
 * Headings land clear of it.
 */
@media (max-width: 63.99rem) {
	.gs-docs {
		--gs-docs-bar-h: 3rem;
		/*
		 * The bar's (and its open panel's) tint. Surface alone all but
		 * vanishes on light paper, whose grain darkens the page to about the
		 * surface colour; a touch of ink sets it off in both schemes.
		 */
		--gs-docs-bar-bg: color-mix(in srgb, var(--wp--preset--color--surface), var(--wp--preset--color--ink) 4%);
	}

	/* The bar hangs straight off the header: no block gap between them. */
	.wp-site-blocks > .gs-docs:has(.gs-docs-toc) {
		margin-block-start: 0;
	}

	.gs-docs__sidebar {
		position: sticky;
		inset-block-start: var(--gs-docs-top);
		z-index: 20;
		margin-inline: calc(var(--wp--preset--spacing--gutter) * -1);
		padding-inline: var(--wp--preset--spacing--gutter);
		background-color: var(--gs-docs-bar-bg);
		anchor-name: --gs-docs-bar;
	}

	.gs-docs__content [id] {
		scroll-margin-top: calc(var(--gs-docs-top) + var(--gs-docs-bar-h) + 1.25rem);
	}
}

@media (min-width: 64rem) {
	.gs-docs {
		grid-template-columns: var(--gs-docs-side-w) minmax(0, 1fr);
	}

	.gs-docs__sidebar {
		position: sticky;
		inset-block-start: var(--gs-docs-top);
		align-self: start;
		max-block-size: calc(100dvh - var(--gs-docs-top));
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		padding-block: var(--wp--preset--spacing--40);
		padding-inline-end: 1.25rem;
	}

	/* A page too short for a TOC (the docs index) gets no empty column. */
	.gs-docs:not(:has(.gs-docs-toc)) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ------------------------------------------------------------- article */

.gs-docs__main {
	display: grid;
	grid-template-columns: minmax(0, var(--gs-docs-measure));
	align-content: start;
	padding-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.gs-docs__main > * {
	grid-column: 1;
}

.gs-docs__main > * + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

.gs-docs__main > .gs-docs__content {
	margin-block-start: var(--wp--preset--spacing--40);
}

.gs-docs__main > .gs-docs-pager {
	margin-block-start: var(--wp--preset--spacing--60);
}

.gs-docs__title {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 900;
	letter-spacing: -0.035em;
	line-height: 1.02;
}

.gs-docs__lede p {
	margin: 0;
	font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.01em;
}

/* ------------------------------------------------------------------ TOC */

.gs-docs-toc {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.35;
}

.gs-docs-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * The current section: ink, and a small square in the gutter. The square is
 * the cue that is not colour (though it carries some; see below); it sits
 * outside the text, so marking a link while scrolling never rewraps it (a
 * weight change would).
 */
.gs-docs-toc a {
	position: relative;
	display: block;
	padding: 0.3rem 0 0.3rem 0.875rem;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.gs-docs-toc a:hover {
	color: var(--wp--preset--color--ink);
}

/* Set by docs.js as the reader scrolls. */
.gs-docs-toc a[aria-current="true"] {
	color: var(--wp--preset--color--ink);
}

.gs-docs-toc a[aria-current="true"]::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	inset-block-start: calc(0.3rem + 0.675em - 0.1875rem);
	inline-size: 0.375rem;
	block-size: 0.375rem;
	/*
	 * The colour the header rule's tip has reached: the rule's run (--gs-rise)
	 * drawn 100 times the square's width and slid along with page scroll, so
	 * the square shows one point of it. It rides gs-sweep, as the logotype
	 * does. Without scroll timelines, or with reduced motion, it holds red.
	 */
	background: linear-gradient(to right, var(--gs-rise)) 20% 50% / 10000% 100% no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: scroll()) {
		.gs-docs-toc a[aria-current="true"]::before {
			animation: gs-sweep linear both;
			animation-timeline: scroll(root);
		}
	}
}

@media (forced-colors: active) {
	.gs-docs-toc a[aria-current="true"]::before {
		background: CanvasText;
	}
}

@media (pointer: coarse) {
	.gs-docs-toc a {
		padding-block: 0.7rem;
	}

	.gs-docs-toc a[aria-current="true"]::before {
		inset-block-start: calc(0.7rem + 0.675em - 0.1875rem);
	}
}

.gs-docs-toc__heading {
	display: none;
}

.gs-docs-toc .gs-chevron {
	transition: rotate 0.2s var(--gs-ease);
}

.gs-docs-toc:has(:popover-open) .gs-chevron {
	rotate: 180deg;
}

/*
 * Narrow: the bar's button names the list and the section being read
 * (docs.js), and opens the list as a panel under the bar.
 */
@media (max-width: 63.99rem) {
	.gs-docs-toc__toggle {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		inline-size: 100%;
		min-block-size: var(--gs-docs-bar-h);
		padding: 0;
		border: 0;
		background: none;
		color: var(--wp--preset--color--ink);
		font: inherit;
		text-align: start;
		cursor: pointer;
	}

	.gs-docs-toc__label {
		flex: none;
		color: var(--wp--preset--color--muted);
	}

	.gs-docs-toc__current {
		flex: 1;
		min-inline-size: 0;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		font-weight: 500;
	}

	.gs-docs-toc__toggle .gs-chevron {
		margin-inline-start: auto;
	}

	/*
	 * The open panel: the bar's tint, so bar and list read as one sheet
	 * dropped over the dimmed article. It scrolls on its own.
	 */
	.gs-docs-toc__list[popover] {
		inline-size: auto;
		max-block-size: 70dvh;
		margin: 0;
		padding: 0.5rem var(--wp--preset--spacing--gutter) 1rem;
		border: 0;
		background: var(--gs-docs-bar-bg);
		color: inherit;
		box-shadow: var(--gs-panel-shadow);
		transition: opacity 0.2s var(--gs-ease);
		overflow-y: auto;
		overscroll-behavior: contain;
		/* Where anchors are unknown: a sheet from the bottom edge. */
		inset: auto 0 0;
	}

	@starting-style {
		.gs-docs-toc__list:popover-open {
			opacity: 0;
		}
	}

	.gs-docs-toc__list a {
		font-size: var(--wp--preset--font-size--medium);
	}

	@supports (anchor-name: --a) {
		.gs-docs-toc__list[popover] {
			inset: auto;
			position-anchor: --gs-docs-bar;
			position-area: bottom span-all;
			justify-self: stretch;
			max-block-size: min(70dvh, calc(100% - 1rem));
		}
	}
}

/*
 * Wide: a column under a label. The list is a popover (for narrow screens),
 * so the UA's popover styles are undone; author styles outrank them.
 */
@media (min-width: 64rem) {
	.gs-docs-toc__toggle {
		display: none;
	}

	.gs-docs-toc__heading {
		display: block;
		margin: 0 0 0.75rem;
		color: var(--wp--preset--color--muted);
	}

	.gs-docs-toc__list[popover] {
		position: static;
		inset: auto;
		display: block;
		inline-size: auto;
		block-size: auto;
		margin: 0;
		padding: 0;
		border: 0;
		background: none;
		color: inherit;
		overflow: visible;
	}
}

/* -------------------------------------------------------------- content */

.gs-docs__content {
	line-height: 1.65;
}

.gs-docs__content a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.gs-docs__content a:hover {
	text-decoration-thickness: 2px;
}

/* Headings. inc/docs.php wraps h2/h3 in .gs-heading with their permalink. */
.gs-docs__content :is(h2, h3) {
	margin: 0;
}

.gs-docs__content h2 {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.gs-docs__content h3 {
	font-size: 1.1875rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

/* A top-level h2 opens a section: space and weight mark it, not a rule. */
.gs-docs__content > :is(h2, .gs-heading--h2) {
	margin-block-start: var(--wp--preset--spacing--60);
}

.gs-docs__content > :is(h3, .gs-heading--h3) {
	margin-block-start: 2.25rem;
}

.gs-docs__content > :is(h2, h3, .gs-heading):first-child {
	margin-block-start: 0;
}

.gs-docs__content > :is(h2, h3, h4, .gs-heading) + * {
	margin-block-start: 0.75rem;
}

.gs-heading {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
}

.gs-heading > :is(h2, h3) {
	min-inline-size: 0;
}

.gs-heading__anchor {
	flex: none;
	display: inline-grid;
	place-items: center;
	min-inline-size: 1.5rem;
	min-block-size: 1.5rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	opacity: 0;
	transition: opacity 0.2s var(--gs-ease);
}

.gs-heading:hover .gs-heading__anchor,
.gs-heading:has(:target) .gs-heading__anchor,
.gs-heading__anchor:focus-visible {
	opacity: 1;
}

.gs-heading__anchor:hover {
	color: var(--wp--preset--color--ink);
}

@media (hover: none) {
	.gs-heading__anchor {
		opacity: 1; /* muted colour is quiet enough; 0.6 fell to 2.6:1 */
	}
}

/* Lists. */
.gs-docs__content :is(ul, ol) {
	padding-inline-start: 1.25em;
}

.gs-docs__content li + li {
	margin-block-start: 0.4em;
}

.gs-docs__content li::marker {
	color: var(--wp--preset--color--muted);
}

/* Checklists: Markdown task lists, as the docs importer writes them. */
.gs-docs__content .gs-checklist {
	padding-inline-start: 0;
	list-style: none;
}

.gs-docs__content .gs-checklist > li {
	position: relative;
	padding-inline-start: 1.75em;
}

.gs-docs__content .gs-checklist > li::before {
	content: "";
	position: absolute;
	inset-block-start: 0.3em;
	inset-inline-start: 0;
	inline-size: 1em;
	block-size: 1em;
	border: 1.5px solid currentColor;
}

.gs-docs__content .gs-checklist > li.is-checked::before {
	background: currentColor;
}

.gs-docs__content kbd {
	padding: 0.05em 0.35em;
	border: 1px solid var(--wp--preset--color--line);
	border-block-end-width: 2px;
	font-size: 0.85em;
}

/* Code: scroll inside the block, never widen the page. */
.gs-docs__content :is(.wp-block-code, .wp-block-preformatted) {
	max-inline-size: 100%;
	overflow-x: auto;
	tab-size: 2;
	scrollbar-width: thin;
}

.gs-docs__content .wp-block-code code {
	white-space: pre;
	overflow-wrap: normal;
}

.gs-docs__content .wp-block-preformatted {
	padding: 1.25rem;
	background: var(--wp--preset--color--surface);
	white-space: pre;
	line-height: 1.6;
}

/* Copy button, added by docs.js. */
.gs-code {
	position: relative;
}

.gs-code > pre {
	margin: 0;
}

/*
 * The button appears over the code's top corner while the pointer is on the
 * block or focus is in it, on its own patch of the code's fill, so it hides
 * the line it covers only while it is shown. Without hover (touch) it is
 * always shown, and the code gets a strip above it instead: long lines
 * scroll horizontally underneath an absolutely placed button.
 */
.gs-copy {
	position: absolute;
	inset-block-start: 0.375rem;
	inset-inline-end: 0.375rem;
	min-block-size: 2rem;
	padding: 0.25rem 0.625rem;
	border: 0;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s var(--gs-ease), color 0.2s var(--gs-ease);
}

.gs-code:is(:hover, :focus-within) .gs-copy {
	opacity: 1;
}

.gs-copy:hover {
	color: var(--wp--preset--color--ink);
}

@media (hover: none) {
	.gs-docs__content .gs-code > pre {
		padding-block-start: 3rem;
	}

	.gs-copy {
		opacity: 1;
	}
}

@media (pointer: coarse) {
	.gs-copy {
		min-block-size: 2.75rem;
	}
}

/* Tables: the figure scrolls on narrow screens. */
.gs-docs__content .wp-block-table {
	max-inline-size: 100%;
	overflow-x: auto;
	scrollbar-width: thin;
}

.gs-docs__content .wp-block-table table {
	inline-size: 100%;
	border-collapse: collapse;
}

/* A chip broken mid-word is unreadable; the table scrolls instead. */
.gs-docs__content .wp-block-table td > code {
	white-space: nowrap;
	overflow-wrap: normal;
}

.gs-docs__content .wp-block-table :is(th, td) {
	padding: 0.7rem 1rem 0.7rem 0;
	border: 0;
	border-block-end: 1px solid var(--wp--preset--color--line);
	text-align: start;
	vertical-align: top;
}

.gs-docs__content .wp-block-table th {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-wrap: balance;
}

.gs-docs__content .wp-block-table thead {
	border: 0;
}

/* ------------------------------------------------------------- callouts */

.is-style-gs-note,
.is-style-gs-warning {
	padding: 1.25rem 1.5rem;
	background-color: var(--wp--preset--color--surface);
}

.is-style-gs-warning {
	border: var(--gs-rule) solid var(--wp--preset--color--ink);
	background-color: transparent;
}

.wp-block-group:is(.is-style-gs-note, .is-style-gs-warning) > * {
	margin-block: 0;
}

.wp-block-group:is(.is-style-gs-note, .is-style-gs-warning) > * + * {
	margin-block-start: 0.5rem;
}

.gs-callout__label {
	display: flex;
	align-items: center;
	gap: 0.6em;
}

/* The one spot of signal colour; the label says "Warning" either way. */
.is-style-gs-warning .gs-callout__label::before {
	content: "";
	inline-size: 0.6em;
	block-size: 0.6em;
	background-color: var(--wp--preset--color--accent-1);
}

/* -------------------------------------------------------- docs index */

/*
 * The guides (blocks/docs-guides): a numbered list in reading order. Type,
 * not boxes, marks them as links: a large title ending in an arrow, which
 * on hover or focus fills with the signal gradient while the arrow nudges
 * on (rules shared with the pager, below). The whole row takes the pointer
 * (the title's link is stretched over it).
 *
 * Two classes deep, to outrank the article's list and heading rules
 * (.gs-docs__content li + li, .gs-docs__content h2).
 */
.gs-docs__content .gs-guides {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
	list-style: none;
	counter-reset: gs-guide;
}

.gs-guides > .gs-guide {
	position: relative;
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr);
	align-items: baseline;
	row-gap: 0.35rem;
	margin: 0;
	counter-increment: gs-guide;
}

/* 01, 02: the order, in the mono of the site's other labels. */
.gs-guide::before {
	content: counter(gs-guide, decimal-leading-zero);
	grid-row: 1;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
}

.gs-guide > * {
	grid-column: 2;
	margin: 0;
}

.gs-guides .gs-guide__title {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.gs-guide__link {
	text-decoration: none;
}

/*
 * The mono arrow of the site's other calls to action (the landing page's,
 * the pager's labels), a little over half the title's size: a sign after
 * the words, not another word. Raised to sit at the title's middle.
 */
.gs-guide__link .gs-guide__arrow {
	margin-inline-start: 0.4em;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.6em;
	font-weight: 700;
	vertical-align: 0.2em;
}

/* The whole row is the link's hit area; the ring goes round the row. */
.gs-guide__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.gs-guide__link:focus-visible {
	outline: none;
}

.gs-guide:has(.gs-guide__link:focus-visible) {
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 0.5rem;
}

.gs-guide__summary {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/*
 * The image beside the introduction (blocks/docs-art: the photograph or the
 * featured image, per page). Narrow, a band above the title; wide, a column
 * beside the introduction as tall as it, with the text column narrowed from
 * the reading measure to make room. The image fills its box (absolutely
 * placed), so the text sets the height, never the image.
 */
.gs-docs__main > .gs-docs-art {
	position: relative;
	grid-row: 1;
	aspect-ratio: 5 / 2;
	margin-block: 0 var(--wp--preset--spacing--40);
	overflow: hidden;
	background-color: var(--wp--preset--color--surface);
}

.gs-docs-art img {
	position: absolute;
	inset: 0;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

/* The photograph's average while it loads; the crop keeps the paper's curl
   in view. */
.gs-docs__main > .gs-docs-art--photo {
	background-color: #985a8d;
}

.gs-docs-art--photo img {
	object-position: 50% 70%;
}

@media (min-width: 64rem) {
	.gs-docs__main:has(> .gs-docs-art) {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
		column-gap: var(--gs-docs-gap);
	}

	.gs-docs__main > .gs-docs-art {
		grid-column: 2;
		grid-row: 1 / span 3;
		aspect-ratio: auto;
		min-block-size: 18rem;
		margin-block: 0;
	}
}

/* ---------------------------------------------------------------- pager */

.gs-docs-pager__updated {
	margin: 0 0 1.5rem;
	color: var(--wp--preset--color--muted);
}

.gs-docs-pager__nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--30);
}

.gs-docs-pager__link {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	text-decoration: none;
}

.gs-docs-pager__link--next {
	grid-column: 2;
	text-align: end;
}

.gs-docs-pager__label {
	color: var(--wp--preset--color--muted);
}

.gs-docs-pager__title {
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

/*
 * The arrows carry the colour the page's scroll has reached, as the TOC
 * marker does (the same --gs-rise run, slid by gs-sweep); by the time the
 * pager is in view that is the violet end. Red where it cannot move.
 */
.gs-docs-pager__arrow,
.gs-guide__arrow {
	display: inline-block;
	background: linear-gradient(to right, var(--gs-rise)) 20% 50% / 10000% 100% no-repeat;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	transition: translate 0.3s var(--gs-ease);
}

/*
 * Pointing at a link wipes its title from ink into the signal gradient, the
 * way the arrow points (the header rule's fill, in miniature), and nudges
 * the arrow. The title is painted by one background, clipped to the text:
 * the signal colours and ink side by side, each the title's width, slid
 * from the ink half to the colour half. One layer, not ink over a gradient:
 * text-clipped layers are masked one by one, so a gradient below would
 * show at the glyph edges at rest (plainly so on 1x screens).
 */
@supports (background-clip: text) or (-webkit-background-clip: text) {
	.gs-docs-pager__title,
	.gs-guide__link {
		--gs-wipe-rest: 100% 0;
		--gs-wipe-lit: 0 0;
		background: linear-gradient(to right, var(--wp--preset--color--accent-1), var(--wp--preset--color--accent-2) 25%, var(--wp--preset--color--accent-3) 50%, var(--wp--preset--color--ink) 50%) var(--gs-wipe-rest) / 200% 100% no-repeat;
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
		transition: background-position 0.4s var(--gs-ease);
	}

	/* Previous points left: ink on the left half, colour comes in from the right. */
	.gs-docs-pager__link--prev .gs-docs-pager__title {
		--gs-wipe-rest: 0 0;
		--gs-wipe-lit: 100% 0;
		background-image: linear-gradient(to right, var(--wp--preset--color--ink) 50%, var(--wp--preset--color--accent-1) 50%, var(--wp--preset--color--accent-2) 75%, var(--wp--preset--color--accent-3));
	}

	.gs-docs-pager__link:is(:hover, :focus-visible) .gs-docs-pager__title,
	.gs-guide:is(:hover, :has(.gs-guide__link:focus-visible)) .gs-guide__link {
		background-position: var(--gs-wipe-lit);
	}
}

.gs-docs-pager__link--prev:is(:hover, :focus-visible) .gs-docs-pager__arrow {
	translate: -0.25rem 0;
}

.gs-docs-pager__link--next:is(:hover, :focus-visible) .gs-docs-pager__arrow,
.gs-guide:is(:hover, :has(.gs-guide__link:focus-visible)) .gs-guide__arrow {
	translate: 0.25rem 0;
}

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: scroll()) {
		.gs-docs-pager__arrow {
			animation: gs-sweep linear both;
			animation-timeline: scroll(root);
		}
	}
}

@media (forced-colors: active) {
	.gs-docs-pager__arrow,
	.gs-docs-pager__title,
	.gs-guide__arrow,
	.gs-guide__link {
		background: none;
		color: inherit;
	}

	.gs-docs-pager__link:is(:hover, :focus-visible) .gs-docs-pager__title,
	.gs-guide:is(:hover, :has(.gs-guide__link:focus-visible)) .gs-guide__link {
		color: inherit;
		text-decoration: underline;
	}
}

/* ------------------------------------------------------- editor + print */

.gs-docs-placeholder {
	margin: 0;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--x-small);
}

@media print {
	.gs-docs__sidebar,
	.gs-docs-toc,
	.gs-docs-pager__nav,
	.gs-heading__anchor,
	.gs-copy {
		display: none;
	}

	.gs-docs,
	.gs-docs__main {
		display: block;
	}
}
