/* Umschalter Hell, Dunkel, System (thema.py, thema-kern.js), gemeinsam für öffentliche Seiten und Portal. 26.10.2026
   Der Knopf nimmt die Schriftfarbe seiner Umgebung (auch auf dunklem Kopf), das Menü hat eigene Farben je Modus. */
:root{
  --thema-flaeche:#FFFFFF; --thema-text:#0F172A; --thema-text-2:#475569; --thema-linie:#E2E8F0;
  --thema-hover:#F1F5F9; --thema-akzent:#1D4ED8; --thema-schatten:0 1px 2px rgba(15,23,42,.06),0 16px 40px -16px rgba(15,23,42,.28);
}
:root[data-theme="dunkel"]{
  --thema-flaeche:#121D33; --thema-text:#F1F5F9; --thema-text-2:#A3B1C6; --thema-linie:rgba(148,163,184,.26);
  --thema-hover:#1B2945; --thema-akzent:#8AB4FF; --thema-schatten:0 1px 2px rgba(0,0,0,.4),0 20px 48px -16px rgba(0,0,0,.7);
}
.thema-umschalter{position:relative;display:inline-flex;flex:none}
.thema-knopf{display:inline-grid;place-items:center;width:40px;height:40px;padding:0;border-radius:10px;cursor:pointer;
  color:inherit;background:transparent;border:1px solid color-mix(in srgb,currentColor 22%,transparent);
  transition:background-color .15s ease,border-color .15s ease}
.thema-knopf:hover,.thema-knopf[aria-expanded="true"]{background:color-mix(in srgb,currentColor 9%,transparent);border-color:color-mix(in srgb,currentColor 34%,transparent)}
.thema-knopf:focus-visible{outline:3px solid #2563FF;outline-offset:2px}
.thema-knopf svg{grid-area:1/1;width:20px;height:20px;transition:transform .35s cubic-bezier(.22,1,.36,1),opacity .2s ease}
:root:not([data-theme="dunkel"]) .thema-knopf .thema-mond,
:root[data-theme="dunkel"] .thema-knopf .thema-sonne{opacity:0;transform:rotate(-40deg) scale(.6)}
@media (pointer:coarse){.thema-knopf{width:44px;height:44px}}

.thema-menue{position:absolute;top:calc(100% + 8px);right:0;z-index:80;min-width:208px;padding:6px;margin:0;
  background:var(--thema-flaeche);color:var(--thema-text);border:1px solid var(--thema-linie);border-radius:12px;box-shadow:var(--thema-schatten);
  transform-origin:top right;transition:opacity .14s ease,transform .18s cubic-bezier(.22,1,.36,1)}
.thema-menue[hidden]{display:none}
@starting-style{.thema-menue:not([hidden]){opacity:0;transform:translateY(-4px) scale(.97)}}
.thema-menue [data-thema-wahl]{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:0 12px;border:0;border-radius:8px;
  background:transparent;color:inherit;font:inherit;font-size:15px;font-weight:500;text-align:left;cursor:pointer}
.thema-menue [data-thema-wahl] svg{width:20px;height:20px;flex:none;color:var(--thema-text-2)}
.thema-menue [data-thema-wahl] span{flex:1}
.thema-menue [data-thema-wahl]:hover,.thema-menue [data-thema-wahl]:focus-visible{background:var(--thema-hover);outline:none}
.thema-menue [data-thema-wahl]:focus-visible{box-shadow:inset 0 0 0 2px var(--thema-akzent)}
.thema-menue .thema-haken{visibility:hidden;color:var(--thema-akzent)}
.thema-menue [aria-checked="true"]{font-weight:600}
.thema-menue [aria-checked="true"] svg,.thema-menue [aria-checked="true"] .thema-haken{visibility:visible;color:var(--thema-akzent)}

/* Beim Wechsel der Darstellung blendet die ganze Seite über, auch Kopf und Leisten mit eigenem Namen */
.thema-wechsel *{view-transition-name:none!important}
/* Kreis aus dem Knopf: das alte Bild bleibt stehen, das neue wächst darüber (Animation setzt thema-kern.js) */
.thema-kreis::view-transition-old(root),.thema-kreis::view-transition-new(root){animation:none;mix-blend-mode:normal}
.thema-kreis::view-transition-new(root){z-index:1}
@media (prefers-reduced-motion:reduce){.thema-knopf svg,.thema-menue{transition:none}}
