/**
 * Course Landing (single gec-course).
 *
 * The design's palette is the Foundation's: its navy is --color-secondary-500, its soft
 * band is --color-secondary-50 and its cards round to --radius-lg. Those are named here
 * rather than restated as hex, so the page follows the theme when the theme moves.
 */

/* ------------------------------------------------------------------ shared */

.gec-course {
    --gec-course-section-space: var(--space-12);
    --gec-course-card-padding: var(--space-7);
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.gec-course .gec-container { max-inline-size: var(--container-xl); }
.gec-course :is(#lop-hoc, #noi-dung) { scroll-margin-top: 8rem; }
.gec-course :is(a, summary):focus-visible { outline: 3px solid var(--color-primary-500); outline-offset: 4px; }

.gec-course__notice {
    margin: 0;
    padding-block: var(--space-3);
    background: var(--color-secondary-100);
    color: var(--color-secondary-700);
    font-size: var(--font-size-sm, 0.875rem);
    text-align: center;
}

.gec-course__eyebrow {
    margin: 0 0 var(--space-3);
    color: var(--color-text-secondary);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gec-course-section {
    padding-block: var(--gec-course-section-space);
}

.gec-course-section--soft {
    background: var(--color-secondary-50);
}

.gec-course-section h2 {
    margin: 0 0 var(--space-6);
    font-size: clamp(1.625rem, 2.8vw, 2.25rem);
    line-height: 1.25;
}

/* --------------------------------------------------------------------- hero */

.gec-course-hero {
    padding-block: var(--space-7) var(--gec-course-section-space);
    background: var(--color-secondary-500);
    color: var(--color-white);
}

.gec-course-hero__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-block-end: var(--space-8);
    color: var(--color-secondary-300);
    font-size: var(--font-size-sm, 0.875rem);
}

.gec-course-hero__breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.gec-course-hero__breadcrumb a:hover,
.gec-course-hero__breadcrumb a:focus-visible {
    color: var(--color-white);
    text-decoration: underline;
}

.gec-course-hero .gec-course__eyebrow {
    color: var(--color-secondary-300);
}

.gec-course-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-9);
    align-items: center;
}

.gec-course-hero h1 {
    margin: 0 0 var(--space-5);
    color: var(--color-white);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
}

/**
 * No measure of its own: the summary shares the hero title's column.
 *
 * It used to carry `max-inline-size: 46ch`, which stopped it 169px short of the h1 above it at
 * 1440px — the paragraph and the title started on the same left edge and ended on different right
 * ones, which reads as a mistake rather than as a reading measure. `ch` made it worse by being
 * font-relative: the cap moved whenever the type size did, while the grid column stayed put. Same
 * trap the news article measure had.
 *
 * Letting the grid column do the work keeps both edges identical at every width — measured at
 * 1440, 1024, 880 and 375 — and the column is already a comfortable line (about 61 zero-widths at
 * 1440). Below 900px the hero collapses to one column, where the title is equally wide, so the two
 * stay together there too.
 */
.gec-course-hero__summary {
    margin: 0 0 var(--space-6);
    color: var(--color-secondary-100);
    font-size: 1.125rem;
    line-height: 1.7;
}

.gec-course-hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0 0 var(--space-7);
    padding: 0;
    list-style: none;
}

.gec-course-hero__chips li {
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-secondary-400);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm, 0.875rem);
}

.gec-course-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.gec-course-hero__media {
    margin: 0;
}

.gec-course-hero__media img {
    display: block;
    inline-size: 100%;
    block-size: auto;
    border-radius: var(--radius-xl);
}

/* -------------------------------------------------------------------- facts */

.gec-course-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-5);
    margin: 0;
}

