/* MOJ Filter Component Styles */

.moj-filter {
    border: 1px solid #b1b4b6;
    margin-bottom: 30px;
}

.moj-filter__header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #b1b4b6;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.moj-filter__header-title {
    margin: 0;
}

.moj-filter__header-action {
    margin: 0;
}

.moj-filter__content {
    padding: 20px;
}

.moj-filter__selected {
    background-color: #f8f9fa;
    border-bottom: 1px solid #b1b4b6;
    margin: -20px -20px 20px -20px;
    padding: 0px 20px 20px 20px;
}

.moj-filter__selected-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.moj-filter__heading-title {
    margin: 0;
}

.moj-filter__heading-action {
    margin: 0;
}

.moj-filter-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.moj-filter__tag {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 12px;
    border: 1px solid #0b0c0c;
    color: #0b0c0c;
    background-color: #fff;
    font-size: 16px;
    font-family: inherit;
    text-decoration: none;
    vertical-align: middle;
    transition: background 0.2s, color 0.2s;
    position: relative;
}

.moj-filter__tag:link,
.moj-filter__tag:visited {
    color: #0b0c0c;
}

.moj-filter__tag:focus {
    color: #0b0c0c;
    background-color: #ffdd00;
    outline: 3px solid #fd0;
    outline-offset: 0;
}

.moj-filter__tag:hover {
    color: #fff;
    background-color: #0b0c0c;
    border-color: #0b0c0c;
}

.moj-filter__tag-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.1em;
    margin-left: 8px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    vertical-align: middle;
    font-weight: bold;
    transition: color 0.2s;
}

.moj-filter__tag:focus .moj-filter__tag-close {
    outline: 2px solid #1d70b8;
    outline-offset: 2px;
    color: inherit;
    background: #ffdd00;
}

.moj-filter__tag:hover .moj-filter__tag-close {
    color: inherit;
}

.moj-filter__options {
    margin-top: 20px;
}

.moj-filter__options .govuk-form-group {
    margin-bottom: 20px;
}

.moj-filter__options .govuk-button {
    margin-bottom: 20px;
}


/* Accordion styles */

.moj-filter__accordion {
    border-bottom: 1px solid #b1b4b6;
    margin-bottom: 10px;
}

.moj-filter__accordion-button {
    background: none;
    border: none;
    color: #1d70b8;
    padding: 10px 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    outline: none;
    display: flex;
    align-items: center;
    font-size: 1.1em;
}

.moj-filter__accordion-button[aria-expanded="true"]::before {
    content: "\25BC";
    margin-right: 8px;
    font-size: 0.9em;
}

.moj-filter__accordion-button[aria-expanded="false"]::before {
    content: "\25B6";
    margin-right: 8px;
    font-size: 0.9em;
}

.moj-filter__accordion-content {
    padding: 0 0 10px 0;
    display: block;
}

.moj-filter__accordion-content[aria-hidden="true"] {
    display: none;
}

.moj-filter__accordion-button:focus {
    outline: 2px solid #fd0;
    outline-offset: 0;
    color: #0b0c0c;
    background: transparent;
    box-shadow: 0 0 0 4px #ffdd00;
}


/* Responsive adjustments */

@media (max-width: 48.0625em) {
    .moj-filter__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .moj-filter__selected-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .moj-filter-tags {
        flex-direction: column;
    }
}

.moj-filter__selected-count {
    display: block;
    color: #505a5f;
    font-size: 0.95em;
    margin-left: 2.2em;
    margin-bottom: 0.6em;
}