/*
 * Phase 5 — public student-facing styles.
 *
 * Theme overrides are honored by every property exposed via CSS
 * variables (`--cpe-*`). Authors / child themes can recolor the bundle
 * without overriding selectors by setting custom properties in
 * `:root` or `.cpe-progress`, etc.
 *
 * Phase 5.1 polish — every presentational default is a `--cpe-*` token
 * with a neutral fallback so a no-customization theme still reads
 * cleanly, while a child theme (or Elementor widget) can override the
 * variables on any wrapper to re-skin the bundle without rewriting
 * selectors. Selectors never target `body`, `h1`-`h6`, global `a`, or
 * Elementor container classes — every rule is scoped to a `.cpe-*`
 * root class.
 */

:root {
    /* ----------------------------------------------------------------
     * Surface / text / accent — semantic, theme-overridable tokens.
     * Set any of these on a parent wrapper (e.g. a `.cpe-courses` block
     * inside Elementor) and every nested `.cpe-*` component inherits
     * the new value through `var()` lookups.
     * ---------------------------------------------------------------- */
    --cpe-surface: #ffffff;
    --cpe-text: #1f2933;
    --cpe-muted: #52606d;
    --cpe-accent: #2d6cdf;
    --cpe-success: #1f8a3a;
    --cpe-warning: #b45309;
    --cpe-border-color: #e4e7eb;

    /* The lesson the learner is on: the accent of its status icon and the
     * tint of its row. Two tokens so a theme can move one without the
     * other. */
    --cpe-current: #d9541f;
    --cpe-current-tint: #fdece6;

    /* The soft disc behind a completed status icon — the navigator's own
     * tint, so a theme can move the disc without moving the icon. */
    --cpe-success-tint: #e8f5ec;

    /* A neutral surface for a control that sits on the page background —
     * the navigator's collapse chevron. */
    --cpe-surface-muted: #f1f4f8;

    /* ----------------------------------------------------------------
     * Type scale — the navigator's own sizes.
     *
     * The outline sets its sizes explicitly: with the theme's inherited
     * size a section title and a Lesson title come out the same size and
     * the reader cannot tell a section from a Lesson. A child theme can
     * move any step without rewriting a selector.
     * ---------------------------------------------------------------- */
    --cpe-font-size-section: 0.9375rem;
    --cpe-font-size-title: 0.875rem;
    --cpe-font-size-meta: 0.75rem;

    /* The course header's own two steps — the Course name and the
     * eyebrow above it. They sit between the section title and the
     * Lesson title: the header names the Course, and the Course name is
     * smaller than a section title but larger than a Lesson title. */
    --cpe-font-size-course: 0.90625rem;
    --cpe-font-size-eyebrow: 0.6875rem;

    /* The glyph's share of an icon slot's box. An SVG icon fills the
     * box; a font icon draws inside it — the ratio keeps both markups at
     * the same visual weight. */
    --cpe-icon-glyph-ratio: 0.75;

    /* ----------------------------------------------------------------
     * Spacing scale — logical rem units. Components pull padding /
     * margin / gap from these so child themes can tighten or loosen
     * the rhythm without overriding each rule.
     * ---------------------------------------------------------------- */
    --cpe-space-xs: 0.25rem;
    --cpe-space-sm: 0.5rem;
    --cpe-space-md: 1rem;
    --cpe-space-lg: 1.5rem;

    /* ----------------------------------------------------------------
     * Radius + motion — geometry / animation duration. The motion token
     * is also the value used by the prefers-reduced-motion override
     * below so authors can disable transitions globally by setting
     * `--cpe-motion-duration: 0ms`.
     * ---------------------------------------------------------------- */
    --cpe-radius: 6px;
    --cpe-motion-duration: 150ms;

    /* The soft card's own shadow — the card the outline sits in. */
    --cpe-shadow-card: 0 8px 24px -12px rgba(16, 24, 40, 0.18);

    /* ----------------------------------------------------------------
     * Focus ring — visible keyboard focus on every interactive CPE
     * surface. Authors can soften or recolor the ring without
     * touching the rule.
     * ---------------------------------------------------------------- */
    --cpe-focus-ring: 0 0 0 3px rgba(45, 108, 223, 0.35);

    /* ----------------------------------------------------------------
     * Backward-compatibility aliases — keep every Phase 5 token name
     * working so existing selectors and external style hooks do not
     * break. Each alias resolves through the new token, so overriding
     * one overrides both.
     * ---------------------------------------------------------------- */
    --cpe-color-bg: var(--cpe-surface, #ffffff);
    --cpe-color-fg: var(--cpe-text, #1f2933);
    --cpe-color-muted: var(--cpe-muted, #52606d);
    --cpe-color-accent: var(--cpe-accent, #2d6cdf);
    --cpe-color-success: var(--cpe-success, #1f8a3a);
    --cpe-color-warning: var(--cpe-warning, #b45309);
    --cpe-color-border: var(--cpe-border-color, #e4e7eb);
    --cpe-gap: var(--cpe-space-md, 1rem);
}

/* ===================================================================
 * Progress (lesson status list)
 * =================================================================== */

.cpe-progress {
    background: var(--cpe-surface);
    color: var(--cpe-text);
    padding: var(--cpe-space-md);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    margin-block: var(--cpe-space-md);
}

.cpe-progress__list {
    margin: 0;
    padding-inline-start: 1.25rem;
    display: grid;
    gap: var(--cpe-space-xs);
}

.cpe-progress__item {
    padding-block: var(--cpe-space-xs);
}

.cpe-progress__item[data-status="completed"] {
    color: var(--cpe-success);
}

.cpe-progress__item[data-status="in_progress"] {
    color: var(--cpe-accent);
}

.cpe-progress__item[data-status="not_started"] {
    color: var(--cpe-muted);
}

/* ===================================================================
 * Countdown (time_since unlock indicator)
 * =================================================================== */

.cpe-countdown {
    display: inline-flex;
    align-items: center;
    gap: var(--cpe-space-sm);
    padding: var(--cpe-space-sm) var(--cpe-space-md);
    margin-block: var(--cpe-space-md);
    background: color-mix(in srgb, var(--cpe-accent) 8%, transparent);
    color: var(--cpe-accent);
    border-radius: var(--cpe-radius);
    font-variant-numeric: tabular-nums;
    border: 1px solid color-mix(in srgb, var(--cpe-accent) 18%, transparent);
    transition: color var(--cpe-motion-duration) ease,
        background-color var(--cpe-motion-duration) ease;
}

.cpe-countdown__label {
    font-weight: 600;
}

/* ===================================================================
 * Lesson nav (prev / current / next / denied anchors)
 * =================================================================== */

.cpe-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cpe-space-sm);
    margin-block: var(--cpe-space-md);
}

.cpe-nav a {
    display: inline-block;
    padding: var(--cpe-space-sm) 0.9rem;
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    text-decoration: none;
    color: var(--cpe-text);
    background: var(--cpe-surface);
    transition: border-color var(--cpe-motion-duration) ease,
        color var(--cpe-motion-duration) ease,
        background-color var(--cpe-motion-duration) ease,
        box-shadow var(--cpe-motion-duration) ease;
}

/* Hover changes only color/border — never replaces the focus outline
 * so keyboard users keep a visible indicator after click/focus. */
.cpe-nav a:hover {
    border-color: var(--cpe-accent);
    color: var(--cpe-accent);
}

.cpe-nav a:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
    border-color: var(--cpe-accent);
}

.cpe-nav a[aria-current="page"] {
    font-weight: 600;
    border-color: var(--cpe-accent);
}

.cpe-nav a[aria-disabled="true"] {
    color: var(--cpe-muted);
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

/* The disabled anchor must not steal the focus ring on accidental
 * keyboard focus (some browsers still draw focus on `pointer-events:
 * none` elements under high-contrast / forced-colors mode). */
.cpe-nav a[aria-disabled="true"]:focus-visible {
    box-shadow: none;
}

/* ===================================================================
 * Upgrade CTA
 * =================================================================== */

.cpe-cta {
    margin-block: var(--cpe-space-md);
    padding: var(--cpe-space-md);
    border: 1px solid var(--cpe-warning);
    border-radius: var(--cpe-radius);
    background: color-mix(in srgb, var(--cpe-warning) 6%, transparent);
}

.cpe-cta__link {
    display: inline-block;
    margin-block-start: var(--cpe-space-sm);
    padding: var(--cpe-space-sm) var(--cpe-space-md);
    background: var(--cpe-warning);
    color: var(--cpe-surface);
    text-decoration: none;
    border-radius: var(--cpe-radius);
    font-weight: 600;
    transition: background-color var(--cpe-motion-duration) ease,
        box-shadow var(--cpe-motion-duration) ease;
}

.cpe-cta__link:hover {
    background: color-mix(in srgb, var(--cpe-warning) 88%, #000000 12%);
}

.cpe-cta__link:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

/* ===================================================================
 * Course archive (listing of cards)
 * =================================================================== */

.cpe-courses__title {
    margin-block: var(--cpe-space-md);
}

.cpe-courses__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--cpe-space-md);
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.cpe-courses__empty {
    color: var(--cpe-muted);
    margin: 0;
    padding-block: var(--cpe-space-sm);
}

/* ===================================================================
 * Course card
 * =================================================================== */

.cpe-course-card {
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    padding: var(--cpe-space-md);
    background: var(--cpe-surface);
    display: flex;
    flex-direction: column;
    gap: var(--cpe-space-sm);
    transition: border-color var(--cpe-motion-duration) ease,
        box-shadow var(--cpe-motion-duration) ease;
}

.cpe-course-card__title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
}

.cpe-course-card__progress {
    color: var(--cpe-muted);
    margin: 0;
}

.cpe-course-card__cta {
    display: inline-block;
    padding: var(--cpe-space-xs) var(--cpe-space-sm);
    border-radius: var(--cpe-radius);
    background: var(--cpe-accent);
    color: var(--cpe-surface);
    text-decoration: none;
    margin-block-start: auto;
    align-self: flex-start;
    transition: background-color var(--cpe-motion-duration) ease,
        box-shadow var(--cpe-motion-duration) ease;
}

.cpe-course-card__cta:hover {
    background: color-mix(in srgb, var(--cpe-accent) 88%, #000000 12%);
}

.cpe-course-card__cta:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

.cpe-course-card[data-status="completed"] {
    border-color: var(--cpe-success);
}

.cpe-course-card[data-status="renew"] {
    border-color: var(--cpe-warning);
}

/* ===================================================================
 * Lesson player (Elementor widget wrapper around lesson content)
 * =================================================================== */

.cpe-lesson-player {
    margin-block: var(--cpe-space-md);
    padding: var(--cpe-space-md);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    color: var(--cpe-text);
    line-height: 1.6;
}

.cpe-lesson-player:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

/* ===================================================================
 * Lesson status (Elementor widget — not_started / in_progress / completed)
 * =================================================================== */

.cpe-status {
    display: inline-flex;
    align-items: center;
    gap: var(--cpe-space-xs);
    padding: var(--cpe-space-xs) var(--cpe-space-sm);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    border: 1px solid var(--cpe-border-color);
    color: var(--cpe-text);
    font-size: 0.9rem;
}

.cpe-status__icon {
    line-height: 1;
}

.cpe-status__label {
    line-height: 1;
}

.cpe-status--completed {
    color: var(--cpe-success);
    border-color: var(--cpe-success);
}

.cpe-status--in_progress {
    color: var(--cpe-accent);
    border-color: var(--cpe-accent);
}

.cpe-status--not_started {
    color: var(--cpe-muted);
}

/* ===================================================================
 * Locked notice (Elementor widget — deny reason + continue link)
 * =================================================================== */

.cpe-locked-notice {
    margin-block: var(--cpe-space-md);
    padding: var(--cpe-space-md);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: color-mix(in srgb, var(--cpe-warning) 6%, transparent);
    color: var(--cpe-text);
}

.cpe-locked-reason {
    color: var(--cpe-warning);
    font-weight: 600;
}

.cpe-locked-cta {
    display: inline-block;
    margin-block-start: var(--cpe-space-sm);
    padding: var(--cpe-space-xs) var(--cpe-space-sm);
    border-radius: var(--cpe-radius);
    background: var(--cpe-accent);
    color: var(--cpe-surface);
    text-decoration: none;
    transition: background-color var(--cpe-motion-duration) ease,
        box-shadow var(--cpe-motion-duration) ease;
}

.cpe-locked-cta:hover {
    background: color-mix(in srgb, var(--cpe-accent) 88%, #000000 12%);
}

.cpe-locked-cta:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

/* ===================================================================
 * Single-lesson container (render_single_lesson output)
 * =================================================================== */

.cpe-lesson {
    display: grid;
    gap: var(--cpe-space-md);
}

.cpe-lesson__title {
    margin: 0;
}

.cpe-lesson__content {
    color: var(--cpe-text);
}

/* Lesson-only footer policy also covers theme/Elementor template overrides. */
body.cpe-lesson-hide-theme-footer > footer,
body.cpe-lesson-hide-theme-footer > #page > footer,
body.cpe-lesson-hide-theme-footer .site-footer,
body.cpe-lesson-hide-theme-footer #colophon,
body.cpe-lesson-hide-theme-footer .elementor-location-footer {
    display: none;
}

.cpe-lesson-shell {
    --cpe-lesson-nav-clearance: 5rem;
    display: grid;
    grid-template-columns: minmax(14rem, 19rem) minmax(0, 1fr);
    gap: var(--cpe-space-lg);
    max-width: 90rem;
    margin-inline: auto;
    padding: var(--cpe-space-lg) var(--cpe-space-md) calc(var(--cpe-lesson-nav-clearance) + var(--cpe-space-lg) + env(safe-area-inset-bottom));
}

.cpe-lesson-sidebar {
    align-self: start;
    position: sticky;
    top: var(--cpe-space-md);
    max-height: calc(100vh - 2 * var(--cpe-space-md));
    overflow-y: auto;
}

.cpe-lesson-shell--no-sidebar {
    grid-template-columns: minmax(0, 1fr);
}

/* The theme keeps its own content; the controls appended at wp_footer stay in view. */
@media (min-width: 768px) {
    body.cpe-lesson-has-external-shell {
        padding-inline-start: min(19rem, 25vw);
    }

    .cpe-lesson-external-shell .cpe-lesson-sidebar {
        position: fixed;
        z-index: 10;
        inset-inline-start: 0;
        top: var(--cpe-space-md);
        width: min(19rem, 25vw);
        box-sizing: border-box;
        padding: var(--cpe-space-md);
        background: var(--cpe-surface);
    }
}

@media (max-width: 767px) {
    .cpe-lesson-external-shell .cpe-curriculum-trigger {
        display: inline-block;
        position: fixed;
        z-index: 20;
        top: var(--cpe-space-md);
        inset-inline-start: var(--cpe-space-md);
        padding: var(--cpe-space-sm) var(--cpe-space-md);
        border: 1px solid var(--cpe-border-color);
        border-radius: var(--cpe-radius);
        background: var(--cpe-surface);
        color: var(--cpe-text);
    }
}

.cpe-lesson-nav--sticky {
    position: fixed;
    z-index: 20;
    inset-inline: 0;
    bottom: 0;
    min-height: 0;
    max-height: 50vh;
    box-sizing: border-box;
    overflow-y: auto;
    padding: var(--cpe-space-sm) var(--cpe-space-md) calc(var(--cpe-space-sm) + env(safe-area-inset-bottom));
    background: var(--cpe-surface);
    border-top: 1px solid var(--cpe-border-color);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}

.cpe-lesson-nav--sticky .cpe-nav {
    justify-content: center;
    margin: 0;
}

.cpe-lesson-nav-spacer {
    display: block;
    flex: 0 0 auto;
    clear: both;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}

.cpe-curriculum-trigger {
    display: none;
}

.cpe-curriculum-trigger--widget {
    display: inline-block;
    justify-self: start;
    padding: var(--cpe-space-sm) var(--cpe-space-md);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    color: var(--cpe-text);
}

.cpe-curriculum-drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(22rem, 90vw);
    max-width: 90vw;
    max-height: 100vh;
    margin: 0;
    padding: var(--cpe-space-md);
    border: 0;
    background: var(--cpe-surface);
    color: var(--cpe-text);
    overflow-y: auto;
}

.cpe-curriculum-drawer::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.cpe-curriculum-drawer__close {
    margin-block-end: var(--cpe-space-md);
}

.cpe-curriculum-trigger:focus-visible,
.cpe-curriculum-drawer__close:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

/* ===================================================================
 * Waiting popup — a lesson that is not open YET.
 *
 * The learner stays on the lesson page and sees this popup: the deny
 * reason, the countdown, and a CTA. The lesson body behind it stays
 * blanked — the popup never carries the lesson.
 * =================================================================== */

.cpe-waiting {
    width: min(26rem, 92vw);
    max-width: 92vw;
    margin: auto;
    padding: var(--cpe-space-lg);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    color: var(--cpe-text);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    text-align: left;
}

.cpe-waiting::backdrop {
    background: rgba(15, 23, 42, 0.55);
}

.cpe-waiting__title {
    margin: 0 0 var(--cpe-space-sm);
    font-size: var(--cpe-font-size-section);
    font-weight: 700;
    line-height: 1.3;
}

.cpe-waiting__reason {
    margin: 0 0 var(--cpe-space-md);
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-title);
}

.cpe-waiting__countdown {
    margin: 0 0 var(--cpe-space-lg);
    font-size: var(--cpe-font-size-section);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cpe-waiting__countdown .cpe-countdown__label {
    color: var(--cpe-current);
}

.cpe-waiting__actions {
    display: flex;
    align-items: center;
    gap: var(--cpe-space-md);
    margin: 0;
}

.cpe-waiting__cta {
    display: inline-block;
    padding: var(--cpe-space-sm) var(--cpe-space-md);
    border-radius: var(--cpe-radius);
    background: var(--cpe-current);
    color: var(--cpe-surface);
    font-weight: 600;
    text-decoration: none;
}

.cpe-waiting__cta:hover,
.cpe-waiting__cta:focus-visible {
    text-decoration: underline;
}

.cpe-waiting__close {
    padding: var(--cpe-space-sm) var(--cpe-space-sm);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    color: var(--cpe-muted);
    cursor: pointer;
    font: inherit;
}

.cpe-waiting__close:hover {
    color: var(--cpe-text);
}

.cpe-waiting__cta:focus-visible,
.cpe-waiting__close:focus-visible {
    outline: none;
    box-shadow: var(--cpe-focus-ring);
}

/* ===================================================================
 * Lesson navigator — the curriculum outline.
 *
 * The outline is an accordion of numbered SECTIONS. A section is
 * visibly a section: it carries a rule under it, a numbered badge, a
 * title that is LARGER than a Lesson title, and its Lessons are
 * indented under it.
 *
 * The outline ships in THREE templates — `soft-card` (the default),
 * `timeline` and `compact`. They are the SAME markup, so a template
 * can only REARRANGE the outline, never change what the learner sees.
 * The template is a class on the outline's root:
 *
 *   .cpe-curriculum--template-soft-card
 *   .cpe-curriculum--template-timeline
 *   .cpe-curriculum--template-compact
 *
 * The type scale is EXPLICIT. The theme's own sizes must not reach the
 * outline: with the inherited size a section title and a Lesson title
 * come out the same size, and the reader cannot tell a section from a
 * Lesson. The scale is:
 *
 *   section title   15px / 600 / sentence case
 *   Lesson title    14px / 500
 *   numbers, meta   12px
 *
 * A section title is written as a SENTENCE. The outline never shouts.
 *
 * The status icon IS the status: one inline SVG per state, coloured with
 * `currentColor` so the `--cpe-*` tokens re-skin it.
 * =================================================================== */

.cpe-curriculum {
    color: var(--cpe-text);
    font-size: var(--cpe-font-size-title);
    line-height: 1.45;
}

/* ---------------------------------------------------------------------
 * The soft card's own card.
 *
 * Mẫu 1 — the soft card — is a CARD: a surface, a border, a radius and a
 * soft shadow, with the outline inside it. The other two templates stay
 * bare lists, so the card belongs to this template alone.
 * --------------------------------------------------------------------- */
.cpe-curriculum--template-soft-card {
    padding: 1.125rem 1rem 0.875rem;
    border: 1px solid var(--cpe-border-color);
    border-radius: 16px;
    background: var(--cpe-surface);
    box-shadow: var(--cpe-shadow-card);
}

/* The outline's boxes are sized with their padding AND their border
 * INCLUDED. With the default `content-box` a fixed-width box that also
 * carries a padding is WIDER than the grid track it sits in: the collapse
 * chevron is `1.5rem` wide and pads `0.25rem` on each side, so it hung
 * 8px over the outline's right edge. The timeline's nodes paid the same
 * price — their 2px border pushed them 2px off the rail they ride. */
.cpe-curriculum *,
.cpe-curriculum *::before,
.cpe-curriculum *::after {
    box-sizing: border-box;
}

.cpe-curriculum__items,
.cpe-curriculum__lessons {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The heading of the PHP fallback's outline. The Elementor surface carries
 * the same heading as a stock Elementor heading widget. */
.cpe-curriculum__heading {
    margin: 0 0 var(--cpe-space-sm);
    font-size: 1.25rem;
    font-weight: 700;
}

/* The Course name, when the navigator carries it. */
.cpe-curriculum__course {
    margin: 0 0 var(--cpe-space-sm);
    color: var(--cpe-text);
    font-size: var(--cpe-font-size-section);
    font-weight: 600;
    line-height: 1.35;
}

/* ---------------------------------------------------------------------
 * The course header — the block Mẫu 1 opens with.
 *
 * It names the Course and reports how far the learner has come: the
 * eyebrow, the Course name, the progress ring, the progress bar, the
 * instructor and the Course's totals. Every part that has nothing to
 * report is ABSENT from the markup, so there is no empty line to style.
 * --------------------------------------------------------------------- */
.cpe-curriculum__header {
    margin-bottom: var(--cpe-space-xs);
}

.cpe-curriculum__header-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--cpe-space-sm);
}

.cpe-curriculum__header-text {
    min-width: 0;
}

/* The eyebrow says what the block is about: the Course. It is small,
 * uppercase and muted so it never competes with the Course name. */
.cpe-curriculum__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-eyebrow);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

/* Inside the header the Course name wears the header's own step of the
 * type scale — smaller than a section title, larger than a Lesson title.
 * Outside it — the timeline and the compact list — the name keeps the
 * section step. */
.cpe-curriculum__header .cpe-curriculum__course {
    margin: 0;
    font-size: var(--cpe-font-size-course);
}

/* The ring is a donut that fills as the learner completes Lessons, with
 * the percentage in its middle. */
.cpe-curriculum__ring {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
}

.cpe-curriculum__ring-chart {
    width: 46px;
    height: 46px;
    transform: rotate(-90deg);
}

.cpe-curriculum__ring-track {
    stroke: var(--cpe-border-color);
}

.cpe-curriculum__ring-fill {
    stroke: var(--cpe-current);
}

/* An empty ring must read as empty: a round cap on a zero-length arc
 * would still paint a dot in the accent colour. */
.cpe-curriculum__ring-fill--flat {
    stroke-linecap: butt;
}

.cpe-curriculum__ring-value {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-meta);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* The bar carries the same figure as the ring, as a line. Its width is
 * the one presentational value in the markup — the figure is data. */
.cpe-curriculum__bar {
    display: block;
    height: 5px;
    margin: 14px 0 12px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--cpe-surface-muted);
}

.cpe-curriculum__bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--cpe-current);
}

