/* The pages under /web/: the same wordpress.org tokens as the landing page,
   with a sidebar. */
@font-face {
	font-family: Inter;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url(../fonts/inter.woff2) format("woff2");
}

@font-face {
	font-family: "EB Garamond";
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url(../fonts/eb-garamond.woff2) format("woff2");
}

:root {

	/* warm greys in place of wordpress.org's cool ones, where the page is
	   paper: the surfaces, the rules and the quieter text */
	--warm-1: #e4ded4;
	--warm-2: #f6f3ee;
	--warm-ink-2: #625c53;
	--warm-dark: #1c1a17;
	--paper: #efe5d5;
	--rule: #dccfb9;
	--fingerboard: var(--paper);
	--blueberry: #3858e9;
	--blueberry-deep: #213fd4;
	--space-1: 8px;
	--space-2: 16px;
	--space-3: 24px;
	--space-4: 32px;
	--space-5: 48px;
	--space-6: 64px;
	--space-7: 96px;
	--charcoal-1: #1e1e1e;
	--charcoal-3: #40464d;
	--charcoal-4: #656a71;
	--charcoal-5: #979aa1;
	--grey-1: #d9d9d9;
	--grey-2: #f6f6f6;
	--white: #fff;
	--action: var(--blueberry);
	--action-hover: var(--blueberry-deep);
	--on-action: var(--white);
	--black: #000;
	--panel: #121212;
	--surface: #f6f0e6;
	--ink: var(--charcoal-1);
	--ink-2: var(--warm-ink-2);
	--line: var(--rule);
	--accent: var(--blueberry-deep);
	--serif: "EB Garamond", garamond, georgia, serif;
	--sans: inter, -apple-system, blinkmacsystemfont, "Segoe UI", helvetica, arial, sans-serif;
	--t: 0.2s;
	--gap: clamp(40px, 5vw, 60px);
	--section: clamp(60px, calc(5vw + 30px), 100px);
	--edge: clamp(20px, 5vw, 80px);
}

* {
	box-sizing: border-box;
}

html {
	font-family: var(--sans);
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-size: 16px;
	line-height: 1.875;
	-webkit-font-smoothing: antialiased;
	text-wrap: pretty;
}

a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

a:hover {
	text-decoration: none;
}

code {
	font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.875em;
	background: var(--surface);
	border: 1px solid var(--line);
	padding: 1px 5px;
	border-radius: 2px;
}

.wrap {
	max-width: 1160px;
	margin: 0 auto;
	padding: 0 var(--edge);
}

.skip {
	position: absolute;
	left: 16px;
	top: -200px;
	z-index: 20;
	background: var(--action);
	color: var(--on-action);
	padding: 10px 16px;
	border-radius: 2px;
	text-decoration: none;
}

.skip:focus {
	top: 12px;
}

/* the global bar: light, on the page's own ground, with the wordmark
   alone, Riff and nothing more; it scrolls away and the section bar
   under it stays. The strings are in the margin (neck.css). */
.nav {
	position: relative;
	z-index: 10;
	background: var(--paper);
	border-bottom: 1px solid var(--rule);
	color: var(--ink);
}

.nav .mark {
	order: 0;
}

.nav .wrap > nav {
	order: 2;
}

/* the wordmark and the sections on one row while they fit, the sections
   under the wordmark when they don't */
.nav .wrap {
	min-height: 72px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0 20px;
	padding-top: 8px;
	padding-bottom: 8px;
}

.mark {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	font-weight: 600;
	text-decoration: none;
	color: var(--ink);
	font-size: 1.375rem;
	letter-spacing: -0.01em;
}

.mark svg {
	flex: none;
	display: block;
	width: auto;
	height: 30px;
}

.nav nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 clamp(16px, 3vw, 28px);
}

/* each a 44px target, and never broken across two lines */
.nav nav a {
	color: var(--ink);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 24px;
	padding: 10px 0;
	white-space: nowrap;
	opacity: 0.85;
	transition: opacity var(--t);
}

