/*
 * Responsive tables in rendered article content.
 *
 * These selectors intentionally avoid Bootstrap's `.table` and
 * `.table-responsive` classes. Bootstrap 3 gives those tables a fixed width
 * and forces cells onto one line on small screens, which is unsuitable for
 * wide Markdown tables and MathJax 3 output.
 */

.post-container .post-table-scroll {
    box-sizing: border-box;
    max-width: 100%;
    margin: 1.5em 0;
    border: 1px solid #a0a0a0;
    border-radius: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.post-container .post-table-scroll:focus-visible {
    outline: 2px solid #337ab7;
    outline-offset: -2px;
}

.post-container .post-table-scroll > table.post-table {
    width: auto;
    min-width: 100%;
    max-width: none;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.post-container table.post-table th,
.post-container table.post-table td {
    min-width: 6em;
    border: 0;
    border-right: 1px solid #a0a0a0;
    border-bottom: 1px solid #a0a0a0;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.post-container table.post-table tr > :last-child {
    border-right: 0;
}

.post-container table.post-table > :last-child > tr:last-child > * {
    border-bottom: 0;
}

.post-container table.post-table th,
.post-container table.post-table code,
.post-container table.post-table kbd,
.post-container table.post-table samp,
.post-container table.post-table mjx-container[jax="SVG"] {
    white-space: nowrap;
}

.post-container table.post-table mjx-container[jax="SVG"],
.post-container table.post-table mjx-container[jax="SVG"] > svg {
    max-width: none;
}

.post-container table.post-table mjx-container[jax="SVG"] > svg {
    overflow: visible;
}
