/*
 * Tabellen aus dem Editor (CKEditor 5) responsiv machen.
 * CKEditor speichert Tabellen als <figure class="table" style="width:…;height:…"><table>…</table></figure>.
 * Die feste Inline-Breite/-Höhe wird hier überschrieben:
 * - Die Tabelle nimmt die volle Breite der Inhaltsspalte ein.
 * - Zellen brechen nicht um (z.B. "792.- CHF"); reicht der Platz nicht,
 *   scrollt die Tabelle einzeln horizontal, statt die Seite zu verbreitern.
 */
figure.table {
    display: block;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    margin-left: 0;
    margin-right: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

figure.table > table,
table.contenttable {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

figure.table td,
figure.table th,
table.contenttable td,
table.contenttable th {
    padding: .5em .75em;
    vertical-align: top;
    white-space: nowrap;
}

@media (max-width: 767.98px) {
    figure.table td,
    figure.table th,
    table.contenttable td,
    table.contenttable th {
        padding: .4em .6em;
    }

    /* Ältere Tabellen ohne <figure>-Wrapper */
    :not(figure) > table.contenttable {
        display: block;
        width: auto;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