.nav nav a:hover,
.nav nav a[aria-current] {
	opacity: 1;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.nav nav a:focus-visible {
	outline: 1.5px solid var(--accent);
	outline-offset: 2px;
	opacity: 1;
}

.btn {
	appearance: none;
	border: 1px solid var(--action);
	background: var(--action);
	color: var(--on-action);
	border-radius: 2px;
	padding: 7px 12px;
	display: inline-flex;
	align-items: center;
	font-weight: 600;
	text-decoration: none;
	font-size: 0.875rem;
	line-height: 1.714;
	transition: background-color var(--t), border-color var(--t);
}

.btn:hover {
	background: var(--action-hover);
	border-color: var(--action-hover);
	color: var(--on-action);
}

.btn:focus-visible {
	box-shadow: inset 0 0 0 3px var(--white);
	outline: 1.5px solid var(--charcoal-1);
	outline-offset: -1.5px;
}

/* marginalia, as wordpress.org sets it: a band of dots before the footer, a
   record cropped into the margin on a wide screen */
main,
.layout {
	position: relative;
	z-index: 1;
}

footer {
	background: var(--warm-dark);
	color: #a39d93;
	padding: var(--space-5) 0;
	font-size: 0.875rem;
	line-height: 1.714;
	margin-top: var(--space-7);
	position: relative;
	z-index: 1;
}

footer .wrap {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-4) 28px;
	justify-content: space-between;
	align-items: flex-start;
}

footer p {
	margin: 0;
}

footer a {
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--white);
}

/* the footer's links in their groups, as wordpress.org's foot has them */
footer nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) var(--space-6);
}

footer .foot-label {
	margin-bottom: var(--space-1);
	color: #a39d93;
}

footer .foot-group ul {
	display: grid;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* type */
h1,
h2 {
	font-family: var(--serif);
	font-weight: 400;
	margin: 0;
	letter-spacing: 0;
	text-wrap: balance;
	color: var(--ink);
}

h1 {
	font-size: clamp(40px, 5vw, 50px);
	line-height: 1.2;
}

main h2 {
	font-size: clamp(26px, 3vw, 30px);
	line-height: 1.3;
	margin: var(--space-5) 0 var(--space-2);
}

.lede {
	margin: var(--space-2) 0 0;
	font-size: 1.25rem;
	line-height: 1.7;
	color: var(--charcoal-3);
	max-width: 36rem;
}

.fine {
	font-size: 0.875rem;
	line-height: 1.714;
	color: var(--ink-2);
}


/* the page: sidebar left, article right */
.layout {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: var(--gap);
	padding-top: var(--section);
	align-items: start;
}

.layout > * {
	min-width: 0;
}

main p {
	max-width: 40rem;
}

.side {
	order: -1;
	font-size: 0.875rem;
	line-height: 1.714;
}


.side h2 {
	font-family: var(--sans);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ink-2);
	margin: 20px 0 6px;
}

.side ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.side a {
	display: block;
	color: var(--ink);
	text-decoration: none;
	padding: 3px 10px;
	margin-left: -10px;
	border-radius: 2px;
}

.side a:hover {
	text-decoration: underline;
}

.side a[aria-current] {
	background: var(--surface);
	color: var(--accent);
	font-weight: 600;
}

figure {
	margin: 32px 0 0;
	padding: 32px;
	background: var(--surface);
	border-radius: 2px;
	display: grid;
	justify-items: center;
	gap: 16px;
}

figcaption {
	font-size: 0.875rem;
	line-height: 1.714;
	color: var(--ink-2);
	text-align: center;
	max-width: 36rem;
	text-wrap: balance;
}

.device {
	display: block;
	width: min(300px, 100%);
	border-radius: 2px;
	border: 1px solid var(--line);
	overflow: hidden;
}

.device img {
	display: block;
	width: 100%;
	height: auto;
}

.desk {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
	border: 1px solid var(--line);
}

