/* ============ ONYX docs & terms — shared layout ============ */
/* Reuses tokens/components from styles.css. Adds a two-column
   reference layout: sticky side nav + a single readable column. */

.doc-body { background: var(--void); }

.doc-shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}
/* ---------- side nav ---------- */
.doc-nav {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-family: var(--f-mono);
  font-size: .84rem;
}
.doc-nav__group {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ash-dim);
  margin: 1.3rem 0 .4rem;
}
.doc-nav__group:first-child { margin-top: 0; }
.doc-nav a {
  color: var(--ash);
  padding: .3rem 0;
  border-left: 2px solid transparent;
  padding-left: .8rem;
  margin-left: -.8rem;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.doc-nav a:hover { color: var(--bone); }
/* Section in view. Set by nav.js as aria-current="true", so the marker and
   the announced state are the same fact. Lit rail, matching the way the top
   bar marks the current page. */
.doc-nav a[aria-current] {
  color: var(--spec);
  border-left-color: var(--spec);
  box-shadow: -1px 0 10px -3px rgba(255, 255, 255, .45);
}

/* ---------- content column ---------- */
.doc-content { min-width: 0; padding-bottom: 2rem; border-bottom: 1px solid var(--graphite); }

.doc-h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1;
  margin: .8rem 0 1rem;
  background: linear-gradient(180deg, var(--spec) 0%, var(--bone) 30%, #6a6a72 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.doc-lede {
  color: var(--ash);
  font-size: 1.08rem;
  max-width: 62ch;
  margin-bottom: 3rem;
}
.doc-lede a { color: var(--bone); border-bottom: 1px solid var(--graphite-2); }

.doc-section {
  padding: 2.4rem 0;
  border-top: 1px solid var(--graphite);
}
.doc-section:first-of-type { border-top: none; padding-top: 0; }
.doc-section h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--bone);
  margin-bottom: .9rem;
  scroll-margin-top: 5.5rem;
}
.doc-section p { color: var(--ash); font-size: 1rem; margin-bottom: 1rem; max-width: 70ch; }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section a { color: var(--bone); border-bottom: 1px solid var(--graphite-2); }
.doc-section a:hover { border-color: var(--ash); }

.inline {
  font-family: var(--f-mono);
  font-size: .88em;
  color: var(--bone);
  background: var(--onyx);
  border: 1px solid var(--graphite);
  border-radius: 5px;
  padding: .1em .4em;
}

.doc-code { margin: 0 0 1.1rem; max-width: 70ch; }

.doc-list {
  list-style: none;
  display: grid;
  gap: .7rem;
  margin-bottom: 1rem;
  max-width: 70ch;
}
.doc-list li {
  color: var(--ash);
  font-size: .98rem;
  padding-left: 1.3rem;
  position: relative;
}
.doc-list li::before {
  content: "";
  position: absolute; left: 0; top: .6em;
  width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, var(--spec), #4a4a52 60%, #101014);
}
.doc-list code.inline { color: var(--bone); }

.doc-note {
  border: 1px solid var(--graphite-2);
  border-left: 2px solid var(--graphite-2);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  background: var(--onyx);
  max-width: 70ch;
  margin-bottom: 1.1rem;
}
.doc-note p { color: var(--bone); margin: 0; font-size: .94rem; }
.doc-note--warn { border-left-color: var(--spec); }

/* ---------- reference tables ---------- */
.doc-table {
  border: var(--edge);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 1.3rem;
  max-width: 70ch;
}
.doc-table__row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1rem;
  padding: .8rem 1.1rem;
  border-top: 1px solid var(--graphite);
  font-size: .88rem;
}
.doc-table__row:first-child { border-top: none; }
.doc-table__row--head {
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ash-dim);
  background: var(--onyx-2);
}
.doc-table__row span:first-child { color: var(--bone); }
.doc-table__row span:not(:first-child) { color: var(--ash); }
.doc-table__row--head span { color: var(--ash-dim); }

/* Bottom of a long article is the other place a reader looks for a way out,
   so "next" and "back to the top of the site" both live here. */
.doc-foot-nav {
  margin-top: 1rem;
  display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: .8rem 2rem;
  align-items: baseline;
}
.doc-foot-nav a {
  font-family: var(--f-mono);
  font-size: .88rem;
  color: var(--bone);
  border-bottom: 1px solid var(--graphite-2);
  max-width: fit-content;
}
.doc-foot-nav a:hover { border-color: var(--ash); }
.doc-foot-nav a.doc-foot-nav__back { color: var(--ash); border-bottom-color: transparent; }
.doc-foot-nav a.doc-foot-nav__back:hover { color: var(--bone); border-bottom-color: var(--graphite-2); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  /* Two sticky strips now, so anchor jumps have to clear both. */
  html { scroll-padding-top: calc(var(--nav-h) + 3.6rem); }

  .doc-shell { grid-template-columns: 1fr; gap: 1.6rem; padding: 1.6rem var(--gutter) 4rem; }

  /* Wrapping eleven links makes a three-row wall of text above the article.
     A single sticky row that scrolls sideways keeps the contents reachable
     without pushing the content off the first screen — and nav.js keeps the
     active chip scrolled into view. */
  .doc-nav {
    position: sticky;
    top: var(--nav-h);
    z-index: 40;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1);
    padding: .5rem var(--gutter);
    background: rgba(5, 5, 6, .92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--graphite);
    max-width: 100vw;
  }
  .doc-nav::-webkit-scrollbar { display: none; }
  .doc-nav__group { display: none; }
  .doc-nav a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: .35rem .7rem .45rem;
    margin-left: 0;
    white-space: nowrap;
    flex: none;
  }
  .doc-nav a[aria-current] {
    border-bottom-color: var(--spec);
    box-shadow: 0 1px 10px -3px rgba(255, 255, 255, .45);
  }

  .doc-table__row { grid-template-columns: 1fr; gap: .2rem; }
}
