/**
 * Facet Badges Styling
 * Ensures proper text wrapping for long facet names
 * Updated with GSP color palette
 */

/* Search facet sidebar typography */
.search-facets .card-header,
.search-facets .card-header .btn,
.search-facets .form-check-label,
.search-facets .facet-item,
.search-facets .facet-item a,
.search-facets .facet-select-range,
.search-facets .range-numeric-label,
.search-facets .facet-items,
.search-facets .chosen-container-single .chosen-single,
.search-facets .chosen-container .chosen-results {
    font-size: 0.875rem;
}

.search-facets .facet-item .count,
.search-facets .form-check-label .badge,
.search-facets .card-header .badge,
.search-facets .active-filter .badge {
    font-size: 0.75rem;
}

/* Active filter badges container */
.active-filters {
    max-width: 100%;
}

/* Individual filter wrapper */
.active-filter {
    max-width: 100%;
}

/* Badge styling with text wrapping - GSP Evergreen */
.active-filter .badge {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    white-space: normal;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    text-align: left;
    background-color: var(--gsp-evergreen, #01411d) !important;
}

/* Label text styling */
.active-filter .badge .text-white-50 {
    flex-shrink: 0;
    white-space: nowrap;
}

/* Strong text (facet value) with wrapping */
.active-filter .badge strong {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: anywhere;
    hyphens: auto;
    flex: 1 1 auto;
    min-width: 0;
}

/* Close button styling */
.active-filter .badge a {
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    color: var(--gsp-keystone-gold, #e0a000);
}

.active-filter .badge a:hover {
    color: #fff;
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .active-filter {
        width: 100%;
    }

    .active-filter .badge {
        width: 100%;
        justify-content: space-between;
    }
}

/* For very long text, limit maximum width */
@media (min-width: 577px) {
    .active-filter {
        max-width: 500px;
    }
}

/* Ensure proper spacing when badges wrap to multiple lines */
.active-filter .badge {
    min-height: 36px;
    align-items: flex-start;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}
