.featured-mosaic-posts {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow: visible;
}

.featured-mosaic-post-item {
    display: flex;
    background: #fff;
    overflow: hidden;
}

.featured-mosaic-post-image-scale{
    display: block;
    width: 100%;
    overflow: hidden;
}

.featured-mosaic-post-image {
    transition:
        width 0.4s ease,
        flex-basis 0.4s ease;
}

.featured-mosaic-post-item:not(.active) {
    border-color: transparent !important;
}

.featured-mosaic-post-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.featured-mosaic-post-content {
    position: relative;
    overflow: hidden;
    width: 0;
    height: 0;
    flex: 0 0 0;
    opacity: 0;
    padding: 0;
    transition:
        width 0.4s ease,
        flex-basis 0.4s ease,
        opacity 0.25s ease,
        padding 0.3s ease;
}

.featured-mosaic-post-content-box{
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.featured-mosaic-post-item.active .featured-mosaic-post-content {
    border-left: none !important; 
    height: auto;
    opacity: 1;
}

.featured-mosaic-post-title {
    margin: 0 0 10px 0;
}

.featured-mosaic-post-title a {
    text-decoration: none;
}

.featured-mosaic-post-excerpt {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.featured-mosaic-post-meta {
    font-size: 12px;
    color: #999;
}

.featured-mosaic-post-date {
    margin-right: 10px;
}

.featured-mosaic-post-category {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    
}

@media (max-width: 768px) {
    /* Disable the horizontal accordion on tablet/mobile: every post becomes a
       normal stacked card (image on top, content flowing below). Without these
       overrides the collapsed content column (flex-basis:0) stays 0-height and
       its absolutely-positioned title / category overlap the image. */
    .featured-mosaic-posts {
        flex-wrap: wrap;
    }

    .featured-mosaic-post-item,
    .featured-mosaic-post-item.active {
        flex: 0 0 calc(50% - var(--gap, 20px));
        flex-direction: column;
    }

    .featured-mosaic-post-image {
        width: 100% !important;
        flex: 0 0 auto !important;
    }

    .featured-mosaic-post-image img {
        height: 150px;
    }

    .featured-mosaic-post-content,
    .featured-mosaic-post-item.active .featured-mosaic-post-content {
        position: static;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        flex: 1 1 auto !important;
        opacity: 1 !important;
        overflow: visible;
        padding: 0;
        transition: none;
    }

    .featured-mosaic-post-content-box {
        position: static;
        inset: auto;
        justify-content: flex-start;
        padding: 14px 6px 6px;
    }

    .featured-mosaic-post-category {
        position: static;
        margin-top: 8px;
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    /* Must also match .active (same 2-class specificity as the 768px rule),
       otherwise the active item stays at 50% width and its image shrinks. */
    .featured-mosaic-post-item,
    .featured-mosaic-post-item.active {
        flex: 0 0 100%;
    }
}