.custom-cover-image {
    /* Remove the default height set by the Gutenberg cover block */
    min-height: 0 !important;
    height: auto;
}

/* Maintain the aspect ratio of the background image */
.custom-cover-image::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* Adjust this value based on your image's aspect ratio (e.g., 16:9 -> 56.25%) */
}

/* Mobile devices (portrait and landscape) */
@media only screen and (max-width: 767px) {
    .custom-cover-image img.wp-block-cover__image-background {
        object-fit: cover !important;
        object-position: center !important;
        width: 100% !important;
        height: 100% !important;
        position: absolute;
    }

    .custom-cover-image .wp-block-cover__inner-container {
        /* Center align the content */
        text-align: center;
        /* Position the inner container on top of the background image */
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

