.page-template-page-course-archive {
    background-color: #FBFCFC;
}

.page-template-page-course-archive .ast-container {
    max-width: 100%;
}

.nsc-course-archive {
    max-width: 1464px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 0 24px 60px;
}

.nsc-archive-inner {
    width: 100%;
}

.nsc-archive-title {
    font-size: 32px;
    font-weight: 350;
    color: #333F48;
    margin: 75px 0 50px;
}

/* --- Filters --- */

.nsc-filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.nsc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.nsc-filter {
    position: relative;
}

.nsc-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 2px solid #0077C8;
    border-radius: 0;
    background: #fff;
    color: #0077C8;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.nsc-filter-btn:hover,
.nsc-filter-btn:focus {
    background: #0077C8 !important;
    color: #fff !important;
    border-color: #0077C8 !important;
}

.nsc-filter-btn:hover .nsc-filter-chevron path,
.nsc-filter-btn:focus .nsc-filter-chevron path {
    fill: #fff;
}

.nsc-filter-chevron {
    transition: transform 0.2s;
}

.nsc-filter.open .nsc-filter-chevron {
    transform: rotate(180deg);
}

.nsc-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 4px rgba(0, 0, 0, 0.08);
    padding: 16px;
    z-index: 100;
}

.nsc-filter.open .nsc-filter-dropdown {
    display: block;
}

.nsc-filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
    color: #333F48;
    line-height: 19px;
    transition: background 0.1s;
}

.nsc-filter-option:hover {
    background: #f0fbfc;
}

.nsc-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #0077C8;
    border-radius: 0;
    cursor: pointer;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    border: 1.5px solid #6F787E;
    background: #fff;
    flex-shrink: 0;
}

.nsc-filter-option input[type="checkbox"]:checked {
    background: #0077C8;
    border-color: #0077C8;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 6.1L1.4 4l-.7.7L3.5 7.5l6-6-.7-.7L3.5 6.1z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* --- Active Filter Tags --- */

.nsc-active-filters {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.nsc-active-filters.has-filters {
    display: flex;
}

.nsc-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #333F48;
    color: #fff;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    border-radius: 0;
}

.nsc-active-tag svg {
    flex-shrink: 0;
}

.nsc-clear-filters {
    background: none;
    border: none;
    border-radius: 0;
    color: #333F48;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    padding: 0 12px;
    height: 32px;
    white-space: nowrap;
    text-decoration: none;
}

/* --- Count --- */

.nsc-showing-count {
    font-size: 14px;
    color: #333F48;
    margin-bottom: 16px;
}

/* --- Course Grid --- */

.nsc-course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    transition: opacity 0.2s;
    min-height: 200px;
}

.nsc-course-grid.nsc-loading {
    opacity: 0.5;
    pointer-events: none;
}

.nsc-course-grid-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6B7280;
    font-size: 16px;
}

/* --- Course Card --- */

.nsc-course-card {
    overflow: visible;
    background: #fff;
    border: 2px solid #F0F3F3;
    transition: border-color 0.2s ease;
    padding: 24px;
}

.nsc-course-card:hover {
    border-color: #00A2C6;
}

.nsc-course-card:hover .nsc-card-title {
    text-decoration: underline;
}

.nsc-card-link {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.nsc-card-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e5e7eb;
}

.nsc-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nsc-badge-new {
    position: absolute;
    top: 8px;
    left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'GT Eesti Display', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #333F48;
    background: #f3f9ee;
    border: 1px solid #8bc058;
    border-radius: 999px;
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    line-height: 19px;
}

.nsc-card-body {
    flex: 1;
}

.nsc-card-overline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    margin-bottom: 8px;
}

.nsc-card-category {
    font-size: 14px;
    font-weight: 300;
    color: #333F48;
    line-height: 19px;
}

.nordic-custom-lang-element--card {
    background: transparent;
    padding: 4px 16px !important;
    border-radius: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.nordic-custom-lang-element--card .lang-change {
    font-size: 14px;
}

.nsc-card-title {
    font-size: 22px;
    font-weight: 400;
    color: #333F48;
    margin: 0 0 16px;
    line-height: 29px;
}

.nsc-card-excerpt {
    font-size: 18px;
    line-height: 23px;
    font-weight: 300;
    color: #333F48;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 72px;
}

.nsc-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    font-size: 14px;
    color: #333F48;
}

