/* MONAS reading plane: hide Logseq product navigation and non-reading chrome.
   Shared across every MONAS site via nginx sub_filter (see the "Site: <n>"
   blocks in default.conf) -- edit only this one file, never a per-site copy.
   Pairs with debrand.js (Flashcards has no href, so it is hidden there by
   text match instead of by selector). */

/* Shared MONAS reading palette. Logseq's native reader control owns theme
   state and publishes it as html[data-theme="light"|"dark"]. This file owns
   only the rendering of those states. It creates no mode, control, geometry,
   persistence, or state transition. */
html[data-theme="light"],
html[data-theme="light"][data-color],
html[data-theme="light"] body.white-theme,
html[data-theme="light"] body.light-theme {
  color-scheme: light;
  --ls-primary-background-color: #ffffff;
  --ls-secondary-background-color: #f6f6f5;
  --ls-tertiary-background-color: #efefee;
  --ls-quaternary-background-color: #e6e6e4;
  --ls-primary-text-color: #1c1c1c;
  --ls-secondary-text-color: #6b6b6b;
  --ls-title-text-color: #111111;
  --ls-border-color: #e4e4e2;
  --ls-secondary-border-color: #efefee;
  --ls-tertiary-border-color: #dadad7;
  --ls-link-text-color: var(--ls-primary-text-color);
  --ls-link-text-hover-color: #2563a8;
  --ls-link-ref-text-color: var(--ls-primary-text-color);
  --ls-link-ref-text-hover-color: #2563a8;
  --ls-tag-text-color: var(--ls-primary-text-color);
  --ls-block-ref-link-text-color: var(--ls-primary-text-color);
  --ls-block-bullet-color: #c4c4c0;
  --ls-selection-background-color: #dbeaff;
  --ls-page-inline-code-color: var(--ls-primary-text-color);
  --ls-page-inline-code-bg-color: #f1f1ef;
  --ls-page-blockquote-color: var(--ls-secondary-text-color);
  --ls-page-blockquote-border-color: #dcdcd9;
  --ls-table-tr-even-background-color: var(--ls-secondary-background-color);
  --ls-block-properties-background-color: var(--ls-secondary-background-color);
  --ls-page-properties-background-color: var(--ls-secondary-background-color);
  --ls-guideline-color: var(--ls-border-color);
  --ls-block-highlight-color: var(--ls-tertiary-background-color);
  --ls-active-primary-color: #2563a8;
  --ls-active-secondary-color: #2563a8;
  --ls-scrollbar-foreground-color: #c4c4c0;
  --ls-scrollbar-background-color: var(--ls-primary-background-color);
  --background: 0 0% 100%;
  --foreground: 0 0% 11%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 11%;
  --primary: 211 64% 40%;
  --primary-foreground: 0 0% 100%;
  --secondary: 60 3% 96%;
  --secondary-foreground: 0 0% 17%;
  --muted: 60 3% 94%;
  --muted-foreground: 0 0% 42%;
  --accent: 60 3% 94%;
  --accent-foreground: 211 64% 40%;
  --border: 60 3% 89%;
  --input: 60 3% 89%;
  --ring: 211 64% 40%;
  background-color: var(--ls-primary-background-color);
  color: var(--ls-primary-text-color);
}

