/* Engram docs — layout on top of the site's palette (../styles.css). */

.docs-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.docs-top__brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); }
.docs-top__brand img { width: 26px; height: 26px; }
.docs-top__tag { color: var(--muted); font-weight: 500; }
.docs-top__spacer { flex: 1; }
.docs-top a.docs-top__link { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.docs-top a.docs-top__link:hover { color: var(--blue); }

.docs-wrap {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px; max-width: 1180px; margin: 0 auto; padding: 28px 22px 80px;
}

/* sidebar */
.docs-side { position: sticky; top: 74px; align-self: start; height: fit-content; }
.docs-side h4 {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2); margin: 18px 0 7px;
}
.docs-side a {
  display: block; padding: 5px 10px; border-radius: 8px;
  color: var(--ink-soft); text-decoration: none; font-size: .92rem; line-height: 1.35;
}
.docs-side a:hover { background: var(--paper-3); color: var(--ink); }
.docs-side a.active { background: var(--slate); color: var(--blue-ink); font-weight: 600; }

/* content */
.docs-main { min-width: 0; }
.docs-main h1 { font-size: 2.1rem; margin: 0 0 .2em; }
.docs-main h2 {
  font-size: 1.45rem; margin: 2.4em 0 .5em; padding-top: .3em;
  scroll-margin-top: 84px; border-top: 1px solid var(--line);
}
.docs-main h2:first-of-type { border-top: none; }
.docs-main h3 { font-size: 1.08rem; margin: 1.5em 0 .4em; }
.docs-main p, .docs-main li { color: var(--ink-soft); line-height: 1.65; }
.docs-main ul, .docs-main ol { padding-left: 1.3em; }
.docs-main li { margin: .25em 0; }
.docs-main code {
  font-family: var(--mono); font-size: .88em; background: var(--paper-3);
  padding: .1em .38em; border-radius: 5px; color: var(--ink);
}
.docs-main pre {
  background: #1e2228; color: #e7e9ec; border-radius: 10px;
  padding: 14px 16px; overflow-x: auto; font: .86rem/1.55 var(--mono); margin: 1em 0;
}
.docs-main pre code { background: none; padding: 0; color: inherit; }
.docs-main pre .cmt { color: #8d97a3; }
.docs-lede { font-size: 1.12rem; color: var(--muted); margin-bottom: 1.5em; }

/* callouts */
.callout {
  border-radius: 12px; padding: 14px 16px; margin: 1.2em 0;
  border: 1px solid var(--line); background: var(--paper-2);
}
.callout__title { font-weight: 700; margin-bottom: .35em; display: flex; gap: 7px; align-items: center; }
.callout--tip { border-color: #bcdcc9; background: #f0f8f3; }
.callout--tip .callout__title { color: #2f8f6b; }
.callout--warn { border-color: #f0d6bf; background: #fdf3ec; }
.callout--warn .callout__title { color: var(--orange-ink); }
.callout--start { border-color: var(--blue); background: #eef4fa; box-shadow: var(--shadow); }
.callout--start .callout__title { color: var(--blue-ink); font-size: 1.05rem; }

/* numbered steps */
.steps { list-style: none; padding-left: 0; counter-reset: step; }
.steps > li {
  position: relative; padding-left: 38px; margin: .7em 0;
}
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; font-size: .8rem;
  display: grid; place-items: center;
}

/* model / filter mini-table */
.docs-table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .92rem; }
.docs-table th, .docs-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-table th { color: var(--muted); font-weight: 600; }
.docs-table code { white-space: nowrap; }

@media (max-width: 820px) {
  .docs-wrap { grid-template-columns: 1fr; }
  .docs-side { position: static; }
}
