.blog-archive-wrapper {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 35px 0 0;
}

.blog-sidebar {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    z-index: 20;
}

.blog-sidebar::-webkit-scrollbar {
    display: none;
}

.taxonomy-widget {
    position: relative;
    flex-shrink: 0;
}

.taxonomy-widget-header {
    min-height: 43px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 20px;
    border: 1px solid var(--color-2);
    border-radius: 6px;
    background: #ffffff;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.taxonomy-title {
    width: 100%;
    font: 600 16px var(--font-body);
    color: var(--color-9);
    margin: 0;
    white-space: nowrap;
}

.taxonomy-title a {
    color: var(--color-9);
    text-decoration: none;
}

.toggle-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #005a40;
    border-bottom: 2px solid #005a40;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.3s ease;
}

.taxonomy-widget.is-open .toggle-icon {
    transform: translateY(2px) rotate(-135deg);
}

.taxonomy-collapse {
    position: fixed;
    z-index: 9999;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.3s ease, opacity 0.3s ease, visibility 0.3s;
}

.taxonomy-widget.is-open .taxonomy-collapse {
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
}

.taxonomy-collapse-inner {
    min-width: max-content;
    border-radius: 8px;
    box-shadow: 1px 1px 3px 0px rgba(0, 0, 0, 0.1), 3px 4px 5px 0px rgba(0, 0, 0, 0.09), 7px 9px 7px 0px rgba(0, 0, 0, 0.05), 13px 15px 8px 0px rgba(0, 0, 0, 0.01), 20px 24px 9px 0px rgba(0, 0, 0, 0);
    background: #fff;
    overflow: hidden;
}

.taxonomy-term-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.taxonomy-term-list li:last-child {
    margin-bottom: 0;
}

.taxonomy-term-list li a {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    color: var(--color-5);
    transition: color 0.2s ease;
}

.blog-main-content {
    flex: 1;
    min-width: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 32px;
}

#blog-grid-container {
    transition: opacity 0.3s ease;
}

.blog-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.no-posts-message {
    padding: 40px 0;
    text-align: center;
}

.no-posts-message img {
    max-width: 250px;
    margin-bottom: 20px;
}

.btn-show-more {
    position: relative;
}

.btn-show-more.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn-show-more.is-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #e33621;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
}

@keyframes btn-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (min-width: 400px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 750px) {
    .blog-archive-wrapper {
        padding: 35px 0 15px;
    }
}

@media (min-width: 990px) {
    .blog-archive-wrapper {
        gap: 20px;
        flex-direction: row;
        padding: 39px 0;
    }

    .blog-sidebar {
        width: 191px;
        flex-direction: column;
        gap: 33px;
        overflow-x: visible;
    }

    .taxonomy-widget-header {
        min-height: auto;
        gap: 10px;
        padding: 0;
        justify-content: space-between;
        background: transparent;
        border: none;
        border-radius: 0;
    }


    .taxonomy-title a {
        width: 100%;
        display: inline-block;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--color-2);
    }

    .toggle-icon {
        position: relative;
        top: -1px;
        right: 2px;
        width: 12px;
        height: 12px;
        border: 0;
        transform: none;
    }

    .toggle-icon::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 2px;
        height: 100%;
        border-radius: 2px;
        background: var(--color-9);
        transform: translateX(-50%);
        transition: opacity 0.3s;
    }

    .toggle-icon::after {
        content: "";
        top: 50%;
        left: 0;
        position: absolute;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: var(--color-9);
        transform: translateY(-50%);
    }

    .taxonomy-widget.is-open .toggle-icon {
        transform: none;
    }

    .taxonomy-widget.is-open .toggle-icon::before {
        opacity: 0;
    }

    .taxonomy-collapse {
        position: static !important;
        margin-top: 0;
        top: auto !important;
        left: auto !important;
    }

    .taxonomy-collapse-inner {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .taxonomy-term-list {
        padding: 12px 0 0 0;
    }

    .taxonomy-term-list li {
        margin-bottom: 3px;
        border-bottom: 1px solid var(--color-2);
    }

    .taxonomy-widget-header.has-active-child .taxonomy-title {
        color: var(--color-9);
        /*text-decoration-color: currentColor;*/
        /*text-decoration: underline;*/
        /*text-underline-offset: 4px;*/
    }

    .taxonomy-widget-header.active .taxonomy-title {
        text-decoration-color: var(--color-9) !important;
        text-decoration: underline !important;
        text-underline-offset: 4px !important;
    }

    .taxonomy-term-list li a {
        display: inline-block;
        padding: 7px 0;
        text-decoration: underline;
        text-decoration-color: transparent;
        text-underline-offset: 4px;
        transition: color 0.3s ease-out, text-decoration-color 0.3s ease-out;
    }

    .taxonomy-term-list li a.active,
    .taxonomy-term-list li a:hover {
        color: var(--color-9);
        text-decoration-color: currentColor;
    }

    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 989px) {
    .blog-sidebar {
        max-width: calc(100% + 40px);
        width: calc(100% + 40px);
        margin-left: -20px;
        padding: 0 20px;
    }
    .taxonomy-term-list li a {
        position: relative;
        width: 100%;
        min-height: 41px;
        align-content: center;
        display: inline-block;
        padding: 5px 13px;
        text-decoration: none;
        border-bottom: 1px solid var(--color-2);
        transition: background 0.3s;
    }

    .taxonomy-term-list li a::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 1px;
        height: 100%;
        background: transparent;
        transition: background 0.3s;
    }

    .taxonomy-term-list li a.active::before {
        background: #000;
    }

    .taxonomy-term-list li a.active,
    .taxonomy-term-list li a:hover {
        background: var(--color-3);
    }
}