/* ============================================
    TA — COURSE ARCHIVE
    Page sections: ta-archive (categories, Sort By).
============================================ */

/* ==========================================================================
   ARCHIVE — "All Courses" (also bundles / blog archives)
   abbr: ta-archive
   ========================================================================== */
.ta-archive {
    padding: 27px 0 54px;
}
.ta-archive-title {
    margin: 0;
    font-size: var(--ta-fs-39);
    font-weight: var(--ta-fw-bold);
    color: var(--ta-navy);
}

/* ---- Category chips ---- */
.ta-cats {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 15px 11px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.ta-cat {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 5px 8px;
    border-radius: var(--ta-radius-8);
    background-color: var(--ta-peach);
    font-size: var(--ta-fs-12);
    font-weight: var(--ta-fw-bold);
    text-transform: uppercase;
    text-align: center;
    color: var(--ta-black);
    line-height: 1.15;
    overflow-wrap: anywhere;   /* long category names wrap to two lines instead of being cut */
}
.ta-cat:hover {
    background-color: #fcd6ab;
    color: var(--ta-black);
}
.ta-cat.is-active {
    background-color: var(--ta-orange);
}

/* ---- Sort By ---- */
.ta-archive-bar {
    display: flex;
    justify-content: flex-end;
    margin: 70px 0 37px;
}
.ta-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 169px;
    height: 51px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--ta-radius-4);
    background: linear-gradient(180deg, #fdfdfb 0%, #f4f3ea 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    font-size: var(--ta-fs-16);
    color: var(--ta-navy);
}
.ta-sort-btn svg {
    width: 13px;
    height: 9px;
    transition: transform var(--ta-ease);
}
.ta-sort-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}
.ta-sort-menu {
    --bs-dropdown-min-width: 169px;
    --bs-dropdown-padding-y: 4px;
    --bs-dropdown-border-width: 0;
    --bs-dropdown-border-radius: var(--ta-radius-4);
    --bs-dropdown-box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    box-shadow: var(--bs-dropdown-box-shadow);
    background: #fbfaf5;
}
.ta-sort-item.dropdown-item {
    padding: 4px 12px;
    border-radius: var(--ta-radius-6);
    font-size: var(--ta-fs-14);
    text-align: center;
    color: var(--ta-navy);
}
.ta-sort-item.dropdown-item:hover,
.ta-sort-item.dropdown-item:focus {
    background-color: var(--ta-peach);
    color: var(--ta-navy);
}
.ta-sort-item.dropdown-item.active,
.ta-sort-item.dropdown-item:active {
    background-color: var(--ta-orange);
    color: var(--ta-white);
}

@media (max-width: 1199.98px) {
    .ta-cats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
@media (max-width: 767.98px) {
    .ta-cats {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        margin-inline: calc(var(--ta-gutter) * -1);
        padding: 0 var(--ta-gutter) 4px;
        scrollbar-width: none;
    }
    .ta-cats::-webkit-scrollbar {
        display: none;
    }
    .ta-cat {
        padding: 0 16px;
        overflow: visible;
        white-space: nowrap;   /* one swipeable row on mobile */
    }
    .ta-archive-bar {
        margin: 28px 0 24px;
    }
}
