/* ---------------------------------------------------------------------------
   Bausteine der drei Demos.

   Setzt auf site.css und wissen.css auf und erfindet weder Farben noch Radien
   noch Schriftgrößen neu — alles kommt aus den Tokens des Design-Systems.
   Hier stehen nur die Teile, die es dort noch nicht gibt: Fragebogen,
   Ergebnistafeln, Ampeln, Quellenkarten.
--------------------------------------------------------------------------- */

/* ---- Seitengerüst -------------------------------------------------------- */

.d-schmal { max-width: 780px; margin: 0 auto; }

.d-zurueck {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: var(--fw-semibold); color: var(--text-label);
  margin-bottom: var(--space-4);
}
.d-zurueck:hover { color: var(--primary); opacity: 1; }

.d-hinweis {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--surface-tint); border: 1px solid #dedcfa;
  font-size: 13.5px; line-height: 1.6; color: var(--text-body);
}
.d-hinweis strong { color: var(--text-heading); }
.d-hinweis-dunkel {
  background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14);
  color: var(--nws-on-dark);
}
.d-hinweis-dunkel strong { color: #fff; }

/* ---- Schrittanzeige ------------------------------------------------------ */

.d-fortschritt { margin-bottom: var(--space-6); }
.d-fortschritt-kopf {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
  font-size: 12px; font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--text-label);
}
.d-balken { height: 5px; border-radius: 3px; background: var(--nws-border-strong); overflow: hidden; }
.d-balken > span {
  display: block; height: 100%; border-radius: 3px; background: var(--primary);
  transition: width var(--dur-mid, .35s) var(--ease-out, ease);
}

/* ---- Fragebogen ---------------------------------------------------------- */

.d-frageblock + .d-frageblock { margin-top: var(--space-6); }

.d-frage { padding: 20px 0; border-top: 1px solid var(--border-hairline); }
.d-frage:first-child { border-top: 0; padding-top: 4px; }
.d-frage-text {
  margin: 0 0 14px; font-size: 15.5px; line-height: 1.55;
  color: var(--text-heading); font-weight: var(--fw-medium);
}

.d-optionen { display: flex; flex-wrap: wrap; gap: 8px; }

.d-option {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--nws-border-strong); background: var(--nws-white);
  font-family: inherit; font-size: 13.5px; font-weight: var(--fw-medium);
  color: var(--text-body); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.d-option:hover { border-color: var(--primary); color: var(--text-heading); }
