/* Kühn Geoconsulting GmbH: Avada palette in the dark view and the light/dark toggle button.
   Dark values come from the design system 2.1 (css/kuehn-designsystem.css, tokens, dunkel).
   Loaded after kuehn-designsystem.css. Light stays the default. */

/* Avada palette in the dark view, same trigger as the design system: data-theme="dark",
   or the system setting unless data-theme="light" is set. */
:root[data-theme="dark"] {
  --awb-color1: #262522; /* Karte (was white) */
  --awb-color2: #2F2D29; /* Hellgrau, Wechselfläche */
  --awb-color3: #1C1B19; /* Grund */
  --awb-color4: #F9312C; /* Kontakt, dunkle Variante */
  --awb-color5: #A882B5; /* Wissen, dunkle Variante */
  --awb-color6: #ACABAB; /* Unternehmen, dunkle Variante (also used as body text colour) */
  --awb-color7: #91B0C3; /* Leistungen, dunkle Variante */
  --awb-color8: #8EB374; /* Projekte und Referenzen, dunkle Variante */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --awb-color1: #262522;
    --awb-color2: #2F2D29;
    --awb-color3: #1C1B19;
    --awb-color4: #F9312C;
    --awb-color5: #A882B5;
    --awb-color6: #ACABAB;
    --awb-color7: #91B0C3;
    --awb-color8: #8EB374;
  }
}

/* Demo header, title bar and footer (Avada Magazine import) use fixed colours that the palette
   variables do not reach. Readable text until the Kühn header and footer replace them. */
:root[data-theme="dark"] .fusion-tb-header .awb-menu__main-li:not(.current-menu-item):not(.current-menu-ancestor) > .awb-menu__main-a .menu-text {
  color: var(--kgc-text);
}
/* Titles whose text colour is palette colour 1 (white in the light view, used on coloured or
   image backgrounds) stay white in the dark view; colour 1 itself becomes the dark card colour. */
:root[data-theme="dark"] .fusion-title[style*="--awb-text-color"][style*="--awb-color1"] .fusion-title-heading {
  --awb-text-color: var(--kgc-auf-farbe);
  color: var(--kgc-auf-farbe);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fusion-tb-header .awb-menu__main-li:not(.current-menu-item):not(.current-menu-ancestor) > .awb-menu__main-a .menu-text {
    color: var(--kgc-text);
  }
  :root:not([data-theme="light"]) .fusion-title[style*="--awb-text-color"][style*="--awb-color1"] .fusion-title-heading {
    --awb-text-color: var(--kgc-auf-farbe);
    color: var(--kgc-auf-farbe);
  }
}
/* Footer tagline (demo text) is unreadable in both views: use the secondary text colour. */
.fusion-tb-footer .fusion-text p {
  color: var(--kgc-text-sekundaer);
}

/* Toggle button, fixed at the bottom right, independent of the header. */
.kgc-theme-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100000;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--kgc-text-sekundaer);
  border-radius: 22px;
  background: var(--kgc-karte);
  color: var(--kgc-text);
  font: 600 14px/1 var(--kgc-schrift-text);
  box-shadow: var(--kgc-schatten);
  cursor: pointer;
}
.kgc-theme-toggle:hover { border-color: var(--kgc-text); }
.kgc-theme-toggle:focus-visible { outline: 3px solid var(--kgc-bereich-leistungen); outline-offset: 2px; }