.gec-course-facts > div {
    padding: var(--gec-course-card-padding);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.gec-course-facts dt {
    margin-block-end: var(--space-2);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
}

.gec-course-facts dd {
    margin: 0 0 var(--space-3);
    font-size: 1.3125rem;
    font-weight: 700;
    line-height: 1.35;
}

/* -------------------------------------------------------------------- prose */

.gec-course-prose {
    max-inline-size: 62ch;
}

/* Keep the foundation container aligned with the other sections, constrain text only. */
.gec-course .gec-container.gec-course-prose { max-inline-size: var(--container-xl); }

/*
 * The prose band keeps the section's own margins (owner decision, 2026-09-23).
 *
 * Eyebrow, heading and copy run edge to edge on the container, which is the same 1232px the
 * facts and schedule blocks in the section above occupy, so the two bands share one left and
 * one right edge at every width. Capping the copy narrower than its own heading is what made
 * this section read as shoved against the left with dead space beside it; a narrower centred
 * column fixed that but indented the block ~196px away from every neighbouring section.
 *
 * `margin-inline` only — the block margins below set the vertical rhythm and must survive.
 */
.gec-container.gec-course-prose > * {
    max-inline-size: none;
    margin-inline: 0;
}

.gec-container.gec-course-prose > p:not(.gec-course__eyebrow) { font-size: 1.125rem; }

/*
 * Justifying needs room to absorb the extra space between words. On a phone the column is
 * narrow enough that the same setting opens rivers through the paragraph, so the small screen
 * keeps its ragged right edge. 600px is the breakpoint the rest of this file already uses.
 */
@media (min-width: 601px) {
    .gec-container.gec-course-prose > p:not(.gec-course__eyebrow) {
        text-align: justify;
        text-justify: inter-word;
    }
}

.gec-course-prose > p {
    margin: 0 0 var(--space-4);
    line-height: 1.75;
}

.gec-course-prose > h3 {
    margin: var(--space-7) 0 var(--space-3);
    font-size: 1.3rem;
    line-height: 1.35;
}

.gec-course-prose > h3:first-child {
    margin-block-start: 0;
}

.gec-course-prose__label {
    margin: 0 0 var(--space-2);
    font-weight: 600;
}

.gec-course-prose > ul {
    margin: 0 0 var(--space-5);
    padding-inline-start: var(--space-5);
}

.gec-course-prose > ul > li {
    margin-block-end: var(--space-2);
    line-height: 1.7;
}

/* ------------------------------------------------------- content + outcomes */

.gec-course-content {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-9);
    align-items: start;
}

.gec-course-modules {
    display: grid;
    gap: var(--space-3);
    margin-block-end: var(--space-5);
}

.gec-course-modules details {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.gec-course-modules summary {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    /* The Foundation sets nowrap on interactive elements; a module title is prose. */
    white-space: normal;
}

.gec-course-modules summary > * {
    max-inline-size: 100%;
}

.gec-course-modules__number {
    color: var(--color-primary-600);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.gec-course-modules details > p {
    margin: 0;
    padding: 0 var(--space-5) var(--space-5) calc(var(--space-5) + var(--space-6));
    line-height: 1.7;
}

.gec-course-outcomes {
    padding: var(--gec-course-card-padding);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-secondary-50);
}

.gec-course-outcomes h3 {
    margin: 0 0 var(--space-4);
    font-size: 1.15rem;
    line-height: 1.35;
}

.gec-course-outcomes ul {
    margin: 0;
    padding-inline-start: var(--space-5);
}

.gec-course-outcomes li {
    margin-block-end: var(--space-2);
    line-height: 1.6;
}

/* ------------------------------------------------------------------ classes */

.gec-course-classes {
    display: grid;
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gec-course-class {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    padding: var(--gec-course-card-padding);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.gec-course-class h3 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.gec-course-class__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4) var(--space-7);
    margin: 0;
    padding: var(--space-5) var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--color-secondary-50);
}

.gec-course-class__facts dt {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
}

.gec-course-class__facts dd {
    margin: 0;
    font-weight: 600;
    line-height: 1.5;
}

.gec-course-class__price {
    color: var(--color-primary-600);
    font-size: 1.15rem;
}

.gec-course-class__actions {
    margin-block-start: auto;
    padding-block-start: var(--space-4);
    border-block-start: 1px solid var(--color-border);
}

.gec-course-class__closed {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
}

.gec-course-empty {
    margin: 0;
    padding: var(--gec-course-card-padding);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
}

/* ---------------------------------------------------------- teacher and CTA */

.gec-course-teacher {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--gec-course-card-padding);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.gec-course-teacher__avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    inline-size: 4rem;
    block-size: 4rem;
    margin: 0;
    border-radius: 50%;
    background: var(--color-secondary-500);
    color: var(--color-white);
    font-weight: 700;
}

.gec-course-teacher h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.2rem;
}

.gec-course-teacher p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.gec-course-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    align-items: center;
    justify-content: space-between;
    padding: var(--space-8);
    border-radius: var(--radius-xl);
    background: var(--color-secondary-500);
    color: var(--color-white);
}

.gec-course-cta h2 {
    margin: 0 0 var(--space-2);
    color: var(--color-white);
}

.gec-course-cta p {
    margin: 0;
    color: var(--color-secondary-100);
}

.gec-course-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

/* ------------------------------------------------------------------ mobile */

