/* courses_archive — finished terms, kept visible so students can see
   what has already run. Deliberately quieter than the live course table. */

.ca {
    padding-block: clamp(2rem, 5vw, 3.5rem);
    background: #FBFAFF;
    border-top: 1px solid rgba(30, 27, 75, 0.1);
}

.ca__heading {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #1E1B4B;
    margin-bottom: 0.5rem;
}

.ca__intro {
    max-width: 44rem;
    color: #44406b;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.ca__term {
    background: #FFFFFF;
    border: 1px solid rgba(30, 27, 75, 0.12);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.ca__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    font-weight: 600;
    color: #1E1B4B;
    list-style: none;
}

.ca__summary::-webkit-details-marker {
    display: none;
}

.ca__summary::before {
    content: "▸";
    font-size: 0.85em;
    color: #5138DF;
    transition: transform 0.15s ease;
}

.ca__term[open] .ca__summary::before {
    transform: rotate(90deg);
}

.ca__summary:focus-visible {
    outline: 3px solid #5138DF;
    outline-offset: -3px;
}

.ca__summary-label {
    margin-right: auto;
}

/* 4.6:1 on its own background — passes AA for small text. */
.ca__pill {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #E3F1E8;
    color: #1F5C3D;
    white-space: nowrap;
}

.ca__count {
    font-size: 0.85rem;
    font-weight: 500;
    color: #5c5880;
    white-space: nowrap;
}

.ca__note {
    padding: 0 1.1rem;
    margin: 0 0 0.75rem;
    color: #5c5880;
    font-size: 0.92rem;
}

/* The table scrolls inside its own box so the page never scrolls sideways. */
.ca__tablewrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid rgba(30, 27, 75, 0.08);
}

.ca__table {
    width: 100%;
    min-width: 34rem;
    border-collapse: collapse;
    font-size: 0.92rem;
}

/* Every cell stays on one line. Squeezed into a phone-width box the date
   column otherwise wrapped onto four or five lines, leaving rows tall and
   mostly empty. The wrapper above scrolls, so width here costs nothing. */
.ca__table th,
.ca__table td {
    text-align: left;
    padding: 0.65rem 1.1rem;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid rgba(30, 27, 75, 0.07);
}

.ca__table thead th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5c5880;
    background: #F6F4FF;
    font-weight: 700;
}

.ca__table tbody tr:last-child th,
.ca__table tbody tr:last-child td {
    border-bottom: 0;
}

.ca__cname {
    font-weight: 600;
    color: #1E1B4B;
    white-space: nowrap;
}

.ca__table td {
    color: #44406b;
}

@media (prefers-reduced-motion: reduce) {
    .ca__summary::before {
        transition: none;
    }
}
