/* ============================================================
   ROVERS — Styleguide
   Nur für die Seite „Design-System“. Das Design-System selbst
   steht unverändert in style.css; hier stehen ausschließlich die
   Hilfsmittel, die zum Vorführen nötig sind: Farbfelder, Rahmen
   um die Beispiele, Beschriftungen.
   ============================================================ */

/* --- Farbfelder --- */
.ds-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-swatch {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.ds-swatch b {
  display: block;
  height: 4.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.ds-swatch code {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--text);
  word-break: break-all;
}

.ds-swatch span {
  font-size: var(--t-xs);
  color: var(--text-muted);
}

/* --- Typografie-Muster --- */
.ds-type {
  display: grid;
  gap: var(--s8);
  margin: 0;
}

.ds-type > div {
  display: grid;
  gap: var(--s2);
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--line);
}

.ds-type > div:last-child {
  border-bottom: 0;
}

.ds-label {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
  letter-spacing: .02em;
}

/* --- Beispielrahmen im Blockkatalog --- */
.ds-block {
  margin: 0 0 var(--s12);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.ds-block > figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s2) var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--surface-sunken);
  border-bottom: 1px solid var(--line);
}

.ds-block h3 {
  font-family: var(--font-display);
  font-size: var(--t-md);
  margin: 0;
}

.ds-block code {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--accent-color);
}

.ds-block p {
  flex: 1 1 16rem;
  margin: 0;
  font-size: var(--t-sm);
  color: var(--text-muted);
}

/* Der Beispielinhalt selbst — bekommt Innenabstand, außer wenn der Block
   seine eigene Fläche mitbringt (Bildband, Abschluss-Band, Seitenkopf).
   Bewusst ohne eigenen Hintergrund: Zeigt der Rahmen eine Fläche, muss deren
   Klasse malen dürfen, sonst dokumentiert er die falsche Farbe. */
.ds-demo {
  padding: var(--s6) var(--s5);
}

.ds-demo--card {
  background: var(--surface-raised);
}

.ds-demo--bleed {
  padding: 0;
}

/* Beispiele auf dunkler Fläche zeigen, was die invertierte Rolle macht */
.ds-demo--dark {
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  --surface: var(--sidebar);
  --surface-raised: var(--invert-raised);
  --text: var(--sidebar-foreground);
  --text-muted: var(--invert-muted);
  --accent-color: var(--invert-accent);
  --line: var(--invert-line);
  --line-strong: var(--invert-line-strong);
  --status-ok: var(--success-invert);
  --status-bad: var(--danger-invert);
  --status-info: var(--info-invert);
}

/* --- Icon-Raster --- */
.ds-icons {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-icons li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
  text-align: center;
}

.ds-icons .icon {
  width: 28px;
  height: 28px;
  color: var(--accent-color);
}

.ds-icons code {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--text-muted);
}

/* --- Inhaltsverzeichnis --- */
.ds-toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s10);
  padding: 0;
  list-style: none;
}

/* --- Abstandsleiter --- */
.ds-spacing {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ds-spacing li {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.ds-spacing b {
  display: block;
  height: 1rem;
  background: var(--accent-wash-strong);
  border-radius: 2px;
}
