/* Farben der Gebietsseiten (#615): dieselben Tokens wie app/src/styles.scss, hell und dunkel wie
   in der App (#59). Sie kommen mit dem Deploy; /gebiet/seiten.css im Datenpaket bringt nur
   Abstände und Layout. Ohne gemerkte Wahl gilt die Systemeinstellung, eine Wahl aus der App setzt
   /gebietsseiten-darstellung.js vor dem Zeichnen als `data-theme`. */
:root {
  --text: #1f1f1c;
  --text-muted: #55544e;
  --surface: #ffffff;
  --surface-2: #f0f0eb;
  --border: #c9c8c1;
  --focus: #0b57d0;
  /* Eine Akzentfarbe für Links wie in der App (#398 F). */
  --accent: #0d6c75;
  --bar: #8e95a2;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --text: #e8e7e2;
    --text-muted: #b3b1a8;
    --surface: #1e1e1c;
    --surface-2: #2e2e2b;
    --border: #5c5b55;
    --focus: #8ab4f8;
    --accent: #7fd0d8;
  }
}

:root[data-theme='dark'] {
  --text: #e8e7e2;
  --text-muted: #b3b1a8;
  --surface: #1e1e1c;
  --surface-2: #2e2e2b;
  --border: #5c5b55;
  --focus: #8ab4f8;
  --accent: #7fd0d8;

  color-scheme: dark;
}

:root[data-theme='light'] {
  color-scheme: light;
}

a {
  color: var(--accent);
}

/* Kante um die Balken wie in der App (#521, WCAG 1.4.11): Auch der schwarze CDU-Balken im
   Dunkeln und der gelbe im Hellen heben sich mit mindestens 3 : 1 ab. Die Farben bleiben (#33). */
.bar span {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 55%, transparent);
}

/* Hinweise des Schalter-Skripts. */
.area-page-status {
  margin-block: var(--space-4, 1.5rem);
  overflow-wrap: anywhere;
}

.area-page-status h1 {
  margin-bottom: var(--space-2, 0.5rem);
}

.area-page-status button {
  min-height: var(--tap, 44px);
  padding: var(--space-2, 0.5rem) var(--space-3, 0.75rem);
  border: 1px solid var(--border, #c9c8c1);
  border-radius: var(--radius, 8px);
  background: var(--surface-2, #f0f0eb);
  color: var(--text, #1f1f1c);
  font: inherit;
  cursor: pointer;
}

/* Die Seiten nutzen unter anderem display:flex für Kennzahlen-Zeilen. */
[data-karte][hidden],
a.map[hidden] {
  display: none !important;
}

/* Dieselbe native Begriffshilfe wie in der App, auch ohne JavaScript lesbar. */
.simple-explanation {
  margin-block: 0.5rem;
  padding: 0 0.5rem;
  border-block: 1px solid var(--border, #c9c8c1);
  line-height: 1.5;
}

/* Mehrere Hilfen hintereinander teilen sich eine Trennlinie (#579). */
.simple-explanation + .simple-explanation {
  margin-top: -0.5rem;
  border-top: 0;
}

.simple-explanation summary,
.simple-explanation a {
  min-height: 44px;
  box-sizing: border-box;
  padding-block: 0.65rem;
  overflow-wrap: anywhere;
}

.simple-explanation summary {
  cursor: pointer;
}
.simple-explanation a {
  display: inline-block;
}
.simple-explanation dl {
  display: block;
}
.simple-explanation dt {
  font-weight: 600;
  margin-top: 0.75rem;
}
.simple-explanation dd {
  margin: 0.2rem 0 0.75rem;
  text-align: left;
}
.simple-explanation summary:focus-visible,
.simple-explanation a:focus-visible {
  outline: 2px solid var(--focus, #0b57d0);
  outline-offset: 2px;
}