/* The footer carries the instructor and the Course's totals on one line,
 * and closes the header with a rule. */
.cpe-curriculum__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cpe-border-color);
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-meta);
}

.cpe-curriculum__instructor {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.cpe-curriculum__instructor-avatar {
    display: inline-flex;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--cpe-surface-muted);
}

.cpe-curriculum__instructor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cpe-curriculum__instructor-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--cpe-font-size-title);
    font-weight: 400;
}

.cpe-curriculum__totals {
    margin-left: auto;
    white-space: nowrap;
    font-size: var(--cpe-font-size-title);
    font-weight: 400;
}

/* The section. It carries NO rule of its own: the outline is one
 * continuous list, and space is what separates one section from the next.
 * The card's only horizontal rule is the header's — the one that says
 * "the header ends here". */
.cpe-curriculum__topic {
    padding-bottom: var(--cpe-space-sm);
}

.cpe-curriculum__topic + .cpe-curriculum__topic {
    margin-top: var(--cpe-space-md);
}

/* The summary is the section header. The native disclosure marker is
 * hidden because the chevron replaces it.
 *
 * The header is a GRID with named areas, so every template can place the
 * number, the title, the meta line and the chevron without touching the
 * markup. The default arrangement is Mẫu 1 — the number, the title and
 * the chevron on the first line, the meta line under the title.
 *
 * The section header — the chevron's column follows the chevron. */