.d-option[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.d-option-unklar[aria-pressed="true"] {
  background: var(--nws-night); border-color: var(--nws-night);
}

/* Auswahl in Kachelform — für Vorhabenstyp, Phase, Hindernis. */
.d-kacheln { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.d-kachel {
  text-align: left; padding: 15px 17px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--nws-border-strong); background: var(--nws-white);
  font-family: inherit; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.d-kachel:hover { border-color: var(--primary); }
.d-kachel[aria-pressed="true"] {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.d-kachel-titel { display: block; font-size: 14.5px; font-weight: var(--fw-semibold); color: var(--text-heading); }
.d-kachel-text { display: block; margin-top: 5px; font-size: 12.5px; line-height: 1.5; color: var(--text-label); }

.d-aktionen {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--border-hairline);
}
.d-aktionen .d-notiz { font-size: 12.5px; color: var(--text-label); margin: 0; }

/* ---- Profil (Balken statt Netzdiagramm) ---------------------------------- */

.d-profil { display: flex; flex-direction: column; gap: 14px; }

.d-achse { display: grid; grid-template-columns: 128px 1fr 46px; gap: 14px; align-items: center; }
.d-achse-name { font-size: 13.5px; font-weight: var(--fw-semibold); color: #fff; }
.d-achse-spur { height: 10px; border-radius: 5px; background: rgba(255,255,255,.11); overflow: hidden; }
.d-achse-wert {
  display: block; height: 100%; border-radius: 5px; background: var(--accent);
  transition: width .6s var(--ease-out, cubic-bezier(.2,.7,.3,1));
}
.d-achse-wert.d-schwach { background: #e8875f; }
.d-achse-wert.d-mittel { background: #7d78ee; }
.d-achse-zahl {
  font-family: var(--font-mono); font-size: 13px; font-weight: var(--fw-medium);
  text-align: right; color: var(--nws-on-dark);
}
.d-achse-unklar { color: var(--nws-on-dark-muted); font-style: italic; }

/* ---- Ergebnisbausteine --------------------------------------------------- */

.d-befund { margin-bottom: var(--space-6); }
.d-befund-marke {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .05em;
  text-transform: uppercase; font-weight: var(--fw-medium);
  background: rgba(198,242,78,.16); color: var(--accent);
}
.d-befund h3 { margin: 14px 0 8px; font-size: 25px; line-height: 1.25; color: #fff; }
.d-befund-zeile { margin: 0; font-size: 16px; line-height: 1.6; color: var(--nws-on-dark); }

.d-karte-reihe { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.d-abschnitt { margin-top: var(--space-8); }
.d-abschnitt > h3 {
  margin: 0 0 6px; font-size: 19px; font-weight: var(--fw-bold); color: var(--text-heading);
}
.d-abschnitt > .d-abschnitt-sub {
  margin: 0 0 var(--space-5); font-size: 14px; line-height: 1.6; color: var(--text-body);
}

/* Nummerierte Empfehlungen */
.d-schritte { display: flex; flex-direction: column; gap: 14px; counter-reset: schritt; }
.d-schritt {
  display: grid; grid-template-columns: 34px 1fr; gap: 16px;
  padding: 20px 22px; border-radius: var(--radius-sm);
  background: var(--nws-white); border: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-card);
}
.d-schritt-nr {
  counter-increment: schritt;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-tint); color: var(--primary);
  font-family: var(--font-mono); font-size: 14px; font-weight: var(--fw-semibold);
}
.d-schritt-nr::before { content: counter(schritt); }
.d-schritt h4 { margin: 4px 0 6px; font-size: 15.5px; font-weight: var(--fw-bold); color: var(--text-heading); }
.d-schritt p { margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-body); }
.d-schritt-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px;
  font-size: 12px; color: var(--text-label);
}
.d-schritt-meta span { display: inline-flex; align-items: center; gap: 6px; }
.d-schritt-meta b { font-weight: var(--fw-semibold); color: var(--text-body); }

/* ---- Ampel (Vorhaben-Check) ---------------------------------------------- */

.d-regeln { display: flex; flex-direction: column; gap: 10px; }

.d-regel {
  display: grid; grid-template-columns: 12px 1fr; gap: 16px;
  padding: 18px 20px; border-radius: var(--radius-sm);
  background: var(--nws-white); border: 1px solid var(--border-hairline);
}
.d-regel-punkt { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; }
.d-regel-gruen  .d-regel-punkt { background: #5aa26f; }
.d-regel-gelb   .d-regel-punkt { background: #d99e26; }
.d-regel-rot    .d-regel-punkt { background: #c2564f; }
.d-regel-gruen { border-left: 3px solid #5aa26f; }
.d-regel-gelb  { border-left: 3px solid #d99e26; }
.d-regel-rot   { border-left: 3px solid #c2564f; }

.d-regel-frage { margin: 0; font-size: 14.5px; font-weight: var(--fw-semibold); color: var(--text-heading); }
.d-regel-befund { margin: 7px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--text-body); }
.d-regel-beleg {
  display: block; margin-top: 10px; padding: 9px 12px;
  border-radius: var(--radius-xs, 6px); background: var(--nws-mist);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.55; color: var(--text-body);
}
.d-regel-beleg b { color: var(--primary); font-weight: var(--fw-medium); }

/* Urteil */
.d-urteil { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.d-urteil-zahl {
  flex-shrink: 0; width: 92px; height: 92px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2.5px solid var(--accent);
}
.d-urteil-zahl b { font-family: var(--font-mono); font-size: 27px; font-weight: var(--fw-medium); color: #fff; line-height: 1; }
.d-urteil-zahl span { margin-top: 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--nws-on-dark-muted); }
.d-urteil-text { flex: 1 1 320px; }
.d-urteil-text h3 { margin: 0 0 8px; font-size: 22px; color: #fff; }
.d-urteil-text p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--nws-on-dark); }

/* ---- Quellen ------------------------------------------------------------- */

.q-block { margin-top: var(--space-5); }
.q-kopf {
  display: block; margin-bottom: 10px;
  font-size: 11.5px; font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-label);
}
.q-liste { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.q-folge {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--nws-white); border: 1px solid var(--border-hairline);
  transition: border-color .15s ease;
}
.q-folge:hover { border-color: var(--primary); opacity: 1; }
.q-nr { font-family: var(--font-mono); font-size: 11px; color: var(--primary); letter-spacing: .04em; }
.q-titel { font-size: 13.5px; line-height: 1.45; font-weight: var(--fw-medium); color: var(--text-heading); }
.q-gast { font-size: 12px; color: var(--text-label); }
.q-grund { margin-top: 4px; font-size: 11.5px; line-height: 1.5; color: var(--text-label); font-style: italic; }

/* Quellen auf dunklem Grund */
.card-night .q-folge, .w-panel-ink .q-folge {
  background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12);
}
.card-night .q-titel, .w-panel-ink .q-titel { color: #fff; }
.card-night .q-nr, .w-panel-ink .q-nr { color: var(--accent); }
.card-night .q-gast, .card-night .q-grund,
.w-panel-ink .q-gast, .w-panel-ink .q-grund { color: var(--nws-on-dark-muted); }
.card-night .q-kopf, .w-panel-ink .q-kopf { color: var(--nws-on-dark-muted); }

/* ---- Zitat aus dem Korpus ------------------------------------------------ */

.d-zitat {
  margin: 0; padding: 20px 24px; border-left: 3px solid var(--accent);
  background: var(--nws-white); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.d-zitat p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--text-heading); }
.d-zitat footer { margin-top: 10px; font-size: 12.5px; color: var(--text-label); }
.d-zitat footer a { color: var(--primary); font-weight: var(--fw-medium); }

/* ---- Aufklappbares (Regelwerk, Rechenweg) -------------------------------- */

.klappe {
  margin-top: var(--space-5); border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm); background: var(--nws-white);
}
.klappe-kopf {
  padding: 15px 20px; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: var(--fw-semibold); color: var(--text-heading);
  display: flex; align-items: center; gap: 10px;
}
.klappe-kopf::-webkit-details-marker { display: none; }
.klappe-kopf::before {
  content: '+'; font-family: var(--font-mono); font-size: 15px;
  color: var(--primary); width: 14px;
}
.klappe[open] > .klappe-kopf::before { content: '–'; }
.klappe-inhalt { padding: 0 20px 20px; font-size: 13.5px; line-height: 1.65; color: var(--text-body); }
.klappe-inhalt p { margin: 0 0 10px; }
.klappe-inhalt ol, .klappe-inhalt ul { margin: 0 0 10px; padding-left: 20px; }
.klappe-inhalt li { margin-bottom: 7px; }
.klappe-inhalt code {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--nws-mist); padding: 1px 5px; border-radius: 4px; color: var(--primary);
}

/* Rechenweg-Tabelle */
.d-rechnung { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.d-rechnung th {
  text-align: left; padding: 7px 10px 7px 0; color: var(--text-label);
  font-weight: var(--fw-semibold); border-bottom: 1px solid var(--border-hairline);
}
.d-rechnung td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border-hairline); vertical-align: top; }
.d-rechnung td:last-child, .d-rechnung th:last-child { text-align: right; padding-right: 0; }
.d-rechnung .d-zahl { font-family: var(--font-mono); color: var(--text-heading); }

/* ---- Übersichtsseite ----------------------------------------------------- */

.d-demo-karte { display: flex; flex-direction: column; height: 100%; }
.d-demo-karte .d-demo-form {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary);
}
/* Auf indigoem und dunklem Grund wäre die Vorspann-Zeile in Primärfarbe
   unsichtbar — dort trägt sie die Akzentfarbe. */
.card-night .d-demo-karte .d-demo-form,
.card-indigo .d-demo-karte .d-demo-form { color: var(--accent); }
.card-indigo .d-demo-karte h3 { color: #fff; }
.card-indigo .d-demo-karte > p { color: rgba(255,255,255,.82); }
.d-demo-karte h3 { margin: 12px 0 10px; font-size: 20px; line-height: 1.3; }
.d-demo-karte > p { flex: 1; margin: 0 0 var(--space-5); font-size: 14px; line-height: 1.65; }
.d-demo-karte .btn { align-self: flex-start; }

.d-zutat { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: start; }
.d-zutat + .d-zutat { margin-top: var(--space-5); }
.d-zutat-zahl {
  font-family: var(--font-mono); font-size: 22px; font-weight: var(--fw-medium);
  color: var(--primary); line-height: 1.1;
}
.d-zutat h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: var(--fw-bold); color: var(--text-heading); }
.d-zutat p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-body); }