.where {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 14px;
}

.where li {
	min-width: 0;
}

.where pre {
	margin: 4px 0 0;
	padding: 10px 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 2px;
	overflow: auto;
	font-size: 0.8125rem;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.where pre code {
	background: none;
	border: 0;
	padding: 0;
	font-size: inherit;
}

.pager {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
	display: flex;
	justify-content: space-between;
	gap: 20px;
}

.pager a {
	display: grid;
	gap: 2px;
	text-decoration: none;
}

.pager .pager-dir {
	color: var(--ink-2);
	font-size: 0.8125rem;
}

.pager .pager-name {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pager a[rel="prev"] .pager-dir::before {
	content: "← ";
}

.pager a[rel="next"] .pager-dir::after {
	content: " →";
}

.pager a[rel="next"] {
	margin-left: auto;
	text-align: right;
}

/* the index of them all */
.index {
	padding-top: var(--section);
}

.groups {
	margin-top: var(--gap);
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--gap);
}

.groups h2 {
	font-family: var(--sans);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	margin: 0 0 10px;
}

.groups ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.groups li {
	display: grid;
	gap: 0;
	line-height: 1.6;
}

.groups li span {
	color: var(--ink-2);
	font-size: 0.875rem;
	line-height: 1.714;
}

@media (max-width: 900px) {

	.layout {
		grid-template-columns: 1fr;
	}

	.side {
		order: 0;
		border-top: 1px solid var(--line);
		padding-top: 24px;
	}

	.groups {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {

	figure {
		padding: 20px;
	}
}

/* ---- the guide */

/* one column, numbered steps */
.guide {
	max-width: 760px;
	padding-top: var(--section);
}

.guide h1 {
	margin-bottom: 0;
}

.guide .lede {
	max-width: none;
}

.guide h2 {
	margin-top: var(--space-6);
}

.guide p {
	max-width: none;
}

.guide ol {
	margin: 16px 0 0;
	padding-left: 1.4em;
}

.guide li {
	margin: 0 0 8px;
}

.guide li::marker {
	color: var(--ink-2);
}

.guide code {
	white-space: nowrap;
}

.guide kbd {
	font-family: var(--sans);
	font-size: 0.9375em;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 2px;
	padding: 1px 6px;
}

.guide figure {
	margin-top: var(--space-4);
}

.guide .fine {
	margin-top: var(--space-2);
}

.with-cover {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
	margin-top: 16px;
}

.with-cover img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 2px;
}

.with-cover p {
	margin: 0;
}

@media (max-width: 640px) {

	.with-cover {
		grid-template-columns: 1fr;
	}

	.with-cover img {
		width: 160px;
	}
}

.aside {
	margin: 24px 0 0;
	padding: 16px 20px;
	background: var(--surface);
	border-radius: 2px;
	font-size: 0.9375rem;
	line-height: 1.7;
}

.cta {
	margin-top: 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
	align-items: center;
}

.cta .btn {
	padding: 14px 32px;
	font-size: 1rem;
	line-height: 1.3;
}

.btn.outline {
	background: transparent;
	color: var(--accent);
	border-color: currentcolor;
}

.btn.outline:hover {
	background: var(--action);
	border-color: var(--action);
	color: var(--on-action);
}

/* ---- the download page */

/* one column, as wordpress.org/download is laid out */
.dl {
	max-width: 760px;
	padding-top: var(--section);
}

.dl h1 {
	margin-bottom: 0;
}

.dl .lede {
	max-width: none;
}

.dl h2 {
	margin-top: var(--space-6);
}

.dl p {
	max-width: none;
}

.dl ol,
.dl ul {
	margin: 16px 0 0;
	padding-left: 1.4em;
}

.dl li {
	margin: 0 0 8px;
}

.dl li::marker {
	color: var(--ink-2);
}

.dl code {
	white-space: nowrap;
}

.dl kbd {
	font-family: var(--sans);
	font-size: 0.9375em;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 2px;
	padding: 1px 6px;
}

.shelf {
	list-style: none;
	margin: 28px 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	max-width: 34rem;
}

.shelf li {
	aspect-ratio: 1;
	border-radius: 2px;
	overflow: hidden;
	background: var(--surface);
}

.shelf img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* the download, as wordpress.org/download sets it: the button and its
   fine print on the left, what it needs on the right, in one grey box
   straight under the heading */
.get {
	margin-top: var(--space-5);
	padding: var(--space-5);
	background: var(--surface);
	border-radius: 2px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: var(--space-3) var(--space-6);
	align-items: start;
}

.get-main .fine {
	max-width: 34rem;
}

.get-needs {
	margin: 0;
	display: grid;
	gap: 8px;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.get-needs div {
	display: grid;
	grid-template-columns: 7rem auto;
	gap: 12px;
}

.get-needs dt {
	color: var(--ink-2);
}

.get-needs dd {
	margin: 0;
}

.get .btn {
	padding: 14px 32px;
	font-size: 1.125rem;
	line-height: 1.3;
}

.get .fine {
	margin: var(--space-2) 0 0;
}

.links {
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	font-size: 0.9375rem;
}

.dl .req,
.req {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 6px;
}

.req li {
	display: grid;
	grid-template-columns: 9rem 1fr;
	gap: 16px;
}

.req li span:first-child {
	color: var(--ink-2);
}

@media (max-width: 640px) {

	.get {
		padding: 20px;
		grid-template-columns: minmax(0, 1fr);
	}

	.req li {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

/* ---- the hooks reference, as developer.wordpress.org's code reference
   sets it: Inter headings, IBM Plex Mono for code, the syntax colours from
   its titles, and its code tables */

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url(../fonts/ibm-plex-mono.woff2) format("woff2");
}

@font-face {
	font-family: "IBM Plex Mono";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url(../fonts/ibm-plex-mono-600.woff2) format("woff2");
}

:root {
	--mono: "IBM Plex Mono", monospace;
	--charcoal-2: #23282d;
	--syntax-grey: #646970;
	--syntax-red: #d63638;
	--syntax-amber: #9a5b00;
	--code-bg: #f8f6f2;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* the section bar under the global one */
.local-nav {
	position: sticky;
	top: 0;
	z-index: 9;
	background: var(--paper);
	color: var(--ink);
	font-size: 0.875rem;
	border-bottom: 1px solid var(--rule);
}

.local-nav .wrap {
	min-height: 56px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 20px;
}

.local-nav a {
	color: var(--warm-ink-2);
	text-decoration: none;
	padding: 4px 8px;
	border-radius: 2px;
}

.local-nav a:hover {
	color: var(--ink);
	text-decoration: underline;
}

.neck-live {
	display: block;
	overflow: visible;
	touch-action: none;
	cursor: pointer;
}

.neck-live svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* the chord held while strumming, quietly, beside the strings */
.neck-chord {
	order: 1;
	flex: none;
	min-width: 2.5em;
	margin: 0 0 0 -40px;
	color: var(--ink-2);
	font: 600 13px/1 var(--sans);
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

/* only once the strings have been asked to sound, in the gap before the menu */
.neck-mute {
	order: 1;
	flex: none;
	width: 24px;
	height: 24px;
	margin: 0 20px 0 -44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink-2);
	font: 12px/24px var(--sans);
	cursor: pointer;
}

.neck-mute[aria-pressed="true"] {
	opacity: 0.45;
}

.neck-mute:focus-visible {
	outline: 2px solid var(--accent);
}

.local-nav a[aria-current] {
	color: var(--ink);
	text-decoration: underline;
	text-underline-offset: 6px;
}

/* the section's own name is a title, not a link to underline: the page
   it marks is named by its heading */
.local-nav .local-title[aria-current] {
	text-decoration: none;
}

.local-nav a:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 1.5px var(--accent);
}

.local-nav .local-title {
	flex: none;
	color: var(--ink);
	font-size: 1rem;
	font-weight: 600;
	margin-left: -8px;
}

/* beside the section's name while there is room, under it when there is
   not, and scrolled sideways rather than wrapped; the auto margin sets it
   at the right only while it fits, so nothing is pushed out of reach */
.local-nav nav {
	flex: 1 1 20rem;
	min-width: 0;
	display: flex;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
}

/* text-wrap on every li would set them wrapping again: a label stays whole */
.local-nav li,
.crumbs li {
	white-space: nowrap;
	text-wrap: nowrap;
}

.local-nav ul {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.local-nav nav > ul {
	margin-left: auto;
	padding: 10px 0;
	gap: var(--space-2);
}

/* a group: its name, quiet, then its pages, a rule between groups */
.local-nav .local-group {
	display: flex;
	align-items: center;
}

.local-nav nav > ul > li + li {
	border-left: 1px solid var(--rule);
	padding-left: var(--space-1);
}

.local-nav .local-label {
	color: var(--ink-2);
	font-size: 0.8125rem;
	padding: 4px 4px 4px 0;
}

main h2[id] {
	scroll-margin-top: 80px;
}

.local-nav nav a[aria-current] {
	text-decoration: underline;
	text-underline-offset: 6px;
}

.crumbs {
	font-size: 0.875rem;
	line-height: 1.714;
	position: relative;
	z-index: 1;
}

.crumbs .wrap {
	padding-top: 18px;
	padding-bottom: 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.crumbs nav {
	min-width: 0;
	overflow-x: auto;
	white-space: nowrap;
}

.crumbs ol {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* a step with no page of its own, such as Reference, in the links' grey */
.crumbs li {
	color: var(--charcoal-4);
}

.crumbs li[aria-current] {
	color: var(--ink);
}

.crumbs li:not(:last-child)::after {
	content: "/";
	color: var(--grey-1);
	margin: 0 10px;
}

.crumbs a {
	color: var(--charcoal-4);
	text-decoration: none;
}

.crumbs a:hover {
	text-decoration: underline;
}

.hook-search input {
	width: 232px;
	max-width: 100%;
	font: inherit;
	font-size: 0.875rem;
	padding: 8px 16px;
	border: 1px solid var(--charcoal-5);
	border-radius: 2px;
	background: var(--white);
	color: var(--ink);
}

.hook-search input:focus-visible {
	outline: 1.5px solid var(--accent);
	outline-offset: -1.5px;
	border-color: var(--action);
}

.reference {
	padding-top: 20px;
}

/* under the breadcrumbs, a page starts close to them, as on wordpress.org */
.crumbs + main,
.crumbs + .layout {
	padding-top: 20px;
}

/* a top-level page has no breadcrumbs, so its title gets the room they took */
.local-nav + main {
	padding-top: var(--space-6);
}

/* the reference in the site's own type: its titles and sections in the
   heading face, as every other page's are; code titles and hook names keep
   Inter and monospace */
.reference h1,
.reference h2,
.reference h3 {
	color: var(--ink);
	text-wrap: balance;
}

.reference h1,
.reference h2 {
	font-family: var(--serif);
	font-weight: 400;
}

.reference h3 {
	font-family: var(--sans);
}

.reference h1 {
	font-size: clamp(40px, 5vw, 50px);
	line-height: 1.2;
	margin: 0 0 20px;
}

.reference h2 {
	font-size: 28px;
	line-height: 1.25;
	margin: 0 0 16px;
}

.reference h3 {
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	margin: 24px 0 12px;
}

.reference p {
	max-width: none;
}

.reference code {
	font-family: var(--mono);
	font-size: 0.875rem;
	background: var(--grey-2);
	border: 0;
	border-radius: 2px;
	padding: 4px 6px;
}

/* the title: the call, monospace, in the code reference's colours */
.reference .code-title {
	font-family: var(--mono);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.73;
	margin-bottom: 40px;
	overflow-wrap: anywhere;
}

.code-title .hook-func {
	color: var(--syntax-grey);
}

.code-title .arg-type {
	color: var(--syntax-red);
}

.code-title .arg-name {
	color: var(--syntax-amber);
}

.is-toc-heading {
	scroll-margin-top: 80px;
}

.is-toc-heading a {
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.is-toc-heading a::after {
	content: "#";
	color: var(--accent);
	font-weight: 400;
	opacity: 0;
	transition: opacity var(--t);
}

.is-toc-heading a:hover::after,
.is-toc-heading a:focus-visible::after {
	opacity: 1;
}

.is-toc-heading:target {
	border-left: 2px solid var(--accent);
	padding-left: 8px;
}

/* the article, with "In this article" beside it on a wide screen */
.with-toc {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 60px;
	align-items: start;
}

.entry {
	grid-row: 1;
	min-width: 0;
}

.entry > section + section {
	margin-top: 50px;
}

.entry p {
	margin: 0 0 16px;
}

.toc {
	grid-row: 1;
	grid-column: 2;
	position: sticky;
	top: 140px;
	font-size: 0.875rem;
	line-height: 1.6;
}

.toc-box {
	border: 1px solid var(--grey-1);
	border-radius: 2px;
}

.toc-box summary {
	padding: 15px 20px;
	list-style: none;
	cursor: default;
	pointer-events: none;
}

.toc-box summary::-webkit-details-marker {
	display: none;
}

.toc-box ul {
	list-style: none;
	margin: 0;
	padding: 0 20px 15px;
}

.toc ul ul {
	padding: 0 0 0 14px;
}

.toc li {
	margin: 5px 0;
	color: var(--charcoal-4);
}

.toc a {
	color: inherit;
	text-decoration: none;
}

.toc a:hover {
	text-decoration: underline;
}

.toc .to-top {
	margin: 16px 0 0;
}

.toc .to-top a {
	color: var(--accent);
}

/* parameters */
.parameters dl {
	margin: 0;
}

.parameters dt {
	display: flex;
	align-items: center;
	gap: 10px;
}

.parameters dt > code,
.param-hash li > code {
	background: none;
	padding: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--charcoal-1);
}

.parameters .type {
	font-family: var(--mono);
	font-size: 0.875rem;
	color: var(--syntax-red);
}

.parameters dd {
	margin: 0;
}

.parameters dd:not(:last-child) {
	padding-bottom: 20px;
}

.param-hash {
	list-style: none;
	margin: 10px 0 0;
	padding-inline-start: 10px;
	border-left: 1px solid var(--grey-1);
}

.param-hash li:not(:last-child) {
	padding-bottom: 20px;
}

.param-hash .type {
	margin-inline-start: 5px;
}

/* code blocks: light, bordered, with line numbers for source */
.wp-block-code {
	margin: 0 0 16px;
	padding: 20px;
	background: var(--code-bg);
	border: 1px solid var(--grey-1);
	border-radius: 2px;
	overflow: auto;
	font-family: var(--mono);
	font-size: 0.875rem;
	line-height: 1.5;
	tab-size: 4;
	color: #101517;
}

.wp-block-code code {
	display: block;
	background: none;
	padding: 0;
	font-size: inherit;
	white-space: pre;
}

.wp-block-code .row {
	display: block;
}

.wp-block-code .n {
	display: inline-block;
	min-width: 3.2em;
	margin-left: -0.4em;
	padding-right: 0.8em;
	text-align: right;
	color: #5c6370;
	user-select: none;
}

.dot-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 10px;
	align-items: center;
	font-size: 0.875rem;
}

.dot-links > :not(:last-child)::after {
	content: "·";
	margin-left: 10px;
	color: var(--ink);
}

.dot-links code {
	color: var(--charcoal-4);
	background: none;
	padding: 0;
}

/* the code reference's tables: bold heads, a rule under each row */
.code-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 20px;
}

.code-table th,
.code-table td {
	text-align: left;
	vertical-align: top;
	font-size: 0.9375rem;
	line-height: 1.5;
	padding: 10px 16px 10px 0;
	border-bottom: 1px solid var(--grey-1);
	width: 50%;
}

.code-table th {
	font-weight: 700;
}

/* three columns, as a schema has: the name wide enough for a nested path,
   the type narrow, the description the rest */
.code-table tr > :first-child:nth-last-child(3) {
	width: 32%;
}

.code-table tr > :nth-child(2):nth-last-child(2) {
	width: 16%;
}

.code-table td > .type {
	white-space: nowrap;
}

.code-table tr > :nth-child(3):last-child {
	width: auto;
}

.changelog .code-table th:first-child,
.changelog .code-table td:first-child {
	width: 8%;
	min-width: 5rem;
	white-space: nowrap;
	padding-right: 32px;
}

.code-table td a {
	display: block;
	overflow-wrap: anywhere;
}

.code-table td:first-child code {
	display: block;
	width: fit-content;
	margin-top: 2px;
	background: none;
	padding: 0;
	color: var(--ink);
	overflow-wrap: anywhere;
}

/* the path to a nested property, quieter than the property itself */
.code-table td:first-child .path {
	color: var(--charcoal-5);
}

/* the index */
.hooks-index .intro {
	max-width: 40rem;
	margin: 0 0 20px;
	font-size: 1.125rem;
	line-height: 1.7;
	color: var(--charcoal-3);
}

.hook-group h2 {
	margin-top: 50px;
}

.hook-group[hidden],
.hook-list li[hidden] {
	display: none;
}

.hook-list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--grey-1);
}

.hook-list li {
	padding: 20px 0;
	border-bottom: 1px solid var(--rule);
}

.hook-list .hook-name {
	font-family: var(--mono);
	font-size: 1.125rem;
	font-weight: 600;
}

.hook-list p {
	margin: 4px 0 0;
}

.hook-list .meta {
	font-size: 0.875rem;
	color: var(--charcoal-4);
}

.hook-list .meta code {
	background: none;
	padding: 0;
	color: inherit;
}

@media (max-width: 1100px) {

	.with-toc {
		grid-template-columns: minmax(0, 1fr);
		gap: 30px;
	}

	.toc {
		position: static;
		grid-column: 1;
	}

	.toc-box summary {
		cursor: pointer;
		pointer-events: auto;
		display: flex;
		justify-content: space-between;
	}

	.toc-box summary::after {
		content: "";
		width: 8px;
		height: 8px;
		margin: 4px 4px 0 0;
		border-right: 1.5px solid var(--charcoal-4);
		border-bottom: 1.5px solid var(--charcoal-4);
		transform: rotate(45deg);
	}

	.toc-box[open] summary::after {
		transform: rotate(-135deg);
		margin-top: 8px;
	}

	.toc .to-top {
		display: none;
	}

	.entry {
		grid-row: 2;
	}
}

@media (max-width: 640px) {

	.reference h1 {
		font-size: 36px;
	}

	.reference .code-title {
		font-size: 20px;
	}

	.member,
	.is-toc-heading {
		scroll-margin-top: 110px;
	}

	.code-table th,
	.code-table td {
		display: block;
		width: 100%;
		padding: 5px 0;
		border: 0;
	}

	.code-table tr {
		display: block;
		padding: 5px 0;
		border-bottom: 1px solid var(--grey-1);
	}

	.code-table thead {
		display: none;
	}
}

/* the JavaScript reference: one section per member of window.riff */
.member {
	scroll-margin-top: 80px;
	padding-top: 30px;
	border-top: 1px solid var(--grey-1);
}

.entry > .member + .member {
	margin-top: 30px;
}

.reference .member-title {
	font-size: 20px;
	margin: 0 0 12px;
}

.member-title a {
	color: var(--ink);
	text-decoration: none;
}

.member-title a:hover {
	text-decoration: underline;
}

.reference h4 {
	font-size: 1rem;
	font-weight: 600;
	margin: 20px 0 8px;
}

.parameters .required {
	color: var(--charcoal-4);
	font-size: 0.875rem;
}

.member .returns .type,
.member .parameters p .type {
	font-family: var(--mono);
	font-size: 0.875rem;
	color: var(--syntax-red);
}

.reference h2 code {
	background: none;
	padding: 0;
	font-size: inherit;
	font-weight: 600;
}

.member .dot-links {
	margin-top: 20px;
}

/* the handbooks: a doc from the repository as a page, its sections apart as
   the reference's are and its lists spaced as the download page's */
.handbook > h2:not(:first-child) {
	margin-top: 50px;
}

.handbook ul,
.handbook ol {
	margin: 0 0 16px;
	padding-left: 1.4em;
}

.handbook li {
	margin: 0 0 8px;
}

.handbook li::marker {
	color: var(--ink-2);
}

.handbook .code-table {
	margin: 0 0 16px;
}

/* a long selector or path in the running text breaks rather than widen the
   page */
.handbook :not(pre) > code {
	overflow-wrap: anywhere;
}

/* ---- the pages: a title, then the article with "In this article" beside it,
   as wordpress.org's documentation is laid out */
.doc {
	max-width: 1160px;
	padding-top: 24px;
}

.doc .lede {
	max-width: 40rem;
	text-wrap: pretty;
}

.doc .with-toc {
	margin-top: 40px;
}

.doc .entry {
	max-width: 760px;
}

.doc .entry h2 {
	margin-top: 48px;
}

.doc .entry > h2:first-child {
	margin-top: 0;
}

.toc-edit {
	margin: 10px 0 0;
}

.toc-edit a {
	color: var(--charcoal-4);
}

/* the guide's sections are numbered as a tracklist is: the number in mono,
   before the title and before each entry of the contents */
.guide .entry {
	counter-reset: step;
}

.guide .entry h2::before {
	counter-increment: step;
	content: counter(step, decimal-leading-zero);
	display: block;
	margin-bottom: 8px;
	font-family: var(--mono);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--accent);
}

.guide .toc-box > ul {
	counter-reset: track;
}

.guide .toc-box > ul > li::before {
	counter-increment: track;
	content: counter(track, decimal-leading-zero);
	margin-right: 10px;
	font-family: var(--mono);
	font-size: 0.75rem;
	color: var(--charcoal-4);
}

/* what is content can be selected and copied; what is the page's chrome
   cannot, so select-all, a double click or a strum across the strings
   picks up words and not the bar, the buttons or the pictures */
.nav,
.local-nav,
.btn,
.go,
.neck-live,
.neck-mute,
.neck-chord,
.device,
.desk,
.shot,
.fan,
.crate,
.shelf,
figure img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

/* selected words in blueberry: a pale wash under dark ink on the paper,
   and the deep shade under light text on a dark band */
::selection {
	background: #c9d3fa;
	color: var(--charcoal-1);
}

.alt ::selection,
footer ::selection {
	background: var(--blueberry-deep);
	color: #fff;
}

/* no lone last word on a line: headings balanced, running text shaped so
   its last line is never one word (the deploy also binds the last two) */
h1,
h2,
h3,
h4 {
	text-wrap: balance;
}

p,
li,
dd,
dt,
figcaption,
blockquote {
	text-wrap: pretty;
}

/* the missing page: the bar, the neck and the footer as on every page,
   and the heading set as large as the landing page's, since it is the
   only thing on the page */
.lost {
	min-height: calc(100vh - 72px - 120px);
	padding-top: var(--space-7);
}

.lost h1 {
	font-size: clamp(56px, 8vw, 96px);
	line-height: 1;
	letter-spacing: -0.015em;
}

.lost .lede {
	margin-top: var(--space-3);
}

.lost .cta {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
	align-items: center;
	margin-top: var(--space-4);
}

.lost .go {
	font-weight: 600;
	text-underline-offset: 4px;
}