.cpe-curriculum__topic-summary {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    grid-template-areas:
        "num  title chev"
        ".    meta  meta";
    align-items: center;
    gap: 0.2rem 0.65rem;
    padding: 0.7rem 0 0.55rem;
    cursor: pointer;
    font-size: var(--cpe-font-size-section);
    font-weight: 600;
    line-height: 1.35;
    list-style: none;
}

.cpe-curriculum__topic-summary::-webkit-details-marker {
    display: none;
}

.cpe-curriculum__topic-summary::marker {
    content: "";
}

.cpe-curriculum__topic-summary:focus-visible {
    outline: 2px solid var(--cpe-focus-ring-color, var(--cpe-accent));
    outline-offset: 2px;
    border-radius: var(--cpe-radius);
}

/* The section number is a BADGE — the clearest sign that the row opens a
 * section and is not a Lesson. */
.cpe-curriculum__topic-number {
    grid-area: num;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--cpe-current-tint);
    color: var(--cpe-current);
    font-size: var(--cpe-font-size-meta);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* The section title is a SENTENCE — never shouted. */
.cpe-curriculum__topic-title {
    grid-area: title;
    min-width: 0;
    color: var(--cpe-text);
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-wrap: balance;
}

/* The chevron is the collapse control — it has to read as a control, not
 * as a stray mark, so it is a circle that lights up on hover. */
