/* Docs layout. Everything visual — colour, type, code blocks — comes from
   styles.css; this file only adds the two-column reading layout and the tables,
   so the docs cannot drift away from the marketing pages. */

.doc {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  padding: 40px 0 88px;
}

/* Sidebar ------------------------------------------------------------- */

.doc__side {
  position: sticky;
  top: 88px;
  font-size: 14px;
}
.doc__side h2 {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 8px;
}
.doc__side h2:first-child { margin-top: 0; }
.doc__side ul { list-style: none; margin: 0; padding: 0; }
.doc__side a {
  display: block;
  padding: 5px 10px;
  margin-left: -10px;
  border-radius: 7px;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 1.4;
}
.doc__side a:hover { background: var(--band); color: var(--ink); }

/* Body ---------------------------------------------------------------- */

.doc__body { min-width: 0; }           /* lets wide code scroll instead of pushing */
.doc__body > section { padding-top: 28px; scroll-margin-top: 84px; }
.doc__body > section + section { border-top: 1px solid var(--line-soft); margin-top: 40px; }

.doc__body h1 { font-size: 34px; line-height: 1.18; margin: 0 0 12px; letter-spacing: -0.02em; }
.doc__body h2 { font-size: 22px; margin: 0 0 10px; letter-spacing: -0.01em; }
.doc__body h3 { font-size: 16px; margin: 26px 0 8px; }
.doc__body p  { color: var(--ink-2); line-height: 1.65; margin: 0 0 14px; max-width: 68ch; }
.doc__body ul { color: var(--ink-2); line-height: 1.65; max-width: 68ch; padding-left: 20px; }
.doc__body li { margin-bottom: 6px; }
.doc__lede { font-size: 17px; color: var(--muted); }

.doc__body code {
  background: var(--band);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 5px;
}

/* A code block here is always visible — the marketing page's tabbed variant
   hides all but one, which is wrong for a reference you read top to bottom. */
.doc-code {
  display: block;
  background: var(--code-bg);
  border-radius: 12px;
  margin: 0 0 18px;
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 12.9px;
  line-height: 1.72;
  color: var(--code-text);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.doc-code code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Tables of fields. They are wide by nature, so the scroll lives on a wrapper
   and never on the page. */
.doc-tablewrap { overflow-x: auto; margin: 0 0 20px; }
.doc-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 540px;
  font-size: 14px;
}
.doc-table th, .doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--line-soft);
}
.doc-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.doc-table td { color: var(--ink-2); line-height: 1.55; }
.doc-table td:first-child { white-space: nowrap; color: var(--ink); }

.doc-note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 0 0 20px;
  max-width: 68ch;
}
.doc-note p:last-child { margin-bottom: 0; }
.doc-note strong { color: var(--ink); }

@media (max-width: 900px) {
  /* Below this the sidebar becomes a contents list at the top: a sticky column
     on a narrow screen eats the width the code samples need. */
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 26px; }
  .doc__side {
    position: static;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 30px;
  }
  .doc__side ul { columns: 2; column-gap: 20px; }
  .doc__side a { margin-left: 0; padding-left: 0; }
  .doc__body h1 { font-size: 28px; }
  .doc-code { font-size: 12.2px; padding: 15px 16px; }
}