.nsc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nsc-meta-item svg {
    flex-shrink: 0;
}

/* --- Pagination --- */

.nsc-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.nsc-pagination__inner {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nsc-pagination__btn,
.nsc-pagination__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: none;
    color: #333F48;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    padding: 0 8px;
}

.nsc-pagination__btn:hover:not(:disabled),
.nsc-pagination__num:hover:not(.nsc-pagination__num--active) {
    background: #f0f7fc;
    color: #0077C8;
}

.nsc-pagination__num--active {
    background: #0077C8;
    color: #fff;
    font-weight: 500;
    cursor: default;
}

.nsc-pagination__btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.nsc-pagination__btn svg {
    flex-shrink: 0;
}

/* --- Mobile Filter Button --- */

.nsc-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid #0077C8;
    border-radius: 0;
    background: #fff;
    color: #0077C8;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.nsc-mobile-filter-btn:hover {
    background: #0077C8;
    color: #fff;
}

/* --- Mobile Panel --- */

.nsc-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #fff;
    flex-direction: column;
}

.nsc-mobile-panel.open {
    display: flex;
}

.nsc-mobile-panel__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 20px 24px;
    flex-shrink: 0;
}

.nsc-mobile-panel__title {
    font-size: 24px;
    font-weight: 300;
    color: #333F48;
    margin: 0;
    padding: 0 24px 16px;
}

.nsc-mobile-panel__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nsc-mobile-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* --- Mobile Accordion --- */

.nsc-mobile-accordion {
    border-bottom: 1px solid #D9E1E2;
    background: #fff;
}

.nsc-mobile-accordion__toggle,
.nsc-mobile-accordion__toggle:hover,
.nsc-mobile-accordion__toggle:focus {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 16px 24px;
    background: #fff;
    border: none;
    border-color: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
    color: #333F48;
    text-align: left;
    gap: 8px;
}

.nsc-mobile-accordion__label {
    flex: 0 0 auto;
}

.nsc-mobile-accordion__chevron {
    margin-left: auto;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.nsc-mobile-accordion__badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #333F48;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 0 4px;
}

.nsc-mobile-accordion__badge.has-count {
    display: inline-flex;
}

.nsc-mobile-accordion.open .nsc-mobile-accordion__chevron {
    transform: rotate(180deg);
}

.nsc-mobile-accordion__content {
    display: none;
    padding: 0 24px 16px;
    background: #fff;
}

.nsc-mobile-accordion.open .nsc-mobile-accordion__content {
    display: block;
}

/* --- Mobile Panel Footer --- */

.nsc-mobile-panel__footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #D9E1E2;
    flex-shrink: 0;
}

.nsc-mobile-panel__clear {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #0077C8;
    border-radius: 0;
    background: #fff;
    color: #0077C8;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
}

.nsc-mobile-panel__clear:disabled {
    border-color: #D9E1E2;
    color: #D9E1E2;
    cursor: default;
}

.nsc-mobile-panel__view {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 0;
    background: linear-gradient(30deg, #00a2c6 62%, #33b4d1 35%) var(--x, 50%) / 160%;
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    transition: 0.5s;
    text-align: center;
}

.nsc-mobile-panel__view:hover {
    --x: 100%;
}

.nsc-mobile-panel__view:disabled {
    background: #D9E1E2;
    color: #fff;
    cursor: default;
}

/* --- Responsive --- */

@media screen and (max-width: 1024px) {
    .nsc-course-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .nsc-filter-bar {
        display: none;
    }

    .nsc-mobile-filter-btn {
        display: flex;
    }
}

@media screen and (max-width: 640px) {
    .page-template-page-course-archive.ast-separate-container #content .ast-container {
        padding-left: 0;
        padding-right: 0;
    }

    .nsc-course-archive {
        padding: 37px 16px 60px;
    }

    .nsc-course-grid {
        grid-template-columns: 1fr;
    }

    .nsc-archive-title {
        font-size: 26px;
        margin: 24px 0 16px;
    }

    .nsc-card-meta {
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    .nsc-active-filters {
        gap: 8px;
    }
}

