/* ============================================================
   orbita:regler + orbita:wahlkarten - two Bausteine of the portal
   (.orbita-bausteine.json), markup in templates/components/regler.html
   and wahlkarten.html, behaviour in static/js/auswahl.js.
   Colours only from tokens.css, so the dark theme follows by itself.
   ============================================================ */

/* -- Slider (instead of input type=range) ---------------------------------- */
.regler { --anteil: 0%; display: grid; gap: 12px; min-width: 0; }
.regler-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.regler-label { font-size: 0.92rem; font-weight: 600; color: var(--text); min-width: 0; }
.regler-wert {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--primary);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.regler-bahn {
  position: relative; height: 28px; cursor: pointer; touch-action: none; outline: none;
  -webkit-tap-highlight-color: transparent;
}
.regler-bahn::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px;
  border-radius: 999px; background: var(--slate-100);
}
.regler-fuellung {
  position: absolute; left: 0; top: 50%; height: 8px; margin-top: -4px; width: var(--anteil);
  border-radius: 999px; background: linear-gradient(90deg, var(--blue-500), var(--cyan-500));
}
.regler-griff {
  position: absolute; top: 50%; left: var(--anteil); width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(15, 27, 61, 0.18);
  transition: box-shadow var(--dur-fast, 150ms) ease, transform var(--dur-fast, 150ms) ease;
}
.regler-bahn:hover .regler-griff { box-shadow: 0 0 0 6px var(--ring), 0 2px 8px rgba(15, 27, 61, 0.18); }
.regler-bahn:focus-visible .regler-griff,
.regler.is-ziehen .regler-griff { box-shadow: 0 0 0 8px var(--ring), 0 2px 8px rgba(15, 27, 61, 0.18); transform: scale(1.06); }
:root[data-theme="dark"] .regler-bahn::before { background: rgba(255, 255, 255, 0.10); }

/* -- Answer tiles (instead of radio buttons and checkboxes) ----------------- */
.wahlkarten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wahlkarte {
  display: flex; align-items: center; gap: 12px; min-height: 56px; min-width: 0; padding: 12px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md, 14px); background: var(--card);
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.3; color: var(--text); text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}
.wahlkarte:hover { border-color: var(--blue-200); background: var(--primary-soft); }
.wahlkarte:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.wahlkarte[aria-checked="true"] {
  border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset;
}
.wahlkarte-text { min-width: 0; overflow-wrap: anywhere; }
.wahlkarte-marke {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border: 1.5px solid var(--border-strong); border-radius: 50%; background: var(--card);
  transition: background 150ms ease, border-color 150ms ease;
}
.wahlkarten.is-mehrfach .wahlkarte-marke { border-radius: 7px; }
.wahlkarte-marke::after {
  content: ""; width: 10px; height: 5px; margin-top: -3px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) scale(0.5); opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}
.wahlkarte[aria-checked="true"] .wahlkarte-marke { background: var(--primary); border-color: var(--primary); }
.wahlkarte[aria-checked="true"] .wahlkarte-marke::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.wahlkarten.is-invalid .wahlkarte { border-color: var(--error); }
@media (max-width: 560px) {
  .wahlkarten { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .regler-griff, .wahlkarte, .wahlkarte-marke, .wahlkarte-marke::after { transition: none; }
}
