.custom-posts-archive-with-filter{
    margin: var(--block-margin) auto;
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--column-gap);
    row-gap: var(--row-gap);
    align-items: start;
} 

.custom-posts-archive-with-filter-filters{
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--item-column-gap);
    row-gap: var(--item-row-gap);
    flex: 1;
}

.custom-posts-archive-with-filter-filters-instructions{
    position: absolute;
}

.custom-posts-archive-with-filter-filters-group{
    width: 100%;
    position: relative;
    flex: 1;
}

.custom-posts-archive-with-filter-filters-group-main{
    flex: auto;
    margin-bottom: var(--row-gap);
}

.custom-posts-archive-with-filter-news-topic-filter{
    position: relative;
    flex: 0 1 auto;
    width: auto;
    min-width: 20rem;
    /*margin-left: auto;*/
}

.custom-posts-archive-with-filter-news-topic-filter .custom-posts-archive-with-filter-filters-group-options{
    width: auto;
    min-width: 100%;
    white-space: nowrap;
}

.custom-posts-archive-with-filter-filters-group-heading{
    position: relative;
}

.custom-posts-archive-with-filter-filters-group-title{
    display: block;
    width: 100%;
    border-bottom: 0.1rem solid var(--title-color);
    position: relative;
}

.custom-posts-archive-with-filter-filters-group-title:focus{
    outline: none;
}

.custom-posts-archive-with-filter-filters-group-title h2{
    font: var(--font-headline-7);
    margin: 0;
    padding: calc(var(--item-row-gap) / 2) calc(var(--item-column-gap) + 2rem) calc(var(--item-row-gap) / 2) var(--item-column-gap);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.custom-posts-archive-with-filter-filters-group-title:is(:hover, :focus, :active) h2{
    opacity: 1;
}

.custom-posts-archive-with-filter-filters-group-title::after{
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    right: 1rem;
    width: 1rem;
    height: 1rem;
    border-right: 0.2rem solid var(--title-color);
    border-bottom: 0.2rem solid var(--title-color);
    transform: translateY(-50%) rotateZ(45deg) translateX(-50%);
    transition: all 0.3s ease;
    opacity: 0.7;
}

.custom-posts-archive-with-filter-filters-group-title:is(:hover, :focus, :active)::after{
    opacity: 1;
}

.custom-posts-archive-with-filter-filters-group.open .custom-posts-archive-with-filter-filters-group-title::after{
    transform: translateY(0) rotateZ(-135deg) translateX(50%);
}

.custom-posts-archive-with-filter-filters-group-options{
    transition: all 0.3s ease;
    max-height: 0;
    overflow: auto;
    scrollbar-color: var(--text-color);
    scrollbar-width: thin;
    padding: 0 var(--item-column-gap);
    box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
    background: var(--background-color);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
}

.custom-posts-archive-with-filter-filters-group-options::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 0.3rem;
}

.custom-posts-archive-with-filter-filters-group-options::-webkit-scrollbar-thumb {
    border-radius: 0.7rem;
    background-color: var(--text-color);
}

.custom-posts-archive-with-filter-filters-group.open .custom-posts-archive-with-filter-filters-group-options{
    max-height: 50vh;
    padding: var(--item-row-gap) var(--item-column-gap);
}

.custom-posts-archive-with-filter-filters-group-main .custom-posts-archive-with-filter-filters-group-options{
    max-height: unset;
    padding: 0;
    box-shadow: none;
    background: transparent;
    position: relative;
    top: unset;
    left: unset;
    display: flex;
}

.custom-posts-archive-with-filter-filters-group-options-item{
    overflow: hidden;
    position: relative;
}

.custom-posts-archive-with-filter-filters-group-options-item:not(:last-child){
    margin-bottom: calc(var(--item-row-gap) / 2);
}

.custom-posts-archive-with-filter-filters-group-main .custom-posts-archive-with-filter-filters-group-options-item{
    flex: 1;
    margin-bottom: 0;
}

.custom-posts-archive-with-filter-filters-group-options-item input{
    position: absolute;
    bottom: calc(100% + 1rem);
    cursor: pointer;
}

.custom-posts-archive-with-filter-filters-group-options-item label{
    cursor: pointer;
    margin: 0;
    transition: all 0.3s ease;
    font: var(--font-body);
    display: flex;
    align-items: center;
    opacity: 0.7;
}

.custom-posts-archive-with-filter-filters-group-options-item label:is(:hover, :focus, :active){
    opacity: 1;
}

