/* The /docs pages. Colours, fonts and links come from /site.css (--bg --surface --line --text
   --muted --faint --accent, with a dark-mode swap); this file only lays out the docs. */

/* The site's body is one narrow column; docs need room for a sidebar and "On this page". */
body.docs-page {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  background: var(--bg);
  color: var(--text);
}
body.docs-page > header { margin-bottom: 2.5rem; }
body.docs-page > footer { margin-top: 5rem; }

.docs { display: block; }
.docs-nav, .docs-toc { display: none; }   /* phones get the menu at the top instead */
.docs-main { min-width: 0; }

@media (min-width: 56rem) {
  .docs { display: grid; grid-template-columns: 13rem minmax(0, 44rem); column-gap: 3rem; }
  .docs-nav { display: block; }
  .docs-menu { display: none; }
}
@media (min-width: 76rem) {
  .docs { grid-template-columns: 13rem minmax(0, 44rem) 12rem; justify-content: space-between; }
  .docs-toc { display: block; }
}

/* Sidebar: sections of links; the current page gets a line in the text colour. */
.docs-nav, .docs-toc {
  position: sticky; top: 1.5rem; align-self: start;
  max-height: calc(100vh - 3rem); overflow-y: auto;
}
.docs-nav-section + .docs-nav-section { margin-top: 1.75rem; }
.docs-nav-label {
  margin: 0 0 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.8125rem; font-weight: 700;
}
.docs-nav ul, .docs-menu ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.docs-nav a, .docs-menu nav a {
  display: block; margin-left: -1px; padding: 0.3rem 0 0.3rem 0.875rem;
  border-left: 1px solid transparent;
  font-size: 0.9375rem; line-height: 1.4; color: var(--muted); text-decoration: none;
}
.docs-nav a:hover, .docs-menu nav a:hover { color: var(--text); }
.docs-nav a[aria-current="page"], .docs-menu nav a[aria-current="page"] {
  border-left-color: var(--text); color: var(--text); font-weight: 600;
}

/* A quiet pill for a project's status, like "experimental". */
.docs-status {
  display: inline-block; margin-left: 0.375rem; padding: 0 0.4rem;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.6875rem; font-weight: 400;
  line-height: 1.5; vertical-align: 0.1em; color: var(--muted);
}

/* Phones: the same links behind a disclosure at the top of the page. */
.docs-menu { margin: 0 0 2rem; border: 1px solid var(--line); border-radius: 6px; }
.docs-menu summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.625rem 0.875rem; cursor: pointer; list-style: none;
  font-size: 0.9375rem; font-weight: 600;
}
.docs-menu summary::-webkit-details-marker { display: none; }
.docs-menu summary::after { content: "+"; font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--muted); }
.docs-menu[open] summary::after { content: "\2212"; }
.docs-menu-label { flex: none; }
.docs-menu-current {   /* one line, so the summary stays one row tall */
  min-width: 0; margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 400; color: var(--muted);
}
.docs-menu nav { padding: 0.25rem 0.875rem 1rem; }

/* On this page */
.docs-toc { font-size: 0.875rem; }
.docs-toc-label { margin: 0 0 0.5rem; font-weight: 600; }
.docs-toc ul { margin: 0; padding: 0; list-style: none; }
.docs-toc li { margin: 0.35rem 0; line-height: 1.4; }
.docs-toc .docs-toc-h3 { padding-left: 0.875rem; }
.docs-toc a { color: var(--muted); text-decoration: none; }
.docs-toc a:hover { color: var(--text); }

/* The article */
.docs-content { overflow-wrap: break-word; }
.docs-eyebrow {
  margin: 0 0 0.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.8125rem; color: var(--muted);
}
.docs-content h1 { margin: 0 0 1.5rem; font-size: 2.25rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.docs-content h2 { margin: 2.75rem 0 0.75rem; font-size: 1.375rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.docs-content h3 { margin: 2rem 0 0.5rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.docs-content :is(h2, h3) { scroll-margin-top: 1.5rem; }
.docs-content p, .docs-content ul, .docs-content ol, .docs-content pre,
.docs-content blockquote, .docs-content table { margin: 0 0 1.125rem; }
.docs-content ul, .docs-content ol { padding-left: 1.375rem; }
.docs-content li { margin: 0.3rem 0; }
.docs-content li::marker { color: var(--muted); }
.docs-content strong { font-weight: 600; }

/* A heading's link to itself, shown on hover. */
.docs-anchor { margin-left: 0.4em; color: var(--faint); text-decoration: none; opacity: 0; }
.docs-content :is(h2, h3):hover .docs-anchor, .docs-anchor:focus { opacity: 1; }

.docs-content code {
  padding: 0.1em 0.3em; border-radius: 4px; background: var(--surface);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.875em;
}
.docs-content pre {
  overflow-x: auto; padding: 0.875rem 1rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  font-size: 0.8125rem; line-height: 1.6;
}
.docs-content pre code { padding: 0; background: none; font-size: inherit; }

/* Callouts: a Markdown "> " quote is context worth stopping for. */
.docs-content blockquote { padding: 0.125rem 0 0.125rem 1rem; border-left: 3px solid var(--faint); color: var(--muted); }
.docs-content blockquote > :last-child { margin-bottom: 0; }
.docs-content blockquote strong { color: var(--text); }

.docs-content table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.9375rem; }
.docs-content th, .docs-content td { padding: 0.5rem 1rem 0.5rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.docs-content hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }

/* Previous and next */
.docs-pager { display: flex; gap: 1rem; margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.docs-pager a {
  flex: 1 1 0; max-width: 50%; padding: 0.75rem 1rem;
  border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 600;
}
.docs-pager a:hover { border-color: var(--muted); }
.docs-pager span { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.docs-pager-prev span::before { content: "\2190\00a0"; }
.docs-pager-next { margin-left: auto; text-align: right; }
.docs-pager-next span::after { content: "\00a0\2192"; }
@media (max-width: 30rem) {
  .docs-content pre { padding: 0.75rem 0.875rem; font-size: 0.75rem; }   /* a few more characters before it scrolls */
  .docs-pager { flex-direction: column; }
  .docs-pager a { max-width: none; }
  .docs-pager-next { margin-left: 0; }
}
