/*
 * Kendr docs redesign skin — matches the current site template
 * (Kendr_Web_UI_Redesign): warm charcoal surfaces + green accent.
 *
 * site.css paints the docs area light through its "Documentation Readability
 * Pass", which drives almost everything from the --docs-* custom properties on
 * .docs-site. This sheet loads after site.css and (1) redefines those
 * variables to the warm-dark template palette, then (2) overrides the pass's
 * remaining hard-coded light values. Every rule is scoped to
 * body[data-doc-page] so other static pages are untouched.
 */

body[data-doc-page] {
  background: #151412 !important;
  color: #d6d3d1;
}

/* Collapse collections so the navigation stays usable as guides are added. */
body[data-doc-page] summary.docs-nav-group-label {
  cursor: pointer;
  display: list-item;
  padding: 10px 0;
}
body[data-doc-page] summary.docs-nav-group-label:focus-visible {
  outline: 2px solid var(--docs-saffron);
  outline-offset: 4px;
}
body[data-doc-page] .docs-prose > pre {
  margin-block: 18px;
}
body[data-doc-page] .docs-prose > .docs-card-grid {
  margin-top: 20px;
}
body[data-doc-page] .docs-code-example {
  min-width: 0;
  margin-block: 20px;
}
body[data-doc-page] .docs-copy-button {
  display: block;
  margin: 0 0 6px auto;
  padding: 5px 10px;
  border: 1px solid var(--docs-border);
  border-radius: 6px;
  color: var(--docs-text);
  background: var(--docs-panel-soft);
  font-size: 12px;
  cursor: pointer;
}
body[data-doc-page] .docs-copy-button:focus-visible {
  outline: 2px solid var(--docs-saffron);
  outline-offset: 3px;
}

/* 1 — repaint the whole readability pass via its own variables */
body[data-doc-page] .docs-site {
  --docs-bg: #151412;
  --docs-panel: #1a1917;
  --docs-panel-soft: #1c1b19;
  --docs-text: #f5f5f4;
  --docs-copy: #a8a29e;
  --docs-muted: #78716c;
  --docs-border: rgba(255, 255, 255, 0.09);
  --docs-border-soft: rgba(255, 255, 255, 0.07);
  /* Docs are a reading surface: the content is the point, so a docs page
     spends ZERO saffron at rest. Saffron appears only on the one thing you
     are touching — a hovered link, a focused field, the page's primary CTA.
     See assets/css/brand.css. */
  --docs-accent: #faf8f4;
  --docs-accent-soft: rgba(250, 248, 244, 0.06);
  --docs-saffron: #e2712a;
  --docs-warm-grey: #8a8378;
  background: var(--docs-bg) !important;
  color: var(--docs-copy);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* 2 — hard-coded light values in the readability pass */

body[data-doc-page] .docs-kicker {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--docs-warm-grey);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em !important;
  text-transform: uppercase;
}
body[data-doc-page] .docs-kicker-dot {
  background: var(--docs-warm-grey);
  box-shadow: 0 0 0 6px rgba(138, 131, 120, 0.12);
}

body[data-doc-page] .docs-meta-pill,
body[data-doc-page] .docs-inline-code {
  border-color: rgba(255, 255, 255, 0.10);
  background: #1c1b19;
  color: #d6d3d1;
}
body[data-doc-page] .docs-inline-code {
  background: #211f1c;
  border-color: rgba(255, 255, 255, 0.10);
  color: #e7e5e4;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* Saffron slot 4 — the citation marker. A page can hold fifty links but only
   one can be under the cursor, so the one-per-viewport rule holds by itself. */
body[data-doc-page] .docs-prose a {
  color: #e7e5e4;
  text-decoration-color: rgba(138, 131, 120, 0.55);
}
body[data-doc-page] .docs-prose a:hover,
body[data-doc-page] .docs-prose a:focus-visible {
  color: var(--docs-saffron);
  text-decoration-color: currentColor;
}

/* Buttons: backgrounds intentionally NOT overridden — the desktop-parity
   layer at the end of site.css owns .btn-primary/.btn-secondary sitewide
   (light-stone primary, soft secondary) and the docs must match the site.
   But the readability pass forces `.docs-site .text-white` to --docs-text
   with !important, which is now light — restore the parity layer's dark
   label on the light primary button. */
body[data-doc-page] .docs-site .btn-primary,
body[data-doc-page] .docs-site .btn-primary.text-white {
  color: #1c1917 !important;
}
body[data-doc-page] .docs-site .btn-secondary {
  color: #a8a29e !important;
}

/* sidebar / toc */
body[data-doc-page] .docs-sidebar-toggle {
  border-color: rgba(255, 255, 255, 0.12);
  background: #1c1b19;
  color: #d6d3d1;
}
body[data-doc-page] .docs-nav-link:hover {
  background: #211f1c;
}
body[data-doc-page] .docs-nav-link-title,
body[data-doc-page] .docs-toc-link {
  color: #d6d3d1;
}
body[data-doc-page] .docs-nav-link.is-active .docs-nav-link-title {
  color: #faf8f4;
  font-weight: 600;
}

/* search */
body[data-doc-page] .docs-search input:focus {
  border-color: rgba(226, 113, 42, 0.55);
  box-shadow: 0 0 0 3px rgba(226, 113, 42, 0.14);
}

/* cards */
body[data-doc-page] .docs-link-card:hover,
body[data-doc-page] .docs-pager-link:hover {
  border-color: rgba(226, 113, 42, 0.32);
  background: #211f1c;
}

/* code tabs */
body[data-doc-page] .docs-code-tab {
  color: #a8a29e;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}
body[data-doc-page] .docs-code-tab:hover {
  background: #211f1c;
  color: #f5f5f4;
}
body[data-doc-page] .docs-code-tab.is-active,
body[data-doc-page] .docs-code-tab[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.07);
  color: #faf8f4;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* code blocks: navy -> warm near-black */
body[data-doc-page] .docs-code,
body[data-doc-page] .docs-pre,
body[data-doc-page] pre {
  border-color: rgba(255, 255, 255, 0.08);
  background: #12110f;
  color: #d6d3d1;
  font-family: ui-monospace, Consolas, monospace;
}

/* notes */
body[data-doc-page] .docs-note {
  border-color: rgba(138, 131, 120, 0.26);
  background: rgba(138, 131, 120, 0.06);
}
body[data-doc-page] .docs-note-label {
  color: var(--docs-warm-grey);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  font-size: 11px;
}

/* ambient orbs stay hidden (readability pass) — keep it that way */
body[data-doc-page] .docs-site .orb {
  display: none;
}

/* docs-theme loads after the shared sheet, so mirror the public scale here
   for the few intentionally themed selectors with equal specificity. */
body[data-doc-page] .docs-kicker,
body[data-doc-page] .docs-note-label {
  font-size: var(--kw-public-meta, 13px);
}

body[data-doc-page] .docs-code-tab,
body[data-doc-page] .docs-code,
body[data-doc-page] .docs-pre,
body[data-doc-page] pre {
  font-size: var(--kw-public-code, 14px);
}
