:root {
    --az-blue: #005a8b;
    --az-dark: #17324d;
    --az-pink: #e0007a;
    --az-light: #f5f7f9;
    --az-border: #dfe5e9;
    --az-text: #495057;
}

#main {
    background: #fff;
}

.az-courses-page {
    color: var(--az-text);
    background: #fff;
}

.az-intro {
    padding: 50px 0 42px;
    background: #fff;
}

.az-intro-content {
    max-width: 850px;
}

.az-eyebrow {
    display: inline-block;
    margin-bottom: .55rem;
    color: var(--az-pink);
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.az-intro h1 {
    margin: 0 0 1rem;
    color: var(--az-dark);
    line-height: 1.05;
}

.az-intro p {
    max-width: 760px;
    margin: 0 0 .9rem;
    line-height: 1.7;
}

.az-intro-lead {
    color: var(--az-dark);
    font-size: 1.15rem;
    font-weight: 500;
}

.az-intro a:not(.az-button),
.az-text-link {
    color: var(--az-blue);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.az-directory-section {
    padding: 3rem 0 4rem;
    background: var(--az-light);
}

.az-section-heading {
    margin-bottom: 1.5rem;
}

.az-section-heading h2,
.az-resource-content h2 {
    margin: 0 0 .5rem;
    color: var(--az-dark);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.az-section-heading p {
    margin: 0;
    line-height: 1.55;
}

.az-letter-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: 0 0 1.5rem;
}

.az-letter-nav a {
    display: inline-flex;
    width: 40px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--az-border);
    border-radius: 5px;
    background: #fff;
    color: var(--az-dark);
    font-weight: 700;
    text-decoration: none;
    transition: color .18s ease, background .18s ease, border-color .18s ease;
}

.az-letter-nav a:hover,
.az-letter-nav a:focus-visible {
    border-color: var(--az-pink);
    background: var(--az-pink);
    color: #fff;
}

.az-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 1rem;
}

.az-letter-group {
    min-width: 0;
    padding: 1.15rem 1.25rem 1rem;
    border: 1px solid var(--az-border);
    border-top: 3px solid var(--az-pink);
    border-radius: 6px;
    background: #fff;
    scroll-margin-top: 1rem;
}

.az-letter-group h3 {
    margin: 0 0 .55rem;
    color: var(--az-dark);
    font-size: 1.35rem;
    font-weight: 800;
}

.az-subject-list {
    margin: 0;
}

.az-subject-button {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .1rem;
    border: 0;
    border-top: 1px solid #edf0f2;
    background: transparent;
    color: var(--az-blue);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    transition: color .18s ease, background .18s ease, padding .18s ease;
}

.az-subject-button::after {
    content: "→";
    flex: 0 0 auto;
    color: var(--az-pink);
    transition: transform .18s ease;
}

.az-subject-name {
    min-width: 0;
}

.az-subject-count {
    display: inline-flex;
    min-width: 1.55rem;
    height: 1.55rem;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #eef2f4;
    color: #687780;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
}

.az-subject-count:empty {
    visibility: hidden;
}

.az-subject-button:hover,
.az-subject-button:focus-visible,
.az-subject-button.is-active {
    padding-right: .5rem;
    padding-left: .5rem;
    border-radius: 4px;
    background: #f8f1f5;
    color: var(--az-dark);
}

.az-subject-button:hover::after,
.az-subject-button:focus-visible::after,
.az-subject-button.is-active::after {
    transform: translateX(3px);
}

.az-directory-status {
    margin: 1rem 0;
    color: #64717a;
    line-height: 1.5;
}

.az-directory-error,
.az-course-status-error {
    color: #a12622;
}

.az-selected-courses {
    margin-top: 2rem;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--az-border);
    border-top: 4px solid var(--az-pink);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 50, 77, .07);
    scroll-margin-top: 1rem;
}

.az-selected-courses[hidden] {
    display: none;
}

.az-selected-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--az-border);
}

