/* Unlayered, loads after kelp.css - same override convention as apps/frontend/styles/custom.css.
   Font tokens and .logo below are copied from that file so the docs site matches the frontend's
   typography (kelp's own defaults are a font-size-base of 112.5% and a ui-sans-serif stack). */

:root {
  --font-primary: sans-serif;
  --font-size-base: 100%;
}

.logo {
  font-family: var(--font-secondary);
}

.navbar,
.footer-content {
  width: 100%;
  padding-inline: 3rem;
}

.docs-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 200px;
  gap: 2.5rem;
  align-items: start;
  width: 100%;
  padding-block: 2rem;
  padding-inline: 3rem;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 2rem;
  font-size: 0.9rem;
}

.docs-sidebar ul,
.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-sidebar li {
  margin-block-end: 0.15rem;
}

.docs-sidebar details summary {
  cursor: pointer;
  font-weight: 600;
}

.docs-sidebar details ul {
  margin-inline-start: 0.9rem;
  padding-block-start: 0.25rem;
}

.docs-sidebar a[aria-current="page"] {
  font-weight: 600;
  text-decoration: underline;
}

.docs-content h1:first-child {
  margin-block-start: 0;
}

.admonition {
  border-inline-start: 4px solid var(--color-neutral-border-vivid);
  background: var(--color-neutral-fill-muted);
  padding: 0.75rem 1rem;
  margin-block: 1.25rem;
  border-radius: 0.25rem;
}

.admonition-note {
  border-inline-start-color: var(--color-primary-border-vivid);
}

.admonition-info {
  border-inline-start-color: var(--color-secondary-border-vivid);
}

.admonition-warning {
  border-inline-start-color: var(--color-warning-border-vivid);
}

/* kelp's `pre` is intentionally bare (no background/padding/radius) - see kelpui/src/css - so
   without this, pandoc's syntax-highlighted spans just sit directly in the page flow.

   The ground is Monokai's own #272822 in BOTH themes, deliberately not a kelp theme token: the
   token colors in highlight.css are Monokai, a dark-only palette, and against the light theme's
   near-white `--color-neutral-fill-muted` (oklch 96%) the pale yellow strings and lime functions
   wash out to near-invisible. A fixed dark ground is what that palette is built for. */
pre,
div.sourceCode {
  background: #272822;
  color: #f8f8f2;
  border-radius: 0.375rem;
}

/* kelp sets `pre code { color: inherit }`, so the ground color above reaches unhighlighted code */
pre code {
  color: inherit;
}

pre {
  padding: 1rem 1.25rem;
}

div.sourceCode pre {
  padding: 1rem 1.25rem;
  margin: 0;
}

/* filename caption pandoc's code fences don't natively support - see convertCodeFenceTitles() in
   scripts/markdown.ts, which emits a lone bold paragraph directly before the fence for this. */
p:has(> strong:only-child):has(+ .sourceCode, + pre) {
  margin-block-end: 0;
  font-family: var(--font-monospace, monospace);
  font-size: 0.85rem;
}

p:has(> strong:only-child):has(+ .sourceCode, + pre) + * {
  margin-block-start: 0.25rem;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
}

.blog-list-item h2 {
  margin-block-end: 0.25rem;
}

.blog-post img {
  max-width: 100%;
}

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

  .docs-toc {
    display: none;
  }
}
