/* Docs pages, rendered from docs/*.md by scripts/build-docs.sh. Tokens come from styles.css. */

.docs {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px;
  padding-block: 48px 72px; max-width: 1120px;
}

.docs-nav {
  position: sticky; top: 24px; align-self: start;
  display: flex; flex-direction: column; gap: 2px;
  border-left: 3px solid rgba(15, 61, 68, .15);
}
.docs-nav a {
  padding: 8px 14px; margin-left: -3px; border-left: 3px solid transparent;
  text-decoration: none; font-weight: 500; color: var(--muted);
}
.docs-nav a:hover { color: var(--teal); }
.docs-nav a[aria-current] { color: var(--teal); font-weight: 700; border-left-color: var(--accent); }

.nav-links a[aria-current] { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; text-decoration-thickness: 3px; }

.doc { max-width: 760px; font-size: 17px; line-height: 1.7; }
.doc h1 {
  font-family: var(--font-display); font-weight: 900; font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1; margin-bottom: 28px;
}
.doc h2, .doc h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; scroll-margin-top: 16px; }
.doc h2 { font-size: 28px; margin: 56px 0 16px; padding-top: 24px; border-top: 2px solid rgba(15, 61, 68, .12); }
.doc h3 { font-size: 21px; margin: 36px 0 12px; }
.doc h4 { font-size: 17px; margin: 28px 0 8px; }
.doc :is(h2, h3) a { text-decoration: none; color: inherit; }
.doc :is(h2, h3) a:hover::after { content: ' #'; color: var(--accent-ink); }
.doc p, .doc ul, .doc ol, .doc table, .doc pre, .doc blockquote { margin: 0 0 18px; }
.doc li + li { margin-top: 6px; }
.doc a { color: var(--teal); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.doc a:hover { color: var(--accent-ink); }

.doc code { font-family: var(--font-mono); font-size: .86em; }
.doc :not(pre) > code { background: rgba(15, 61, 68, .08); padding: 1px 6px; border-radius: 5px; }
.doc pre {
  background: var(--teal-deep); color: var(--cream);
  border-radius: 14px; padding: 18px 20px; overflow-x: auto;
  font-size: 14px; line-height: 1.65;
}
.doc pre code { font-size: inherit; }
/* pandoc's highlighting classes, in the site's palette */
.doc pre .co { color: rgba(246, 235, 210, .55); font-style: italic; }
.doc pre :is(.kw, .cf, .im, .bu) { color: var(--accent); }
.doc pre :is(.st, .ch, .ss, .vs, .sc) { color: var(--mint); }
.doc pre :is(.dv, .fl, .bn, .cn) { color: #F4B183; }
.doc pre :is(.dt, .fu, .at) { color: #E9D8A6; }
.doc pre a { color: inherit; text-decoration: none; }

.doc table { border-collapse: collapse; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid rgba(15, 61, 68, .15); }
.doc th { font-weight: 700; }
.doc thead tr:has(th:empty) { display: none; }

.doc blockquote { border-left: 3px solid var(--accent); padding-left: 18px; color: var(--muted); }

.doc-toc {
  background: var(--paper); border: 2px solid rgba(15, 61, 68, .12); border-radius: 14px;
  padding: 14px 20px; margin-bottom: 32px; font-size: 15px;
}
.doc-toc summary { cursor: pointer; font-weight: 700; }
.doc-toc ul { list-style: none; padding: 0; margin: 12px 0 4px; columns: 2; column-gap: 32px; }
.doc-toc ul ul { display: none; }
.doc-toc li { break-inside: avoid; margin: 0 0 6px; }
.doc-toc a { text-decoration: none; }

.doc-edit { margin-top: 56px; font-size: 15px; }
.doc-edit a { color: var(--muted); }

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 24px 56px; }
  .docs-nav {
    position: static; flex-direction: row; flex-wrap: wrap; gap: 4px;
    border-left: 0; border-bottom: 2px solid rgba(15, 61, 68, .12); padding-bottom: 12px;
  }
  .docs-nav a { margin: 0; border: 0; padding: 6px 10px; border-radius: 999px; }
  .docs-nav a[aria-current] { background: var(--teal); color: var(--cream); }
  .doc { font-size: 16px; }
  .doc-toc ul { columns: 1; }
  .doc pre { font-size: 13px; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
}