.az-selected-heading .az-eyebrow {
    margin-bottom: .25rem;
}

.az-selected-heading h3 {
    margin: 0;
    color: var(--az-dark);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
}

.az-selected-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.az-selected-count {
    color: #64717a;
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
}

.az-close-courses {
    min-height: 40px;
    padding: .45rem .8rem;
    border: 1px solid var(--az-border);
    border-radius: 5px;
    background: #fff;
    color: var(--az-dark);
    cursor: pointer;
    font-weight: 700;
}

.az-close-courses:hover,
.az-close-courses:focus-visible {
    border-color: var(--az-dark);
    background: var(--az-dark);
    color: #fff;
}

.az-course-results {
    padding-top: .35rem;
}

.az-course-status {
    margin: 1rem 0 .25rem;
    color: #64717a;
    font-size: 1rem;
    line-height: 1.5;
}

.az-course-item {
    display: grid;
    grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr) auto;
    align-items: start;
    gap: 1.5rem;
    padding: 1.2rem .25rem;
    border-bottom: 1px solid #edf0f2;
}

.az-course-item:last-child {
    border-bottom: 0;
}

.az-course-item h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.45;
}

.az-course-item h4 a {
    color: var(--az-blue);
    text-decoration: none;
}

.az-course-item h4 a:hover,
.az-course-item h4 a:focus-visible {
    color: var(--az-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.az-course-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .5rem;
    margin: .45rem 0 0;
    color: #58636c;
    font-size: .85rem;
    line-height: 1.4;
}

.az-course-meta strong {
    color: var(--az-dark);
}

.az-course-description {
    margin: 0;
    color: var(--az-text);
    line-height: 1.65;
}

.az-view-course-button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: .55rem .85rem;
    border: 2px solid var(--az-pink);
    border-radius: 5px;
    background: var(--az-pink);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.az-view-course-button:hover,
.az-view-course-button:focus-visible {
    transform: translateY(-1px);
    border-color: #b00060;
    background: #b00060;
    color: #fff;
    text-decoration: none;
}

.az-resources-section {
    padding: 1rem 0 3rem;
    background: #fff;
}

.az-resource-row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: center;
    gap: 2.5rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--az-border);
}

.az-resource-row:last-child {
    border-bottom: 0;
}

.az-resource-row-reverse .az-resource-image {
    order: 2;
}

.az-resource-image {
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--az-light);
}

.az-resource-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.az-resource-content p {
    max-width: 600px;
    line-height: 1.65;
}

.az-text-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: .25rem;
    text-decoration: none;
}

.az-text-link span {
    color: var(--az-pink);
    transition: transform .18s ease;
}

.az-text-link:hover span,
.az-text-link:focus-visible span {
    transform: translateX(3px);
}

@media (max-width: 991.98px) {
    .az-subject-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .az-resource-row {
        gap: 1.75rem;
    }
}

@media (max-width: 767.98px) {
    .az-intro {
        padding: 34px 0 28px;
    }

    .az-intro-lead {
        font-size: 1.05rem;
    }

    .az-directory-section {
        padding: 2.25rem 0 3rem;
    }

    .az-section-heading h2,
    .az-resource-content h2 {
        font-size: 1.55rem;
    }

    .az-subject-grid {
        grid-template-columns: 1fr;
    }

    .az-selected-courses {
        margin-top: 1.5rem;
        padding: 1rem;
    }

    .az-selected-heading {
        align-items: flex-start;
    }

    .az-selected-heading h3 {
        font-size: 1.25rem;
    }

    .az-selected-actions {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: .4rem;
    }

    .az-course-item {
        grid-template-columns: 1fr;
        gap: .55rem;
        padding: 1rem 0;
    }

    .az-view-course-button {
        justify-self: start;
        margin-top: .25rem;
    }

    .az-resource-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.75rem 0;
    }

    .az-resource-row-reverse .az-resource-image {
        order: 0;
    }
}