/**
 * Custom Filter Enhancement CSS
 *
 * Styles for the enhanced nectar-post-grid-filters
 * Add this as a Custom Code block in WPBakery
 *
 * @package Salient Child Theme
 * @version 2.4
 */

/* Enhanced Nectar Post Grid Filters - Solid Purple Background */
.nectar-post-grid-filters.enhanced-filters {
    background: #542452 !important;
    padding: 40px 0 !important;
    margin: 0 0 40px 0 !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    z-index: 3;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    box-sizing: border-box;
    border-radius: 0;
    overflow: hidden;
}

/* Container for centering content */
.nectar-post-grid-filters.enhanced-filters .enhanced-filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    box-sizing: border-box;
}

/* Enhanced Filter Container - 3-Column Grid Layout */
.enhanced-filter-header {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    gap: 30px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

/* Title */
.enhanced-filter-title {
    color: white;
    font-size: 46px;
    font-weight: 700;
    margin: 0;
}

/* Filter Buttons Container */
.enhanced-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

/* Enhanced Filter Buttons */
.enhanced-filter-btn {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    z-index: 1;
}

.enhanced-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.enhanced-filter-btn.active {
    background: white !important;
    color: #542452 !important;
    border-color: white;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.enhanced-filter-btn.active:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #542452 !important;
    transform: translateY(-3px);
}

/* First button (likely "All" button in Nectar) gets special styling */
.enhanced-filter-btn:first-child {
    background: rgba(255, 255, 255, 0.15) !important;
    font-weight: 700;
}

.enhanced-filter-btn:first-child.active {
    background: white !important;
    color: #542452 !important;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.4);
}

/* Filter Buttons Container */
.enhanced-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding-top: 25px;
    padding-bottom: 25px;
}

/* Search */
.enhanced-filter-search {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
}

