/* Context Hub architecture documentation theme for Docmost.
   This stylesheet is injected by internal-docs/docmost-publication/railway/docker-entrypoint-theme.sh.
   Keep all Docmost visual overrides here so the documentation surface is reproducible. */

@font-face {
  font-family: "Roboto Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/RobotoMono-Bold.ttf") format("truetype");
}

:root {
  --chub-doc-callout-font-size: 0.92rem;
  --chub-doc-callout-line-height: 1.62;
  --chub-doc-table-font-size: 0.82rem;
  --chub-doc-table-line-height: 1.48;
  --chub-doc-callout-table-font-size: 0.76rem;
  --chub-doc-callout-table-line-height: 1.42;
  --chub-doc-table-bg: #faf7ef;
  --chub-doc-table-header-bg: #efe6d6;
  --chub-doc-table-border: #d9cfbd;
  --chub-doc-table-text-color: #3f2d1f;
  --chub-doc-body-font: "Segoe UI", SegoeUI, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --chub-doc-technical-font: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --chub-doc-technical-font-size: 0.76rem;
  --chub-doc-technical-color: #16803f;
  --chub-doc-paragraph-label-color: #7f8794;
  --chub-doc-h3-font-size: 1.125rem;
  --chub-doc-h4-font-size: 1rem;
  --chub-doc-detail-heading-line-height: 1.4;
  --chub-doc-detail-heading-font-weight: 700;
  --chub-doc-detail-heading-color: #000;
  --chub-doc-detail-heading-font-style: normal;
}

/* Keep the local Docmost surface aligned with the Windows documentation style.
   Docmost ships its own font stack in several places, so apply this to both
   page chrome and rendered document text. Inline code is overridden below. */
body,
button,
input,
select,
textarea,
.mantine-AppShell-root,
:where(.bnc-content, .ProseMirror, main) :where(h1, h2, h3, h4, h5, h6, p, li, th, td, blockquote, figcaption, span) {
  font-family: var(--chub-doc-body-font) !important;
}

/* H3 and H4 headings are both detail headings inside the imported H2 pages.
   H3 carries one step more visual weight while keeping the same family, color,
   style, and weight as H4. */
:where(.bnc-content, .ProseMirror, main) :where(h3, h4),
:where(.bnc-content, .ProseMirror, main) :where(h3, h4) * {
  color: var(--chub-doc-detail-heading-color) !important;
  font-family: var(--chub-doc-body-font) !important;
  font-style: var(--chub-doc-detail-heading-font-style) !important;
  font-weight: var(--chub-doc-detail-heading-font-weight) !important;
  line-height: var(--chub-doc-detail-heading-line-height) !important;
}

:where(.bnc-content, .ProseMirror, main) h2,
:where(.bnc-content, .ProseMirror, main) h2 * {
  font-family: var(--chub-doc-body-font) !important;
  font-weight: 700 !important;
}

:where(.bnc-content, .ProseMirror, main) h3,
:where(.bnc-content, .ProseMirror, main) h3 * {
  font-size: var(--chub-doc-h3-font-size) !important;
}

:where(.bnc-content, .ProseMirror, main) h4,
:where(.bnc-content, .ProseMirror, main) h4 * {
  font-size: var(--chub-doc-h4-font-size) !important;
}

/* Native Docmost callout blocks are Mantine alerts. Reduce prose density without
   shrinking icons, page chrome, or ordinary paragraph text. */
.mantine-Alert-root[role="alert"] .mantine-Alert-message,
.mantine-Alert-root[role="alert"] [data-node-view-content],
.mantine-Alert-root[role="alert"] [data-node-view-content-react],
.mantine-Alert-root[role="alert"] p,
.mantine-Alert-root[role="alert"] li,
.mantine-Alert-root[role="alert"] td,
.mantine-Alert-root[role="alert"] th {
  font-size: var(--chub-doc-callout-font-size);
  line-height: var(--chub-doc-callout-line-height);
}

.mantine-Alert-root[role="alert"] p {
  margin-bottom: 0.55rem;
}

.mantine-Alert-root[role="alert"] p:last-child {
  margin-bottom: 0;
}

/* Imported reference tables are dense technical evidence. Use a quiet beige table
   surface, smaller type, and a little more padding so schema tables scan cleanly. */
:where(.bnc-content, .ProseMirror, main) .tableWrapper {
  max-width: 100% !important;
  width: 100% !important;
}

.bnc-content table,
.ProseMirror table,
main table {
  background: var(--chub-doc-table-bg);
  border-collapse: collapse;
  color: var(--chub-doc-table-text-color);
  font-size: var(--chub-doc-table-font-size);
  line-height: var(--chub-doc-table-line-height);
  max-width: 100% !important;
  min-width: 100% !important;
  table-layout: auto !important;
  width: 100% !important;
}

:where(.bnc-content, .ProseMirror, main) table col {
  width: auto !important;
}

.bnc-content table th,
.bnc-content table td,
.ProseMirror table th,
.ProseMirror table td,
main table th,
main table td {
  background: var(--chub-doc-table-bg);
  border-color: var(--chub-doc-table-border);
  color: var(--chub-doc-table-text-color);
  font-size: var(--chub-doc-table-font-size);
  line-height: var(--chub-doc-table-line-height);
  padding: 0.42rem 0.55rem;
  vertical-align: top;
}

.bnc-content table th,
.ProseMirror table th,
main table th {
  background: var(--chub-doc-table-header-bg);
  color: var(--chub-doc-table-text-color);
  font-weight: 650;
}

:where(.bnc-content, .ProseMirror, main) table :where(p, li, span, strong, em) {
  color: var(--chub-doc-table-text-color) !important;
}

.bnc-content table code,
.ProseMirror table code,
main table code {
  font-size: 0.95em;
}

/* Inline technical terms are rendered by Docmost as inline code. Keep them
   typographic, not chip-like: bold green Roboto Mono on transparent fill. */
:where(.bnc-content, .ProseMirror, main) code:not(pre code) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--chub-doc-technical-color) !important;
  font-family: var(--chub-doc-technical-font) !important;
  font-size: var(--chub-doc-technical-font-size) !important;
  font-weight: 700 !important;
  padding: 0 !important;
}

/* Source paragraph anchors such as [01.0001] are generated as the first
   strong+emphasis run in imported paragraphs, so they can be styled without
   hardcoding individual labels. */
:where(.bnc-content, .ProseMirror, main) p > strong:first-child > em:first-child {
  color: var(--chub-doc-paragraph-label-color) !important;
  font-size: 0.875em !important;
  font-style: normal !important;
  font-weight: 700 !important;
}

/* Tables embedded inside callouts should be smaller than the callout prose.
   This is deliberately separate from the normal table scale. */
.mantine-Alert-root[role="alert"] table,
.mantine-Alert-root[role="alert"] table th,
.mantine-Alert-root[role="alert"] table td {
  font-size: var(--chub-doc-callout-table-font-size) !important;
  line-height: var(--chub-doc-callout-table-line-height) !important;
}

.mantine-Alert-root[role="alert"] table :where(p, li, span, strong, em) {
  font-size: var(--chub-doc-callout-table-font-size) !important;
  line-height: var(--chub-doc-callout-table-line-height) !important;
}

.mantine-Alert-root[role="alert"] table code:not(pre code) {
  font-size: 0.95em !important;
}

.mantine-Alert-root[role="alert"] .tableWrapper {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}