.cpe-curriculum__chevron {
    grid-area: chev;
    --cpe-icon-size: 1.5rem;
    width: var(--cpe-icon-size);
    height: var(--cpe-icon-size);
    padding: 0.25rem;
    border-radius: 50%;
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
    font-size: calc(var(--cpe-icon-size) * var(--cpe-icon-glyph-ratio, 0.75));
    transition: transform var(--cpe-motion-duration) ease;
}

.cpe-curriculum__topic-summary:hover .cpe-curriculum__chevron {
    color: var(--cpe-text);
}

/* The `open` attribute lives on the `<details>` INSIDE the section, so the
 * selector reaches through it — `.cpe-curriculum__topic[open]` never
 * matched and the chevron never turned. */
.cpe-curriculum__topic > details[open] > .cpe-curriculum__topic-summary .cpe-curriculum__chevron {
    transform: rotate(180deg);
}

/* The meta line — completed / total and the section's total duration. It
 * lives INSIDE the header, so it stays visible when the section is
 * collapsed. */
.cpe-curriculum__topic-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-meta);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.cpe-curriculum__topic-progress {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--cpe-surface-muted);
    font-weight: 500;
}

/* The section's total duration wears a CLOCK — the glyph says "this is
 * a length". It replaces the bar that used to separate the count from
 * the duration, so the meta line reads `0/4 🕐 21:46`. */
