/* The documentation section (docs/docs-site-spec.md section 12). The site's style.css is loaded
   first and supplies the colour tokens; this file only adds layout, the navigation, code blocks
   and tables. No script, no font file, no image. */
.docs-layout { display: block; padding-top: 1.5rem; }
@media (min-width: 60em) {
  .docs-layout { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2.5rem; align-items: start; max-width: 80rem; }
  .docs-nav { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.docs-nav { margin-bottom: 1.5rem; }
.docs-nav details { border-bottom: 1px solid var(--border); padding: 0.25rem 0; }
.docs-nav summary { cursor: pointer; font-weight: 600; padding: 0.6rem 0.25rem; min-height: 2.75rem; display: flex; align-items: center; }
.docs-nav summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 0.25rem; }
.docs-nav ul { list-style: none; margin: 0 0 0.5rem; padding: 0 0 0 0.5rem; }
.docs-nav li a { display: block; padding: 0.4rem 0.25rem; min-height: 2rem; text-decoration: none; }
.docs-nav li a:hover { text-decoration: underline; }
.docs-nav a[aria-current="page"] { font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; }

main { min-width: 0; }
.crumbs { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.doc { max-width: 75ch; }
.doc h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.doc h2 { margin-top: 2.5rem; }
.doc h3 { margin-top: 1.75rem; }
.doc h4, .doc h5 { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.doc li > p:first-child { margin-top: 0; }
.doc .anchor { margin-left: 0.4rem; font-weight: 400; text-decoration: none; opacity: 0; }
.doc :is(h2, h3, h4, h5):hover .anchor, .doc .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .doc .anchor { opacity: 0.6; } }
.doc blockquote { margin: 0 0 1rem; padding: 0.25rem 1rem; border-left: 0.3rem solid var(--border); color: var(--muted); }
.doc hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* code: scrolls on its own, never wraps silently */
.doc pre { white-space: pre; overflow-wrap: normal; overflow-x: auto; max-width: 100%; margin: 0 0 1rem; }
.doc pre:focus-visible, .table-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.doc :not(pre) > code { background: var(--surface-alt); border-radius: 0.25rem; padding: 0.05em 0.3em; overflow-wrap: anywhere; }

/* tables scroll in their own wrapper, not the page */
.table-wrap { overflow-x: auto; max-width: 100%; margin: 0 0 1rem; }
.table-wrap table { margin: 0; min-width: 100%; width: max-content; }
.doc .align-right { text-align: right; }
.doc .align-center { text-align: center; }
.doc th, .doc td { max-width: 40rem; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.75rem 1rem; margin: 0 0 1.5rem; max-width: 75ch; }
.toc > ul, .toc details > ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.toc ul ul { margin: 0; padding-left: 1.25rem; }
.toc-title, .toc summary { font-weight: 600; margin: 0; cursor: pointer; }
.toc summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.toc li { margin: 0.15rem 0; }

.sources { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; max-width: 75ch; }
.pager a { padding: 0.6rem 0; min-height: 2.75rem; }
.docs-foot p { margin: 0 0 0.5rem; }
