/**
 * WPSolr Custom Styles - Post Type Filter
 * MyListing Child Theme
 * 
 * Features:
 * - Pill-style post type filter
 * - Unique colors for each active type
 * - Count badges
 * - Post type result badges
 * - 2-column result layout
 * - Sticky sidebar with 40/60 split
 * - Responsive design
 */

/* ============================================================================
   MAIN LAYOUT - 40/60 Split with Sticky Sidebar
   ========================================================================= */

/* Results container */
.wdm_resultContainer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 0;
}

/* Left Sidebar - Filters (40% width, sticky) */
.wdm_list {
    flex: 0 0 40%;
    width: 40%;
    position: sticky;
    top: 150px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding: 30px;
    padding-top: 30px;
}

.wdm_list .cls_search .ui-widget {
    display: flex;
    gap: 5px;
}

.wdm_list .cls_search .ui-widget input[type="text"] {
    width: 475px!important;
    height: 40px!important;
}


/* Search form in sticky sidebar */
.wdm_list .search_form_shortcode {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wdm_list .search_form_shortcode input[type="text"],
.wdm_list .search_form_shortcode input[type="search"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.wdm_list .search_form_shortcode input[type="text"]:focus,
.wdm_list .search_form_shortcode input[type="search"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.wdm_list .search_form_shortcode input[type="submit"],
.wdm_list .search_form_shortcode button[type="submit"] {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.wdm_list .search_form_shortcode input[type="submit"]:hover,
.wdm_list .search_form_shortcode button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Custom scrollbar for sidebar */
.wdm_list::-webkit-scrollbar {
    width: 6px;
}

.wdm_list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wdm_list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wdm_list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Right Column - Results (60% width, scrollable) */
.wdm_results {
    flex: 0 0 55%;
    width: 55%;
    min-width: 0;
    padding-top: 30px;
    box-shadow: -10px 0 20px -10px rgba(0, 0, 0, 0.1);
}

.wdm_results  .res_info{
    display: none;
}

.wpsolr_ltr  {
    margin-top: 30px;
}


.wpsolr_ltr .wdm_ul ul,
.wpsolr_ltr .wdm_ul .wpsolr_remove_facets {
    margin-bottom: 30px;
}

.wpsolr_ltr .wdm_ul .wpsolr_facet_title {
    font-weight: 700;
}



/* ============================================================================
   SEARCH CONTROLS WRAPPER - Dark Theme
   ========================================================================= */

/* Top Wrapper: Search Controls */
.wpsolr-search-controls-wrapper {
    background: #1A1A1E;
    padding: 40px 60px;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 350px;
}

/* Search Heading */
.wpsolr-search-heading {
    color: #ffffff;
    font-size: 76px!important;
    font-weight: 700;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Search Form in Controls Wrapper */
.wpsolr-search-controls-wrapper .cls_search {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}

.wpsolr-search-controls-wrapper .cls_search input[type="text"],
.wpsolr-search-controls-wrapper .cls_search input[type="search"] {
    width: 650px!important;
    height: 56px!important;
    padding: 15px 20px;
    background: #3a3a3a;
    border-radius: 5px 0 0 5px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    border-right: none;
}

.wpsolr-search-controls-wrapper .cls_search input[type="text"]:focus,
.wpsolr-search-controls-wrapper .cls_search input[type="search"]:focus {
    outline: none;
    border-color: #7C8C60;
    box-shadow: 0 0 0 3px rgba(124, 140, 96, 0.2);
}

.wpsolr-search-controls-wrapper .cls_search input[type="text"]:focus + input[type="submit"],
.wpsolr-search-controls-wrapper .cls_search input[type="search"]:focus + input[type="submit"],
.wpsolr-search-controls-wrapper .cls_search input[type="text"]:focus + button[type="submit"],
.wpsolr-search-controls-wrapper .cls_search input[type="search"]:focus + button[type="submit"] {
    border-color: #7C8C60;
}

.wpsolr-search-controls-wrapper .cls_search input[type="text"]::placeholder,
.wpsolr-search-controls-wrapper .cls_search input[type="search"]::placeholder {
    color: #a0a0a0;
}

/* Search Button in Controls Wrapper */
.wpsolr-search-controls-wrapper .cls_search input[type="submit"],
.wpsolr-search-controls-wrapper .cls_search button[type="submit"] {
    background: #7C8C60;
    border-radius: 0 8px 8px 0;
    color: white;
    padding: 0;
    font-size: 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 56px;
    width: 56px!important;
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Search Button Icon */
.wpsolr-search-controls-wrapper .cls_search input[type="submit"],
.wpsolr-search-controls-wrapper .cls_search button[type="submit"] {
    background-image: url("data:image/svg+xml,%3Csvg aria-hidden='true' class='e-font-icon-svg e-fas-search' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z' fill='white'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

.wpsolr-search-controls-wrapper .cls_search input[type="submit"]:hover,
.wpsolr-search-controls-wrapper .cls_search button[type="submit"]:hover {
    background: #6a7a50;
    background-image: url("data:image/svg+xml,%3Csvg aria-hidden='true' class='e-font-icon-svg e-fas-search' viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z' fill='white'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(124, 140, 96, 0.4);
}

/* ============================================================================
   POST TYPE FILTER - Pill Style
   ========================================================================= */

/* Filter Wrapper */
.wpsolr-post-type-filter-wrapper {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.wpsolr-post-type-filter {
    position: relative;
}

.wpsolr-filter-label {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Pills Container */
.wpsolr-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* Individual Pill Button */
.wpsolr-type-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: #7B7B7B1A!important;
    border-color: #7B7B7B1A!important;
    border-radius: 40px!important;
    font-size: 14px;
    font-weight: 500!important;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    text-transform: capitalize!important;
}

.wpsolr-type-pill:hover {
    border-color: #848E63;
    color: #848E63;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124, 140, 96, 0.3);
    background-color: #848E63!important;
    color: white!important;
}

/* Pill Label */
.pill-label {
    font-weight: inherit;
}


/* Active Pill State - Default (All Types) */
.wpsolr-type-pill.active {
    background-color: #848E63!important;
    border-color: #848E63;
    color: white!important;
    /* box-shadow: 0 4px 12px rgba(124, 140, 96, 0.4); */
    /* font-weight: 700; */
}





/* Active Hover States */
.wpsolr-type-pill.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}



/* ============================================================================
   POST TYPE BADGES on Results
   ========================================================================= */

.wpsolr-post-type-badge {
    display: inline-block;
    padding: 9px 16px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 400;
    text-transform: capitalize;
    border-radius: 4px;
    letter-spacing: 0.5px;
    color: #848E63;
    background: transparent;
    border: 1px solid #848E63;
    line-height: 1;
}



.wpsolr-badge-page {
    background: #2ecc71; /* Green for Pages (fallback) */
}

/* Result container styling */
.wpsolr-result {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.wpsolr-result:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* ============================================================================
   RESULT 2-COLUMN LAYOUT
   ========================================================================= */

/* Two-column container */
.wpsolr-result-columns {
    display: flex;
    gap: 20px;
}

/* Left Column - Featured Image (4:3 Aspect Ratio) */
.wpsolr-result-image {
    flex: 0 0 250px;
    width: 250px;
    position: relative;
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Force 4:3 aspect ratio (250px width = 187.5px height) */
.wpsolr-result-image::before {
    content: '';
    display: block;
    padding-top: 75%; /* 4:3 aspect ratio (3/4 = 0.75 = 75%) */
}

.wpsolr-result-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Placeholder for posts without images */
.wpsolr-no-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ddd;
}

/* Right Column - Badge, Title, Content Wrapper */
.wpsolr-result-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Title Styling - Bold and Larger */
.wpsolr-result-content-wrapper .p_title {
    margin-bottom: 5px;
}

.wpsolr-result-content-wrapper .p_title a {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.3;
    display: block;
    transition: color 0.2s ease;
}

.wpsolr-result-content-wrapper .p_title a:hover {
    color: #3498db;
}

/* Badge in Right Column */
.wpsolr-result-content-wrapper .wpsolr-post-type-badge {
    align-self: flex-start;
    margin-bottom: 5px;
}

/* Content */
.wpsolr-result-content-wrapper .p_content {
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
}

/* Remove images from content text */
.wpsolr-result-content-wrapper .p_content img {
    display: none !important;
}

/* Ensure content text flows properly */
.wpsolr-result-content-wrapper .p_content p {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #555;
    font-size: 14px;
}

.wpsolr-result-content-wrapper .p_misc {
    font-style: italic!important;
    font-size: 12px!important;
    font-family: "CoFo Sans", Sans-serif;
    display: none;
}

.results-by-facets .p_misc {
    display: none;
}

.wdm_result_list_thumb {
    padding: 0;
}

/* Region row under excerpt */
.wpsolr-result-region {
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wpsolr-region-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.wpsolr-region-name {
    font-size: 14px;
    font-weight: 400;
    color: #222;
}

/* New circular container via CSS */
.wpsolr-region-icon {
    width: 28px;
    height: 28px;
    border-radius: 100%;
    background: #7C8C60;
    border: 2px solid #7C8C60;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wpsolr-result-image img,
.search-results .elementor img{
        width: 100%;
        height: 100%!important;
}


.wdm_label {
    font-size: 14px;
    font-weight: 400;
    margin-right: 6px;
}

.wpsolr_ltr .wdm_label {
    display: none;
}

#wpsolr_remove_facets {
    background: unset;
    padding-left: 0;
    font-size: 14px;
}

.wpsolr-content-wrapper .select_field,
#wpsolr_section_facets .wpsolr-select
 {
    height: 40px;
    background-color: #0000001a;
    border: none;
    padding: 10px 36px 10px 16px; /* extra right padding for arrow */
    outline: none;
    box-shadow: none;
    max-width: 400px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center; /* move arrow slightly left */
    background-size: 14px 14px;
}

.wpsolr-content-wrapper .wpsolr-sort-wrapper .select_field {
    width: 140px;
}

.wpsolr-content-wrapper .select_field option,
#wpsolr_section_facets .wpsolr-select option {
    font-size: 14px;
}


.wpsolr-content-wrapper .wpsolr-controls-row {
    display: flex;
    gap: 40px;
    align-items: center;
}

/* ============================================================================
   BADGE CONTAINER STYLING
   ========================================================================= */

/* Badge container for post type and featured badges */
.wpsolr-badge-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Featured badge beside post-type badge */
.wpsolr-featured-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 4px;
    background: #ffffff;
    border: 1px solid #749AB4;
    color: #749AB4;
    line-height: 1;
    min-width: 32px;
    height: 34px;
    margin-bottom: 5px;
}

.wpsolr-featured-badge svg {
    width: 12px;
    height: 12px;
}


#wpsolr_section_facets .wpsolr_facet_title {
    font-size: 20px;
    margin-bottom: 16px;
}

#wpsolr_section_facets ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#wpsolr_section_facets ul li .select_opt {
    text-decoration: none;
    font-size: 14px;
    background: unset!important;
    background-size: unset!important;
    padding-left: 30px;
    position: relative;
    min-height: 28px;
    display: flex;
    align-items: center;
}

/* Custom checkbox box */
#wpsolr_section_facets ul li .select_opt:before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 1px solid #848E63; /* olive */
    border-radius: 2px;
    background: transparent;
    box-sizing: border-box;
}

/* Checked state fill */
#wpsolr_section_facets ul li .select_opt.checked:before {
    background: #848E63;
    border-color: #848E63;
}

/* Checkmark */
#wpsolr_section_facets ul li .select_opt.checked:after {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    width: 12px;
    height: 6px;
    border: 3px solid #fff;
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg);
}




/* ============================================================================
   RESPONSIVE DESIGN
   ========================================================================= */

/* Tablet */
@media (max-width: 1024px) {
    /* Main Layout - Stack on Tablet */
    .wdm_resultContainer {
        flex-direction: column;
    }
    
    .wdm_list {
        position: relative;
        top: auto;
        flex: 0 0 auto;
        width: 50%!important;
        max-height: none;
        overflow-y: visible;
        padding-right: 0;
        margin-bottom: 20px;
    }
    
    .wdm_results {
        flex: 0 0 auto;
        width: 50%!important;
    }

    /* Title sizing on tablet */
    .wpsolr-result-content-wrapper .p_title a {
        font-size: 18px;
    }
    
    /* Filter Pills */
    .wpsolr-post-type-filter-wrapper {
        padding: 15px;
    }
    
    .wpsolr-type-pills {
        gap: 6px;
        height: 40px;
    }
    
    .wpsolr-type-pill {
        padding: 8px 14px;
        font-size: 13px;
        flex: 0 0 auto;
        gap: 6px;
    }
    
    .wpsolr-filter-label {
        font-size: 13px;
    }
    
    .pill-count {
        font-size: 11px;
        padding: 2px 6px;
    }
    
    /* Result 2-Column Layout - Stack on Tablet */
    .wpsolr-result-columns {
        flex-direction: column;
        gap: 15px;
    }
    
    .wpsolr-result-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    /* Maintain 4:3 aspect ratio on tablet */
    .wpsolr-result-image::before {
        padding-top: 75%; /* 4:3 ratio */
    }

    .wpsolr-search-controls-wrapper .cls_search input[type="text"],
    .wpsolr-search-controls-wrapper .cls_search input[type="search"] {
        width: 570px!important;
    }

    #wpsolr_section_facets ul {
        margin-right: 30px;
    }
    
}

/* Mobile */
@media (max-width: 767px) {
    /* Filter Pills */
    .wpsolr-type-pills {
        flex-direction: column;
        height: 100%;
    }
    
    .wpsolr-type-pill {
        width: 100%;
        justify-content: space-between;
    }
    
    .pill-label {
        flex: 1;
    }
    
    /* Result Layout */
    .wpsolr-result {
        padding: 15px;
    }
    
    .wpsolr-result-image {
        width: 100%;
    }
    
    /* Maintain 4:3 aspect ratio on mobile */
    .wpsolr-result-image::before {
        padding-top: 75%; /* 4:3 ratio */
    }
    
    .wpsolr-result-image img {
        width: 100%;
        height: 100%;
    }
    
    .wpsolr-no-image-placeholder svg {
        width: 60px;
        height: 60px;
    }
    
    /* Title sizing on mobile */
    .wpsolr-result-content-wrapper .p_title a {
        font-size: 16px;
    }

    .wdm_list {
        width: 100%!important;
    }
    
    .wdm_results {
        width: 100%!important;
    }

    .wpsolr-search-controls-wrapper {
        padding: 30px;
    }

    .wpsolr-search-controls-wrapper .cls_search input[type="text"], .wpsolr-search-controls-wrapper .cls_search input[type="search"] {
        width: calc(100% - 56px)!important;
        margin-left: 0!important;
    }

    .wpsolr-search-controls-wrapper .cls_search {
        display: block;

    }

    .wpsolr-search-heading {
        font-size: 26px!important;
    }

    .wpsolr-content-wrapper {
        flex-direction: column-reverse;
        display: flex;
    }
}



