/* =====================================================================
   BlaulichtPLUS-Design fuer Docmost ("docs")
   Hell: heller Hintergrund, Navy als Hauptfarbe
   Dunkel (Nachtmodus): Navy-Blau als Hintergrund, wie bei der Nextcloud
   Wird beim Containerstart automatisch eingebunden (siehe start.sh).
   ===================================================================== */

/* ---------- Schrift: Noto Sans, selbst gehostet (kein Google-Abruf) ---------- */
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/bp/fonts/noto-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/bp/fonts/noto-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/bp/fonts/noto-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/bp/fonts/noto-sans-latin-700-normal.woff2") format("woff2"); }

/* ---------- Gemeinsame Werte (beide Modi) ----------
   "html:root" ist absichtlich etwas staerker als Docmosts eigenes ":root",
   damit diese Werte immer gewinnen. */
html:root {
  --bp-navy: #0F1D3A;
  --bp-red: #E2001A;

  --mantine-font-family: "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mantine-font-family-headings: var(--mantine-font-family);

  /* Hauptfarbe (in Docmost "blue") auf BlaulichtPLUS-Navy umstellen */
  --mantine-color-blue-0: #eef2f9;
  --mantine-color-blue-1: #dce3f1;
  --mantine-color-blue-2: #b6c4e1;
  --mantine-color-blue-3: #8ea3cf;
  --mantine-color-blue-4: #5373b4;
  --mantine-color-blue-5: #2f4f8f;
  --mantine-color-blue-6: #0F1D3A;
  --mantine-color-blue-7: #1a2c54;
  --mantine-color-blue-8: #081126;
  --mantine-color-blue-9: #050c1b;
  --mantine-primary-color-contrast: #ffffff;
}

/* ---------- Heller Modus ---------- */
html:root[data-mantine-color-scheme="light"] {
  --mantine-color-text: #141a29;
  --mantine-color-body: #ffffff;
  --mantine-color-anchor: #24478f;

  --mantine-color-blue-filled: var(--bp-navy);
  --mantine-color-blue-filled-hover: #1a2c54;
  --mantine-color-blue-light: rgba(15, 29, 58, 0.07);        /* ausgewaehlt: nur leicht dunkler */
  --mantine-color-blue-light-hover: rgba(15, 29, 58, 0.11);
  --mantine-color-blue-light-color: var(--bp-navy);
  --mantine-color-blue-text: #24478f;
  --mantine-color-blue-outline: var(--bp-navy);
  --mantine-color-blue-outline-hover: rgba(15, 29, 58, 0.05);
}

/* ---------- Nachtmodus: BlaulichtPLUS-Navy ---------- */
html:root[data-mantine-color-scheme="dark"] {
  /* Docmosts Grau-Skala fuer den Nachtmodus durch Navy-Toene ersetzen */
  --mantine-color-dark-0: #e1e6f2;   /* Text */
  --mantine-color-dark-1: #c3cbe0;
  --mantine-color-dark-2: #96a2c2;   /* gedimmter Text */
  --mantine-color-dark-3: #6d7a9e;
  --mantine-color-dark-4: #44527a;   /* Rahmen */
  --mantine-color-dark-5: #2f3d64;   /* Hover */
  --mantine-color-dark-6: #1c2a4d;   /* Eingabefelder, Flaechen */
  --mantine-color-dark-7: #0F1D3A;   /* Hintergrund */
  --mantine-color-dark-8: #0b1630;
  --mantine-color-dark-9: #070f24;

  --mantine-color-body: var(--mantine-color-dark-7);
  --mantine-color-anchor: #a8bdeb;

  /* Buttons etc. im Nachtmodus etwas heller, damit sie auf Navy sichtbar sind */
  --mantine-color-blue-filled: #3b5fa8;
  --mantine-color-blue-filled-hover: #4669b3;
  --mantine-color-blue-light: rgba(110, 145, 215, 0.16);
  --mantine-color-blue-light-hover: rgba(110, 145, 215, 0.22);
  --mantine-color-blue-light-color: #b9cbf2;
  --mantine-color-blue-text: #a8bdeb;
  --mantine-color-blue-outline: #7f9ad6;
  --mantine-color-blue-outline-hover: rgba(127, 154, 214, 0.08);
}

/* Oeffentlich geteilte Seiten nutzen sonst "Inter" */
.public-typography { font-family: var(--mantine-font-family) !important; }

/* ---------- "Powered by Docmost" auf geteilten Seiten ausblenden ---------- */
footer:has(a[href^="https://docmost.com?ref="]) { display: none !important; }

/* ---------- Logo oben links in der App: "BlaulichtPLUS docs" statt "Docmost" ---------- */
a[aria-label="Docmost"] > .mantine-Text-root {
  font-size: 0 !important;
  line-height: 26px;
  padding-left: 34px;
  min-height: 26px;
  white-space: nowrap;
  background: url("/bp/logo-mark.svg") left center / 24px 24px no-repeat;
}
a[aria-label="Docmost"] > .mantine-Text-root::before {
  content: "BlaulichtPLUS";
  font-size: 17px; font-weight: 700; color: var(--bp-navy);
}
a[aria-label="Docmost"] > .mantine-Text-root::after {
  content: "docs";
  font-size: 17px; font-weight: 400; color: var(--bp-red); margin-left: 6px;
}

/* ---------- Anmeldeseite: Logo und "BlaulichtPLUS docs" statt "Docmost" ---------- */
.mantine-Group-root:has(> img[alt="Docmost"]) > img { display: none !important; }
.mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root {
  font-size: 0 !important;
  line-height: 44px;
  padding-left: 56px;
  min-height: 44px;
  white-space: nowrap;
  background: url("/bp/logo-mark.svg") left center / 44px 44px no-repeat;
}
.mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root::before {
  content: "BlaulichtPLUS";
  font-size: 28px; font-weight: 700; color: var(--bp-navy);
}
.mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root::after {
  content: "docs";
  font-size: 28px; font-weight: 400; color: var(--bp-red); margin-left: 8px;
}

/* Logo und Schriftzug im Nachtmodus: Navy-Teil wird weiss */
html:root[data-mantine-color-scheme="dark"] a[aria-label="Docmost"] > .mantine-Text-root,
html:root[data-mantine-color-scheme="dark"] .mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root {
  background-image: url("/bp/logo-mark-dark.svg");
}
html:root[data-mantine-color-scheme="dark"] a[aria-label="Docmost"] > .mantine-Text-root::before,
html:root[data-mantine-color-scheme="dark"] .mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root::before {
  color: #ffffff;
}
html:root[data-mantine-color-scheme="dark"] a[aria-label="Docmost"] > .mantine-Text-root::after,
html:root[data-mantine-color-scheme="dark"] .mantine-Group-root:has(> img[alt="Docmost"]) > .mantine-Text-root::after {
  color: #ff5c6c;
}
