/* === GCBoK Dark-Theme Overrides === */
/* Aktiviert via :root[data-theme="dark"] (gesetzt durch gcbok-theme.js)
   Ueberschreibt alle semantischen Tokens aus main.css :root.
   Kontrastziele:
   - Body:   >= 7:1  (#E2E8F0 auf #0F172A ~ 12.5:1)
   - Muted:  >= 4.5:1 (#94A3B8 auf #0F172A ~ 5.7:1)
   - Links:  >= 4.5:1 (#FDBA74 auf #0F172A ~ 8.2:1)
   ========================================================================== */

:root[data-theme="dark"] {
  /* Hintergrund- und Paper-Tokens */
  --c-paper:      #0F172A;   /* Slate-900 als Haupthintergrund */
  --c-slate-50:   #1E293B;   /* Slate-800 fuer alt-sections */
  --c-slate-100:  #1E293B;
  --c-slate-200:  #334155;
  --c-line:       rgba(255, 255, 255, 0.08);

  /* Semantische Tokens */
  --text-strong:  #F1F5F9;   /* Headlines: Slate-100 */
  --text-body:    #CBD5E1;   /* Body: Slate-300 */
  --text-muted:   #94A3B8;   /* Muted: Slate-400 */
  --link-color:   #FDBA74;   /* Amber-soft */
  --link-hover:   #FFFFFF;
  --link-deco:    #E8632A;   /* Amber */
  --border-soft:  rgba(255, 255, 255, 0.10);
  --code-bg:      rgba(255, 255, 255, 0.08);
  --code-fg:      #E2E8F0;
  --table-row:    rgba(255, 255, 255, 0.04);
}

/* Body Hintergrund im Dark-Mode */
:root[data-theme="dark"] body {
  background: #0F172A;
  color: #CBD5E1;
}

/* Alt-Sections im Dark-Mode */
:root[data-theme="dark"] .section--alt {
  background: #1E293B;
  border-top-color: rgba(255, 255, 255, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* Ink-Section im Dark-Mode (noch dunkler) */
:root[data-theme="dark"] .section--ink {
  background: #020617;
}

/* Footer im Dark-Mode */
:root[data-theme="dark"] .site-footer {
  background: #020617;
}

/* Code-Bloecke im Dark-Mode */
:root[data-theme="dark"] pre {
  background: #1E293B;
  color: #E2E8F0;
}

/* Tabellen im Dark-Mode (gc-table + generic) */
:root[data-theme="dark"] .table--gc {
  --gc-border-soft: rgba(255, 255, 255, 0.10);
  --gc-green-soft: rgba(10, 127, 92, 0.2);
  --gc-green-deep: #6EE7B7;
  --gc-slate-100: rgba(30, 41, 59, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
:root[data-theme="dark"] .table--gc thead th {
  color: #6EE7B7;
}
:root[data-theme="dark"] .table--gc tbody tr:hover {
  background: rgba(30, 41, 59, 0.6);
}
:root[data-theme="dark"] th {
  background: rgba(30, 41, 59, 0.8);
  color: #F1F5F9;
}

/* Mermaid-Diagramme im Dark-Mode */
:root[data-theme="dark"] .mermaid {
  background: #1E293B;
  border-radius: var(--radius);
}

/* Header-Border im Dark-Mode */
:root[data-theme="dark"] header.site-header.site-header--gcbok {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="dark"] header.site-header--gcbok .site-header__row--nav {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="dark"] header.site-header--gcbok .nav-gcbok__link {
  color: #E2E8F0 !important;
}
:root[data-theme="dark"] header.site-header--gcbok .nav-gcbok__link:hover,
:root[data-theme="dark"] header.site-header--gcbok .nav-gcbok__link:focus {
  background: rgba(10, 127, 92, 0.2) !important;
  color: #6EE7B7 !important;
}
:root[data-theme="dark"] header.site-header--gcbok .brand__name {
  color: #F1F5F9 !important;
}
:root[data-theme="dark"] header.site-header--gcbok .brand__suffix {
  color: #94A3B8 !important;
}

/* Banner im Dark-Mode */
:root[data-theme="dark"] .gc-banner {
  background: #0F172A !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
:root[data-theme="dark"] .gc-banner__title { color: #F1F5F9 !important; }
:root[data-theme="dark"] .gc-banner__subtitle { color: #94A3B8 !important; }
:root[data-theme="dark"] .gc-banner__eyebrow { color: #94A3B8 !important; }
:root[data-theme="dark"] .gc-banner__quad { color: #E2E8F0 !important; }

/* Smooth Transition beim Theme-Wechsel */
:root[data-theme] body,
:root[data-theme] .section,
:root[data-theme] .section--alt,
:root[data-theme] .site-footer,
:root[data-theme] .table--gc,
:root[data-theme] th,
:root[data-theme] pre,
:root[data-theme] .gc-banner {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
