/* ============================================================
   BDL Tables - responsive, mobile-freundlich.
   Betrifft Content-Element-Tabellen auf z.B. BDL-Akademie-Seite.
   ============================================================ */

/* Fixe Pixelbreiten aus RTE kappen - mobile hatte vorher Scrollen */
#content table[style*="width"] {
  width: 100% !important;
  max-width: 100% !important;
  border-collapse: collapse;
  margin: 1rem 0;
}

#content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  background: #ffffff;
}

#content table thead {
  background: #E8EEF8;
  color: #1C4F9B;
}

#content table th,
#content table td {
  padding: .7rem .8rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid #e3e8ef;
}

#content table th {
  font-weight: 600;
}

/* Zebra */
#content table tbody tr:nth-child(even) td {
  background: #f7f9fc;
}

/* ============================================================
   MOBILE: Tabelle auf Card-Layout umstellen
   (max-width: 640px: jede Zeile wird ein Card-Block,
    Zellen zeigen ihr Spalten-Header via data-label)
   ============================================================ */
@media (max-width: 640px) {
  #content table,
  #content table thead,
  #content table tbody,
  #content table tr,
  #content table th,
  #content table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  #content table thead {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
  }

  #content table tr {
    margin-bottom: 1rem;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
  }

  #content table tbody tr:nth-child(even) {
    background: #f7f9fc;
  }
  #content table tbody tr:nth-child(even) td {
    background: transparent;
  }

  #content table td {
    border: 0;
    border-bottom: 1px solid #eef2f6;
    padding: .55rem .9rem;
    text-align: left;
  }
  #content table td:last-child {
    border-bottom: 0;
  }

  /* Spalten-Label: wenn kein data-label vorhanden, nutze :before mit "" */
  #content table td[data-label]::before {
    content: attr(data-label) ": ";
    display: block;
    font-weight: 600;
    color: #1C4F9B;
    font-size: .85rem;
    margin-bottom: .15rem;
  }
}