/* ---- Clipfabrik ---------------------------------------------------------- */

.d-clips {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.d-clip {
  display: flex; flex-direction: column;
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--nws-night); border: 1px solid rgba(255,255,255,.12);
}
.d-clip video {
  width: 100%; aspect-ratio: 4 / 5; display: block;
  background: var(--nws-night-900); object-fit: cover;
}
.d-clip-text { padding: 16px 18px 18px; }
.d-clip-these {
  margin: 0 0 8px; font-size: 15px; line-height: 1.35;
  font-weight: var(--fw-bold); color: #fff; letter-spacing: -.01em;
}
.d-clip-quelle {
  margin: 0; font-family: var(--font-mono); font-size: 11.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--nws-on-dark-muted);
}
.d-clip-form {
  display: inline-block; margin-top: 10px; padding: 3px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: var(--fw-semibold);
  color: var(--accent); background: rgba(198,242,78,.12);
  border: 1px solid rgba(198,242,78,.3);
}

.d-takt { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: baseline; }
.d-takt + .d-takt { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-hairline); }
.d-takt-zeit {
  font-family: var(--font-mono); font-size: 13px; color: var(--primary);
  letter-spacing: .04em;
}
.d-takt h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: var(--fw-bold); color: var(--text-heading); }
.d-takt p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--text-body); }