@media (max-width: 900px) {
    .gec-course-hero__grid,
    .gec-course-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .gec-course-hero__media {
        max-inline-size: 22rem;
    }
}

@media (max-width: 600px) {
    .gec-course {
        --gec-course-section-space: var(--space-9);
        --gec-course-card-padding: var(--space-5);
    }

    .gec-course-facts, .gec-course-class__facts { grid-template-columns: minmax(0, 1fr); }
    .gec-course :is(.gec-course-hero__actions, .gec-course-class__actions, .gec-course-cta__actions) .gec-btn { inline-size: 100%; white-space: normal; }

    .gec-course-teacher {
        flex-direction: column;
        align-items: flex-start;
        text-align: start;
    }
}

.gec-course-hero__caption {
    margin: var(--space-4) 0 0;
    color: var(--color-secondary-300);
    font-size: var(--font-size-sm, 0.875rem);
}

/* ------------------------------------------------- schedule inside section 01 */

.gec-course-facts > div > p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.gec-course-schedule {
    margin-block-start: var(--space-9);
}

.gec-course-schedule > h2 {
    margin-block-end: var(--space-2);
}

.gec-course-schedule__lead {
    margin: 0 0 var(--space-6);
    color: var(--color-text-secondary);
}

.gec-course-class__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
}

.gec-course-class__actions small {
    color: var(--color-text-secondary);
}

/* The module row reads as a table line: number, title, then the disclosure marker. */
.gec-course-modules summary {
    display: grid;
    grid-template-columns: var(--space-8) minmax(0, 1fr) var(--space-5);
    align-items: baseline;
    gap: var(--space-3);
}

.gec-course-modules summary::-webkit-details-marker,
.gec-course-modules summary::marker {
    content: "";
    display: none;
}

.gec-course-modules summary::after {
    content: "⌄";
    justify-self: end;
    color: var(--color-text-secondary);
    line-height: 1;
}

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

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

/* A section whose copy carries no outcomes list uses the full measure. */
.gec-course-content--single {
    grid-template-columns: minmax(0, 1fr);
}

.gec-course-content--single .gec-course-prose {
    max-inline-size: 100%;
}

/* ---------------------------------------------------------------- phương pháp */

.gec-course-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.gec-course-methods li {
    padding: var(--gec-course-card-padding);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.gec-course-methods__number {
    display: block;
    margin-block-end: var(--space-3);
    color: var(--color-primary-600);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.gec-course-methods h3 {
    margin: 0 0 var(--space-2);
    font-size: 1.15rem;
    line-height: 1.35;
}

.gec-course-methods p {
    margin: 0;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.gec-course-prose__note {
    margin: var(--space-4) 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm, 0.875rem);
    line-height: 1.6;
}

.gec-course-teacher__photo {
    flex: 0 0 auto;
    inline-size: 6rem;
    block-size: 6rem;
    border-radius: 50%;
    object-fit: cover;
}

.gec-course-teacher__intro {
    margin: 0 0 var(--space-2);
    color: var(--color-text) !important;
    font-weight: 500;
}


.gec-course-reading__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.gec-course-reading__card {
    display: flex;
    flex-direction: column;
    block-size: 100%;
    overflow: hidden;
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--gec-course-card-radius, 0.75rem);
    background: var(--color-surface);
    color: var(--color-text-primary);
    text-decoration: none;
}

.gec-course-reading__cover {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-hover);
}

.gec-course-reading__cover img {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
}

.gec-course-reading__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
}

.gec-course-reading__body h3 {
    margin: 0;
    font-size: var(--font-size-lg, 1.125rem);
    line-height: 1.4;
}

.gec-course-reading__action {
    display: inline-flex;
    gap: var(--space-2);
    margin-block-start: auto;
    color: var(--color-text-link);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.gec-course-reading__card:hover .gec-course-reading__action,
.gec-course-reading__card:focus-visible .gec-course-reading__action {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

@media (max-width: 640px) {
    .gec-course-reading__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-4);
    }

    .gec-course-reading__body {
        padding: var(--space-4);
    }
}

.gec-course-modules.gec-course-faq summary {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.gec-course-modules.gec-course-faq summary > strong {
    grid-column: 1;
}

.gec-course-modules.gec-course-faq summary::after {
    grid-row: 1;
    grid-column: 2;
}

.gec-course-modules.gec-course-faq details > p {
    padding-inline-start: var(--space-5);
}

@media (max-width: 600px) {
    .gec-course-modules.gec-course-faq details > p {
        padding-inline-start: var(--space-4);
    }
}
