/* ============================================================================
 * Ecofirst — Projects landing custom filter rail.
 *
 * Replaces the legacy two Bootstrap <select> dropdowns with a brand-styled
 * cascading filter UI (Status x Expertise x Sectors + chips + reset + live
 * count). Brand tokens: #1561af (blue), #66b145 (green), Poppins family.
 * ============================================================================ */

#ef-projects-filter {
    margin: 0 0 30px;
    font-family: 'Poppins', sans-serif;
}

.ef-filter__panel {
    display: block;
}

.ef-filter__row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.ef-filter__field {
    flex: 1 1 220px;
    min-width: 200px;
    position: relative;
}

.ef-filter__field--reset {
    flex: 0 0 auto;
    min-width: auto;
}

.ef-filter__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1561af;
    margin: 0 0 6px;
}

.ef-filter__trigger {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid #e3e6ea;
    border-radius: 999px;          /* fully rounded pill-style box */
    padding: 14px 44px 14px 22px;
    font-size: 14px;
    font-weight: 500;
    color: #222222;
    text-align: left;
    line-height: 1.2;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.ef-filter__trigger:hover {
    border-color: #66b145;
    box-shadow: 0 2px 6px rgba(102, 177, 69, 0.12);
}

.ef-filter__field.is-open > .ef-filter__trigger {
    border-color: #1561af;
    box-shadow: 0 0 0 4px rgba(21, 97, 175, 0.12);
    background-color: #f7faff;
}

.ef-filter__field.has-selection > .ef-filter__trigger {
    border-color: #66b145;
    background-color: #f5fbf2;
    color: #1f3b18;
    font-weight: 600;
}

.ef-filter__caret {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #1561af;
    font-size: 14px;
    transition: transform 0.18s ease;
}

.ef-filter__field.is-open .ef-filter__caret {
    transform: translateY(-50%) rotate(180deg);
}

.ef-filter__value {
    display: inline-block;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.ef-filter__menu {
    position: absolute;
    z-index: 50;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #e3e6ea;
    border-radius: 18px;            /* big rounded corners on the dropdown panel */
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    max-height: 340px;
    overflow-y: auto;
    display: none;
}

.ef-filter__field.is-open .ef-filter__menu {
    display: block;
}

.ef-filter__menu li {
    padding: 0;
    margin: 0;
}

.ef-filter__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: 0;
    padding: 9px 14px;
    font-size: 13px;
    color: #222222;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    line-height: 1.2;
}

.ef-filter__option:hover:not(:disabled),
.ef-filter__option:focus-visible:not(:disabled) {
    background: rgba(102, 177, 69, 0.10);
    color: #1561af;
    outline: none;
}

.ef-filter__option[aria-selected="true"] {
    background: #1561af;
    color: #ffffff;
}

.ef-filter__option[aria-selected="true"]:hover {
    background: #134d8b;
    color: #ffffff;
}

.ef-filter__option:disabled {
    color: #b0b3b8;
    cursor: not-allowed;
    opacity: 0.55;
}

.ef-filter__option-count {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    margin-left: 10px;
    font-weight: 500;
}

.ef-filter__option[aria-selected="true"] .ef-filter__option-count {
    color: rgba(255, 255, 255, 0.85);
}

.ef-filter__reset {
    background: #66b145;
    color: #ffffff;
    border: 0;
    padding: 12px 22px;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.18s ease;
}

.ef-filter__reset:hover {
    background: #54972f;
}

.ef-filter__reset i {
    margin-right: 6px;
}

.ef-filter__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 0;
    min-height: 0;
}

.ef-filter__chips:empty {
    margin-top: 0;
}

.ef-filter__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eaf4e3;
    color: #1561af;
    border: 1px solid #c7e0b2;
    border-radius: 999px;
    padding: 6px 6px 6px 14px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: capitalize;
}

.ef-filter__chip-dim {
    color: rgba(21, 97, 175, 0.55);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.4px;
    margin-right: 2px;
}

.ef-filter__chip-x {
    background: #1561af;
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}

.ef-filter__chip-x:hover {
    background: #66b145;
}

.ef-filter__count {
    margin: 16px 0 0;
    font-size: 13px;
    color: #555555;
    font-weight: 500;
}

.ef-filter__empty {
    padding: 40px 20px;
    text-align: center;
    width: 100%;
}

.ef-filter__empty h2 {
    font-size: 18px;
    color: #555555;
    margin-bottom: 18px;
    font-weight: 500;
}

/* Hide a tile via JS-set attribute. !important guards against inline width
   the legacy mixitup-era CSS sets. */
[data-ef-tile][hidden] {
    display: none !important;
}

/* ---------------------------------------------------------------------------
 * Mobile — collapse the filter rail behind a single toggle.
 * ------------------------------------------------------------------------ */
.ef-filter__mobile-toggle {
    display: none;
    width: 100%;
    background: #1561af;
    color: #ffffff;
    border: 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    margin: 0 0 12px;
}

.ef-filter__mobile-toggle i {
    margin-right: 8px;
}

.ef-filter__mobile-count {
    background: #66b145;
    color: #ffffff;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.ef-filter__mobile-count:empty {
    display: none;
}

@media (max-width: 767px) {
    .ef-filter__mobile-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
    }
    .ef-filter__panel {
        display: none;
    }
    #ef-projects-filter.is-mobile-open .ef-filter__panel {
        display: block;
        background: #f8f9fa;
        border: 1px solid #d6d8db;
        border-radius: 4px;
        padding: 14px;
    }
    .ef-filter__row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .ef-filter__field {
        flex: 1 1 auto;
        min-width: 0;
    }
}
