/* The documentation page. Everything it shares with the home page -- palette,
   type, nav, buttons -- comes from ../styles.css; this is only the reading
   layout: a contents column and a measure that stays readable. */

.docs-page { overflow-x: hidden; }

.docs {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 28px 96px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 56px;
}

/* ---------------------------------------------------------------- contents */
.toc details { position: sticky; top: 96px; }
.toc summary {
  list-style: none;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  cursor: default;
}
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  line-height: 1.4;
}
.toc a:hover { background: var(--surface); color: var(--ink); }

/* ------------------------------------------------------------------- text */
.doc { min-width: 0; max-width: 760px; }
.doc .eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.doc h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 16px; }
.doc .lede { color: var(--ink-2); font-size: 18px; margin-bottom: 8px; }
.doc section { padding-top: 40px; scroll-margin-top: 80px; }
.doc section + section { border-top: 1px solid var(--line); margin-top: 40px; }
.doc h2 { font-size: 26px; margin-bottom: 14px; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; color: var(--ink); }
.doc p { color: var(--ink-2); margin-bottom: 12px; max-width: 70ch; }
.doc p b, .doc li b, .doc td b { color: var(--ink); font-weight: 600; }
.doc ul, .doc ol { color: var(--ink-2); padding-left: 22px; margin: 0 0 12px; max-width: 70ch; }
.doc li { margin-bottom: 6px; }
.doc ol.steps li { margin-bottom: 10px; }
.doc code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: .8em;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}
.glyph {
  display: inline-grid;
  place-items: center;
  width: 1.3em;
  height: 1.3em;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font-size: .8em;
  font-weight: 600;
}
.badge {
  font-size: .78em;
  padding: 0 5px;
  border: 1px solid var(--warn);
  border-radius: 4px;
  color: var(--warn);
  white-space: nowrap;
}

figure {
  margin: 16px 0 20px;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: var(--surface);
}

.note {
  border-left: 3px solid var(--accent-deep);
  background: var(--surface);
  padding: 10px 14px;
  border-radius: 0 var(--r) var(--r) 0;
}

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin-bottom: 12px; }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 16px;
  font-size: 15px;
}
.doc caption {
  text-align: left;
  color: var(--muted);
  font-size: 13px;
  padding-bottom: 6px;
}
.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.doc thead th { color: var(--muted); font-weight: 500; font-size: 13px; }
.keys td:first-child { white-space: nowrap; width: 1%; padding-right: 24px; }
.keys tr.group th {
  padding-top: 20px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
}

.faq dt { color: var(--ink); font-weight: 600; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }

.doc-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.doc-foot a { color: var(--ink-2); }
.doc-legal { margin-left: auto; color: var(--muted); }
.doc-foot a:hover { color: var(--ink); }

/* ---------------------------------------------------------- release notes */
/* /releases/ reuses this whole stylesheet. What it adds is the date, under
   each version's heading and beside it in the contents, and a fourth heading
   level: notes that releases.js brings in from the published releases keep
   their own sub-headings a level below the page's h3. */
.doc .released { font-family: var(--mono); font-size: 13px; color: var(--muted); margin: -6px 0 16px; }
.toc .toc-date { color: var(--muted); font-size: 12px; margin-left: 6px; }
.doc h4 { font-size: 15px; margin: 18px 0 6px; color: var(--ink); }

/* ------------------------------------------------------------- narrow */
@media (max-width: 960px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px 16px 72px; }
  .toc details { position: static; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
  .toc summary { margin: 0; cursor: pointer; }
  .toc details[open] summary { margin-bottom: 10px; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 860px) {
  .docs-page .nav nav { display: none; }
}
@media (max-width: 520px) {
  .docs-page .nav { gap: 12px; padding: 0 16px; }
  .doc .lede { font-size: 16px; }
}
