/* ==========================================================
   15 · Tabellen im Text-Element (z. B. Kursvergleich)
   1. Zeile = Kursnamen (grün) · 1. Spalte = Kriterium (hellgrün)
   Handy: natalie.js macht daraus Karten (eine pro Spalte)
   ========================================================== */

.rte table {
  width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.5rem 0 2rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  font-size: .95rem; line-height: 1.5;
}
.rte table th, .rte table td {
  padding: 1rem 1.25rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--line);
}
.rte table tr > :first-child { border-left: 0; }
.rte table tr:last-child > * { border-bottom: 0; }
.rte table p { margin: 0; }
.rte figure.table { margin: 0; }

/* Kopfzeile: Kursnamen */
.rte table > thead > tr > *, .rte table > tbody:first-child > tr:first-child > * {
  background: var(--moss); color: #fff; font-family: var(--serif); font-size: var(--step-1); font-weight: 400;
  border-left-color: rgba(255, 255, 255, .18); border-bottom: 0;
}
.rte table > thead > tr > :first-child, .rte table > tbody:first-child > tr:first-child > :first-child { background: var(--moss-dark); }

/* erste Spalte: Kriterium */
.rte table > thead + tbody > tr > :first-child, .rte table > tbody:first-child > tr:not(:first-child) > :first-child {
  width: 1%; white-space: nowrap; font-weight: 600; color: var(--ink); background: var(--sage-50);
}
.rte table tbody tr:nth-child(even) > :not(:first-child) { background: #fdfdfb; }

/* Handy, Tabellen ohne Karten (z. B. nur 2 Spalten): seitlich wischen */
@media (max-width: 860px) {
  .rte table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
  .rte table th, .rte table td { min-width: 12rem; padding: .85rem 1rem; }
  .rte table tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 8.5rem; white-space: normal; box-shadow: 1px 0 0 var(--line); }
}

/* --- Vergleich als Karten (Handy) --- */
.compare-cards { display: none; }
@media (max-width: 860px) {
  .rte table.has-cards { display: none; }
  .compare-cards { display: grid; gap: 1rem; margin: 1.5rem 0 2rem; }
  .compare-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .compare-card__title {
    margin: 0; padding: 1rem 1.25rem; background: var(--moss); color: #fff;
    font-family: var(--serif); font-size: var(--step-1); font-weight: 400;
  }
  .compare-card dl { margin: 0; padding: .4rem 1.25rem 1rem; }
  .compare-card dt { margin-top: .85rem; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sage); }
  .compare-card dd { margin: .15rem 0 0; color: var(--ink); line-height: 1.5; }
  .compare-card dd p { margin: 0; }
}
