/* Tamedes Hub — VORLÄUFIGES Stylesheet für Baustein T0.
 *
 * Das hier ist NICHT die Design-Basis. Die entsteht in Baustein T3 als
 * /ui/v1/tamedes.css und wird dann von allen 19 Apps eingebunden
 * (ADR 0004). Diese Datei existiert nur, damit die T0-Startseite nicht
 * unformatiert aussieht, und verschwindet mit T3.
 *
 * Übernommen sind lediglich die Farbrollen aus Konzept v2.1 §9.5 und
 * die Tokens aus §9.7 — damit T3 nicht bei null anfängt.
 * Schriften bleiben Systemschriften: Jost, Inter und IBM Plex Mono
 * liefert erst T3 mit CORS-Header aus.
 */

:root {
  /* Farben — Konzept v2.1, 9.5 */
  --chrome-gruen: #1a3328;
  --arbeitsflaeche: #f7f8f7;
  --karte: #ffffff;
  --akzent-gold: #b5984e;
  --kritisch: #a3231d;
  --warnung: #8a5a00;
  --gut: #1d6b47;

  --text: #16211c;
  --text-gedaempft: #4a5a52;
  --linie: #dfe4e1;

  /* Tokens — Konzept v2.1, 9.7 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --radius-control: 6px;
  --radius-card: 10px;
  --control-height: 44px;
  --row-height-dense: 32px;

  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --schrift-mono: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--arbeitsflaeche);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
}

/* Tastaturbedienung — Konzept v2.1, 9.9: sichtbarer Fokus */
:focus-visible {
  outline: 3px solid var(--akzent-gold);
  outline-offset: 2px;
  border-radius: var(--radius-control);
}

.sprungmarke {
  position: absolute;
  left: var(--space-md);
  top: -100%;
  z-index: 10;
  padding: var(--space-sm) var(--space-md);
  background: var(--karte);
  color: var(--text);
  border-radius: var(--radius-control);
  text-decoration: none;
}
.sprungmarke:focus { top: var(--space-md); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Kopfzeile ------------------------------------------------------ */

.kopf {
  background: var(--chrome-gruen);
  color: #ffffff;
  padding: var(--space-md);
}

.kopf__innen {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  max-width: 62rem;
  margin: 0 auto;
}

.monogramm {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-control);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.kopf__titel {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.kopf__unterzeile {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.82);
}

/* --- Inhalt --------------------------------------------------------- */

.flaeche { padding: var(--space-lg) var(--space-md); }

.spalte {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
}

.karte h1 {
  margin: 0 0 var(--space-sm);
  font-size: 1.5rem;
  line-height: 1.25;
}

.karte h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.075rem;
  letter-spacing: 0.01em;
}

.fliess { margin: 0 0 var(--space-sm); max-width: 62ch; }
.fliess:last-child { margin-bottom: 0; }
.gedaempft { color: var(--text-gedaempft); font-size: 0.9rem; }

code {
  font-family: var(--schrift-mono);
  font-size: 0.9em;
  background: var(--arbeitsflaeche);
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: 1px 5px;
}

.liste { margin: 0; padding-left: 1.25rem; }
.liste li { margin-bottom: var(--space-xs); }

.bausteine {
  margin: 0;
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: var(--space-xs) var(--space-md);
}
.bausteine dt { font-family: var(--schrift-mono); font-weight: 600; }
.bausteine dd { margin: 0; }

/* --- Zustandsanzeige ------------------------------------------------ */

.zustandsliste { list-style: none; margin: 0; padding: 0; }

.zustand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  min-height: var(--row-height-dense);
  padding: var(--space-sm);
  border-left: 3px solid var(--linie);
  border-radius: var(--radius-control);
}
.zustand + .zustand { margin-top: var(--space-xs); }

/* Farbe nie allein als Signal (9.5) — das Symbol steht immer daneben. */
.zustand__symbol { font-weight: 700; }
.zustand--gut { border-left-color: var(--gut); }
.zustand--gut .zustand__symbol { color: var(--gut); }
.zustand--kritisch { border-left-color: var(--kritisch); }
.zustand--kritisch .zustand__symbol { color: var(--kritisch); }

.zustand__name { font-weight: 600; min-width: 9rem; }
.zustand__text { color: var(--text-gedaempft); }
.zustand__dauer {
  margin-left: auto;
  font-family: var(--schrift-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-gedaempft);
}

/* --- Fusszeile ------------------------------------------------------ */

.fuss {
  max-width: 62rem;
  margin: 0 auto;
  padding: var(--space-md);
  color: var(--text-gedaempft);
  font-size: 0.85rem;
}
.fuss p { margin: 0; }

/* --- Bedienbar bis 360 px (9.9) ------------------------------------- */

@media (max-width: 30rem) {
  .flaeche { padding: var(--space-md) var(--space-sm); }
  .karte { padding: var(--space-md); }
  .zustand__name { min-width: 0; }
  .zustand__dauer { margin-left: 0; }
}

/* --- prefers-reduced-motion respektieren (9.9) ---------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Dunkel: nur so weit, dass nichts bricht ------------------------
 * Persistente Hell/Dunkel-Umschaltung ist DoD von T4, nicht von T0.
 */

@media (prefers-color-scheme: dark) {
  :root {
    --arbeitsflaeche: #121915;
    --karte: #1a2420;
    --text: #e8eeea;
    --text-gedaempft: #a3b3ab;
    --linie: #2c3a34;
    --kritisch: #f08b85;
    --gut: #6cc79b;
  }
  code { background: #0d1310; }
}
