/* In-app help: the full /docs page, the offcanvas help drawer, and the shared
   reading typography. Designed to feel native to the Sneat admin shell — it
   borrows the theme's Bootstrap custom properties (with fallbacks) so it tracks
   the app's palette rather than introducing a second identity. The one bit of
   emphasis is the reading column itself: a comfortable measure, a clear heading
   scale, and a single primary accent on callouts and section rules. */

:root {
  --docs-measure: 44rem;
  --docs-primary: var(--bs-primary, #696cff);
  --docs-ink: var(--bs-body-color, #566a7f);
  --docs-muted: var(--bs-secondary-color, #8592a3);
  --docs-border: var(--bs-border-color, #d9dee3);
  --docs-surface-soft: rgba(105, 108, 255, 0.06);
}

/* ---- Full page layout ------------------------------------------------- */

.docs-page .docs-card {
  border: 0;
}

.docs-toc {
  position: sticky;
  top: 5rem;
}

.docs-toc-section + .docs-toc-section {
  margin-top: 1.25rem;
}

.docs-toc-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.35rem;
}

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

.docs-toc-link {
  display: block;
  padding: 0.3rem 0.75rem;
  border-radius: 0.375rem;
  color: var(--docs-ink);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
}

.docs-toc-link:hover {
  background: var(--docs-surface-soft);
  color: var(--docs-primary);
}

.docs-toc-link.is-active {
  color: var(--docs-primary);
  font-weight: 600;
  background: var(--docs-surface-soft);
  border-left-color: var(--docs-primary);
}

/* ---- Reading typography (shared by page + drawer) --------------------- */

.docs-content {
  max-width: var(--docs-measure);
  color: var(--docs-ink);
  line-height: 1.65;
  font-size: 0.95rem;
}

.docs-content > *:first-child {
  margin-top: 0;
}

.docs-content h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.docs-content h2 {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-content h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin-top: 1.6rem;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
}

.docs-content li + li {
  margin-top: 0.25rem;
}

.docs-content li > ul,
.docs-content li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.docs-content a {
  color: var(--docs-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(105, 108, 255, 0.35);
}

.docs-content a:hover {
  border-bottom-color: var(--docs-primary);
}

.docs-content strong {
  color: var(--bs-heading-color, #566a7f);
  font-weight: 600;
}

.docs-content code {
  font-family: var(--bs-font-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.85em;
  padding: 0.12em 0.4em;
  border-radius: 0.3rem;
  background: rgba(131, 146, 165, 0.14);
  color: #4b5563;
  white-space: nowrap;
}

/* Callout — the FAQ's "> ..." emphasis blocks. One primary accent, quiet fill. */
.docs-content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 3px solid var(--docs-primary);
  background: var(--docs-surface-soft);
  border-radius: 0 0.375rem 0.375rem 0;
  color: var(--docs-ink);
}

.docs-content blockquote > *:last-child {
  margin-bottom: 0;
}

/* Tables — the guide leans on them heavily; keep them crisp and scrollable. */
.docs-content table {
  width: 100%;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  display: block;
  overflow-x: auto;
}

.docs-content thead th {
  text-align: left;
  font-weight: 600;
  background: var(--docs-surface-soft);
  border-bottom: 2px solid var(--docs-border);
}

.docs-content th,
.docs-content td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: top;
}

.docs-content hr {
  margin: 2rem 0 1rem;
  border: 0;
  border-top: 1px solid var(--docs-border);
  opacity: 1;
}

/* The "Last verified against" footer renders as an <em> paragraph after an <hr>. */
.docs-content hr + p {
  font-size: 0.8rem;
  color: var(--docs-muted);
}

/* ---- Topnav "?" button ------------------------------------------------ */

.btn-docs-help {
  color: var(--docs-muted);
  padding: 0.25rem;
  line-height: 1;
}

.btn-docs-help:hover,
.btn-docs-help:focus {
  color: var(--docs-primary);
}

/* ---- Help drawer ------------------------------------------------------ */

.docs-drawer {
  --bs-offcanvas-width: 460px;
}

.docs-drawer .offcanvas-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--docs-border);
}

.docs-drawer-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--docs-primary);
  margin-bottom: 0.15rem;
}

.docs-drawer .offcanvas-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.25;
}

.docs-drawer .offcanvas-body {
  padding-top: 1.1rem;
}

.docs-drawer .docs-content {
  max-width: none;
  font-size: 0.9rem;
}

.docs-drawer .docs-content h2 {
  font-size: 1.08rem;
  margin-top: 1.75rem;
}

.docs-drawer .docs-content h3 {
  font-size: 0.98rem;
}

.offcanvas-footer.docs-drawer-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--docs-border);
}

/* ---- Inline help affordances (report tables) -------------------------- */

/* A column header (or hint) that carries a tooltip: dotted underline + help
   cursor signal there's more to read on hover. */
.funding-help-th {
  cursor: help;
  text-decoration: underline dotted 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--docs-muted);
}

.funding-learn-more {
  color: var(--docs-primary);
  white-space: nowrap;
}

.funding-learn-more:hover {
  color: var(--docs-primary);
  text-decoration: underline !important;
}

/* ---- Quality floor ---------------------------------------------------- */

.btn-docs-help:focus-visible,
.docs-toc-link:focus-visible,
.docs-content a:focus-visible {
  outline: 2px solid var(--docs-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 991.98px) {
  .docs-toc {
    position: static;
    margin-bottom: 0.5rem;
  }
}
