/* The documentation pages. Tokens and base styles come from landing.css. */

.top nav a[aria-current] { color: var(--text); }

.doc-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 200px;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 16px 64px;
}

.doc-menu { align-self: start; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.doc-menu summary { display: none; cursor: pointer; font-weight: 600; }
.doc-menu h2, .doc-toc h2 { margin: 20px 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.doc-menu h2:first-child { margin-top: 0; }
.doc-menu ul, .doc-toc ul { margin: 0; padding: 0; list-style: none; }
.doc-menu a, .doc-toc a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--muted); font-size: 14px; text-decoration: none; }
.doc-menu a:hover, .doc-toc a:hover { color: var(--text); }
.doc-menu a[aria-current] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--text); font-weight: 600; }
.doc-toc { align-self: start; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.doc-toc h2 { margin-top: 0; }

.doc-main { min-width: 0; margin: 0; padding: 0; max-width: 78ch; }
.doc-main h1 { max-width: none; margin: 0 0 16px; font-size: 2rem; line-height: 1.2; text-align: left; }
.doc-main h2 { margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); font-size: 1.5rem; line-height: 1.3; }
.doc-main h3 { margin: 28px 0 8px; font-size: 1.15rem; }
.doc-main h4 { margin: 20px 0 6px; font-size: 1rem; }
.doc-main :is(h2, h3, h4) { scroll-margin-top: 16px; }
.doc-main .anchor { margin-left: 8px; color: var(--muted); font-weight: 400; text-decoration: none; opacity: 0; }
.doc-main :is(h2, h3, h4):hover .anchor, .doc-main .anchor:focus-visible { opacity: 1; }
.doc-main p, .doc-main li { overflow-wrap: anywhere; }
.doc-main ul, .doc-main ol { padding-left: 24px; }
.doc-main li { margin: 4px 0; }
.doc-main hr { margin: 32px 0; border: 0; border-top: 1px solid var(--border); }
.doc-main blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--accent); background: var(--surface); color: var(--muted); }
.doc-main :not(pre) > code { padding: 2px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); font-size: 0.875em; }
.doc-main pre code { font-size: 13px; }

/* A fenced block: the language and the copy button in a bar, the code under it. Shiki colours through variables, one set per scheme. */
.code { display: grid; grid-template-columns: 1fr auto; align-items: center; margin: 16px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg); overflow: hidden; }
.code pre { grid-column: 1 / -1; margin: 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; }
.code-lang { padding: 6px 12px; color: var(--muted); font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.copy { margin: 4px 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; }
.copy:hover { border-color: var(--accent); }
.copy:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.shiki span { color: var(--shiki-light); }
@media (prefers-color-scheme: dark) { .shiki span { color: var(--shiki-dark); } }

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

.table-wrap { margin: 16px 0; overflow-x: auto; }
.doc-main table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-main th, .doc-main td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.doc-main th { background: var(--surface); }

.edit { margin-top: 48px; font-size: 14px; }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; }
.pager a { display: block; min-width: 40%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.pager a:hover { border-color: var(--accent); }
.pager a[rel='next'] { margin-left: auto; text-align: right; }
.pager span { display: block; color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
    .doc-layout { grid-template-columns: 220px minmax(0, 1fr); }
    .doc-toc { display: none; }
}

@media (max-width: 760px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .doc-menu { position: static; max-height: none; border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
    .doc-menu summary { display: block; }
}