.custom-posts-archive-with-filter-filters-group-options-item label::before{
    content: '';
    display: block;
    width: 1em;
    height: 1em;
    border: 0.1rem solid;
    border-radius: 0.4rem;
    margin-right: 0.3em;
    flex-shrink: 0;
}

.custom-posts-archive-with-filter-filters-group-options-item input:checked ~ label{
    opacity: 1;
}

.custom-posts-archive-with-filter-filters-group-options-item input:checked ~ label::after{
    content: '';
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 0.3em;
    height: 0.5em;
    border-bottom: 0.2rem solid;
    border-right: 0.2rem solid;
    transform: translate(0.35em, calc(-50% - 0.05em)) rotate(45deg);
}

.custom-posts-archive-with-filter-filters-group-main label{
    display: block;
    padding: calc(var(--item-row-gap) / 2) calc(var(--item-column-gap) / 2);
    text-align: center;
    text-transform: uppercase;
    border: 0.1rem solid var(--text-color);
    border-radius: 4rem;
    background: var(--background-color);
    text-decoration: none;
    white-space: nowrap;
}

.custom-posts-archive-with-filter-filters-group-main label:is(:hover, :focus, :active),
.custom-posts-archive-with-filter-filters-group-main .custom-posts-archive-with-filter-filters-group-options-item input:checked ~ label{
    background: var(--text-color);
    color: var(--background-color);
}

.custom-posts-archive-with-filter-filters-group-main label::before,
.custom-posts-archive-with-filter-filters-group-main .custom-posts-archive-with-filter-filters-group-options-item input:checked ~ label::after{
    display: none;
}

.custom-posts-archive-with-filter-active-filters{
    display: none;
    flex-wrap: wrap;
    row-gap: var(--item-row-gap);
    column-gap: var(--item-column-gap);
    align-items: center;
    width: 100%;
}

.custom-posts-archive-with-filter-content-wrapper{
    width: 100%;
}

.custom-posts-archive-with-filter-active-filters.active{
    display: flex;
    display: none;
}

.custom-posts-archive-with-filter-active-filters-list{
    display: flex;
    flex-wrap: wrap;
    row-gap: var(--item-row-gap);
    column-gap: var(--item-column-gap);
}

.custom-posts-archive-with-filter-active-filters-list button{
    padding: 0.8rem 1.2rem;
    display: flex;
    column-gap: 0.8rem;
    border-radius: 3rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    color: var(--text-color);
    background: var(--color-white);
}

.custom-posts-archive-with-filter-active-filters-list button:is(:hover, :focus){
    background-color: var(--primary-button-hover-background-color);
    color: var(--primary-button-hover-text-color);
}

.custom-posts-archive-with-filter-active-filters-list button:focus{
    outline: none;
}

.custom-posts-archive-with-filter-active-filters-list button::before{
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--text-color);
    opacity: 0.2;
    z-index: 1;
}

.custom-posts-archive-with-filter-active-filters-list button::after{
    content: '\00D7';
    display: block;
    z-index: 1;
}

.custom-posts-archive-with-filter-active-filters-list button span{
    position: relative;
    z-index: 1;
}

.custom-posts-archive-with-filter-filters-group-clear-all{
    margin-left: auto;
    text-decoration: underline;
}

.custom-posts-archive-with-filter-filters-group-clear-all:disabled{
    cursor: pointer;
    opacity: 0.5;
}

.custom-posts-archive-with-filter-filters-group-clear-all:focus{
    outline: none;
}

.custom-posts-archive-with-filter-content-loading{
    display: none;
    color: var(--accent-color);
}

.custom-posts-archive-with-filter-content-loading svg{
    display: block;
    width: 15rem;
    height: auto;
    margin: 0 auto;
}

.custom-posts-archive-with-filter-content-grid{
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: var(--item-column-gap);
    /*row-gap: var(--item-row-gap);*/
}

.custom-posts-archive-with-filter-content-pagination{
    margin-top: var(--row-gap);
}

.custom-posts-archive-with-filter-content-grid .post-loop-news:first-child{
    border-top: none;
}

@media (min-width: 768px){    
    /*.custom-posts-archive-with-filter-content-grid{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }*/

    .custom-posts-archive-with-filter-filters-group-main label{
        font: var(--font-elevated-2);
    }
} 

@media (min-width: 1200px){
    /*.custom-posts-archive-with-filter-content-grid{
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }*/
}