.cpe-curriculum__topic-duration {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cpe-curriculum__topic-duration-icon {
    --cpe-icon-size: 13px;
    width: var(--cpe-icon-size);
    height: var(--cpe-icon-size);
    font-size: calc(var(--cpe-icon-size) * var(--cpe-icon-glyph-ratio, 0.75));
    opacity: 0.75;
}

/* The Lessons of a section are indented under it, so the nesting is
 * visible without reading the numbers. The thin rule down the left is the
 * guide the eye follows from the section to its Lessons. */
.cpe-curriculum__lessons {
    margin-left: 0.75rem;
    padding-left: 0.85rem;
    border-left: 1px solid var(--cpe-border-color);
}

/* The lesson row — the icon's column follows the icon. */
.cpe-curriculum__lesson {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "icon main meta";
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.45rem;
    border-radius: var(--cpe-radius);
}

.cpe-curriculum__lesson--current {
    background: var(--cpe-current-tint);
}

.cpe-curriculum__lesson-main {
    grid-area: main;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    min-width: 0;
}

.cpe-curriculum__lesson-number {
    flex: 0 0 auto;
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-title);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.cpe-curriculum__lesson-title {
    min-width: 0;
    color: var(--cpe-text);
    font-size: var(--cpe-font-size-title);
    font-weight: 500;
    text-wrap: balance;
}

.cpe-curriculum__lesson-meta {
    grid-area: meta;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--cpe-muted);
    font-size: var(--cpe-font-size-meta);
    font-variant-numeric: tabular-nums;
}