html[data-theme="dark"],
html[data-theme="dark"][data-color],
html[data-theme="dark"] body.dark-theme {
  color-scheme: dark;
  --ls-primary-background-color: #1b1d21;
  --ls-secondary-background-color: #23262c;
  --ls-tertiary-background-color: #2a2e35;
  --ls-quaternary-background-color: #333842;
  --ls-primary-text-color: #d6d8dc;
  --ls-secondary-text-color: #9aa0a8;
  --ls-title-text-color: #e9ebee;
  --ls-border-color: #343941;
  --ls-secondary-border-color: #2a2e35;
  --ls-tertiary-border-color: #3d434c;
  --ls-link-text-color: var(--ls-primary-text-color);
  --ls-link-text-hover-color: #7fb0e6;
  --ls-link-ref-text-color: var(--ls-primary-text-color);
  --ls-link-ref-text-hover-color: #7fb0e6;
  --ls-tag-text-color: var(--ls-primary-text-color);
  --ls-block-ref-link-text-color: var(--ls-primary-text-color);
  --ls-block-bullet-color: #5a616b;
  --ls-selection-background-color: #344a5c;
  --ls-page-inline-code-color: var(--ls-primary-text-color);
  --ls-page-inline-code-bg-color: #2a2e35;
  --ls-page-blockquote-color: var(--ls-secondary-text-color);
  --ls-page-blockquote-border-color: #3d434c;
  --ls-table-tr-even-background-color: var(--ls-secondary-background-color);
  --ls-block-properties-background-color: var(--ls-secondary-background-color);
  --ls-page-properties-background-color: var(--ls-secondary-background-color);
  --ls-guideline-color: var(--ls-border-color);
  --ls-block-highlight-color: var(--ls-tertiary-background-color);
  --ls-active-primary-color: #7fb0e6;
  --ls-active-secondary-color: #7fb0e6;
  --ls-scrollbar-foreground-color: #5a616b;
  --ls-scrollbar-background-color: var(--ls-primary-background-color);
  --background: 220 10% 12%;
  --foreground: 220 8% 85%;
  --card: 220 11% 15%;
  --card-foreground: 220 8% 85%;
  --popover: 220 11% 15%;
  --popover-foreground: 220 8% 85%;
  --primary: 211 64% 70%;
  --primary-foreground: 220 10% 12%;
  --secondary: 220 11% 17%;
  --secondary-foreground: 220 8% 85%;
  --muted: 220 12% 19%;
  --muted-foreground: 218 7% 63%;
  --accent: 220 12% 19%;
  --accent-foreground: 211 64% 70%;
  --border: 218 11% 23%;
  --input: 218 11% 23%;
  --ring: 211 64% 70%;
  background-color: var(--ls-primary-background-color);
  color: var(--ls-primary-text-color);
}

html[data-theme="light"] body,
html[data-theme="dark"] body {
  background: var(--ls-primary-background-color);
  color: var(--ls-primary-text-color);
}

html[data-theme="light"] ::selection,
html[data-theme="dark"] ::selection {
  background: var(--ls-selection-background-color);
}

html[data-theme="light"] ::highlight(monas) { background: rgba(37, 99, 168, .16); }
html[data-theme="light"] ::highlight(monas-active) { background: rgba(37, 99, 168, .30); }
html[data-theme="dark"] ::highlight(monas) { background: rgba(127, 176, 230, .18); }
html[data-theme="dark"] ::highlight(monas-active) { background: rgba(127, 176, 230, .34); }
/* Left sidebar: keep the sidebar itself (page tree, favorites, journal nav);
   remove only the Logseq product-navigation links that don't belong on the
   reading plane. */
#left-sidebar a[href="#/whiteboards"],
#left-sidebar a[href="#/graph"],
#left-sidebar a[href="#/all-pages"] {
  display: none !important;
}

/* 2026-08-16: on the publish-spa (2026-07-21 deVries-route) build, "Graph"
   also renders in the top toolbar (.r.flex.drag-region), not only the left
   sidebar -- confirmed live on wilfridsellars.monas.one. Same #/graph
   product feature; hidden unconditionally rather than re-scoping the rule
   above, so this is additive and cannot change behavior anywhere the old
   selector already matched. */
a[href="#/graph"] {
  display: none !important;
}

/* Right sidebar (Contents / Page graph / Help, including Logseq docs,
   community, about, terms) has no reading-plane purpose. Commentary uses
   its own composer UI, not this panel. */
.toggle-right-sidebar,
#right-sidebar {
  display: none !important;
}

/* ---- Law IX / ORIENTATION: "Colour is a hover state, never a resting one."
   Logseq paints every link with its own default blue AT REST, which breaks
   that law on every MONAS site. MONAS's own designed palette
   (platform/baseline/branding/custom.css, 102 lines, Paper/Light/Night with
   proper --ls-link-* values) is loaded by ZERO live sites -- the reinject.sh
   index.html path it depended on is wiped by every raw Logseq re-export, so
   what every reader has actually been seeing all along is Logseq's raw
   default theme. Migrating that whole palette into this serve-time file is
   DESIGN-01 in BACKLOG.md and is NOT done here.
   This rule restores the law for links only, scoped to the reading plane so
   it cannot touch toolbar/sidebar affordances: ink at rest, the single
   accent on hover. The underline stays -- remove it and the reader loses
   the ability to see that a link is a link (Law I), which is not decoration.
   Falls back through the palette's own variables so it composes correctly,
   rather than being overridden, once DESIGN-01 lands. ---- */
#main-content-container a.external-link,
#main-content-container a.page-ref,
#main-content-container a.block-ref {
  color: inherit;
  text-decoration-color: var(--ls-border-color, #cfc8b8);
}

#main-content-container a.external-link:hover,
#main-content-container a.page-ref:hover,
#main-content-container a.block-ref:hover {
  color: var(--ls-link-text-hover-color, #2c4456);
  text-decoration-color: currentColor;
}
