/* Gunmetal Blue-Gray theme for published SPA.
   Uses data-color="gunmetal" to avoid clashing with any
   built-in Logseq colour theme (logseq, blue, cyan, etc.). */
html[data-theme="dark"][data-color="gunmetal"],
html[data-theme="dark"],
html[data-theme="light"],
html {
  --ls-primary-background-color: #1b2128 !important;
  --ls-secondary-background-color: #242b35 !important;
  --ls-tertiary-background-color: #2e3642 !important;
  --ls-quaternary-background-color: #242b35 !important;
  --ls-primary-text-color: #c5cdd8 !important;
  --ls-secondary-text-color: #8891a0 !important;
  --ls-title-text-color: #e2e8f0 !important;
  --ls-link-text-color: #5b9bd5 !important;
  --ls-link-ref-text-color: #4ec9b0 !important;
  --ls-link-ref-text-hover-color: #c5cdd8 !important;
  --ls-link-text-hover-color: #c5cdd8 !important;
  --ls-alink-color: #5b9bd5 !important;
  --ls-block-highlight-color: rgba(46, 54, 66, 0.8) !important;
  --ls-page-properties-background-color: #242b35 !important;
  --ls-page-inline-code-bg-color: #242b35 !important;
  --ls-page-inline-code-color: #d19a66 !important;
  --ls-page-blockquote-bg-color: #242b35 !important;
  --ls-page-blockquote-border-color: #3d4555 !important;
  --ls-page-blockquote-color: #c5cdd8 !important;
  --ls-border-color: #3d4555 !important;
  --ls-secondary-border-color: #3d4555 !important;
  --ls-scrollbar-foreground-color: #3d4555 !important;
  --ls-scrollbar-background-color: #1b2128 !important;
  --ls-head-text-color: #e2e8f0 !important;
  --ls-active-primary-color: #4ec9b0 !important;
  --ls-active-secondary-color: #c5cdd8 !important;
  --ls-block-properties-background-color: #242b35 !important;
  --ls-block-ref-link-text-color: #4ec9b0 !important;
  --ls-guideline-color: #3d4555 !important;
  --ls-menu-hover-color: #242b35 !important;
  --ls-tag-text-color: #4ec9b0 !important;
  --ls-tag-text-hover-color: #c5cdd8 !important;
  --ls-slide-background-color: #1b2128 !important;
  --ls-block-bullet-border-color: #3d4555 !important;
  --ls-block-bullet-color: #5a6270 !important;
  --ls-selection-background-color: #2e3642 !important;
  --ls-selection-text-color: #e2e8f0 !important;
  --ls-page-checkbox-color: #4ec9b0 !important;
  --ls-page-mark-bg-color: #d19a66 !important;
  --ls-page-mark-color: #1b2128 !important;
  --ls-table-tr-even-background-color: #242b35 !important;
  --color-level-1: #1b2128;
  --color-level-2: #242b35;
  --color-level-3: #2e3642;
}
html { color-scheme: dark; }
body { background-color: #1b2128 !important; color: #c5cdd8 !important; }
.left-sidebar-inner { background-color: #1b2128 !important; }
.cp__header { background-color: #1b2128 !important; }
#main-content-container { background-color: #1b2128 !important; }
/* Catch-all for any theme class Logseq applies */
.dark-theme, .white-theme, .light-theme {
  --ls-primary-background-color: #1b2128 !important;
  --ls-secondary-background-color: #242b35 !important;
  --ls-tertiary-background-color: #2e3642 !important;
  --ls-quaternary-background-color: #242b35 !important;
  --ls-primary-text-color: #c5cdd8 !important;
  --ls-secondary-text-color: #8891a0 !important;
  --ls-title-text-color: #e2e8f0 !important;
  --ls-link-text-color: #5b9bd5 !important;
  --ls-border-color: #3d4555 !important;
}
/* Override Logseq's inline background-color on html element */
html[data-theme="dark"] {
  background-color: #1b2128 !important;
}
/* Neutralise any residual built-in colour scheme vars */
html[data-theme="dark"][data-color] {
  --ls-primary-background-color: #1b2128 !important;
  --ls-secondary-background-color: #242b35 !important;
  --ls-tertiary-background-color: #2e3642 !important;
  --ls-quaternary-background-color: #242b35 !important;
  --ls-primary-text-color: #c5cdd8 !important;
  --ls-secondary-text-color: #8891a0 !important;
  --ls-title-text-color: #e2e8f0 !important;
  --ls-link-text-color: #5b9bd5 !important;
  --ls-link-ref-text-color: #4ec9b0 !important;
  --ls-border-color: #3d4555 !important;
  --ls-secondary-border-color: #3d4555 !important;
  --ls-block-highlight-color: rgba(46, 54, 66, 0.8) !important;
  --ls-page-properties-background-color: #242b35 !important;
  --ls-page-inline-code-bg-color: #242b35 !important;
  --ls-page-inline-code-color: #d19a66 !important;
  --ls-scrollbar-foreground-color: #3d4555 !important;
  --ls-scrollbar-background-color: #1b2128 !important;
  --ls-block-bullet-border-color: #3d4555 !important;
  --ls-block-bullet-color: #5a6270 !important;
  --ls-guideline-color: #3d4555 !important;
  background-color: #1b2128 !important;
}

/* Force gunmetal on block/page embeds (.color-level nesting) */
.color-level {
  background-color: #242b35 !important;
}
.color-level .color-level {
  background-color: #2e3642 !important;
}
.color-level .color-level .color-level {
  background-color: #353e4d !important;
}
.embed-page, .embed-block, .embed {
  background-color: #242b35 !important;
  border-color: #3d4555 !important;
}
/* Override Logseq rx-gray fallbacks that cause white panels */
:root, html {
  --rx-gray-01: #1b2128 !important;
  --rx-gray-02: #242b35 !important;
  --rx-gray-03: #2e3642 !important;
  --rx-gray-04: #353e4d !important;
  --rx-gray-05: #3d4555 !important;
  --rx-gray-06: #4a5568 !important;
  --lx-gray-01: #1b2128 !important;
  --lx-gray-02: #242b35 !important;
  --lx-gray-03: #2e3642 !important;
}

/* Hide mermaid source code blocks after kroki renders them */
.kroki-diagram + .extensions__code,
.kroki-diagram + .ls-block .extensions__code {
  display: none !important;
}
/* Hide {{renderer code_diagram,mermaid}} macro text */
[data-macro-name="renderer"] { display: none; }
