/* Pool / Jogos: restore the visual separation lost in the Elementor grid. */
body.home #pool-jogos #pool-jogos,
body.home #pool-jogos .esb-pool-games-grid {
    gap: 20px !important;
}

/*
 * Gallery hero containers were fixed at 1400 px and exceeded the viewport on
 * regular desktop screens. Keep the intended maximum without horizontal scroll.
 */
body.page-id-2450 .elementor-element[data-id="547319d"],
body.page-id-8763 .elementor-element[data-id="c27cf02"] {
    box-sizing: border-box !important;
    width: 1400px !important;
    max-width: calc(100% - 20px) !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

/* English Groups & Events used a centred fixed-width 1400 px container. */
body.page-id-8432 .elementor-element[data-id="a83aec6"] {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

/*
 * Fallback estritamente condicionado: só é ativado pelo JavaScript quando a
 * galeria Masonry do Elementor não inicializa. Assim as fotografias continuam
 * acessíveis, sem alterar o layout normal quando o widget funciona.
 */
.elementor-gallery__container.esb-gallery-fallback {
    position: relative !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    height: auto !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.elementor-gallery__container.esb-gallery-fallback > .e-gallery-item {
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    aspect-ratio: var(--esb-gallery-ratio, 4 / 3);
    overflow: hidden;
    opacity: 1 !important;
    transform: none !important;
}

.elementor-gallery__container.esb-gallery-fallback .e-gallery-image {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    background-position: center !important;
    background-size: cover !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .elementor-gallery__container.esb-gallery-fallback {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    body.home #pool-jogos #pool-jogos,
    body.home #pool-jogos .esb-pool-games-grid {
        gap: 16px !important;
    }

    .elementor-gallery__container.esb-gallery-fallback {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}
