/* The documentation's own layer over site.css: a sidebar, a reading column, tables and code.
   Same tokens, same fonts - the docs are the landing's neighbour, not a second site. */

/* Instant jumps, not smooth ones. site.css asks html for smooth scrolling, and Chrome then
   performs the on-load anchor jump as an animation - which the layout shift from the web fonts
   arriving cancels at its first frame, leaving a support link like /ru/docs/qql/#errors at the
   top of the page. Seen on the stand, reproducibly, before this line existed (2026-08-31).
   An anchor that lands beats a scroll that glides. */
html { scroll-behavior: auto; }

.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 40px 0 72px; }

.doc-nav { position: sticky; top: 88px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.doc-nav a { padding: 7px 12px; border-radius: 8px; color: var(--text-soft); text-decoration: none; }
.doc-nav a:hover { color: var(--text); background: color-mix(in srgb, var(--card) 70%, transparent); }
.doc-nav a[aria-current="page"] { color: var(--copper); font-weight: 600; background: color-mix(in srgb, var(--copper) 9%, transparent); }

.doc-main { min-width: 0; max-width: 760px; }
.doc-main h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.2; letter-spacing: -0.01em; }
.doc-lead { margin: 0 0 6px; font-size: 17px; color: var(--text-soft); }
.doc-updated { margin: 0 0 26px; font: 400 12.5px var(--font-mono); color: var(--text-faint); }

.doc-toc { display: flex; flex-direction: column; gap: 4px; margin: 0 0 30px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 14.5px; }
.doc-toc span { font: 600 11px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--copper); margin-bottom: 4px; }
.doc-toc a { color: var(--text-soft); text-decoration: none; }
.doc-toc a:hover { color: var(--copper); }

.doc-body { font-size: 15.5px; }
.doc-body h2 { margin: 40px 0 12px; font-size: 22px; line-height: 1.3; }
.doc-body h3 { margin: 28px 0 10px; font-size: 17px; }
.doc-body h4 { margin: 22px 0 8px; font-size: 15.5px; }
.doc-body p { margin: 0 0 14px; color: var(--text); }
.doc-body ul, .doc-body ol { margin: 0 0 14px; padding-left: 24px; }
.doc-body li { margin: 4px 0; }
.doc-body a { color: var(--copper); text-decoration: none; }
.doc-body a:hover { text-decoration: underline; }

.doc-body .anchor { margin-left: 8px; color: var(--text-faint); opacity: 0; font-weight: 400; text-decoration: none; }
.doc-body h2:hover .anchor, .doc-body h3:hover .anchor, .doc-body h4:hover .anchor { opacity: 1; }
.doc-body h2, .doc-body h3, .doc-body h4 { scroll-margin-top: 84px; }

/* No ligatures in code: this is a reference, and a reader who sees the pretty ≠ has not been
   shown the != they must actually type. */
.doc-body code, .doc-body pre { font-variant-ligatures: none; }
.doc-body code { font: 500 13.5px var(--font-mono); padding: 1.5px 6px; border-radius: 6px; background: color-mix(in srgb, var(--line) 45%, transparent); font-variant-ligatures: none; }
.doc-body pre { margin: 0 0 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow-x: auto; }
.doc-body pre code { padding: 0; background: none; font-size: 13.5px; line-height: 1.6; }

.doc-table { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; background: var(--card); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-table th { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 600 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; }
.doc-table td { padding: 9px 14px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: none; }
/* Wrapped, not nowrap: a quoted error message is a sentence, and nowrap made it shove the
   neighbouring column into a one-word-per-line ribbon. Operators are short and lose nothing. */
.doc-table td code { white-space: pre-wrap; }

@media (max-width: 860px) {
  .doc-layout { grid-template-columns: 1fr; gap: 20px; }
  .doc-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
