.posts-archive-with-filter {
    margin: var(--block-margin) auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: var(--column-gap);
    row-gap: var(--row-gap);
    align-items: start;
}

.posts-archive-with-filter header h1 {
    font: var(--font-headline-3);
    margin-bottom: 0;
}

.posts-archive-with-filter .post-loop h3 {
    font: var(--font-headline-6);
    font-weight: bold;
    margin-bottom: 0;
    height: auto;
}

.posts-archive-with-filter .post-loop h4 {
    font: var(--font-headline-7);
    font-weight: bold;
    margin-bottom: 0;
}

.posts-archive-with-filter .post-loop a {
    display: flex;
    flex-direction: column;
    font: var(--font-body-xsmall);
}

.posts-archive-with-filter span.read-more {
    margin-top: auto;
}

.posts-archive-with-filter-content-grid .read-more {
    display: flex;
    justify-content: flex-start;
    width: fit-content;
}

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

.posts-archive-with-filter-filters-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: calc(var(--item-column-gap) / 2);
}

.posts-archive-with-filter-filters-search input[type="text"] {
    grid-row: 1;
    grid-column: 1;
    padding-left: calc(var(--item-column-gap)* 2) !important;
    border-radius: var(--element-border-radius) !important;
}

.posts-archive-with-filter-filters-submit {
    grid-row: 1;
}

.posts-archive-with-filter-filters-search button {
    grid-row: 1;
    grid-column: 1;
}

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

.posts-archive-with-filter-filters-group-clear {
    position: absolute;
    top: 50%;
    right: 3rem;
    width: 4rem;
    height: calc(100% - 0.2rem);
    transform: translateY(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    color: var(--title-color);
    z-index: 1;
}

.posts-archive-with-filter-filters-group-clear:disabled {
    cursor: default;
}

.posts-archive-with-filter-filters-group-clear.visible {
    opacity: 1;
}

.posts-archive-with-filter-filters-group-clear::before,
.posts-archive-with-filter-filters-group-clear::after {
    content: '';
    display: block;
    width: 1.5rem;
    height: 0.2rem;
    background-color: currentColor;
    position: absolute;
    top: 42%;
    left: 50%;
}

.posts-archive-with-filter-filters-group-clear::before {
    transform: translate(-50%, -50%) rotateZ(45deg);
}

.posts-archive-with-filter-filters-group-clear::after {
    transform: translate(-50%, -50%) rotateZ(-45deg);
}

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

.posts-archive-with-filter-filters-group-title h2 {
    color: var(--color-purple);
    font: var(--font-headline-5);
}

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

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

.posts-archive-with-filter-filters-group-options {
    transition: all 0.3s ease;
    max-height: 0;
    overflow: auto;
    margin-top: 1rem;
    scrollbar-color: var(--text-color);
    scrollbar-width: thin;
    padding: 0;
}

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

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

.posts-archive-with-filter-filters-group.open .posts-archive-with-filter-filters-group-options {
    max-height: 47rem;
}

.posts-archive-with-filter-filters-group-options-item {
    overflow: hidden;
    margin-top: 0.8rem;
    position: relative;
}

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

.posts-archive-with-filter-filters-group-options-item label {
    cursor: pointer;
    margin: 0;
    transition: all 0.3s ease;
    font: var(--font-body-small);
    border-width: var(--secondary-button-border-width);
    border-style: var(--secondary-button-border-style);
    border-radius: var(--secondary-button-border-radius);
    padding: 0.5em 1em;
    position: relative;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;
    width: min-content;
    max-width: 100%;
    border-color: var(--secondary-button-border-color);
    background-color: var(--secondary-button-background-color);
    color: var(--secondary-button-text-color);
    box-shadow: var(--secondary-button-box-shadow);
}

.posts-archive-with-filter-filters-group-options-item label:is(:hover, :focus, :active) {
    background-color: var(--color-purple);
    border-color: var(--secondary-button-hover-border-color);
    color: var(--secondary-button-hover-text-color);
    box-shadow: var(--secondary-button-hover-box-shadow);
}

.posts-archive-with-filter-filters-group-options-item input:checked~label {
    background-color: var(--color-dark-purple);
    color: var(--primary-button-text-color) !important;
}

.posts-archive-with-filter-filters-group-options-item label::after {
    content: '\00D7';
    display: inline-block;
    font-size: 1.3em;
    line-height: 1;
    position: absolute;
    top: 50%;
    right: 0.5em;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s ease;
}

.posts-archive-with-filter-filters-group-options-item input:checked~label {
    padding-right: 2em;
}

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

.posts-archive-with-filter-content-inner {
    width: 100%;
    margin-top: var(--row-gap);
}

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

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

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

.posts-archive-with-filter-content-grid .post-card {
    padding: var(--row-gap);
    background: var(--color-offwhite);
    border-radius: var(--element-border-radius);
}

.posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: var(--item-column-gap);
    height: 100%;
}

.posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    row-gap: calc( var(--row-gap) / 2 );
}

.posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner-thumb {
    display: flex;
    align-items: center;
}

.posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner-thumb .post-loop-image {
    margin-bottom: 0;
}

.posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner-content p {
    margin: 0;
}

.posts-archive-with-filter-content-grid h3 {
    font: var(--font-body);
    font-weight: bold;
    margin-bottom: var(--page-padding);
}

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

.posts-archive-with-filter-content-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.5em;
    justify-content: center;
}

.posts-archive-with-filter-content-pagination .nav-links .page-numbers {
    padding: 0.5em;
    font: var(--font-body);
    font-weight: bold;
    line-height: 1;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--link-color);
}

.posts-archive-with-filter-content-pagination .nav-links .page-numbers.current {
    color: var(--accent-color);
}

.posts-archive-with-filter-content-pagination .nav-links a.page-numbers:is(:hover, :focus, :active) {
    color: var(--hover-link-color);
}

.posts-archive-with-filter-content-pagination .nav-links .page-numbers:is(.prev, .next) {
    padding-left: 0;
    padding-right: 0;
}

@media (min-width: 768px) {
    .posts-archive-with-filter:has(form) {
        grid-template-columns: minmax(0, 1fr);
        row-gap: var(--row-gap);
    }

    .posts-archive-with-filter header {
        grid-column: span 2;
    }

    .posts-archive-with-filter-filters-group-clear {
        right: 0;
        width: 2rem;
    }

    .posts-archive-with-filter-filters-group-options {
        max-height: 47rem;
    }

    .posts-archive-with-filter-filters-group-title {
        cursor: default;
    }

    .posts-archive-with-filter-filters-group-title::after {
        display: none;
    }

    .posts-archive-with-filter-content-wrapper {
        display: flex;
        align-items: flex-start;
        column-gap: var(--column-gap);
    }

    .posts-archive-with-filter-content-grid .posts-archive-with-filter-content-grid-inner:has(.posts-archive-with-filter-content-grid-inner-thumb) {
        grid-template-columns: 30% minmax(0, 1fr);
    }

    .posts-archive-with-filter-content-grid .post-card {
        padding: calc(var(--column-gap) - var(--item-column-gap));
    }

    .posts-archive-with-filter .post-loop a {
        font: var(--font-body);
    }
}

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