/* docs page — same industrial system, content-first. No reveals, no motion:
   documentation loads settled. */

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 96px;
}

/* section nav — plain links, mono, like the header nav. A checkbox-hack toggle
   (zero JS) gives narrow viewports a real collapsed "on this page" control
   instead of 13 links dumped as wrapped text above the title; wide viewports
   unwrap the wrapper (display: contents) and the nav renders as the sidebar it
   always was. (A <details>/<summary> was tried first — browsers force a closed
   details' non-summary content to stay un-rendered even under display: contents,
   so it went invisible at desktop widths. A checkbox has no such native hiding.) */
.docs-nav-wrap { display: contents; }
.docs-nav-toggle-input, .docs-nav-toggle { display: none; }

.docs-nav {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--beam);
}
.docs-nav a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 6px 0 6px 16px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}
.docs-nav a:hover { color: var(--text); border-left-color: var(--beam-bright); }

/* content */
.docs-main h1 {
  font-size: clamp(30px, 4vw, 40px);
  margin-bottom: 12px;
}
.docs-intro {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 60ch;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--beam);
}
.docs-intro strong { color: var(--text); }

.docs-main section { padding: 40px 0; }
.docs-main section + section { border-top: 1px solid var(--beam); }

.docs-main h2 {
  font-size: 24px;
  margin-bottom: 14px;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.docs-main h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 26px 0 10px;
}
.docs-main p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 70ch;
  margin-bottom: 12px;
}
.docs-main p strong, .docs-main li strong { color: var(--text); font-weight: 600; }
.docs-main a { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.docs-main a:hover { color: var(--text); }

.docs-main ul, .docs-main ol {
  margin: 0 0 14px 20px;
  color: var(--text-dim);
  font-size: 15px;
  display: grid;
  gap: 8px;
  max-width: 68ch;
}

.docs-main .codeblock { margin: 14px 0 18px; }

/* definition tables: term | description */
.docs-table {
  width: 100%;
  border: 1px solid var(--beam);
  border-radius: var(--radius);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  margin: 14px 0 18px;
  background: var(--charcoal);
}
.docs-table td {
  padding: 13px 18px;
  font-size: 14px;
  color: var(--text-dim);
  vertical-align: top;
}
.docs-table tr + tr td { border-top: 1px solid var(--beam); }
.docs-table td:first-child {
  width: 190px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--cyan);
  white-space: nowrap;
}
.docs-table td:first-child code { font-family: var(--font-mono); }
.docs-note {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* verdict words keep the site's verdict colors */
.v-pass { color: var(--green); }
.v-warn { color: #f3cf5c; }
.v-block { color: var(--coral); }

@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }

  .docs-nav-wrap {
    display: block;
    border: 1px solid var(--beam);
    border-radius: var(--radius);
    background: var(--charcoal);
    margin-bottom: 8px;
  }
  .docs-nav-toggle-input { position: absolute; opacity: 0; pointer-events: none; }
  .docs-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    padding: 12px 16px;
    cursor: pointer;
  }
  .docs-nav-toggle::after { content: "+"; color: var(--text-faint); }
  .docs-nav-toggle-input:checked ~ .docs-nav-toggle::after { content: "\2212"; }
  .docs-nav-toggle-input:checked ~ .docs-nav-toggle { border-bottom: 1px solid var(--beam); }
  .docs-nav-toggle-input:focus-visible ~ .docs-nav-toggle { outline: 1px solid var(--cyan-dim); outline-offset: -1px; }

  .docs-nav {
    display: none;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 18px;
    border-left: 0;
    padding: 14px 16px 16px;
  }
  .docs-nav-toggle-input:checked ~ .docs-nav { display: flex; }
  .docs-nav a { border-left: 0; padding: 4px 0; margin-left: 0; }
  .docs-table td:first-child { width: 130px; white-space: normal; }
}