/* ---- Podcast-Kachel ------------------------------------------------------ */

.d-podcast { display: grid; grid-template-columns: 216px 1fr; gap: var(--space-8); align-items: center; }
.d-podcast-cover {
  /* height:auto ist nötig — sonst gewinnt das height-Attribut des img-Tags
     gegen aspect-ratio und das Cover wird 560 statt 216 Pixel hoch. */
  width: 100%; height: auto; aspect-ratio: 1 / 1; display: block;
  border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 24px 48px -18px rgba(0,0,0,.6);
}
.d-podcast h3 { margin: var(--space-3) 0 0; font-size: 26px; color: #fff; }
.d-podcast > div > p { color: var(--nws-on-dark); }
.d-podcast-fakten {
  display: flex; flex-wrap: wrap; gap: 8px 10px; margin: var(--space-5) 0 var(--space-5);
  padding: 0; list-style: none;
}
.d-podcast-fakten li {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--nws-on-dark); padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}

/* ---- Kleine Bildschirme -------------------------------------------------- */

@media (max-width: 720px) {
  .d-podcast { grid-template-columns: 1fr; gap: var(--space-6); }
  .d-podcast-cover { max-width: 216px; }
  .d-achse { grid-template-columns: 96px 1fr 40px; gap: 10px; }
  .d-achse-name { font-size: 12.5px; }
  .d-schritt { grid-template-columns: 28px 1fr; gap: 12px; padding: 16px 17px; }
  .d-schritt-nr { width: 28px; height: 28px; font-size: 12.5px; }
  .d-urteil-zahl { width: 74px; height: 74px; }
  .d-urteil-zahl b { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .d-achse-wert, .d-balken > span { transition: none; }
}
