/* general */
.post-listing {
    position: fixed;
    top: var(--admin-bar-height, 0);
    height: 100vh;
    height: 100dvh;
    left: var(--6col);

    display: flex;
}

/* liste des filtres */

.filters-list {
    width: var(--3col);
    position: sticky;
    height: 100vh;
    height: 100dvh;
    top: 0;
    overflow: scroll;
}


.sortby-button-bg {
    /* background-color: var(--background); */
    position: fixed;
    top: var(--admin-bar-height, 0);
    left: inherit;
    width: inherit;
    padding: var(--button-padding);
    z-index: 9;
    height: 1.6em;
}

#sortby_button.active {
    background-color: var(--primary);
    color: var(--background);
}

#sortby_button.active .white-svg svg {
    fill: var(--background);
}

.filters-toggle {
    cursor: pointer;
    border: none;
    position: sticky;
    background-color: var(--background);
    z-index: 10;
    top: 0;

    padding: var(--button-padding);

    min-width: 5.6rem;
}

.filters-content {
    display: none;
    position: sticky;
    top: 0;
}

.post-filters {
    display: flex;
    flex-direction: column;
    font-size: var(--fontsize-small);
    background-color: var(--background);
    height: var(--vh-100-header);
    overflow: auto;
    border-top: var(--white-border);

}


.filters-toggle.active .white-svg {
    transform: rotate(-180deg);
}




.filter-group {
    display: grid;
    grid-template-columns: calc(var(--col) - var(--medium-marge)) calc(var(--2col) - var(--medium-marge));
    align-items: start;
    padding: 0 var(--medium-marge);
}



.filter-label {
    position: sticky;
    /* top: 0; */
    top: calc(calc(1em + calc(var(--medium-marge) * 2)) + 4px);
    background: var(--background);
    z-index: 5;
    grid-column: 1;
    padding: var(--medium-marge) 0;
}


.filter-group:not(:last-child) {
    border-bottom: 1px solid var(--primary);
}

.filter-list {
    display: flex;
    flex-direction: column;
    padding: var(--medium-marge) 0;
}

.filter-list li {
    cursor: pointer;
    color: var(--secondary);
}

.filter-list li:hover {
    color: var(--white);
}

.filter-list li.active {
    background: var(--background);
    color: var(--primary);
}

#erase-all {
    position: sticky;
    top: 0;
    left: 0;
    background: var(--background);
    z-index: 10;
}

#filter-all {
    color: var(--secondary);
    cursor: pointer;
    padding: var(--medium-marge) 0;
}

#filter-all svg {
    fill: var(--secondary) !important;
}

#filter-all:hover {
    color: var(--primary);
}

#filter-all:hover svg {
    fill: var(--primary) !important;
}



/* liste des posts */

.posts-list {
    position: sticky;
    top: 0;
    width: var(--3col);
    height: 100vh;
    height: 100dvh;
    overflow: scroll;
}

.posts-list h2 {
    position: sticky;
    top: 0;
    background-color: var(--background);
    padding: var(--button-padding);
}

@media (max-width: 768px) {

    .post-listing--desktop {
        display: none;
    }

    .post-listing {
        width: 100%;
        left: 0;
        position: fixed;
        height: var(--vh-100-header);
        top: 0;
    }


    /* FILTRES MOBILE */

    .filters-list {
        width: 100%;
        top: var(--admin-bar-height, 0);
        left: 0;
        position: fixed;
        height: auto;
        z-index: 40;
    }

    .sortby-button-bg {
        display: none;
    }

    #sortby_button.active {
        background-color: var(--background);
        color: var(--primary);
    }

    #sortby_button.active .white-svg svg {
        fill: var(--primary);
    }

    .filters-toggle {
        width: 50%;
        left: 50%;
    }

    .post-filters {
        font-size: var(--fontsize-big);
        height: calc(var(--vh-100-header) - var(--header-height));
        border-top: none;
    }

    .filter-group {
        grid-template-columns: 1fr 1fr;
        padding: 0 0 var(--big-marge) 0;
    }

    .filter-group:last-child {
        margin-bottom: var(--header-height);
    }

    .filter-label {
        padding: var(--big-marge);
        top: 0;
    }

    .filter-list {
        padding: var(--big-marge) var(--big-marge) 0 var(--big-marge);
    }

    #erase-all {
        padding-bottom: 0;
        position: fixed;
        bottom: var(--header-height);
        left: 0;
        top: unset;
        width: 100%;
        border-top: var(--white-border);
    }

    #filter-all {
        padding: var(--big-marge);
    }


    /* index */

    .posts-list h2 {
        display: none;
    }

    .posts-list {
        position: absolute;
        width: 100%;
        top: var(--admin-bar-height, 0);
        left: 0;
        height: inherit;
        background-color: var(--background);
        padding-top: var(--header-height);
    }

    #post-list {
        overflow-x: hidden;
    }

    /* preview mobile */
    .mobile-preview {
        background-color: var(--background);
        color: var(--primary);
        border-bottom: var(--white-border);
        font-size: var(--fontsize-small);
    }

    .mobile-preview img {
        width: 100%;
        height: auto;
        margin-top: var(--small-marge);
    }

    #mobile-preview__close {
        text-align: end;
    }

    .mobile-preview .metadata__title-elements,
    .mobile-preview .metadata__excerpt {
        margin: 0 var(--big-marge);
    }

    .metadata__image-link {
        padding: 0 !important;
    }

    .post-item.is-pinned {
        position: relative;
        background-color: var(--background);
        z-index: 15;
    }

    .posts-list.pinned-active {
        scroll-behavior: smooth;
    }

}