/* The status icon is the FIRST column of the row — it is the state, and
 * every template gives it the same place. It rides a soft disc so the
 * eye finds it without reading the row. */
.cpe-curriculum__lesson-icon {
    grid-area: icon;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    --cpe-icon-size: 1.25rem;
    width: var(--cpe-icon-size);
    height: var(--cpe-icon-size);
    border-radius: 50%;
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
}

/* The glyph inside an icon slot. An SVG icon fills the slot; a font icon
 * draws at the slot's share of it. */
.cpe-curriculum__icon {
    width: 100%;
    height: 100%;
    font-size: calc(var(--cpe-icon-size, 1em) * var(--cpe-icon-glyph-ratio, 0.75));
}

/* A FONT glyph is text in a box, not a replaced element: `width` and
 * `height` do not lay it out, and it would sit in the corner of the slot.
 * A font icon therefore centres itself in the slot it was given — an SVG
 * icon is left alone, because an SVG fills the box it is handed.
 *
 * A font icon can be chosen for ANY of the three slots, so all three are
 * named here: the glyph inside the Lesson disc, the chevron, and the
 * clock beside a section's duration. */
.cpe-curriculum__icon:not(svg),
.cpe-curriculum__chevron:not(svg),
.cpe-curriculum__topic-duration-icon:not(svg) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cpe-curriculum__lesson-duration {
    flex: 0 0 auto;
    font-size: var(--cpe-font-size-title);
    font-weight: 400;
}

/* The countdown sits in the right-hand slot of the row — next to the
 * duration, on a Lesson that waits for a known unlock time. The value is
 * ticked by the frontend script. */
.cpe-curriculum__lesson-countdown {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    gap: 0.2rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--cpe-current-tint);
    color: var(--cpe-current);
    font-size: var(--cpe-font-size-meta);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cpe-curriculum__lesson-countdown-label {
    color: var(--cpe-muted);
    font-weight: 400;
}

/* The assignment badge rides in the same right-hand slot as the duration —
 * it IS the row's answer about the homework, so it takes the duration's
 * place rather than crowding the row next to it. The state is an attribute,
 * so a theme can colour the badge without parsing its text. */
.cpe-curriculum__lesson-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    font-size: var(--cpe-font-size-meta);
    font-weight: 600;
    white-space: nowrap;
}

/* The badge's COLOURS are the core's, and they are shared: the Lesson
 * Navigator, a form, a notification — every surface that shows the
 * homework's standing wears this class and carries the state attribute,
 * so the two read exactly the same. The shape stays with the surface. */
.cpe-assignment-badge {
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
}

/* The work was accepted — the same green the completed Lesson wears. */
.cpe-assignment-badge[data-cpe-assignment-state="completed"] {
    background: var(--cpe-success-tint);
    color: var(--cpe-success);
}

/* The work is with a grader — the same orange a waiting Lesson wears. */
.cpe-assignment-badge[data-cpe-assignment-state="pending"] {
    background: var(--cpe-current-tint);
    color: var(--cpe-current);
}

/* The work came back and must be redone — the warning colour the core
 * already uses for a notice that needs an answer. */
.cpe-assignment-badge[data-cpe-assignment-state="redo"] {
    background: color-mix(in srgb, var(--cpe-warning) 10%, transparent);
    color: var(--cpe-warning);
}

.cpe-curriculum__lesson--completed .cpe-curriculum__lesson-icon {
    background: var(--cpe-success-tint);
    color: var(--cpe-success);
}

.cpe-curriculum__lesson--current .cpe-curriculum__lesson-icon {
    background: var(--cpe-current-tint);
    color: var(--cpe-current);
}

.cpe-curriculum__lesson--available .cpe-curriculum__lesson-icon {
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
}

.cpe-curriculum__lesson--locked .cpe-curriculum__lesson-icon {
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
}

.cpe-curriculum__lesson--waiting .cpe-curriculum__lesson-icon {
    background: var(--cpe-current-tint);
    color: var(--cpe-current);
}

