/* Jumpr docs. Loaded after site.css, which supplies the colors, type, header
   and key caps. Written by hand; every page under site/docs/ is built from
   docs-src/ by scripts/build-docs.mjs and shares this one sheet. */

/* ---------- frame: header, sidebar, content ---------- */

.docs-header {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  border-bottom: 1px solid var(--line);
}

.docs {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.docs-side {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 16px 40px 20px;
  font-size: 0.85rem;
}
.docs-side a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}
.docs-side a:hover { color: var(--text); background: var(--surface); }
.docs-side a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--yellow);
}
.docs-group { margin: 26px 0 4px; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; }
.docs-group a { color: var(--faint); font-weight: 700; }

/* The sidebar's button on a phone. Only shown once docs.js is running: with
   no script the sidebar stays open above the page. */
.docs-menu { display: none; }

.docs-content { min-width: 0; min-height: 100vh; border-left: 1px solid var(--line); }

/* ---------- the top of a page ---------- */

.docs-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 40px;
  padding: 52px 56px 44px;
  border-bottom: 1px solid var(--line);
}
.docs-hero > div { flex: 1 1 420px; min-width: 0; }
.docs-crumb { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--faint); }
.docs-crumb i { width: 10px; height: 10px; border-radius: 3px; background: var(--yellow); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.6); }
.docs-hero h1 { margin-top: 14px; font-size: clamp(2rem, 4vw, 2.55rem); line-height: 1.1; letter-spacing: -0.03em; }
.docs-lede { margin-top: 16px; max-width: 36em; font-size: 1.1rem; line-height: 1.5; color: var(--muted); }

.docs-copy {
  display: none; /* needs docs.js */
  align-items: center;
  height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}
.docs-copy:hover { background: var(--surface); }
.docs.js .docs-copy { display: inline-flex; }

/* ---------- article and "On this page" ---------- */

.docs-main {
  display: grid;
  grid-template-columns: minmax(0, 760px) 200px;
  gap: 64px;
  align-items: start;
  padding: 16px 56px 96px;
}

.docs-article { font-size: 0.95rem; line-height: 1.6; }
.docs-article > * + * { margin-top: 16px; }
.docs-article p, .docs-article li { color: var(--muted); }
.docs-article strong { color: var(--text); }
.docs-article a { color: var(--text); }

.docs-article h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 56px;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  scroll-margin-top: 24px;
}
.docs-article h2::before { content: ""; flex: none; width: 4px; height: 1em; border-radius: 2px; background: var(--yellow); }
.docs-article > h2:first-child { margin-top: 36px; }
.docs-article > :first-child:not(h2) { margin-top: 32px; }
.docs-article h3 { margin-top: 36px; font-size: 1.1rem; scroll-margin-top: 24px; }
.docs-article h2 + *, .docs-article h3 + * { margin-top: 14px; }

.docs-article ul { padding-left: 1.2em; }
.docs-article li + li { margin-top: 8px; }

/* A numbered list is a run of steps, numbered the way the site's labels look. */
.docs-steps { list-style: none; padding: 0; counter-reset: step; }
.docs-steps li { counter-increment: step; position: relative; min-height: 34px; padding: 3px 0 0 50px; }
.docs-steps li + li { margin-top: 14px; }
.docs-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  font: 700 16px/1 var(--mono);
  color: var(--on-yellow);
  background: var(--yellow);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.6);
}

.docs-article code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 6px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow-wrap: anywhere;
}
.docs-article pre {
  margin-bottom: 0;
  padding: 14px 16px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.docs-article pre code { padding: 0; border: 0; background: none; font-size: 0.85rem; overflow-wrap: normal; }
.docs-article pre[data-lang]::before {
  content: attr(data-lang);
  display: block;
  margin-bottom: 8px;
  font: 0.68rem/1.6 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
}

/* The box scrolls sideways, so a wide table never widens the page on a phone. */
.docs-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.docs-table table { width: 100%; border-collapse: collapse; }
.docs-table th { padding: 11px 18px; text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--faint); background: var(--surface); }
.docs-table td { padding: 12px 18px; vertical-align: top; color: var(--muted); border-top: 1px solid var(--line); }
.docs-table td:first-child { color: var(--text); }

/* The mono chip on a callout and on a figure still waiting for its image. */
.docs-chip {
  flex: none;
  padding: 0 7px;
  font: 700 0.66rem/1.7 var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}
.docs-note {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.docs-note.warn .docs-chip { color: var(--on-yellow); background: var(--yellow); border-color: transparent; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.6); }

.docs-figure { margin: 32px 0 0; }
.docs-figure .frame { padding: 28px; background: var(--art); border: 1px solid var(--line); border-radius: 14px; }
/* A capture is shown at its own size, never stretched: these are one-to-one screen
   pixels and blur when enlarged. The shadow follows the capture's own outline. */
.docs-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3)); }
.docs-figure .is-placeholder { display: grid; padding: 0; place-items: center; align-content: center; gap: 8px; min-height: 160px; border-style: dashed; border-color: var(--line-strong); }
.docs-figure .file { font: 0.78rem/1.4 var(--mono); color: var(--faint); }
.docs-figure figcaption { margin-top: 10px; font-size: 0.8rem; color: var(--faint); }

/* A group's own page lists its pages as cards. */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 28px; }
.docs-cards a { display: block; padding: 16px 18px; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; }
.docs-cards a:hover { background: var(--surface); border-color: var(--line-strong); }
.docs-cards b { display: block; }
.docs-cards span { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }

.docs-foot { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.docs-foot > * { flex: 1 1 220px; }
.docs-foot a { display: block; padding: 14px 20px; font-weight: 600; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; }
.docs-foot a:hover { background: var(--surface); border-color: var(--line-strong); }
.docs-foot small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--faint); }
.docs-foot .next { text-align: right; }

.docs-toc { position: sticky; top: 24px; padding-top: 40px; font-size: 0.8rem; }
.docs-toc h2 { margin-bottom: 10px; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.docs-toc a { display: block; padding: 6px 0 6px 14px; color: var(--muted); text-decoration: none; box-shadow: inset 2px 0 0 var(--line); }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.is-active { color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--yellow); }

/* ---------- narrower windows ---------- */

@media (max-width: 1180px) {
  .docs-main { grid-template-columns: minmax(0, 760px); }
  .docs-toc { display: none; }
}

@media (max-width: 860px) {
  .docs { display: block; }
  .docs-content { border-left: 0; min-height: 0; }
  .docs-side { position: static; max-height: none; padding: 10px var(--gutter) 20px; font-size: 0.9rem; border-bottom: 1px solid var(--line); }
  .docs-side a { padding: 11px 12px; }
  .docs-hero { padding: 28px var(--gutter) 24px; }
  .docs-main { padding: 0 var(--gutter) 64px; }

  .docs.js .docs-menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: calc(100% - 2 * var(--gutter));
    min-height: 46px;
    margin: 12px var(--gutter);
    padding: 0 16px;
    font: inherit;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    cursor: pointer;
  }
  .docs-menu span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; color: var(--faint); }
  .docs.js .docs-side { display: none; }
  .docs.js.nav-open .docs-side { display: block; }
}
