/* Custom Nice Select Styling for Blog Archive */
.nice-select {
    font-family: "Mulish", sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 30px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: none;
    border-radius: 0;
    background-color: transparent;
    padding: 5px 25px 5px 0;
    height: auto;
    color: #161616;
    position: relative;
    display: inline-block;
    width: auto !important;
    min-width: 180px;
}

@media only screen and (min-width: 1025px) {
    .nice-select {
        font-size: 0.9375vw;
        line-height: 1.8229vw;
        letter-spacing: 0.05625vw;
        padding: 0.625vw 2.0833vw 0.625vw 0;
        min-width: 15vw;
    }
}

/* Remove default arrow */
.nice-select:after {
    display: none !important;
}

/* Current selected value - ensure dark text */
.nice-select .current {
    color: #161616 ;
    white-space: nowrap;
}

/* Dropdown list */
.nice-select .list {
    border: 2px solid #C41230;
    border-radius: 0;
    background-color: #ffffff;
    margin-top: 10px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.1);
    width: 240px;
    max-height: 300px;
    overflow-y: auto;
    position: absolute;
    left: 0;
    top: 100%;
}

@media only screen and (min-width: 1025px) {
    .nice-select .list {
        width: 20.833vw;
        margin-top: 0.521vw;
    }
}

/* Counter badge at top right */
.nice-select .list:before {
    content: attr(data-count);
    position: absolute;
    top: -15px;
    right: 15px;
    background-color: #C41230;
    color: #ffffff;
    font-family: "Mulish", sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    z-index: 10;
}

@media only screen and (min-width: 1025px) {
    .nice-select .list:before {
        font-size: 0.729vw;
        padding: 0.3125vw 0.625vw;
        top: -0.9375vw;
        right: 0.781vw;
    }
}

/* Base styling for all list items */
.nice-select .list .option {
    font-family: "Mulish", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    padding: 12px 20px;
    color: #161616 ;
    background-color: #ffffff ;
    border-bottom: 1px solid #F5F4F1;
    transition: all 0.3s ease;
    min-height: auto;
    cursor: pointer;
}

.subsite-selector .nice-select .list .option {
  background-color: #f5f4f1 ;
  color: #161616 ;
}

@media only screen and (min-width: 1025px) {
    .nice-select .list .option {
        font-size: 0.833vw;
        padding: 0.781vw 1.302vw;
    }
}

.nice-select .list .option:last-child {
    border-bottom: none;
}

/* First option ONLY when it's NOT selected - "All Years" / "All Categories" */
/* .nice-select .list .option:first-child:not(.selected) {
    background-color: #A08A5F !important;
    color: #ffffff !important;
}

.nice-select .list .option:first-child:not(.selected):hover {
    background-color: #8B7850 !important;
    color: #ffffff !important;
} */

/* Selected option styling (any option that's selected) */
.nice-select .list .option.selected {
    background-color: #A08A5F !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Hover state for selected option */
.nice-select .list .option.selected:hover,
.nice-select .list .option.selected.focus {
    background-color: #8B7850 !important;
    color: #ffffff !important;
}

/* Hover state for NON-selected regular options (not first, not selected) */
.nice-select .list .option:not(.selected):not(:first-child):hover,
.nice-select .list .option:not(.selected):not(:first-child).focus {
    background-color: #F5F4F1;
    color: #161616 ;
}

/* Open state */
.nice-select.open .list {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Custom arrow for select wrapper */
.select-wrapper {
    position: relative;
    display: inline-block;
    margin: 0;
}

.select-wrapper .nice-select:after {
    display: none !important;
}

/* Keep the existing arrow styling from select-wrapper */
.select-wrapper:after {
    z-index: 1;
    pointer-events: none;
}

.select-wrapper.active .nice-select {
    color: #161616;
}

.select-wrapper.active:after {
    transform: rotate(180deg) translateY(40%);
}

/* Disabled option */
.nice-select .list .option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar styling for dropdown */
.nice-select .list::-webkit-scrollbar {
    width: 6px;
}

.nice-select .list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.nice-select .list ::-webkit-scrollbar-thumb {
    background: #A08A5F;
    border-radius: 3px;
}

.nice-select .list::-webkit-scrollbar-thumb:hover {
    background: #8B7850;
}

/* Hide the original select elements */
#post-filters select {
    display: none;
}

/* Fix for spacing in post-filters */
#post-filters .select-wrapper {
    margin: 0 25px;
}

/* Ensure proper positioning */
#post-filters .select-wrapper .nice-select .list {
    position: absolute;
}

/* Specific styling for category and year filters counters */
#filter-category + .nice-select .list[data-count]:before,
#filter-year + .nice-select .list[data-count]:before {
    display: block;
}

/* Hide counter if empty */
.nice-select .list:not([data-count]):before,
.nice-select .list[data-count=""]:before {
    display: none;
}
