/* ==========================================================================
   Category filter bar (Proxify-style) + search dropdown
   Shared by the Events & Projects, Blog and News pages. The existing chip
   elements (.filter-pill / .blog-chip / .newshub-chip) are reused as tabs and
   progressively enhanced into this bar by filter-search.js — so the existing
   filtering + pagination keeps working untouched.
   This file is imported LAST in main.css so its rules win over the per-page
   chip styles regardless of specificity.
   ========================================================================== */

.filterbar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 40px;
    padding: 9px 12px;
    background: #F9FAFB;
    border-radius: 999px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.10);
}
/* Search mode: bar turns solid white and stretches wide */
.filterbar.is-searching {
    width: 100%;
    max-width: 880px;
    background: #FFFFFF;
}

/* ---- Tabs (reuse the existing chip row) ---- */
.filterbar-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    margin: 0;
    padding: 0;
    border: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.filterbar-tabs::-webkit-scrollbar { display: none; }
.filterbar-tabs[hidden] { display: none; }

.filterbar .filter-pill,
.filterbar .blog-chip,
.filterbar .newshub-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 42px;
    padding: 0 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    color: #344054;
    background: transparent;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.filterbar .filter-pill i,
.filterbar .blog-chip i,
.filterbar .newshub-chip i { font-size: 12px; }

.filterbar .filter-pill:hover,
.filterbar .blog-chip:hover,
.filterbar .newshub-chip:hover { color: #2D5F72; background: transparent; }

.filterbar .filter-pill.active,
.filterbar .blog-chip.is-active,
.filterbar .newshub-chip.is-active {
    color: #2D5F72;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.10), 0 1px 2px rgba(16, 24, 40, 0.06);
}

/* ---- Search icon button ---- */
.filterbar-search-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #344054;
    font-size: 18px;
    cursor: pointer;
    transition: color .15s ease;
}
.filterbar-search-btn:hover { color: #2D5F72; }
.filterbar-search-btn[hidden] { display: none; }

/* ---- Search mode row ---- */
.filterbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    width: 100%;
}
.filterbar-search[hidden] { display: none; }
.filterbar-search-label {
    display: none;
    padding: 0 6px 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #101828;
    white-space: nowrap;
}
@media (min-width: 640px) { .filterbar-search-label { display: block; } }

.filterbar-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    height: 42px;
    padding: 0 14px;
    background: #FFFFFF;
    border: 1.5px solid #2D5F72;
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 0 0 4px #E1ECF0;
}
.filterbar-search-field i { color: #101828; font-size: 15px; }
.filterbar-search-field input {
    flex: 1 1 auto;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: #101828;
}
.filterbar-search-field input::placeholder { color: #98A2B3; }

.filterbar-search-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #667085;
    font-size: 18px;
    cursor: pointer;
    transition: color .15s ease;
}
.filterbar-search-close:hover { color: #101828; }

/* ---- Results dropdown ---- */
.filterbar-results {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    padding: 20px 8px 12px;
    background: #F9FAFB;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(16, 24, 40, 0.16);
}
.filterbar-results[hidden] { display: none; }
.filterbar-results-count {
    margin: 0 0 8px;
    padding: 0 18px;
    font-size: 13px;
    color: #667085;
}
.filterbar-results-list {
    list-style: none;
    margin: 0;
    padding: 0 8px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.filterbar-result { border-radius: 14px; transition: background .15s ease; }
.filterbar-result:hover { background: #FFFFFF; }
.filterbar-result-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    text-decoration: none;
}
.filterbar-result-thumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px; height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: #EAF1F4;
    color: #2D5F72;
    font-size: 24px;
}
.filterbar-result-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.filterbar-result-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.filterbar-result-cat {
    align-self: flex-start;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #475467;
    background: #FFFFFF;
    border: 1px solid #D0D5DD;
    border-radius: 999px;
}
.filterbar-result-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #101828;
}

/* ==========================================================================
   Projects sub-filter row (event types) — centred pill row under the bar,
   styled like the Proxify secondary chips.
   ========================================================================== */
.filter-subnav {
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .filterbar { width: 100%; border-radius: 20px; }
    .filterbar.is-searching { width: 100%; }
}
