/* The Docs' own stylesheet, over the site's (site/site.css, which sets the
   paper, ink, type and the pinned bar for every page of thisisatlas.app; the
   bar was pinned here, for the Docs alone, until 2026-11-07). Only what the
   Docs add is here: the sidebar, the long page's headings, the pictures and
   the phone's contents row. docs-site/render.mjs publishes
   it at /docs/docs.css; the page's <body> has the class docs-page.

   The colours are the site's tokens (--bg, --text, --text-h, --text-faint,
   --border, --line, --wash), dark included. */
.docs-page {
  font-size: 16px;
}

html {
  /* Room for the bar (and on a phone the contents row) when a link jumps to
     a heading, so the heading isn't under them. */
  scroll-padding-top: 88px;
}

/* Smooth only once the page has loaded (the page's script adds the class).
   With it on from the start, a link straight to a section (/docs/#regions)
   began a smooth scroll on load and the browser dropped it as the page
   settled, leaving the reader at the top (2026-11-07). */
@media (prefers-reduced-motion: no-preference) {
  html.docs-smooth {
    scroll-behavior: smooth;
  }
}

.docs-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* The sidebar, after HTTPie's: each section in the heading's ink, its
   subsections under it in the text's, the one being read marked
   (aria-current, set by the page's script as you scroll). Its own scroll
   when it is taller than the window. */
.docs-nav {
  position: sticky;
  top: 64px;
  align-self: start;
  padding: 28px 0 0;
  font-size: 14.5px;
}

.docs-nav__list {
  max-height: calc(100vh - 64px - 28px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}

.docs-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-nav__section + .docs-nav__section {
  margin-top: 18px;
}

/* The last section clear of the window's edge: a scroller's own end padding
   isn't counted in what it scrolls through, so the room is the list's. */
.docs-nav__section:last-child {
  margin-bottom: 48px;
}

.docs-nav__section > a {
  display: block;
  margin: 0 -10px 2px;
  padding: 4px 10px;
  color: var(--text-h);
  font-weight: 600;
  text-decoration: none;
}

.docs-nav__section ul a {
  display: block;
  margin: 0 -10px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--text-h);
}

.docs-nav__section ul a[aria-current] {
  background: var(--wash);
  color: var(--text-h);
  font-weight: 600;
}

/* The phone's way to the same list: a row under the bar naming the
   subsection being read, which unfolds the list (docs-nav[data-open]).
   Hidden on a wide window, where the sidebar is always there. */
.docs-toc {
  display: none;
}

.docs-main {
  max-width: 720px;
  padding: 40px 0 40vh;
}

/* The page's title in the slab, as the app's screen titles are; the headings
   under it in Inter, the reading face ("the H1 titles are good with the slab
   font, but then the … lower headings should have Inter", 2026-11-05). */
.docs-main h1,
.docs-main h2,
.docs-main h3 {
  color: var(--text-h);
  line-height: 1.25;
}

.docs-main h1 {
  margin: 0 0 16px;
  font-family: 'Zilla Slab', Georgia, serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
}

/* A section: a rule above it and a larger heading, so the page reads as six
   parts and not thirty-five paragraphs. */
.docs-section {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.docs-main h2 {
  margin: 24px 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.docs-main h3 {
  margin: 40px 0 10px;
  font-size: 19px;
  font-weight: 600;
}

.docs-main h2 + .docs-sub h3 {
  margin-top: 20px;
}

/* A heading is a link to itself, so its address can be copied; it reads as
   a heading, with a # in the margin on hover to say so. */
.docs-main h2 a,
.docs-main h3 a {
  position: relative;
  color: inherit;
  text-decoration: none;
}

.docs-main h2 a:hover::before,
.docs-main h3 a:hover::before {
  content: '#';
  position: absolute;
  right: 100%;
  padding-right: 8px;
  color: var(--text-faint);
  font-weight: 400;
}

/* The tables (keyboard shortcuts). */
.docs-main table {
  width: 100%;
  margin: 8px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
}

.docs-main th,
.docs-main td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.docs-main th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 13px;
}

.docs-main td:first-child {
  width: 34%;
  color: var(--text-h);
  white-space: nowrap;
}

.docs-main p,
.docs-main ul,
.docs-main ol {
  margin: 0 0 16px;
}

.docs-main ul,
.docs-main ol {
  padding-left: 22px;
}

.docs-main li {
  margin: 6px 0;
}

/* Something to type exactly: coordinates, a phrase for the search box. */
.docs-main code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--wash);
  color: var(--text-h);
  font: 0.9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.docs-main em {
  font-style: italic;
}

.docs-main strong {
  color: var(--text-h);
  font-weight: 600;
}

/* A screenshot or a clip. A hairline round it, since the app's paper and the
   page's are the same colour and a capture would otherwise have no edge. */
.docs-figure {
  margin: 24px 0 28px;
}

.docs-figure img,
.docs-figure video {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--wash);
}

/* A detail (render.mjs's figure: anything but the whole window): its
   own width, set on the element, with the page's paper either side. Centred,
   so the space reads as margin and not as a column left empty. */
.docs-figure--detail {
  margin-left: auto;
  margin-right: auto;
}

.docs-figure--detail figcaption {
  text-align: center;
}

.docs-figure__open {
  display: block;
  cursor: zoom-in;
}

.docs-figure figcaption {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 14px;
}

/* A phone, or a narrow window: no column for the sidebar. A row under the
   bar names the subsection being read; pressing it unfolds the whole list
   over the page, and choosing a subsection folds it again (the page's
   script). */
@media (max-width: 839px) {
  html {
    scroll-padding-top: 116px;
  }

  .docs-toc {
    position: sticky;
    top: 64px;
    z-index: 1;
    display: block;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .docs-toc__button {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: var(--text-h);
    font: 600 15px/1.3 Inter, system-ui, sans-serif;
    text-align: left;
    cursor: pointer;
  }

  .docs-toc__button::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-3px) rotate(45deg);
  }

  .docs-toc__button[aria-expanded='true']::after {
    transform: translateY(1px) rotate(-135deg);
  }

  .docs-toc__current {
    overflow: hidden;
    color: var(--text);
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .docs-layout {
    display: block;
    padding: 0 16px;
  }

  .docs-nav {
    position: fixed;
    top: 109px;
    right: 0;
    left: 0;
    z-index: 1;
    display: none;
    padding: 8px 16px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  }

  .docs-nav[data-open] {
    display: block;
  }

  .docs-nav__list {
    max-height: calc(100vh - 109px - 16px);
    padding-bottom: 16px;
  }

  .docs-main {
    padding-top: 28px;
  }

  .docs-main h1 {
    font-size: 32px;
  }

  .docs-main td:first-child {
    white-space: normal;
  }
}
