/**
 * Blog Search Styles - MOBILE FIX
 * Force horizontal layout on mobile devices
 */

/* CRITICAL: Override Bootstrap column behavior on mobile */
@media (max-width: 767px) {
    /* Force parent row to be horizontal */
    #blog-page .row.align-items-center,
    .blog-page-section .row.align-items-center {
        display: block !important;
        white-space: nowrap !important;
        margin-top: -15px !important;
        margin-bottom: 30px !important;
        margin-left: 0 !important; /* Remove Bootstrap negative margin */
        margin-right: 0 !important; /* Remove Bootstrap negative margin */
    }
    
    /* Override BOTH col-md-6 on mobile - make them inline */
    #blog-page .row.align-items-center > .col-md-6,
    .blog-page-section .row.align-items-center > .col-md-6,
    #blog-page .row.align-items-center > .col,
    .blog-page-section .row.align-items-center > .col {
        display: inline-block !important;
        width: auto !important;
        padding: 0 !important; /* Remove Bootstrap padding */
        padding-left: 0 !important;
        padding-right: 0 !important;
        vertical-align: middle !important;
        margin: 0 !important;
    }
    
    /* Space between the two columns */
    #blog-page .row.align-items-center > .col-md-6:first-child,
    .blog-page-section .row.align-items-center > .col-md-6:first-child {
        margin-right: 10px !important;
    }
    
    /* Force the posts-category to be inline */
    #blog-page .posts-category,
    .blog-page-section .posts-category,
    #blog-page .posts-category.ico-20,
    .blog-page-section .posts-category.ico-20 {
        display: inline-block !important;
        vertical-align: middle !important;
        width: auto !important;
        margin: 0 !important;
        margin-top: -3px !important; /* Move up slightly */
    }
    
    /* Force blog-search-wrapper to be inline */
    #blog-page .blog-search-wrapper,
    .blog-page-section .blog-search-wrapper {
        display: inline-block !important;
        vertical-align: middle !important;
        width: auto !important;
        margin: 0 !important;
        margin-left: 25px !important; /* Move to the right - increase this value to move further */
        padding: 0 !important;
    }
    
    /* Heading styles - CRITICAL ALIGNMENT */
    .posts-category h4 {
        font-size: 20px !important;
        margin: 0 !important;
        display: inline-block !important;
        vertical-align: middle !important;
        line-height: 40px !important; /* Match search bar height */
    }
    
    .posts-category h4 span {
        vertical-align: middle !important;
    }
    
    /* Search form styles - CRITICAL ALIGNMENT */
    .blog-search-form {
        display: inline-block !important;
        vertical-align: middle !important;
        margin: 0 !important;
    }
    
    .blog-search-form .input-group {
        max-width: 320px !important; /* Increased from 250px */
        display: inline-flex !important;
        vertical-align: middle !important;
        height: 40px !important; /* Fixed height for alignment */
        margin: 0 !important;
    }
    
    .blog-search-form .form-control {
        font-size: 14px !important;
        padding: 10px 14px !important;
        height: 40px !important;
        line-height: 20px !important;
    }
    
    .blog-search-form .btn {
        font-size: 14px !important;
        padding: 10px 16px !important;
        height: 40px !important;
        line-height: 20px !important;
    }
}

@media (max-width: 575px) {
    .posts-category h4 {
        font-size: 18px !important;
        line-height: 36px !important;
    }
    
    .blog-search-form .input-group {
        max-width: 260px !important; /* Increased from 200px */
        height: 36px !important;
    }
    
    .blog-search-form .form-control {
        font-size: 13px !important;
        padding: 8px 12px !important;
        height: 36px !important;
        line-height: 20px !important;
    }
    
    .blog-search-form .btn {
        font-size: 13px !important;
        padding: 8px 12px !important;
        height: 36px !important;
        line-height: 20px !important;
    }
}

@media (max-width: 480px) {
    .posts-category h4 {
        font-size: 16px !important;
        line-height: 34px !important;
    }
    
    .blog-search-form .input-group {
        max-width: 220px !important; /* Increased from 170px */
        height: 34px !important;
    }
    
    .blog-search-form .form-control {
        font-size: 12px !important;
        padding: 7px 10px !important;
        height: 34px !important;
        line-height: 20px !important;
    }
    
    .blog-search-form .btn {
        font-size: 12px !important;
        padding: 7px 10px !important;
        height: 34px !important;
        line-height: 20px !important;
    }
}

/* Desktop - move up slightly */
@media (min-width: 768px) {
    #blog-page .row.align-items-center,
    .blog-page-section .row.align-items-center {
        margin-top: -10px;
    }
}