/* ============================================================
   HOMEPAGE SPECIFIC STYLES
   Moved from inline styles in index.php for clean SEO
   ============================================================ */

/* Body overflow prevention */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    position: relative;
}

/* Remove min-height from site-showcase to eliminate white gap */
.site-showcase {
    min-height: 0 !important;
    height: auto !important;
}

.site-showcase .hero-slider.hidden-xs {
    min-height: 0 !important;
    height: auto !important;
}

/* Hide site-showcase when it has no slides/content */
.site-showcase .hero-slider.hidden-xs ul.slides:empty {
    display: none !important;
}

/* Ensure content starts 10px under heading */
.main {
    margin-top: 10px;
}

/* Hide empty site-showcase completely */
.site-showcase:empty {
    display: none !important;
}

/* Mobile styles - Match Buying Guide layout for News and Blog sections */
@media (max-width: 767px) {
    /* Make News and Blog columns full width on mobile (stack vertically) */
    .page-section .container .row .col-md-6.posts-archive {
        width: 100% !important;
        margin-bottom: 30px;
        float: none !important;
        clear: both;
    }
    
    /* News and Blog sections - match Buying Guide layout on mobile */
    .posts-archive .post {
        margin-bottom: 20px;
        border: none;
    }
    
    /* Ensure articles in News/Blog have same structure as Buying Guide */
    .posts-archive .post .row {
        margin: 0;
    }
    
    /* Image column styling to match Buying Guide exactly */
    .posts-archive .post .col-md-3.col-sm-4.col-xs-6 {
        width: 50% !important;
        float: left;
        padding-left: 0 !important;
        padding-right: 10px !important;
        margin-bottom: 10px;
    }
    
    /* Text column styling to match Buying Guide exactly */
    .posts-archive .post .col-md-9.col-sm-8.col-xs-6 {
        width: 50% !important;
        float: left;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Image styling to match Buying Guide - prevent stretching, maintain aspect ratio */
    .posts-archive .post img.img-rounded.img-responsive,
    .posts-archive .post img.lozad,
    .posts-archive .post a img {
        width: 100% !important;
        height: auto !important;
        border-radius: 4px !important;
        display: block !important;
        object-fit: cover !important;
        max-width: 100% !important;
        max-height: 120px !important;
    }
    
    /* Image container to match Buying Guide */
    .posts-archive .post .col-md-3.col-sm-4.col-xs-6 a {
        display: block;
        overflow: hidden;
        border-radius: 4px;
    }
    
    /* Limit article header to 2 lines on mobile for consistency */
    .posts-archive .post h3 {
        margin-top: 0;
        margin-bottom: 10px;
        font-size: 16px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.6em;
    }
    
    .posts-archive .post h3 a {
        display: block;
    }
    
    /* Text styling */
    .posts-archive .post p {
        margin-bottom: 0;
        line-height: 1.5;
        font-size: 13px;
    }
    
    /* Clear floats */
    .posts-archive .post .col-md-12:after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Match Buying Guide article wrapper styling */
    .posts-archive .post .col-md-12.col-sm-12 {
        padding: 0;
    }
}
