/* The documentation at /docs/ (loaded only by its pages). Uses site.css's tokens. */

.docs { display: grid; gap: 32px; padding-top: 40px; padding-bottom: 80px; }
@media (min-width: 900px) { .docs { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }

.docs-nav { font-size: .95rem; }
.docs-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-nav a { display: block; padding: 7px 12px; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.docs-nav a:hover { background: var(--grey-100); }
.docs-nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.docs-nav .label { display: block; padding: 0 12px 8px; color: var(--grey-600); font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; }
@media (min-width: 900px) { .docs-nav nav { position: sticky; top: 24px; } }
@media (max-width: 899px) {
  .docs-nav ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .docs-nav a { white-space: nowrap; border: 1px solid var(--grey-200); }
}

.doc { max-width: 760px; min-width: 0; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin-bottom: .4rem; }
.doc .intro { font-size: 1.15rem; color: var(--grey-600); margin-bottom: 2rem; }
.doc h2 { font-size: 1.45rem; margin: 2.6rem 0 .8rem; }
.doc h3 { font-size: 1.1rem; margin: 1.8rem 0 .5rem; }
.doc ul, .doc ol { padding-left: 22px; margin: 0 0 1rem; }
.doc li { margin-bottom: 6px; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em;
  background: var(--grey-100); padding: 1px 5px; border-radius: 4px; }
.doc pre { background: var(--ink-900); color: #e5e7eb; padding: 16px 18px; border-radius: var(--radius-sm);
  overflow-x: auto; font-size: .85rem; line-height: 1.55; margin: 0 0 1.2rem; }
.doc pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.doc pre .c { color: #9ca3af; }
.doc pre .k { color: #93c5fd; }
.doc pre .s { color: #fcd34d; }
.doc table { width: 100%; border-collapse: collapse; margin: 8px 0 1.2rem; font-size: .93rem; }
.doc th, .doc td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.doc th { color: var(--ink-900); background: var(--grey-50); font-weight: 600; }
.doc .table-scroll { overflow-x: auto; margin-bottom: 1.2rem; }
.doc .table-scroll table { margin: 0; }

.callout { background: var(--brand-50); border-left: 4px solid var(--brand); padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 1.4rem; }
.callout p:last-child { margin: 0; }

/* Figures: a framed picture with a caption. */
.fig { margin: 1.4rem 0 2rem; border: 1px solid var(--grey-200); border-radius: var(--radius); padding: 20px;
  background: var(--grey-50); }
.fig figcaption { color: var(--grey-600); font-size: .9rem; margin-top: 14px; }
.fig svg { display: block; width: 100%; height: auto; max-width: 100%; }
.fig-pair { display: grid; gap: 20px; }
@media (min-width: 700px) { .fig-pair { grid-template-columns: 1fr 1fr; } }
.fig-pair h4 { margin: 0 0 10px; font-size: .95rem; color: var(--ink-900); }
.fig-pair .bad h4 { color: #a1281e; }
.fig-pair .good h4 { color: var(--brand-700); }

/* SVG parts */
.d-box { fill: var(--white); stroke: var(--grey); stroke-width: 1.2; }
.d-svc { fill: var(--white); stroke: var(--ink); stroke-width: 1.2; }
.d-hub { fill: var(--brand-600); }
.d-t { fill: var(--ink-900); font-size: 12px; font-family: var(--font); }
.d-s { fill: var(--grey-600); font-size: 10.5px; font-family: var(--font); }
.d-hub-t { fill: var(--white); font-weight: 700; font-size: 14px; font-family: var(--font); }
.d-hub-s { fill: var(--brand-100); font-size: 10.5px; font-family: var(--font); }
.d-line { stroke: var(--grey); stroke-width: 1.2; fill: none; }
.d-key { stroke: #c2410c; stroke-width: 1.2; fill: none; }
.d-line-b { stroke: var(--brand); stroke-width: 1.8; fill: none; }
.d-arrow { fill: var(--grey-600); }
.d-arrow-b { fill: var(--brand); }
.d-dec { fill: #fff7e6; stroke: #b7791f; stroke-width: 1.2; }
.d-step { fill: var(--white); stroke: var(--brand); stroke-width: 1.4; }
.d-end { fill: var(--grey-100); stroke: var(--grey); stroke-width: 1.2; }
.d-yes { fill: #1f7a3a; font-size: 11px; font-weight: 600; font-family: var(--font); }
.d-no { fill: #a1281e; font-size: 11px; font-weight: 600; font-family: var(--font); }

/* Layers: the four pieces stacked */
.layers { display: grid; gap: 0; }
.layer { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 14px 16px;
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-sm); }
.layer + .layer { margin-top: 26px; position: relative; }
.layer + .layer::before { content: "↓"; position: absolute; top: -25px; left: 30px; color: var(--grey-600); font-size: 18px; }
.layer .n { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 700;
  color: var(--white); background: var(--brand-600); }
.layer b { color: var(--ink-900); }
.layer p { margin: 2px 0 0; color: var(--grey-600); font-size: .93rem; }
.layer code { font-size: .82em; }

/* Pipeline: what happens on one call */
.pipe { list-style: none; padding: 0 !important; margin: 0 !important; display: grid; gap: 12px; counter-reset: pipe; }
@media (min-width: 760px) { .pipe { grid-template-columns: repeat(5, 1fr); gap: 10px; } }
.pipe li { margin: 0 !important; position: relative; background: var(--white); border: 1px solid var(--grey-200);
  border-top: 3px solid var(--brand); border-radius: var(--radius-sm); padding: 12px; font-size: .88rem;
  counter-increment: pipe; }
.pipe li::before { content: counter(pipe); display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand-600); color: var(--white); font-size: .75rem; font-weight: 700;
  margin-bottom: 6px; }
.pipe b { display: block; color: var(--ink-900); margin-bottom: 2px; }
.pipe span { color: var(--grey-600); }
.pipe .stop { display: block; margin-top: 6px; color: #a1281e; font-size: .8rem; }

/* Chips for READ / WRITE / DELETE */
.chip { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 5px;
  font-size: .78rem; font-weight: 700; margin-right: 3px; }
.chip.on { background: var(--brand-600); color: var(--white); }
.chip.off { background: var(--grey-100); color: var(--grey); }
.chip.get { background: #e6f4ea; color: #1f7a3a; }
.chip.post { background: var(--brand-100); color: var(--brand-700); }
.chip.put { background: #fff7e6; color: #8a5a14; }
.chip.del { background: #fdecea; color: #a1281e; }

.arrow-cell { color: var(--grey-600); text-align: center; width: 28px; }

/* Cards linking to the pages */
.doc-cards { display: grid; gap: 14px; margin: 1rem 0 2rem; }
@media (min-width: 640px) { .doc-cards { grid-template-columns: 1fr 1fr; } }
.doc-cards a { display: block; padding: 16px 18px; border: 1px solid var(--grey-200); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); }
.doc-cards a:hover { border-color: var(--brand); background: var(--brand-50); }
.doc-cards b { display: block; color: var(--ink-900); margin-bottom: 2px; }
.doc-cards span { color: var(--grey-600); font-size: .92rem; }

.gallery { columns: 2 220px; column-gap: 28px; margin-bottom: 1rem; }
.gallery div { break-inside: avoid; margin-bottom: 14px; }
.gallery b { display: block; color: var(--ink-900); font-size: .9rem; }
.gallery span { color: var(--grey-600); font-size: .9rem; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 3rem; padding-top: 1.4rem;
  border-top: 1px solid var(--grey-200); }
.pager a { text-decoration: none; display: block; max-width: 48%; }
.pager small { display: block; color: var(--grey-600); }
.pager .next { margin-left: auto; text-align: right; }
@media (min-width: 760px) { .pipe.three { grid-template-columns: repeat(3, 1fr); } .pipe.four { grid-template-columns: repeat(4, 1fr); } }
