/**
 * Fix for News/Blog/Guides Image Thumbnail Cropping
 * Fixes images being cropped at the bottom on mobile and desktop
 * Only applies to news, blog, and guides sections
 */

/* Desktop Fix - Remove cropping for blog and news last articles (including second articles in each row) */
@media (min-width: 992px) {
    /* News/Blog/Guides Image Wrapper - Remove overflow hidden on desktop to prevent cropping */
    /* Target all possible structures including .col-md-6 wrapper for second articles */
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .col-md-6 .box-desktop-size.newsList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .col-md-6 .box-desktop-size.blogList .news-image-wrapper,
    .col-md-6 .col-md-12.col-sm-12.box-desktop-size.newsList .news-image-wrapper,
    .col-md-6 .col-md-12.col-sm-12.box-desktop-size.blogList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.newsList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.blogList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.guideList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList > .col-md-5,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.newsList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.blogList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.guideList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.guideList .content-row {
        overflow: visible !important;
    }
    
    /* News/Blog/Guides Images - Remove height constraints and change object-fit on desktop */
    /* This prevents bottom cropping by allowing full image to display */
    /* Target all possible structures including .col-md-6 wrapper for second articles */
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList img,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList img,
    .fw.page .pageRight .pageRightBox .row .col-md-6 .box-desktop-size.newsList img,
    .fw.page .pageRight .pageRightBox .row .col-md-6 .box-desktop-size.blogList img,
    .col-md-6 .col-md-12.col-sm-12.box-desktop-size.newsList img,
    .col-md-6 .col-md-12.col-sm-12.box-desktop-size.blogList img,
    .col-md-12.col-sm-12.box-desktop-size.newsList img,
    .col-md-12.col-sm-12.box-desktop-size.blogList img,
    .col-md-12.col-sm-12.box-desktop-size.guideList img,
    .col-md-6 .box-desktop-size.newsList img,
    .col-md-6 .box-desktop-size.blogList img {
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        object-fit: contain !important;
        width: 100% !important;
        display: block !important;
    }
}

/* Mobile Fix */
@media (max-width: 991px) {
    /* News/Blog/Guides Image Wrapper - Remove overflow hidden on mobile to prevent cropping */
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.newsList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.blogList .news-image-wrapper,
    .col-md-12.col-sm-12.box-desktop-size.guideList .news-image-wrapper,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList > .col-md-5,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.newsList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.blogList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.guideList > .col-md-5,
    .col-md-12.col-sm-12.box-desktop-size.guideList .content-row {
        overflow: visible !important;
    }
    
    /* News/Blog/Guides Images - Remove height constraints and change object-fit on mobile */
    /* This prevents bottom cropping by allowing full image to display */
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.newsList img,
    .fw.page .pageRight .pageRightBox .row .box-desktop-size.blogList img,
    .col-md-12.col-sm-12.box-desktop-size.newsList img,
    .col-md-12.col-sm-12.box-desktop-size.blogList img,
    .col-md-12.col-sm-12.box-desktop-size.guideList img {
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        object-fit: contain !important;
        width: 100% !important;
        display: block !important;
    }
    
    /* Homepage News/Blog Section Images - Fix cropping on mobile */
    .news-blog-section .post img,
    .news-blog-section .news-blog-post img,
    .posts-archive .post img.img-rounded.img-responsive,
    .posts-archive .post img.lozad,
    .posts-archive .post a img {
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        object-fit: contain !important;
        width: 100% !important;
    }
    
    /* Homepage News/Blog Image Containers - Remove overflow hidden */
    .posts-archive .post .col-md-3.col-sm-4.col-xs-6 a,
    .news-blog-section .post a,
    .news-blog-section .news-blog-post a {
        overflow: visible !important;
    }
}
