/* gcahs-article-tables-guard: editorial spacing on every single post.
 * Classic tables can sit inside several classless editor wrappers. Gutenberg
 * owns its spacing on the figure instead, so captions stay with the table.
 */
body.single-post :is(.entry-content, .post-content, .gcaa-article-content) table:where(:not(table table, .widget table, nav table)),
body.single-post :is(.entry-content, .post-content, .gcaa-article-content) .wp-block-table:where(:not(table .wp-block-table, .widget .wp-block-table, nav .wp-block-table)) {
    margin-bottom: 34px !important;
}

/* One gap after the complete Gutenberg block, not after both table and block. */
body.single-post :is(.entry-content, .post-content, .gcaa-article-content) .wp-block-table table:where(:not(table table, .widget table, nav table)) {
    margin-bottom: 0 !important;
}

/* Wide comparison tables scroll inside the article on tablets and phones.
 * The page itself keeps its viewport width, including classic tables wrapped
 * in otherwise classless editor divs such as the Generationencheck example.
 */
@media screen and (max-width: 980px) {
    body.single-post :is(.entry-content, .post-content, .gcaa-article-content) table:where(:not(table table, .wp-block-table table, .widget table, nav table)),
    body.single-post :is(.entry-content, .post-content, .gcaa-article-content) .wp-block-table:where(:not(table .wp-block-table, .widget .wp-block-table, nav .wp-block-table)) {
        box-sizing: border-box;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

@media screen and (max-width: 640px) {
    body.single-post :is(.entry-content, .post-content, .gcaa-article-content) table:where(:not(table table, .widget table, nav table)) {
        font-size: 14px !important;
        line-height: 1.45 !important;
    }

    body.single-post :is(.entry-content, .post-content, .gcaa-article-content) table:where(:not(table table, .widget table, nav table)) th,
    body.single-post :is(.entry-content, .post-content, .gcaa-article-content) table:where(:not(table table, .widget table, nav table)) td {
        padding: 11px 13px !important;
    }
}
