/* Navbar courses dropdown + clickable course cards */

.nav-dropdown-wrap {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    position: relative;
}

.nav-dropdown-toggle:hover,
.nav-dropdown-wrap.is-open .nav-dropdown-toggle {
    color: var(--primary);
}

.nav-dropdown-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 2px;
    background: var(--primary);
    border-radius: 999px;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-dropdown-toggle:hover::after,
.nav-dropdown-wrap.is-open .nav-dropdown-toggle::after {
    transform: scaleX(1);
}

.nav-dropdown-caret {
    display: inline-block;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s ease;
}

.nav-dropdown-wrap.is-open .nav-dropdown-caret {
    transform: rotate(-135deg) translateY(2px);
}

.nav-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    min-width: min(320px, 88vw);
    max-width: 360px;
    max-height: min(70vh, 420px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    padding: 12px;
    z-index: 120;
}

.nav-dropdown__view-all {
    display: block;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
}

.nav-dropdown__view-all:hover {
    background: #e0e7ff;
}

.nav-dropdown__group + .nav-dropdown__group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.nav-dropdown__label {
    margin: 0 0 6px;
    padding: 0 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.nav-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-dropdown__list a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    line-height: 1.35;
}

.nav-dropdown__list a::after {
    display: none;
}

.nav-dropdown__list a:hover,
.nav-dropdown__list a:focus-visible {
    background: #f8fafc;
    color: var(--primary);
}

.card--course-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card--course-link:hover,
.card--course-link:focus-visible {
    border-color: var(--primary-mid);
    outline: none;
}

.card--course-link p {
    color: var(--muted);
}

.card--course-link .course-read-more {
    text-decoration: none;
}

.card--course-link:hover .course-read-more,
.card--course-link:focus-visible .course-read-more {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .nav-dropdown-wrap {
        width: 100%;
    }

    .nav-dropdown-toggle {
        width: 100%;
        min-height: 44px;
        justify-content: space-between;
        padding: 10px 4px;
    }

    .nav-dropdown {
        position: static;
        transform: none;
        min-width: 0;
        max-width: none;
        max-height: none;
        width: 100%;
        margin-top: 4px;
        box-shadow: none;
        border: 1px solid var(--line);
    }
}
