/* Gutenberg content behavior shared by the editor and singular templates. */

:where(.entry-content, .editor-styles-wrapper) .has-text-align-left {
    text-align: left !important;
}

:where(.entry-content, .editor-styles-wrapper) .has-text-align-center {
    text-align: center !important;
}

:where(.entry-content, .editor-styles-wrapper) .has-text-align-right {
    text-align: right !important;
}

:where(.entry-content, .editor-styles-wrapper) :is(figure, .wp-block-image).aligncenter,
:where(.entry-content, .editor-styles-wrapper) img.aligncenter {
    display: block;
    margin-right: auto !important;
    margin-left: auto !important;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-image.aligncenter {
    text-align: center;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-image.alignleft {
    float: left;
    margin-right: 1.5rem;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-image.alignright {
    float: right;
    margin-left: 1.5rem;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-image img {
    height: auto;
    margin-top: 0;
    margin-bottom: 0;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 4px;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table > table {
    width: 100%;
    max-width: none;
    border-collapse: collapse;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table thead {
    border: 0 !important;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table :is(th, td) {
    vertical-align: top;
}

:where(.entry-content, .editor-styles-wrapper) .wp-block-table :is(th, td).has-text-align-center img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table :is(th, td)[style*="text-align: center"] img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table :is(th, td)[style*="text-align:center"] img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table .has-text-align-center > img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table.has-text-align-center img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table table.has-text-align-center img,
:where(.entry-content, .editor-styles-wrapper) .wp-block-table img.aligncenter {
    display: block;
    margin-right: auto !important;
    margin-left: auto !important;
}

@media (max-width: 768px) {
    :where(.entry-content, .editor-styles-wrapper) .wp-block-table > table {
        width: 100% !important;
        min-width: 600px;
    }

    :where(.entry-content, .editor-styles-wrapper) .wp-block-table.alignleft,
    :where(.entry-content, .editor-styles-wrapper) .wp-block-table.aligncenter,
    :where(.entry-content, .editor-styles-wrapper) .wp-block-table.alignright {
        float: none;
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    :where(.entry-content, .editor-styles-wrapper) .wp-block-image.alignleft,
    :where(.entry-content, .editor-styles-wrapper) .wp-block-image.alignright {
        float: none;
        margin-right: 0;
        margin-left: 0;
    }
}
