/**
 * Course Landing, section 3 — the curriculum rows.
 *
 * WHY THIS IS A SEPARATE FILE, AND MUST STAY ONE
 * ---------------------------------------------
 * LiteSpeed names its combined stylesheet after the LIST of source files, not their
 * contents. Editing a file already in that list leaves the combined URL identical, so
 * Cloudflare keeps serving the bytes it cached under it, and there is no Cloudflare API
 * credential on this host to purge with. A NEW file changes the source list, the combined
 * name changes, and the edge has to fetch a URL it has never seen.
 *
 * So: do not fold these rules back into course-landing.css. They would deploy cleanly and
 * change nothing a visitor sees.
 *
 * This file loads after course-landing.css (declared as a dependency in AssetManifest), so
 * equal-specificity rules here win. Palette and spacing are the Foundation's tokens.
 */

/* ------------------------------------------------- the list is one panel, not many cards */

/* One bordered panel with hairline-divided rows, instead of separate floating cards: the
   rows then line up as a table does, which is what makes a long syllabus scannable. */
.gec-course-modules {
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    overflow: hidden;
}

.gec-course-modules details {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.gec-course-modules > * + * {
    border-block-start: 1px solid var(--color-border);
}

/* ------------------------------------------------------------------------------ the row */

/* Four columns: number, title, gloss, disclosure marker. A row with nothing to disclose is
   a plain div and keeps the same grid, so both shapes align down the panel. */
.gec-course-modules :is(summary, .gec-course-modules__row) {
    display: grid;
    grid-template-columns: var(--space-8) minmax(0, 1fr) minmax(0, 1.2fr) var(--space-5);
    gap: var(--space-5);
    align-items: center;
    min-block-size: 4.5rem;
    padding: var(--space-5) var(--space-6);
    white-space: normal;
}

.gec-course-modules .gec-course-modules__row {
    cursor: default;
}

.gec-course-modules__number {
    grid-column: 1;
    grid-row: 1;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.gec-course-modules :is(summary, .gec-course-modules__row) > strong {
    grid-column: 2;
    grid-row: 1;
    color: var(--color-secondary-500);
    font-weight: 600;
    line-height: 1.5;
}

.gec-course-modules__gloss {
    grid-column: 3;
    grid-row: 1;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.5;
}

/* The marker is a glyph swap, not a rotation.
 *
 * The demo rotates a real <span> 180deg. Here the marker is a ::after, and rotate(180deg)
 * on it computes to the identity matrix in Chrome -- measured on the live page, open rows
 * reported "matrix(1, 0, 0, 1, 0, 0)" while closed rows reported "none", so the rule applied
 * and did nothing. Swapping the glyph is what this theme already shipped, it needs no
 * transform, and it looks the same. */
.gec-course-modules summary::after {
    content: "⌄";
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    line-height: 1;
    color: var(--color-text-secondary);
}

.gec-course-modules details[open] summary::after {
    content: "⌃";
}

/* The disclosed sentence hangs under the title, not under the number. */
.gec-course-modules details > p {
    padding: 0 var(--space-6) var(--space-5);
    padding-inline-start: calc(var(--space-6) + var(--space-8) + var(--space-5));
    color: var(--color-text-secondary);
}

/* ------------------------------------------------------- the note, and the outcomes panel */

/* The note now introduces the list rather than trailing it, so it reads before the reader
   starts counting rows. */
.gec-course-prose__note {
    margin: 0 0 var(--space-5);
    max-inline-size: 48rem;
}

/* A curriculum takes the full measure, so the outcomes panel sits below it rather than
   squeezed into a side column. */
.gec-course-content--stacked .gec-course-outcomes {
    margin-block-start: var(--space-8);
}

/* ----------------------------------------------------------------------------- narrow */

@media (max-width: 900px) {
    .gec-course-modules :is(summary, .gec-course-modules__row) {
        grid-template-columns: var(--space-8) minmax(0, 1fr) var(--space-5);
        align-items: start;
        row-gap: var(--space-1);
    }

    /* The gloss drops under the title and keeps its indent. */
    .gec-course-modules__gloss {
        grid-column: 2;
        grid-row: 2;
    }

    .gec-course-modules summary::after {
        grid-column: 3;
    }
}

@media (max-width: 600px) {
    .gec-course-modules :is(summary, .gec-course-modules__row) {
        gap: var(--space-3);
        padding: var(--space-4);
    }

    .gec-course-modules details > p {
        padding: 0 var(--space-4) var(--space-4);
        padding-inline-start: calc(var(--space-4) + var(--space-8) + var(--space-3));
    }
}
