/* Template-scoped repairs. Existing content, links and media are untouched. */

:is(body.single-casino, body.single-game, body.single-post, body.page)
    .space-page-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
}

:is(body.single-casino, body.single-game, body.single-post, body.page)
    .space-page-content table :is(th, td) {
    border: 1px solid currentColor;
}

body:not(.home) .space-page-content .wp-block-columns {
    display: flex;
    align-items: normal;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 32px;
}

body:not(.home) .space-page-content .wp-block-columns > .wp-block-column {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
}

:is(body.single-casino, body.single-game)
    :is(.attachment-mercury-9999-135, .size-mercury-9999-135,
        .attachment-mercury-135-135, .size-mercury-135-135,
        .attachment-mercury-100-100, .size-mercury-100-100) {
    object-fit: cover;
    object-position: 50% 50%;
}

.codex-not-found-template .space-page-wrapper {
    display: flow-root;
}

.codex-not-found {
    padding: 10px 15px 55px;
}

.codex-not-found h1 {
    margin: 0 0 10px;
}

.codex-not-found h2 {
    margin: 0 0 25px;
}

.codex-not-found .search-form {
    max-width: 520px;
}

@media (max-width: 781px) {
    :is(body.single-casino, body.single-game, body.single-post, body.page)
        .space-page-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body:not(.home) .space-page-content .wp-block-columns {
        flex-wrap: wrap;
        gap: 32px;
    }

    body:not(.home) .space-page-content .wp-block-columns > .wp-block-column {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    body:not(.home) .space-page-content .wp-block-column > * {
        max-width: 100%;
    }

    body.error404 .space-sidebar-section .widget_search,
    body.error404 .space-sidebar-section .space-widget:has(.space-default-search-form) {
        display: none;
    }
}
