/* Inner wrapper added by JS: make it the actual flex-row so children align horizontally */
.articles-header__wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    align-items: baseline;
    flex-wrap: nowrap;
    align-items: center;
}

/* Title */
.articles-header__heading {
    font-size: 44px;
    font-weight: 400;
    margin: 0;
    color: #1E1E1E;
    line-height: 120%;
}

.articles-header__title {
       max-width: 38%;
}

.articles-header__btns {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
    font-weight: normal;
    overflow-x: auto;
    font-weight: normal;
    font-family: var(--body-font-family-semibold);
}


.articles-header__btn {
    display: inline-block;
    border: 1px solid #ddd;
    background: #fff;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 16px;
    border-radius: 4px;
    font-family: var(--body-font-family-semibold);
    font-size: 14px;
    font-weight: normal;
    color: #111111;
    cursor: pointer;
}

.articles-header__btn:hover {
    border-color: #e5461c;
    color: #e5461c;
}

.articles-header__btn.active {
    background: linear-gradient(270deg, #E5461C 0%, #EE6F32 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    /* padding: 11px 16px; */
}

.articles-header__search {
    position: relative;
    flex: 0 0 260px;
}

/* Search input */
.articles-header__search-input {
    width: 100%;
    padding: 15px 36px 12px;
    font-size: 18px;
    /* color: #1111110A; */
    background: #1111110A;
    border: 1px solid #1111111F;
    border-radius: 8px;
    outline: none;
}



/* Search icon */
.articles-header__search::after {
    content: url("../../icons/search-icon-article.svg");
    position: absolute;
    right: 12px;
    top: 55%;
    transform: translateY(-50%);
    cursor: pointer;
}

/* Mobile view adjustments to match the provided design */
@media (max-width: 767px) {
    .articles-header {
        padding: 8px 0;
    }

    .articles-header__wrapper {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 30px;
        position: relative;
        align-items: flex-start;
    }

    .articles-header__heading {
        font-size: 32px;
        line-height: 1;
        margin: 0;
    }
.articles-header__search::after {
    content: url("../../icons/search-icon-article.svg");
    position: absolute;
    right: 12px;
       top: 4px;
    transform: unset;
    cursor: pointer;
}
    /* keep filters in a single horizontal row with smooth scrolling */
    /* Place the buttons on the full second row */
    .articles-header__btns {
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
        scrollbar-width: none;
        /* give space for shadow/badges */
        width: 100%;
    }

    /* pill style for mobile */
    .articles-header__btn {
        padding: 8px 10px;
        line-height: 120%;
        max-width: 100%;
    }


    .articles-header__btn-group {
        position: relative;
        display: inline-flex;
        align-items: center;
        min-width: fit-content;
    }

    .articles-header__btn-group> :nth-child(3) {
        position: absolute;
        top: -6px;
        right: -6px;
        background: #70090a;
        /* dark red/maroon */
        color: #fff;
        min-width: 28px;
        height: 28px;
        padding: 0 6px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 12px;
        border-radius: 4px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
        line-height: 1;
    }

    .articles-header__btn-group> :nth-child(3)::after {
        content: none;
    }


    .articles-header__search {
        grid-column: 2 / 3;
        grid-row: 1;
        justify-self: end;
        flex: 0 0 auto;
        max-width: 44px;
        position: absolute;
        right: 0;
    }

    .articles-header__search-input {
        display: none;
    }

    .articles-header__search-icon {
        right: 8px;
        font-size: 18px;
    }

    .articles-header__title {
        max-width: 100%;
    }

}