/*
 * Apptrove Popular Posts v1.3
 * Active card shows the complete image.
 * Inactive cards show the LEFT/FIRST HALF of the same image.
 */
.apptrove-popular-posts {
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 310px;
    gap: 20px !important;
    overflow: hidden;
}

.apptrove-popular-posts > .apptrove-popular-post {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: auto !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
    border-radius: 20px;
    transition: flex-grow 0.45s ease, flex-basis 0.45s ease !important;
}

.apptrove-popular-posts > .apptrove-popular-post.is-active {
    flex: 2 1 0 !important;
}

.apptrove-popular-posts .apptrove-popular-post__link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/*
 * Inactive state: make the image twice the card width and anchor it to the left.
 * Because the card clips overflow, the visitor sees the first/left half rather
 * than Elementor/theme centering the middle of the image.
 */
.apptrove-popular-posts .apptrove-popular-post__image {
    display: block !important;
    width: 200% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: left center !important;
    border-radius: 0 !important;
    transform: translateX(0) !important;
    transition: width 0.45s ease !important;
}

/* Active state: reveal the entire image. */
.apptrove-popular-posts > .apptrove-popular-post.is-active .apptrove-popular-post__image {
    width: 100% !important;
    object-position: center center !important;
}

.apptrove-popular-posts-empty {
    margin: 0;
}

@media only screen and (max-width: 1280px) {
    .apptrove-popular-posts {
        height: 280px;
    }
}

@media only screen and (max-width: 1080px) {
    .apptrove-popular-posts {
        height: 250px;
    }
}

@media only screen and (max-width: 767px) {
    .apptrove-popular-posts {
        flex-direction: column !important;
        height: auto !important;
        gap: 15px !important;
        overflow: visible;
    }

    .apptrove-popular-posts > .apptrove-popular-post,
    .apptrove-popular-posts > .apptrove-popular-post.is-active {
        flex: none !important;
        width: 100% !important;
        height: 220px !important;
    }

    .apptrove-popular-posts .apptrove-popular-post__image,
    .apptrove-popular-posts > .apptrove-popular-post.is-active .apptrove-popular-post__image {
        width: 100% !important;
        object-position: center center !important;
    }
}