.enhanced-filter-search-input {
    width: 100%;
    padding: 10px 10px 10px 72px !important;
    border: none;
    border-radius: 15px !important;
    background: rgba(255, 255, 255, 0.95);
    color: #542452;
    font-size: 22px;
    font-weight: 500;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.enhanced-filter-search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.enhanced-filter-search-input:focus {
    background: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.enhanced-filter-search-btn {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #542452;
}

.enhanced-filter-search-btn:hover {
    background: #4a1f4a;
    transform: translateY(-50%) scale(1.05);
}

.enhanced-filter-search-btn svg {
    width: 18px;
    height: 18px;
}

/* Style the filter buttons - ALL BUTTONS IN THE ENHANCED FILTER */
.nectar-post-grid-filters.enhanced-filters a {
    background: #c79cc8 !important;
    color: white !important;
    border: none;
    padding: 12px 24px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    backdrop-filter: blur(10px);
    white-space: nowrap;
    /* ULTRA AGGRESSIVE underline removal */
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
    text-underline-position: unset !important;
    border-bottom: none !important;
    outline: none !important;
    /* Additional underline removal */
    text-decoration-skip: none !important;
    text-decoration-skip-ink: none !important;
    text-underline-offset: 0 !important;
    text-underline-position: auto !important;
}

.nectar-post-grid-filters.enhanced-filters a:hover {
    background: #AA85AB !important;
    border-color: #BC93BD !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* ULTRA AGGRESSIVE underline removal on hover */
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
    text-underline-position: unset !important;
    border-bottom: none !important;
    outline: none !important;
    text-decoration-skip: none !important;
    text-decoration-skip-ink: none !important;
    text-underline-offset: 0 !important;
    text-underline-position: auto !important;
}

/* Active state - work with Nectar's native active class */
.nectar-post-grid-filters.enhanced-filters a.active,
.nectar-post-grid-filters.enhanced-filters a[class*="active"] {
    background: white !important;
    color: #542452 !important;
    border-color: white !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    /* ULTRA AGGRESSIVE underline removal on active state */
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
    text-underline-position: unset !important;
    border-bottom: none !important;
    outline: none !important;
    text-decoration-skip: none !important;
    text-decoration-skip-ink: none !important;
    text-underline-offset: 0 !important;
    text-underline-position: auto !important;
}

.nectar-post-grid-filters.enhanced-filters a.active:hover,
.nectar-post-grid-filters.enhanced-filters a[class*="active"]:hover {
    background: #f8f9fa !important;
    transform: translateY(-2px);
    /* ULTRA AGGRESSIVE underline removal on active hover */
    text-decoration: none !important;
    text-decoration-line: none !important;
    text-decoration-style: none !important;
    text-decoration-color: transparent !important;
    text-decoration-thickness: 0 !important;
    text-underline-offset: 0 !important;
    text-underline-position: unset !important;
    border-bottom: none !important;
    outline: none !important;
    text-decoration-skip: none !important;
    text-decoration-skip-ink: none !important;
    text-underline-offset: 0 !important;
    text-underline-position: auto !important;
}

/* REMOVE THE ::AFTER PSEUDO-ELEMENT UNDERLINES */
.nectar-post-grid-filters.enhanced-filters a::after {
    display: none !important;
    content: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.nectar-post-grid-filters.enhanced-filters a:hover::after {
    display: none !important;
    content: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.nectar-post-grid-filters.enhanced-filters a.active::after,
.nectar-post-grid-filters.enhanced-filters a[class*="active"]::after {
    display: none !important;
    content: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.nectar-post-grid-filters.enhanced-filters a.active:hover::after,
.nectar-post-grid-filters.enhanced-filters a[class*="active"]:hover::after {
    display: none !important;
    content: none !important;
    height: 0 !important;
    width: 0 !important;
    background: none !important;
    transform: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Search filtered items - add subtle highlight for search results */
.nectar-post-grid-item.search-filtered {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .enhanced-filter-header {
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    
    .enhanced-filter-title {
        text-align: center;
    }
    
    .enhanced-filter-search {
        margin-left: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .nectar-post-grid-filters.enhanced-filters {
        padding: 30px 20px;
    }

    .enhanced-filter-title {
        font-size: 24px;
    }

    .enhanced-filter-search-input {
        padding: 25px 45px 25px 25px;
        font-size: 14px;
    }

    .enhanced-filter-search-btn {
        width: 35px;
        height: 35px;
    }

    .enhanced-filter-buttons {
        gap: 8px;
    }

    .nectar-post-grid-filters.enhanced-filters a {
        padding: 10px 18px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .nectar-post-grid-filters.enhanced-filters {
        padding: 25px 15px;
    }

    .enhanced-filter-title {
        font-size: 20px;
    }

    .nectar-post-grid-filters.enhanced-filters a {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }
}

/* Ensure filters are always visible - OVERRIDE ALL NECTAR RULES */
.nectar-post-grid-filters.enhanced-filters {
    visibility: visible !important;
    opacity: 1 !important;
    max-width: none !important;
    padding: 40px 30px !important;
}

/* Override Nectar's mobile filter hiding */
.nectar-post-grid-filters.enhanced-filters div:not(.n-sticky) {
    margin-top: 0 !important;
}

.nectar-post-grid-filters.enhanced-filters div.visible {
    display: block !important;
}

/* Force display on all screen sizes */
@media (max-width: 1024px) {
    .nectar-post-grid-filters.enhanced-filters {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nectar-post-grid-filters.enhanced-filters div:not(.n-sticky) {
        display: block !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 768px) {
    .nectar-post-grid-filters.enhanced-filters {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nectar-post-grid-filters.enhanced-filters div:not(.n-sticky) {
        display: block !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 690px) {
    .nectar-post-grid-filters.enhanced-filters {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nectar-post-grid-filters.enhanced-filters div:not(.n-sticky) {
        display: block !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 480px) {
    .nectar-post-grid-filters.enhanced-filters {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .nectar-post-grid-filters.enhanced-filters div:not(.n-sticky) {
        display: block !important;
        margin-top: 0 !important;
    }
}

/* Override any Nectar animations that might hide the filter */
.nectar-post-grid-filters.enhanced-filters[data-animation="fade-in-from-bottom"] {
    opacity: 1 !important;
    transition: none !important;
}

.nectar-post-grid-filters.enhanced-filters[data-animation="fade-in-from-bottom"].animated-in {
    opacity: 1 !important;
}

/* Ensure the enhanced header is always visible */
.enhanced-filter-header {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Override any potential hiding of filter buttons */
.enhanced-filter-buttons {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.enhanced-filter-buttons a {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* TARGET SPECIFIC BLOG GRID - jb-main-blog-grid */
.jb-main-blog-grid .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: #542452 !important;
    padding: 40px 30px !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    z-index: 3;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    box-sizing: border-box;
    border-radius: 0;
    overflow: hidden;
}

/* Ensure all other enhanced filters are hidden by default */
.nectar-post-grid-filters.enhanced-filters:not(.jb-main-blog-grid .nectar-post-grid-filters.enhanced-filters) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Alternative approach - hide all enhanced filters except those in jb-main-blog-grid */
.nectar-post-grid-filters.enhanced-filters {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.jb-main-blog-grid .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   Alternate TARGETING OPTIONS
   ======================================== */

/* Option 1: Target by specific data attributes */
/* Uncomment and modify the selector below to target a specific post grid module */

/*
.nectar-post-grid-wrap[data-style="content_under_image"] .nectar-post-grid-filters.enhanced-filters,
.nectar-post-grid-wrap[data-style="content_overlaid"] .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/

/* Option 2: Target by specific columns */
/*
.nectar-post-grid-wrap .nectar-post-grid[data-columns="3"] + .nectar-post-grid-filters.enhanced-filters,
.nectar-post-grid-wrap .nectar-post-grid[data-columns="2"] + .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/

/* Option 3: Target by specific grid spacing */
/*
.nectar-post-grid-wrap .nectar-post-grid[data-grid-spacing="30px"] + .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/

/* Option 4: Target by parent container class */
/*
.wpb_row .nectar-post-grid-wrap .nectar-post-grid-filters.enhanced-filters,
.vc_row .nectar-post-grid-wrap .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/

/* Option 5: Target by specific page or template */
/*
.page-template-blog .nectar-post-grid-filters.enhanced-filters,
.single-post .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/

/* Option 6: Target by custom class (add this class to your specific post grid) */
/*
.nectar-post-grid-wrap.target-this-module .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/



/* Option 7: Target by position (first, second, etc. post grid on page) */
/*
.nectar-post-grid-wrap:first-of-type .nectar-post-grid-filters.enhanced-filters,
.nectar-post-grid-wrap:nth-of-type(2) .nectar-post-grid-filters.enhanced-filters {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}
*/
