/* ==========================================================================
   /docs — reference and guides. Layered on site.css, reusing its tokens.
   ========================================================================== */

.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: 2.5rem 4rem;
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- sidebar --- */

.docs-nav {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: .5rem;
  font-size: .9rem;
}

@media (max-width: 900px) {
  .docs-nav {
    position: static;
    max-height: none;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
  }
}

.docs-nav-title {
  font-family: var(--meta);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin: 1.5rem 0 .5rem;
}
.docs-nav-title:first-child { margin-top: 0; }

.docs-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.docs-nav li { margin-bottom: .1rem; }

.docs-nav a {
  display: block;
  padding: .28rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.docs-nav a:hover {
  color: var(--ink);
  background: var(--bg-alt);
}
.docs-nav a.on {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--brand-purple);
  background: var(--accent-soft);
}
.docs-nav code {
  background: none;
  border: 0;
  padding: 0;
  font-size: .95em;
  color: inherit;
}

.doc-subnav {
  margin: .2rem 0 .6rem .7rem !important;
  padding-left: .6rem !important;
  border-left: 1px solid var(--border);
}
.doc-subnav a { padding: .18rem .5rem; font-size: .86rem; }

/* ---------------------------------------------------------------- main --- */

.docs-main { min-width: 0; }

.docs-main h1 {
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem);
  margin-bottom: .5rem;
}
.docs-main h1 code {
  background: none;
  border: 0;
  padding: 0;
  font-size: .92em;
}

.docs-main h2 {
  font-size: 1.5rem;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.docs-main h2:first-of-type { border-top: 0; padding-top: 0; }

.docs-main h3 { font-size: 1.12rem; margin-top: 1.75rem; }

.docs-main p { color: var(--ink-soft); }
.docs-main li { color: var(--ink-soft); }

.crumb {
  font-family: var(--meta);
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: .75rem;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); text-decoration: underline; }

.docs-lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 68ch;
  margin-bottom: 1.5rem;
}

.docs-note {
  font-size: .9rem !important;
  color: var(--muted) !important;
  background: var(--bg-alt);
  border-left: 3px solid;
  border-image: var(--brand-grad) 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: .85rem 1.1rem;
  margin: 1.25rem 0;
}
.docs-note code { background: var(--surface); }

.docs-main nc-copy,
.docs-main .term { margin: 1.1rem 0; }

/* ---------------------------------------------------- command reference --- */

.doc-cmd {
  scroll-margin-top: 84px;
  padding: 1.4rem 0 .4rem;
  border-top: 1px solid var(--border);
}
.doc-cmd:first-of-type { border-top: 0; }

.doc-cmd h2, .doc-cmd h3, .doc-cmd h4 {
  margin: 0 0 .5rem;
  padding-top: 0;
  border-top: 0;
  font-size: 1.18rem;
}
.doc-cmd h2 code, .doc-cmd h3 code, .doc-cmd h4 code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-size: 1em;
}

/* Nested subcommands sit slightly in from their parent. */
.doc-cmd .doc-cmd {
  margin-left: 1.1rem;
  padding-left: 1.1rem;
  border-left: 1px solid var(--border);
}

.alias {
  font-family: var(--meta);
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  padding: .1rem .5rem;
  vertical-align: middle;
}
.alias::before { content: "alias "; opacity: .6; }

.doc-blurb {
  margin-bottom: .8rem;
  max-width: 70ch;
}

.doc-usage {
  margin: 0 0 1rem;
  background: var(--term-bg);
  color: var(--term-cmd);
  border-radius: var(--radius-sm);
  padding: .7rem 1rem;
  overflow-x: auto;
  font-size: .82rem;
}
.doc-usage code { background: none; border: 0; padding: 0; color: inherit; }

.doc-subhead {
  font-family: var(--meta);
  font-size: .72rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin: 1rem 0 .4rem !important;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .89rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.doc-table td {
  padding: .45rem .8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--ink-soft);
}
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { width: 34%; min-width: 12rem; }
.doc-table td:first-child code {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

/* --------------------------------------------------------------- index --- */

.cmd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: .8rem;
  margin: 1.25rem 0 0;
}

.cmd-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-image: var(--brand-grad) 1;
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.cmd-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.cmd-card code {
  background: none;
  border: 0;
  padding: 0;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.cmd-card span {
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}
.cmd-card em {
  font-family: var(--meta);
  font-style: normal;
  font-size: .72rem;
  letter-spacing: .05em;
  color: var(--muted);
}

/* Which release the reference describes — the reason this is prominent is
   that a reference silently describing a different version than the reader
   installed is worse than no reference. */
.docs-version {
  font-family: var(--meta);
  font-size: .78rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border-left: 3px solid;
  border-image: var(--brand-grad) 1;
}
.docs-version strong { color: var(--ink); font-weight: 700; }
