/* The docs pages (/docs, web/scripts/build-docs.mjs), on top of doc.css. Theme tokens only. */

.docs-wrap {
  flex: 1;
  width: min(100% - 2 * var(--gutter), var(--content));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
}
.docs-main {
  max-width: 760px;
  margin: 0;
  padding: 32px 0 48px;
  min-width: 0;
}
.docs-nav {
  position: sticky;
  top: 72px;
  align-self: start;
  padding-top: 40px;
}
.docs-nav-h {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-nav li a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--text-soft);
  text-decoration: none;
}
.docs-nav li a:hover {
  background: var(--surface);
  color: var(--text);
}
.docs-nav li a[aria-current='page'] {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 760px) {
  .docs-wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .docs-nav {
    position: static;
    padding-top: 16px;
  }
  .docs-nav-h {
    display: none;
  }
  .docs-nav ul {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .docs-nav li a {
    white-space: nowrap;
    border: 1px solid var(--line);
    font-size: 0.9375rem;
  }
  .docs-main {
    padding-top: 16px;
  }
}

.docs-main h3 {
  font-size: 1.0625rem;
  margin: 28px 0 8px;
  color: var(--text);
}
.doc-for {
  color: var(--text-muted);
  margin-top: 0;
}

.docs-main code {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
  font-feature-settings: 'liga' 0, 'calt' 0;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  color: var(--text);
}
.doc-code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
  font-size: 0.875rem;
}
.doc-code code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.doc-prompt {
  color: var(--text-muted);
  user-select: none;
}
.doc-out {
  color: var(--code-string);
}

.doc-table {
  overflow-x: auto;
  margin: 12px 0;
}
.doc-table table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
}
.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
}
.doc-table th {
  color: var(--text);
  font-weight: 600;
}
.doc-table td code {
  white-space: nowrap;
}
.doc-ref td:last-child,
.doc-ref th:last-child {
  text-align: right;
  white-space: nowrap;
}
.doc-count {
  color: var(--text-muted);
}
.doc-differs {
  margin-left: 6px;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
}

.doc-doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 24px 0;
}
.doc-door {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.doc-door:hover {
  border-color: var(--accent);
  color: var(--text);
}
.doc-door span {
  color: var(--text-soft);
}
.doc-door em {
  font-style: normal;
  color: var(--link);
  font-weight: 600;
}

/* The pinout strips (build-docs.mjs pinout()): one circle per pin, coloured by what it is. */
.pin-wrap {
  overflow-x: auto;
  margin: 8px 0;
}
.pin-strip {
  display: block;
  height: 74px;
  width: auto;
  max-width: none;
}
.pin-strip circle {
  stroke: var(--line-strong);
  stroke-width: 2;
}
.pin-strip text {
  font-family: var(--font-mono);
  font-size: 13px;
  fill: var(--text);
}
.pin-gnd circle { fill: var(--line-strong); }
.pin-pwr circle { fill: var(--danger); }
.pin-i2c circle { fill: var(--teal, var(--accent)); }
.pin-uart circle { fill: var(--cart-5); }
.pin-gpio circle { fill: var(--accent); }

/* The apps tour (build-docs.mjs appsTour()): a screen shot beside each app's pitch. */
.doc-apps {
  display: grid;
  gap: 16px;
  margin: 12px 0 24px;
}
.doc-app {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.doc-app img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.doc-app h3 {
  margin-top: 0;
}
.doc-app p {
  margin: 0 0 6px;
}
.doc-app-links {
  font-size: 0.9375rem;
}
@media (max-width: 520px) {
  .doc-app {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .doc-app img {
    max-width: 256px;
  }
}