.cpe-curriculum__lesson-title:hover,
.cpe-curriculum__lesson-title:focus-visible {
    color: var(--cpe-current);
}

/* ===================================================================
 * Mẫu 2 — TIMELINE.
 *
 * The sections hang on ONE vertical rail: the section number is a node
 * on it and the Lessons branch off it. The status icon rides the branch
 * rail, so the row never carries the same state twice.
 * =================================================================== */

.cpe-curriculum--template-timeline .cpe-curriculum__items {
    position: relative;
}

.cpe-curriculum--template-timeline .cpe-curriculum__items::before {
    content: "";
    position: absolute;
    left: 0.9375rem;
    top: 1.1rem;
    bottom: 1.1rem;
    width: 2px;
    border-radius: 2px;
    background: var(--cpe-border-color);
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic {
    padding-bottom: 0;
    border-bottom: 0;
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic + .cpe-curriculum__topic {
    margin-top: 0.2rem;
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic-summary {
    grid-template-columns: 2rem minmax(0, 1fr) auto auto;
    grid-template-areas: "num title meta chev";
    gap: 0 0.7rem;
    padding: 0.55rem 0;
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic-number {
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--cpe-border-color);
    background: var(--cpe-surface);
    color: var(--cpe-muted);
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic-meta {
    justify-content: flex-end;
}

.cpe-curriculum--template-timeline .cpe-curriculum__topic-progress {
    background: transparent;
    padding: 0;
}

.cpe-curriculum--template-timeline .cpe-curriculum__lessons {
    position: relative;
    margin: 0;
    padding: 0 0 0.75rem 3.625rem;
    border-left: 0;
}

/* The branch rail: it leaves the section's rail and carries the Lesson
 * icons down the outline. */
.cpe-curriculum--template-timeline .cpe-curriculum__lessons::before {
    content: "";
    position: absolute;
    left: 4.1875rem;
    top: 0;
    bottom: 0.9rem;
    width: 2px;
    border-radius: 2px;
    background: var(--cpe-border-color);
}

.cpe-curriculum--template-timeline .cpe-curriculum__lessons::after {
    content: "";
    position: absolute;
    left: 1rem;
    top: 0;
    width: 3.25rem;
    height: 2px;
    background: var(--cpe-border-color);
}

/* The Lesson row carries NO horizontal padding in this template: the
 * status icon rides the branch rail, and a padding would push the icon
 * off the rail it is supposed to hang on. */
.cpe-curriculum--template-timeline .cpe-curriculum__lesson {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0.25rem 0;
}

.cpe-curriculum--template-timeline .cpe-curriculum__lesson-icon {
    border: 2px solid var(--cpe-border-color);
    background: var(--cpe-surface);
}

.cpe-curriculum--template-timeline .cpe-curriculum__lesson--completed .cpe-curriculum__lesson-icon {
    border-color: var(--cpe-success);
    background: var(--cpe-success);
    color: var(--cpe-surface);
}

.cpe-curriculum--template-timeline .cpe-curriculum__lesson--current .cpe-curriculum__lesson-icon {
    border-color: var(--cpe-current);
    background: var(--cpe-current);
    color: var(--cpe-surface);
}

.cpe-curriculum--template-timeline .cpe-curriculum__lesson--waiting .cpe-curriculum__lesson-icon {
    border-color: var(--cpe-current);
    background: var(--cpe-surface);
    color: var(--cpe-current);
}

/* ===================================================================
 * Mẫu 3 — COMPACT LIST.
 *
 * The densest arrangement: the section title and its meta share one line
 * and the Lessons are tight rows. For a Course with many sections.
 * =================================================================== */

.cpe-curriculum--template-compact .cpe-curriculum__topic {
    padding-bottom: 0.35rem;
}

.cpe-curriculum--template-compact .cpe-curriculum__topic + .cpe-curriculum__topic {
    margin-top: 0.35rem;
}

.cpe-curriculum--template-compact .cpe-curriculum__topic-summary {
    grid-template-columns: 1.2rem minmax(0, 1fr) auto auto;
    grid-template-areas: "num title meta chev";
    gap: 0 0.5rem;
    padding: 0.55rem 0 0.4rem;
}

.cpe-curriculum--template-compact .cpe-curriculum__topic-number {
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 5px;
    background: var(--cpe-surface-muted);
    color: var(--cpe-muted);
    font-size: 0.6875rem;
}

.cpe-curriculum--template-compact .cpe-curriculum__topic-meta {
    justify-content: flex-end;
}

.cpe-curriculum--template-compact .cpe-curriculum__topic-progress {
    background: transparent;
    padding: 0;
}

.cpe-curriculum--template-compact .cpe-curriculum__chevron {
    --cpe-icon-size: 1.25rem;
    width: var(--cpe-icon-size);
    height: var(--cpe-icon-size);
    padding: 0.2rem;
}

.cpe-curriculum--template-compact .cpe-curriculum__lessons {
    margin: 0;
    padding: 0 0 0.35rem 1.7rem;
    border-left: 0;
}

.cpe-curriculum--template-compact .cpe-curriculum__lesson {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "main meta icon";
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-top: 1px dashed var(--cpe-border-color);
    border-radius: 0;
}

@media (max-width: 767px) {
    .cpe-lesson-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .cpe-lesson-sidebar {
        display: none;
    }

    .cpe-curriculum-trigger {
        display: inline-block;
        justify-self: start;
        padding: var(--cpe-space-sm) var(--cpe-space-md);
        border: 1px solid var(--cpe-border-color);
        border-radius: var(--cpe-radius);
        background: var(--cpe-surface);
        color: var(--cpe-text);
    }

    .cpe-lesson-nav--sticky .cpe-nav {
        flex-direction: row;
        justify-content: space-between;
    }

    .cpe-lesson-nav--sticky .cpe-nav__current,
    .cpe-lesson-nav--sticky .cpe-nav__denied,
    .cpe-lesson-nav--sticky .cpe-nav__prev[aria-disabled="true"],
    .cpe-lesson-nav--sticky .cpe-nav__next[aria-disabled="true"] {
        display: none;
    }

    .cpe-lesson-nav--sticky .cpe-nav__prev,
    .cpe-lesson-nav--sticky .cpe-nav__next {
        font-size: 0;
        min-width: 2.75rem;
        min-height: 2.75rem;
        text-align: center;
    }

    .cpe-lesson-nav--sticky .cpe-nav__prev::before {
        content: "\2190";
        font-size: 1.25rem;
    }

    .cpe-lesson-nav--sticky .cpe-nav__next::before {
        content: "\2192";
        font-size: 1.25rem;
    }
}

/* ===================================================================
 * Reduced motion — scoped to CPE components (no `*` selector).
 * Setting `--cpe-motion-duration: 0ms` on `:root` is the canonical
 * way for a child theme to opt out of transitions; this media query
 * keeps the same contract for users who set their OS-level preference.
 * =================================================================== */

@media (prefers-reduced-motion: reduce) {
    .cpe-progress,
    .cpe-nav a,
    .cpe-countdown,
    .cpe-cta,
    .cpe-cta__link,
    .cpe-courses__list,
    .cpe-course-card,
    .cpe-course-card__cta,
    .cpe-status,
    .cpe-locked-notice,
    .cpe-locked-cta,
    .cpe-lesson-player {
        transition-duration: var(--cpe-motion-duration, 0ms);
    }
}

/* ===================================================================
 * Narrow-screen layout — flex nav to a column, cards to a single
 * column. No fixed horizontal width; the parent block's available
 * width is respected.
 * =================================================================== */

@media (max-width: 480px) {
    .cpe-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .cpe-courses__list {
        grid-template-columns: 1fr;
    }
}

/* ===================================================================
 * The 1.12.0 lesson surface — the video block, the lesson body, the
 * course card and the assignment pane.
 *
 * These four blocks are the data half of the EDEARN-style lesson page.
 * The Elementor template and the PHP fallback render the **same**
 * markup through the same renderer classes, so one set of rules serves
 * both surfaces.
 *
 * The video block scales with its column through the `aspect-ratio`
 * the widget control emits — the rules below only make the player fill
 * that box. Nothing here sets a fixed width, so a 100 %-wide mobile
 * column cannot overflow.
 * =================================================================== */

.cpe-lesson-video {
    position: relative;
    width: 100%;
    margin-block-end: var(--cpe-space-md);
    overflow: hidden;
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
}

.cpe-lesson-video__player {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.cpe-lesson-video__player > * {
    display: block;
    width: 100%;
    height: 100%;
}

.cpe-lesson-video__player iframe,
.cpe-lesson-video__player video {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

/* The lesson body — the *Nội dung* pane. */
.cpe-lesson-description {
    color: var(--cpe-text);
    line-height: 1.6;
}

.cpe-lesson-description > *:first-child {
    margin-block-start: 0;
}

.cpe-lesson-description > *:last-child {
    margin-block-end: 0;
}

/* The course card — the sidebar's second block. */
.cpe-course-summary {
    margin-block-start: var(--cpe-space-md);
    padding: var(--cpe-space-md);
    border: 1px solid var(--cpe-border-color);
    border-radius: var(--cpe-radius);
    background: var(--cpe-surface);
    color: var(--cpe-text);
}

.cpe-course-summary__title {
    margin: 0 0 var(--cpe-space-sm);
    font-size: 1.05rem;
    line-height: 1.3;
}

.cpe-course-summary__progress {
    display: flex;
    align-items: center;
    gap: var(--cpe-space-sm);
    margin-block: var(--cpe-space-sm);
    padding: var(--cpe-space-xs) var(--cpe-space-sm);
    border-radius: var(--cpe-radius);
    background: var(--cpe-border-color);
    font-size: 0.9rem;
}

.cpe-course-summary__progress-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cpe-course-summary__instructor {
    display: flex;
    align-items: center;
    gap: var(--cpe-space-sm);
    margin-block-start: var(--cpe-space-sm);
    font-size: 0.9rem;
}

.cpe-course-summary__instructor-avatar img {
    display: block;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    object-fit: cover;
}

.cpe-course-summary__instructor-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* The assignment pane — the *Bài tập* pane. */
.cpe-lesson-exercise {
    margin-block-start: var(--cpe-space-md);
    color: var(--cpe-text);
    line-height: 1.6;
}

.cpe-lesson-exercise > *:first-child {
    margin-block-start: 0;
}

.cpe-lesson-exercise > *:last-child {
    margin-block-end: 0;
}

/* The model answer of an open assignment — the reference answer the
   learner reads once they completed the lesson. The title is sized by
   the stylesheet (1.5rem = 24px): a bare `<p>` inherits the theme's
   paragraph scale, so the block would read as body text instead of a
   heading. The BODY inherits the lesson's own typography — it is lesson
   content, and a muted 14px would read as an aside. The add-on that
   owns the pane may restyle the title to match its own surface. */
.cpe-lesson-model-answer {
    margin-block-start: var(--cpe-space-lg);
}

.cpe-lesson-model-answer__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.cpe-lesson-model-answer__body {
    margin-block-start: 5px;
}
