/* =========================
   Tabellen-Wrapper
   ========================= */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 2rem 0;
}

/* =========================
   Tabelle (Hauptstil)
   ========================= */

.table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
  min-width: 600px;
  background-color: #ffffff;
}

/* =========================
   Tabellenkopf
   ========================= */

.table-wrapper thead {
  background-color: #2c3e50;
}

.table-wrapper th {
  color: #ffffff;
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 2px solid #1a252f;
}

/* =========================
   Tabellenzellen
   ========================= */

.table-wrapper td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

/* =========================
   Zebra-Streifen
   ========================= */

.table-wrapper tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* =========================
   Hover-Effekt
   ========================= */

.table-wrapper tbody tr:hover {
  background-color: #f1f5f9;
  transition: background-color 0.2s ease-in-out;
}

/* =========================
   Letzte Zeile ohne Border
   ========================= */

.table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

/* =========================
   Responsive Anpassung
   ========================= */

@media (max-width: 768px) {
  .table-wrapper table {
    font-size: 0.85rem;
  }
}

/* =========================
   Dark Mode Support
   ========================= */

@media (prefers-color-scheme: dark) {

  .table-wrapper table {
    background-color: #1e1e1e;
    color: #e0e0e0;
  }

  .table-wrapper thead {
    background-color: #1a252f;
  }

  .table-wrapper th {
    border-bottom: 2px solid #000;
  }

  .table-wrapper td {
    border-bottom: 1px solid #444;
  }

  .table-wrapper tbody tr:nth-child(even) {
    background-color: #252525;
  }

  .table-wrapper tbody tr:hover {
    background-color: #2f2f2f;
  }
}

/* ======================================================
   FIX: Ananke schneidet Post-Previews ab
   ====================================================== */

/* Hauptcontainer darf nicht limitieren */
main,
article,
.nested-copy-line-height,
.measure {
  max-width: 100% !important;
  overflow: visible !important;
}

/* Flex Grid (Post-Liste) */
.flex {
  align-items: stretch;
}

/* Einzelne Karten */
.flex .pa2 {
  height: auto !important;
  display: flex;
}

/* Artikel innerhalb der Karte */
.flex .pa2 article {
  height: auto !important;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
}

/* Inhalt darf wachsen */
.flex .pa2 .nested-copy-line-height {
  overflow: visible !important;
}

/* Entfernt Abschneiden von Text */
.flex .pa2 p {
  overflow: visible !important;
  white-space: normal !important;
}

/* Entfernt harte Höhenlimits */
.flex .pa2 * {
  max-height: none !important;
}

/* Optional: sorgt für gleichmäßige Kartenhöhe */
.flex .pa2 article > div {
  flex-grow: 1;
}

/* ======================================================
   DEBUG (bei Bedarf aktivieren)
   ====================================================== */
/*
.table-wrapper {
  border: 3px solid red;
}

.flex .pa2 {
  border: 2px solid blue;
}
*/