/* simhachalam · Docmost-Theme (docs.simhachalam.de), Entwurf 1 mit Korrektur 9, 3.12.2026, 🎨 DESIGNER
   Quelle: Themes tempelnacht (Dark) und tempel (Light) im kosmos-Katalog simhachalam.
   Nur Mantine-7-Variablen und @font-face. Einbau: BAUMEISTER per nginx sub_filter nach den Docmost-Styles.
   Schriften selbst gehostet unter /simhachalam-theme/fonts/ (Dateien: kosmos Design/simhachalam/ressourcen/schriften/, Lizenz OFL/Apache). */

/* ---------- Schriften ---------- */
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("/simhachalam-theme/fonts/roboto-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 400; font-display: swap; src: url("/simhachalam-theme/fonts/roboto-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: "Roboto"; font-weight: 500; font-display: swap; src: url("/simhachalam-theme/fonts/roboto-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Roboto"; font-weight: 700; font-display: swap; src: url("/simhachalam-theme/fonts/roboto-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("/simhachalam-theme/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 600; font-display: swap; src: url("/simhachalam-theme/fonts/cormorant-garamond-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF; }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-display: swap; src: url("/simhachalam-theme/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2"); }

/* ---------- gemeinsam ---------- */
:root {
  --mantine-font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mantine-font-family-headings: "Cormorant Garamond", Georgia, serif;
  --mantine-radius-default: 3px;           /* eine Rundung wie im Katalog */
  --mantine-radius-xs: 2px; --mantine-radius-sm: 3px; --mantine-radius-md: 3px;

  /* Gold als Primärfarbe (Knöpfe, Auswahl, Fortschritt), 0 hell … 9 dunkel, 5 = Gold #d9962b */
  --mantine-color-gold-0: #fbf1de; --mantine-color-gold-1: #f5dfb4; --mantine-color-gold-2: #efca85;
  --mantine-color-gold-3: #e8b45a; --mantine-color-gold-4: #f2b632; --mantine-color-gold-5: #d9962b;
  --mantine-color-gold-6: #bf8224; --mantine-color-gold-7: #a06c1e; --mantine-color-gold-8: #805617; --mantine-color-gold-9: #5f4011;
  --mantine-primary-color-0: var(--mantine-color-gold-0); --mantine-primary-color-1: var(--mantine-color-gold-1);
  --mantine-primary-color-2: var(--mantine-color-gold-2); --mantine-primary-color-3: var(--mantine-color-gold-3);
  --mantine-primary-color-4: var(--mantine-color-gold-4); --mantine-primary-color-5: var(--mantine-color-gold-5);
  --mantine-primary-color-6: var(--mantine-color-gold-6); --mantine-primary-color-7: var(--mantine-color-gold-7);
  --mantine-primary-color-8: var(--mantine-color-gold-8); --mantine-primary-color-9: var(--mantine-color-gold-9);
  /* Docmost nutzt teils direkt blue: auf Gold umbiegen */
  --mantine-color-blue-0: var(--mantine-color-gold-0); --mantine-color-blue-1: var(--mantine-color-gold-1);
  --mantine-color-blue-2: var(--mantine-color-gold-2); --mantine-color-blue-3: var(--mantine-color-gold-3);
  --mantine-color-blue-4: var(--mantine-color-gold-4); --mantine-color-blue-5: var(--mantine-color-gold-5);
  --mantine-color-blue-6: var(--mantine-color-gold-6); --mantine-color-blue-7: var(--mantine-color-gold-7);
  --mantine-color-blue-8: var(--mantine-color-gold-8); --mantine-color-blue-9: var(--mantine-color-gold-9);
  --mantine-primary-color-filled: #d9962b;
  --mantine-primary-color-filled-hover: #f2b632;
  --mantine-primary-color-contrast: #14110d;   /* dunkle Schrift auf Gold (8:1) */
  --mantine-color-blue-filled: #d9962b; --mantine-color-blue-filled-hover: #f2b632;
}

/* ---------- Dark: Tempel Nacht ---------- */
:root[data-mantine-color-scheme="dark"] {
  /* Korrektur 3 (3.12.): Captain fand Dunkel zu dunkel und die Schrift blendend. Text gedämpft, Grund einen Tick heller. */
  --mantine-color-white: #e4d9c4;    /* Korrektur 4: wo Docmost reines Weiß als Schrift setzt, helles Pergament */
  --mantine-color-dark-0: #d8ccb6;   /* Text, warmes Pergament statt fast Weiß */
  --mantine-color-dark-1: #c3b7a1;   /* Text leiser */
  --mantine-color-dark-2: #a69a84;   /* gedimmt, Meta */
  --mantine-color-dark-3: #82765f;   /* Platzhalter */
  --mantine-color-dark-4: #4c4234;   /* Rand */
  --mantine-color-dark-5: #332c22;   /* Hover */
  --mantine-color-dark-6: #26211a;   /* Felder, Karten */
  --mantine-color-dark-7: #1d1914;   /* Seitengrund */
  --mantine-color-dark-8: #16130f;   /* Kopf und Seitenleiste, leise abgesetzt vom Seitengrund */
  --mantine-color-dark-9: #0f0d0a;   /* Nacht */
  --mantine-color-body: #1d1914;
  --mantine-color-text: #d8ccb6;
  --mantine-color-dimmed: #a69a84;
  --mantine-color-placeholder: #82765f;
  --mantine-color-default: #26211a;
  --mantine-color-default-hover: #332c22;
  --mantine-color-default-color: #d8ccb6;
  --mantine-color-default-border: #4c4234;
  --mantine-color-anchor: #6aaab0;          /* Petrol: hier wird gehandelt */
  --mantine-primary-color-light: rgba(217, 150, 43, .16);
  --mantine-primary-color-light-hover: rgba(217, 150, 43, .24);
  --mantine-primary-color-light-color: #e6b968;
  --mantine-color-blue-light: rgba(217, 150, 43, .16);
  --mantine-color-blue-light-hover: rgba(217, 150, 43, .24);
  --mantine-color-blue-light-color: #e6b968;
  --mantine-color-error: #f0a090;
}

/* ---------- Light: Tempel ----------
   Korrektur 6 (3.12.): gilt immer, wenn nicht ausdrücklich dunkel. Absicherung: Fehlt das Farbschema-Attribut, bliebe sonst
   Docmost-Weiß. (Anlass Buchhaltungs-PC, dort lag es am Ende an den Bildschirmeinstellungen.) */
:root:not([data-mantine-color-scheme="dark"]) {
  /* Korrektur 4 (3.12.): nichts heller als der Seitengrund, sonst weiße Inseln (Suche, Teilen, Schalter, Kbd) */
  --mantine-color-white: #f7f0e3;    /* Docmost und Mantine malen viele Flächen mit „white“: hier Creme */
  --mantine-color-gray-0: #f2e9d8;   /* Karten, Kbd, Tabellenkopf */
  --mantine-color-gray-1: #f3ead9;   /* Hover, Seitenleiste */
  --mantine-color-gray-2: #e6dcc9;
  --mantine-color-gray-3: #cdbfa5;   /* Rand */
  --mantine-color-gray-4: #b5a68c;
  --mantine-color-gray-5: #8f806b;
  --mantine-color-gray-6: #6b5d4d;   /* gedimmt */
  --mantine-color-gray-7: #4d4134;
  --mantine-color-gray-8: #33291f;
  --mantine-color-gray-9: #241d16;
  --mantine-color-body: #f7f0e3;            /* Creme */
  --mantine-color-text: #241d16;
  --mantine-color-dimmed: #6b5d4d;
  --mantine-color-placeholder: #8f806b;
  --mantine-color-default: #f7f0e3;        /* Nebenknöpfe und Felder wie der Seitengrund, nur mit Rand */
  --mantine-color-default-hover: #efe5d2;
  --mantine-color-default-color: #241d16;
  --mantine-color-default-border: #cdbfa5;
  --mantine-color-anchor: #1f5f66;          /* Petrol */
  --mantine-primary-color-light: rgba(217, 150, 43, .14);
  --mantine-primary-color-light-hover: rgba(217, 150, 43, .22);
  --mantine-primary-color-light-color: #8a5a3b;   /* Erde: Gold-Schrift auf Creme */
  --mantine-color-blue-light: rgba(217, 150, 43, .14);
  --mantine-color-blue-light-hover: rgba(217, 150, 43, .22);
  --mantine-color-blue-light-color: #8a5a3b;
  --mantine-color-error: #7e2a19;
}

/* ---------- Korrektur 1 (3.12.): Mantine setzt auf gefüllten Knöpfen inline fest Weiß (--button-color im style-Attribut),
   auf Gold zu wenig Kontrast (2,3:1). Nur diese Knöpfe bekommen dunkle Schrift, !important schlägt das Inline-Style. ---------- */
.mantine-Button-root[style*="--button-color: var(--mantine-color-white)"] { --button-color: #14110d !important; }
.mantine-ActionIcon-root[style*="--ai-color: var(--mantine-color-white)"] { --ai-color: #14110d !important; }

/* ---------- Korrektur 2 (3.12.): Docmost-eigene Klassen. CSS-Module-Namen ändern ihren Hash bei Updates,
   darum nur der stabile Anfang per [class*="_name_"]. Nach jedem Docmost-Update kurz prüfen. ---------- */

/* Überschriften: Seitentitel und Editor in Cormorant (Docmost setzt sie nicht über --mantine-font-family-headings) */
.page-title .ProseMirror h1,
.ProseMirror h1, .ProseMirror h2, .ProseMirror h3,
[class*="_title_"] { font-family: var(--mantine-font-family-headings); letter-spacing: 0; }
.page-title .ProseMirror h1 { font-size: 3rem; font-weight: 700; line-height: 1.1; }
.ProseMirror h2 { font-size: 1.9rem; font-weight: 600; }
.ProseMirror h3 { font-size: 1.5rem; font-weight: 600; }

/* Kopf und Seitenleiste: Nacht, mit feiner Linie zum Inhalt */
[data-mantine-color-scheme="dark"] [class*="_navbar_"].mantine-AppShell-navbar { border-right: 1px solid var(--mantine-color-dark-4); }
[data-mantine-color-scheme="dark"] .mantine-AppShell-header { border-bottom-color: var(--mantine-color-dark-4); }
:root:not([data-mantine-color-scheme="dark"]) [class*="_header_"].mantine-AppShell-header,
:root:not([data-mantine-color-scheme="dark"]) [class*="_navbar_"].mantine-AppShell-navbar { background-color: var(--mantine-color-gray-1); }

/* Aktive Seite im Baum und aktiver Menüpunkt: Gold */
[class*="_node_"][aria-selected="true"],
[class*="_activeButton_"] {
  background-color: var(--mantine-primary-color-light) !important;
  color: var(--mantine-primary-color-light-color) !important;
  font-weight: 500;
}
[class*="_node_"][aria-selected="true"] svg,
[class*="_activeButton_"] svg { color: var(--mantine-primary-color-filled); }

/* Avatare und Bereichslogo: Gold statt Mantine-Blau, -Rot, -Cyan (Farbe kommt inline, daher !important) */
.mantine-Avatar-root[data-variant="filled"] { --avatar-bg: var(--mantine-primary-color-filled) !important; --avatar-color: #14110d !important; }
.mantine-Avatar-root:not([data-variant="filled"]) { --avatar-bg: var(--mantine-primary-color-light) !important; --avatar-color: var(--mantine-primary-color-light-color) !important; }
.mantine-Avatar-root:not([data-variant="filled"]) .mantine-Avatar-placeholder { color: var(--mantine-primary-color-light-color) !important; }   /* Initialen-Farbe steht inline am Platzhalter */

/* ---------- Korrektur 3 (3.12.): Hell durchgehend eine Fläche. Docmost malt den Editor (.ProseMirror) weiß,
   Titel und Meta-Zeile dazwischen liegen auf dem Seitengrund, das wirkte wie abgetrennte Streifen. ---------- */
/*
   Docmost lädt sein Editor-CSS nach dem Theme, darum mit :root davor (höhere Spezifität). */
:root[data-mantine-color-scheme] .ProseMirror { background-color: transparent; }
/* Dunkel: Docmost setzt die Editor-Schrift auf reines Weiß, das blendet. Gedämpftes Pergament wie der übrige Text. */
:root[data-mantine-color-scheme="dark"] .ProseMirror { color: var(--mantine-color-text); }

/* ---------- Korrektur 4 (3.12.): Mantine-Felder holen ihren Grund aus --input-bg (hell: white) ---------- */
:root:not([data-mantine-color-scheme="dark"]) .mantine-Input-input { background-color: var(--mantine-color-body); }

/* ---------- Korrektur 5 (3.12.): öffentliche Freigabe unter /s/ (ausgeloggt). Docmost hat dafür ein eigenes Layout
   mit eigenen Variablen --docs-* (hell fast Weiß und Grau, Akzent Blau, Schrift Inter). Hier auf die Theme-Werte. ---------- */
:root:not([data-mantine-color-scheme="dark"]) {
  --docs-bg: var(--mantine-color-body);
  --docs-fg: var(--mantine-color-text);
  --docs-nav-fg: var(--mantine-color-gray-7);
  --docs-faint: var(--mantine-color-gray-5);
  --docs-hover: var(--mantine-color-default-hover);
  --docs-border: var(--mantine-color-gray-3);
  --docs-accent: #8a5a3b;                                   /* Erde: aktive Seite, Gliederung */
  --docs-accent-soft: var(--mantine-primary-color-light);
}
:root[data-mantine-color-scheme="dark"] {
  --docs-bg: var(--mantine-color-body);
  --docs-fg: var(--mantine-color-text);
  --docs-nav-fg: var(--mantine-color-dark-1);
  --docs-faint: var(--mantine-color-dark-3);
  --docs-hover: var(--mantine-color-default-hover);
  --docs-border: var(--mantine-color-dark-4);
  --docs-accent: var(--mantine-primary-color-light-color);  /* Gold, gedämpft */
  --docs-accent-soft: var(--mantine-primary-color-light);
}
/* Text in der Freigabe: Roboto statt Inter, Links im Inhalt Petrol wie im angemeldeten Docmost */
:root .public-typography { font-family: var(--mantine-font-family); letter-spacing: 0; }
:root [class*="_root_"] .ProseMirror a:not([class*="pageMention"]) { color: var(--mantine-color-anchor); }

/* ---------- Korrektur 7 (3.12.): Links im Inhalt erkennbar. Docmost färbt sie grau (dark-4) mit grauer Linie,
   sie sahen aus wie Text. Jetzt Petrol und unterstrichen, wie auf der Webseite. Seiten-Erwähnungen bleiben, wie sie sind. ---------- */
:root .ProseMirror a:not([class*="pageMention"]) {
  color: var(--mantine-color-anchor);
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-thickness: .07em;
  text-underline-offset: .18em;
}
:root .ProseMirror a:not([class*="pageMention"]):hover { text-decoration-thickness: .12em; }

/* ---------- Korrektur 8 (3.12.): Grundschrift 18 px statt 16 px, Wunsch Captain (nicht mehr zoomen).
   Mantine und Docmost rechnen in rem, darum wächst alles mit: Text, Überschriften, Tabellen, Listen, Kopf, Seitenleiste.
   112,5 % statt 18px, damit die Browser-Einstellung der Leser weiter mitzählt. ---------- */
html { font-size: 112.5%; }

/* ---------- Korrektur 9 (3.12.): Im Bearbeiten-Modus sieht man, wo man schreiben kann (Wunsch Captain).
   Erkennungszeichen ist contenteditable="true": im Lesen-Modus setzt Docmost es auf false, dann greift hier nichts.
   Fläche und Rahmen kommen als box-shadow, so verschiebt sich beim Umschalten kein Text.
   9a (3.12.): Live zu schwach, vor allem dunkel. Fläche kräftiger, dazu ein Streifen links (ruhig braun, beim Fokus Gold),
   der auch beim Scrollen sichtbar bleibt. ---------- */
:root:not([data-mantine-color-scheme="dark"]) {
  --sim-edit-bg: #eee3cf;                       /* dunkler als der Seitengrund, keine weiße Insel */
  --sim-edit-border: #d6c7ab;
  --sim-edit-border-hover: #c2b293;
  --sim-edit-bar: #c2b293;                      /* Streifen links, ruhig */
  --sim-edit-focus: #b07a24;                    /* Gold, abgedunkelt für Creme */
  --sim-edit-ring: rgba(217, 150, 43, .20);
  --sim-caret: #a06c1e;
  --mantine-color-placeholder: #7d6e5a;         /* Platzhalter etwas kräftiger, bleibt erkennbar leise */
}
:root[data-mantine-color-scheme="dark"] {
  --sim-edit-bg: #2a241c;                       /* Korrektur 9a: deutlich heller als der Grund #1d1914 */
  --sim-edit-border: #4c4234;
  --sim-edit-border-hover: #5e5241;
  --sim-edit-bar: #6b5d48;
  --sim-edit-focus: #d9962b;
  --sim-edit-ring: rgba(217, 150, 43, .22);
  --sim-caret: #e6b968;
  --mantine-color-placeholder: #948870;
}

/* Seiteninhalt und Seitentitel */
:root .ProseMirror[contenteditable="true"] { caret-color: var(--sim-caret); }
:root .ProseMirror[contenteditable="true"][aria-label="Seiteninhalt"],
:root .ProseMirror[contenteditable="true"][aria-label="Seitentitel"] {
  --sim-pad: .7rem;
  background-color: var(--sim-edit-bg);
  border-radius: 2px;
  box-shadow: 0 0 0 var(--sim-pad) var(--sim-edit-bg), 0 0 0 calc(var(--sim-pad) + 1px) var(--sim-edit-border),
              -4px 0 0 var(--sim-pad) var(--sim-edit-bar);
  transition: box-shadow .15s ease;
}
:root .ProseMirror[contenteditable="true"][aria-label="Seitentitel"] { --sim-pad: .4rem; }
:root .ProseMirror[contenteditable="true"][aria-label="Seiteninhalt"]:hover,
:root .ProseMirror[contenteditable="true"][aria-label="Seitentitel"]:hover {
  box-shadow: 0 0 0 var(--sim-pad) var(--sim-edit-bg), 0 0 0 calc(var(--sim-pad) + 1px) var(--sim-edit-border-hover),
              -4px 0 0 var(--sim-pad) var(--sim-edit-bar);
}
:root .ProseMirror[contenteditable="true"][aria-label="Seiteninhalt"].ProseMirror-focused,
:root .ProseMirror[contenteditable="true"][aria-label="Seitentitel"].ProseMirror-focused {
  box-shadow: 0 0 0 var(--sim-pad) var(--sim-edit-bg), 0 0 0 calc(var(--sim-pad) + 1px) var(--sim-edit-focus),
              -4px 0 0 var(--sim-pad) var(--sim-edit-focus), 0 0 0 calc(var(--sim-pad) + 4px) var(--sim-edit-ring);
}

/* Tabellen beim Bearbeiten: Zellenränder im Theme statt Grau, markierte Zellen Gold statt Lila */
:root .ProseMirror[contenteditable="true"] table td,
:root .ProseMirror[contenteditable="true"] table th { border-color: var(--sim-edit-border-hover); }
:root .ProseMirror table .selectedCell:after { background: var(--mantine-primary-color-light-hover); }

/* Kommentarfeld: gleiche Fläche, Fokus Gold */
:root [class*="_commentEditor_"][data-editable] [class*="_ProseMirror_"] { background-color: var(--sim-edit-bg); border-radius: var(--mantine-radius-sm); }
:root [class*="_commentEditor_"][data-editable] [class*="_ProseMirror_"]:not([class*="_focused_"]) { box-shadow: 0 0 0 1px var(--sim-edit-border-hover); }
:root [class*="_commentEditor_"] [class*="_focused_"] { box-shadow: 0 0 0 1px var(--sim-edit-focus), 0 0 0 4px var(--sim-edit-ring); }

/* Eingabefelder (Suche, Dialoge, Einstellungen): gleiche Fläche, Cursor Gold, Fokus mit leisem Ring */
:root[data-mantine-color-scheme] .mantine-Input-input,
:root:not([data-mantine-color-scheme="dark"]) .mantine-Input-input { background-color: var(--sim-edit-bg); caret-color: var(--sim-caret); }
:root .mantine-Input-input:focus,
:root .mantine-Input-input:focus-within { border-color: var(--sim-edit-focus); box-shadow: 0 0 0 3px var(--sim-edit-ring); }
