/* ============================================
   Course Detail Page - Code Blue Academy
   BEM block: cd (course detail)
   ============================================ */


/* ===== 1. HERO ===== */

.cd-hero {
    position: relative;
    background-color: var(--color-midnight-950);
    padding-block: var(--space-16) var(--space-20);
    overflow: hidden;
}

/* Brand pattern overlay */
.cd-hero__pattern {
    position: absolute;
    inset: 0;
    background-image: url("/static/images/patterns/Code_Blue_Academy_Pattern_Update_5-02.66f68157fc33.png");
    background-size: 400px;
    background-repeat: repeat;
    opacity: 0.06;
    pointer-events: none;
}

.cd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 15% 50%, rgba(193, 0, 0, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 85% 50%, rgba(68, 120, 204, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cd-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--color-midnight-900));
    pointer-events: none;
    z-index: 1;
}

.cd-hero__ecg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 120px;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
}

/* Breadcrumbs: the shared trail (includes/_breadcrumbs.html, .breadcrumbs
   in _components.css), set in the hero as on a training course page. */
.cd-hero__breadcrumbs {
    position: relative;
    /* Over the hero's pattern, glow and heartbeat line (positioned, no
       z-index), so the links take the pointer. */
    z-index: var(--z-raised);
    margin-block-end: var(--space-6);
}

.cd-hero__breadcrumbs .breadcrumbs {
    padding-block: 0;
}

.cd-hero__breadcrumbs .breadcrumbs a:hover {
    color: var(--color-white);
}

.cd-hero__breadcrumbs .breadcrumbs__separator {
    color: var(--color-midnight-600);
}

/* Grid layout */
.cd-hero__grid {
    display: grid;
    gap: var(--space-12);
    align-items: center;
}

@media (min-width: 64em) {
    .cd-hero__grid {
        grid-template-columns: 1fr 400px;
    }
}

/* Badges row */
.cd-hero__badges {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-4);
}

.cd-hero__category {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    /* The category colour mixed 45% into white (the catalog card's recipe):
       the colour itself on a tint of itself was 2.84:1 for a red category. */
    color: color-mix(in srgb, rgb(var(--cc)) 45%, var(--color-white));
    background: rgba(var(--cc), 0.12);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

.cd-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    color: var(--badge-color, var(--color-white));
    background: color-mix(in srgb, var(--badge-color, #fff) 20%, transparent);
}

.cd-hero__badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: cd-badge-pulse 1.5s ease-in-out infinite;
}

@keyframes cd-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Title */
.cd-hero__title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--color-white);
    margin-block-end: var(--space-4);
}

@media (min-width: 48em) {
    .cd-hero__title {
        font-size: var(--text-4xl);
    }
}

.cd-hero__subtitle {
    font-family: var(--font-reading);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-400);
    margin-block-end: var(--space-6);
}

/* Instructor in hero */
.cd-hero__instructor {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-end: var(--space-6);
}

.cd-hero__instructor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--color-midnight-800);
    border: 2px solid rgba(var(--cc), 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: rgb(var(--cc));
    overflow: hidden;
    flex-shrink: 0;
}

.cd-hero__instructor-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cd-hero__instructor-info {
    display: flex;
    flex-direction: column;
}

.cd-hero__instructor-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-white);
}

.cd-hero__instructor-title {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Stats row */
.cd-hero__stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-4) var(--space-6);
    margin-block-end: var(--space-8);
    padding-block: var(--space-4);
    border-top: 1px solid var(--color-midnight-800);
    border-bottom: 1px solid var(--color-midnight-800);
}

.cd-hero__stat {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--color-slate-300);
}

.cd-hero__stat strong {
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.cd-hero__stat svg {
    color: var(--color-slate-500);
    flex-shrink: 0;
}

.cd-hero__stat-label {
    color: var(--text-muted);
}

/* The review count opens the Reviews section. */
.cd-hero__stat-link {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cd-hero__stat-link:hover {
    color: var(--link-hover);
}

.cd-hero__stars {
    color: var(--neon-gold);
    letter-spacing: var(--tracking-wider);
}

/* CTA */
.cd-hero__actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.cd-hero__price-note {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* An Exam Only course gives no certificate: under the button. */
.cd-hero__exam-only {
    margin-block: var(--space-3) 0;
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-slate-300);
}

/* A link inside a note beside a button (the reason it is disabled, and
   where the fix is): the site's link colour, underlined. */
.cd-note-link {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cd-note-link:hover {
    color: var(--link-hover);
}

/* Hero image card */
.cd-hero__image-card {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--color-midnight-800);
    border: 2px solid rgb(var(--cc));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(var(--cc), 0.25),
        0 0 80px rgba(var(--cc), 0.08);
}

.cd-hero__image-placeholder {
    color: rgba(var(--cc), 0.4);
}

.cd-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ===== 2. STICKY BAR ===== */

/* Under the sticky site header (--site-header-h, courses.css: the header
   is 79 to 130 px tall and opaque, so at top: 0 the bar was drawn wholly
   behind it). It slides out from behind the header, which stays above it. */
.cd-sticky {
    position: fixed;
    top: var(--site-header-h);
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-midnight-800);
    padding-block: var(--space-3);
}

.cd-sticky__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.cd-sticky__title {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

@media (min-width: 48em) {
    .cd-sticky__title {
        font-size: var(--text-base);
    }
}

.cd-sticky__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.cd-sticky__price {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
}

.cd-sticky__price--free {
    color: var(--status-ok); /* 8.52:1 on its tint over the bar; --color-success-600 was 4.24:1 */
    background: rgba(13, 148, 136, 0.15);
}

.cd-sticky__price--premium {
    color: var(--neon-gold);
    background: rgba(234, 179, 8, 0.15);
}

/* On a phone the pill's longest label, Included With Pro, takes two lines
   (as on the catalog card): on one line it left the course title 8 px of
   the bar at 375 and pushed the button past the edge at 320. */
@media (max-width: 48em) {
    .cd-sticky__price {
        max-width: var(--space-24);
        text-align: center;
    }
}

/* Transitions */
.cd-sticky--enter { transition: all var(--duration-normal) ease; }
.cd-sticky--enter-start { opacity: 0; transform: translateY(-100%); }
.cd-sticky--enter-end { opacity: 1; transform: translateY(0); }
.cd-sticky--leave { transition: all var(--duration-fast) ease; }
.cd-sticky--leave-start { opacity: 1; transform: translateY(0); }
.cd-sticky--leave-end { opacity: 0; transform: translateY(-100%); }


/* ===== 3. VERTICAL TABS ===== */

.cd-tabs {
    position: relative;
    background: var(--color-midnight-900);
    padding-block: var(--space-16);
    /* A link to a section scrolls here: clear of the site header, with the
       tab row below the sticky enroll bar. */
    scroll-margin-top: calc(var(--site-header-h) + var(--space-4));
}

.cd-tabs::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--color-midnight-950));
    pointer-events: none;
    z-index: 0;
}

/* Layout: horizontal tabs above content */
.cd-tabs__layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* Tab navigation — horizontal bar */
.cd-tabs__nav {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-block-end: var(--space-4);
    border-bottom: 1px solid var(--color-midnight-700);
}

.cd-tabs__nav::-webkit-scrollbar {
    display: none;
}

.cd-tabs__btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    background: none;
    color: var(--text-muted);
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    white-space: nowrap;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    transition: all var(--duration-fast) var(--ease-default);
    position: relative;
}

.cd-tabs__btn::after {
    content: '';
    position: absolute;
    bottom: calc(-1 * var(--space-4));
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    transition: background var(--duration-fast) var(--ease-default);
}

.cd-tabs__btn:hover {
    color: var(--color-slate-300);
    background: rgba(255, 255, 255, 0.03);
}

.cd-tabs__btn--active {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.04);
}

.cd-tabs__btn--active::after {
    background: linear-gradient(90deg, #C10000, #4478CC);
}

.cd-tabs__btn--active svg {
    color: rgb(68, 120, 204);
}

/* Panels */
.cd-tabs__panels {
    min-width: 0; /* prevent grid blowout */
}

.cd-tabs__panel {
    /* no extra padding — content styles handle it */
}

/* Panel transitions */
.cd-tabs__panel--enter {
    transition: opacity var(--duration-normal) ease, transform var(--duration-normal) ease;
}

.cd-tabs__panel--enter-start {
    opacity: 0;
    transform: translateY(8px);
}

.cd-tabs__panel--enter-end {
    opacity: 1;
    transform: translateY(0);
}


/* ===== OVERVIEW (inside tab panel) ===== */

.cd-overview__description {
    margin-block-end: var(--space-8);
}

.cd-overview__heading {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-4);
}

.cd-overview__text {
    font-family: var(--font-reading);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-300);
    word-break: break-word;
    overflow-wrap: break-word;
}

.cd-overview__text p {
    max-width: none;
    margin-block-end: var(--space-4);
}

.cd-overview__text--collapsed {
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.cd-overview__text--collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--color-midnight-900));
    pointer-events: none;
}

.cd-overview__expand {
    background: none;
    border: none;
    color: var(--link);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    padding: var(--space-2) 0;
    transition: color var(--duration-fast) var(--ease-default);
}

.cd-overview__expand:hover {
    color: var(--link-hover);
}

/* Tags */
.cd-overview__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-block-start: var(--space-6);
}

.cd-overview__tag {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-slate-400);
    background: var(--color-midnight-800);
    border: 1px solid var(--color-midnight-700);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-default);
}

.cd-overview__tag:hover {
    color: var(--color-white);
    border-color: var(--color-midnight-600);
}


/* ===== 4. CURRICULUM (inside tab panel) ===== */

.cd-curriculum__header {
    margin-block-end: var(--space-8);
}

.cd-curriculum__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-2);
}

.cd-curriculum__summary {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Modules */
.cd-curriculum__modules {
    display: grid;
    gap: var(--space-3);
}

.cd-curriculum__module {
    --cc: var(--curriculum-color, 68, 120, 204);
    background: var(--color-midnight-800);
    border: 2px solid rgb(var(--cc));
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(var(--cc), 0.25),
        0 0 80px rgba(var(--cc), 0.08);
    transition: box-shadow var(--duration-normal) var(--ease-out);
}

.cd-curriculum__module:hover {
    box-shadow:
        0 0 60px rgba(var(--cc), 0.45),
        0 0 120px rgba(var(--cc), 0.15);
}

.cd-curriculum__module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-4) var(--space-5);
    background: none;
    border: none;
    color: var(--color-white);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}

.cd-curriculum__module-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cd-curriculum__module-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.cd-curriculum__module-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: rgb(var(--cc));
    background: rgba(var(--cc), 0.12);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.cd-curriculum__module-title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    color: var(--color-white);
    text-align: left;
}

.cd-curriculum__module-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.cd-curriculum__module-count {
    font-size: var(--text-xs);
    color: var(--text-muted);
    display: none;
}

@media (min-width: 36em) {
    .cd-curriculum__module-count {
        display: inline;
    }
}

.cd-curriculum__chevron {
    color: var(--color-slate-500);
    transition: transform var(--duration-normal) var(--ease-out);
}

.cd-curriculum__chevron--open {
    transform: rotate(180deg);
}

/* Lessons */
.cd-curriculum__lessons {
    border-top: 1px solid var(--color-midnight-700);
}

.cd-curriculum__lesson {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    transition: background var(--duration-fast) var(--ease-default);
}

.cd-curriculum__lesson:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.cd-curriculum__lesson:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cd-curriculum__lesson-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.cd-curriculum__lesson-icon {
    color: var(--color-cb-red);
    flex-shrink: 0;
}

.cd-curriculum__lesson-icon--play {
    color: rgb(34, 197, 94);
}

.cd-curriculum__lesson-title {
    font-size: var(--text-sm);
    color: var(--color-slate-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Below 48em a long lesson name wraps, so all of it can be read (it was
   cut off on one line with no way to see the rest). */
@media (max-width: 48em) {
    .cd-curriculum__lesson {
        gap: var(--space-3);
    }

    .cd-curriculum__lesson-title {
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
    }
}

/* Empty state */
.cd-curriculum__empty {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--color-midnight-800);
    border: 1px solid var(--color-midnight-700);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.cd-curriculum__empty svg {
    margin-block-end: var(--space-4);
    opacity: 0.5;
}

.cd-curriculum__empty-text {
    font-size: var(--text-lg);
    color: var(--color-slate-400);
    margin-block-end: var(--space-2);
}

.cd-curriculum__empty-note {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.cd-curriculum__empty-action {
    margin-block-start: var(--space-4);
}


/* ===== 4b. OBJECTIVES TAB ===== */

.cd-objectives {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cd-objectives__item {
    /* The curriculum module box's glowing border (.cd-curriculum__module). */
    --cc: var(--curriculum-color, var(--color-cb-blue-rgb));
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--color-midnight-800);
    border: 2px solid rgb(var(--cc));
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 40px rgba(var(--cc), 0.25),
        0 0 80px rgba(var(--cc), 0.08);
    font-size: var(--text-base);
    color: var(--color-slate-300);
    line-height: 1.6;
    transition: box-shadow var(--duration-normal) var(--ease-out);
}

.cd-objectives__item:hover {
    box-shadow:
        0 0 60px rgba(var(--cc), 0.45),
        0 0 120px rgba(var(--cc), 0.15);
}

.cd-objectives__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--accent-green-rgb),0.1);
    border: 1px solid rgba(var(--accent-green-rgb),0.25);
    color: var(--neon-emerald);
    margin-top: 2px;
}


/* ===== 4c. PREREQUISITES TAB ===== */

.cd-prereqs__text {
    font-size: var(--text-base);
    color: var(--color-slate-300);
    line-height: 1.7;
    margin-bottom: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: rgba(251,191,36,0.05);
    border: 1px solid rgba(251,191,36,0.15);
    border-radius: var(--radius-md);
    border-left: 3px solid rgba(251,191,36,0.5);
}

.cd-prereqs__courses {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cd-prereqs__course {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    transition: background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.cd-prereqs__course:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.1);
}

.cd-prereqs__check {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cd-prereqs__check--done {
    background: rgba(var(--accent-green-rgb),0.1);
    border: 1px solid rgba(var(--accent-green-rgb),0.3);
    color: var(--neon-emerald);
}

.cd-prereqs__check--pending {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-slate-500);
}

.cd-prereqs__info {
    flex: 1;
    min-width: 0;
}

.cd-prereqs__title {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.cd-prereqs__title:hover {
    color: var(--neon-blue, #60a5fa);
}

.cd-prereqs__meta {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

.cd-prereqs__badge--completed {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    background: rgba(var(--accent-green-rgb),0.1);
    border: 1px solid rgba(var(--accent-green-rgb),0.3);
    color: var(--neon-emerald);
}

.cd-prereqs__badge--required {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--space-1) var(--space-3);
    border-radius: 999px;
    background: rgba(251,191,36,0.1);
    border: 1px solid rgba(251,191,36,0.25);
    color: var(--neon-gold, #fbbf24);
}

@media (max-width: 36em) {
    .cd-prereqs__course {
        flex-wrap: wrap;
    }
    .cd-prereqs__badge {
        margin-left: auto;
    }
}


/* ===== 6. INSTRUCTOR (inside tab panel) ===== */

/* ── Instructor hero card ── */

.cd-instructor__hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    padding: var(--space-6);
    background: var(--color-midnight-800);
    border: 2px solid rgb(var(--cc));
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 40px rgba(var(--cc), 0.25),
        0 0 80px rgba(var(--cc), 0.08);
    margin-block-end: var(--space-6);
}

.cd-instructor__hero-left {
    display: flex;
    gap: var(--space-5);
    align-items: flex-start;
}

.cd-instructor__avatar-wrap {
    flex-shrink: 0;
}

.cd-instructor__photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(var(--cc), 0.5);
    box-shadow: 0 0 20px rgba(var(--cc), 0.15);
}

.cd-instructor__avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: rgba(var(--cc), 0.1);
    border: 3px solid rgba(var(--cc), 0.5);
    box-shadow: 0 0 20px rgba(var(--cc), 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: rgb(var(--cc));
}

.cd-instructor__identity {
    min-width: 0;
}

.cd-instructor__name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-1);
}

.cd-instructor__creds {
    font-weight: var(--weight-regular);
    color: rgb(var(--cc));
}

.cd-instructor__title {
    font-size: var(--text-sm);
    color: var(--color-slate-400);
    margin-block-end: var(--space-2);
}

.cd-instructor__org,
.cd-instructor__location {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-block-end: var(--space-1);
}

.cd-instructor__org svg,
.cd-instructor__location svg {
    flex-shrink: 0;
    color: var(--color-midnight-600);
}

.cd-instructor__socials {
    display: flex;
    gap: var(--space-2);
    margin-block-start: var(--space-3);
}

.cd-instructor__social {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-midnight-700);
    color: var(--color-slate-400);
    transition: all var(--duration-fast) var(--ease-default);
}

.cd-instructor__social:hover {
    background: rgba(var(--cc), 0.15);
    color: rgb(var(--cc));
}

/* ── Stats row ── */

.cd-instructor__stats {
    display: flex;
    gap: var(--space-4);
    padding-block-start: var(--space-5);
    border-top: 1px solid var(--color-midnight-700);
}

.cd-instructor__stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-1);
}

.cd-instructor__stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.cd-instructor__stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
}

/* ── Content section box (always visible with border + glow) ── */

.cd-instructor__section {
    margin-block-end: var(--space-6);
    padding: var(--space-5);
    background: var(--color-midnight-800);
    border: 1px solid rgba(var(--cc), 0.25);
    border-radius: var(--radius-lg);
    box-shadow:
        0 0 30px rgba(var(--cc), 0.1),
        0 0 60px rgba(var(--cc), 0.05);
    transition: box-shadow var(--duration-normal) var(--ease-default),
                border-color var(--duration-normal) var(--ease-default);
}

.cd-instructor__section:hover {
    border-color: rgba(var(--cc), 0.4);
    box-shadow:
        0 0 40px rgba(var(--cc), 0.18),
        0 0 80px rgba(var(--cc), 0.08);
}

/* Section title – static (non-collapsible) boxes */
.cd-instructor__section-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin: 0 0 var(--space-4) 0;
    padding-block-end: var(--space-3);
    border-bottom: 1px solid var(--color-midnight-700);
}

.cd-instructor__section-title svg {
    color: rgb(var(--cc));
    flex-shrink: 0;
}

/* Section header – the toggle of a collapsible box: a button inside the
   heading, so it takes keyboard focus and says whether it is open. */
.cd-instructor__section-heading {
    margin: 0;
}

.cd-instructor__section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    width: 100%;
    min-height: var(--tap-min);
    padding: 0;
    border: none;
    background: none;
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    text-align: left;
    cursor: pointer;
    user-select: none;
    transition: color var(--duration-fast) var(--ease-default);
}

.cd-instructor__section-header:hover {
    color: rgb(var(--cc));
}

.cd-instructor__section-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.cd-instructor__section-header-left svg {
    color: rgb(var(--cc));
    flex-shrink: 0;
}

/* Chevron rotation */
.cd-instructor__chevron {
    color: var(--color-slate-500);
    transition: transform var(--duration-fast) var(--ease-default),
                color var(--duration-fast) var(--ease-default);
    transform: rotate(-90deg);
    flex-shrink: 0;
}

.cd-instructor__chevron--open {
    transform: rotate(0deg);
}

.cd-instructor__section-header:hover .cd-instructor__chevron {
    color: rgb(var(--cc));
}

/* Collapsible body – content below the header */
.cd-instructor__body {
    margin-block-start: var(--space-4);
    padding-block-start: var(--space-4);
    border-top: 1px solid var(--color-midnight-700);
}

.cd-instructor__bio {
    font-family: var(--font-reading);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-300);
}

/* ── Two-column grid (specializations + certifications) ── */

.cd-instructor__grid {
    display: grid;
    gap: var(--space-6);
    margin-block-end: var(--space-6);
}

/* Sections inside the grid don't need bottom margin */
.cd-instructor__grid .cd-instructor__section {
    margin-block-end: 0;
}

@media (min-width: 48em) {
    .cd-instructor__grid {
        grid-template-columns: 1fr 1fr;
    }
}

.cd-instructor__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.cd-instructor__tag {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    background: rgba(var(--cc), 0.15);
    border: 1px solid rgba(var(--cc), 0.3);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
}

.cd-instructor__cert-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: var(--space-2);
}

.cd-instructor__cert-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-slate-300);
}

.cd-instructor__cert-item svg {
    color: rgb(34, 197, 94);
    flex-shrink: 0;
}

/* ── Education ── */

.cd-instructor__education {
    display: grid;
    gap: var(--space-3);
}

.cd-instructor__edu-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) var(--space-4);
    background: rgba(var(--cc), 0.04);
    border: 1px solid var(--color-midnight-700);
    border-radius: var(--radius-md);
}

.cd-instructor__edu-degree {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.cd-instructor__edu-institution {
    font-size: var(--text-xs);
    color: var(--color-slate-400);
    margin-block-start: 2px;
}

/* ── Other courses by instructor ── */

.cd-instructor__other-courses {
    display: grid;
    gap: var(--space-2);
}

.cd-instructor__other-course {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: rgba(var(--cc), 0.04);
    border: 1px solid var(--color-midnight-700);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color var(--duration-fast) var(--ease-default),
                background var(--duration-fast) var(--ease-default);
}

.cd-instructor__other-course:hover {
    border-color: rgba(var(--cc), 0.2);
    background: rgba(var(--cc), 0.08);
}

.cd-instructor__other-cat {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: color-mix(in srgb, rgb(var(--cc)) 45%, var(--color-white)); /* as .cd-hero__category; was 2.27:1 for red */
    background: rgba(var(--cc), 0.1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.cd-instructor__other-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cd-instructor__other-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

/* Below 48em a long course title wraps, as a lesson name does. */
@media (max-width: 48em) {
    .cd-instructor__other-title {
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
    }
}

/* ── Responsive: stack on mobile ── */

@media (max-width: 35.99em) {
    .cd-instructor__hero-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cd-instructor__org,
    .cd-instructor__location {
        justify-content: center;
    }

    .cd-instructor__socials {
        justify-content: center;
    }

    .cd-instructor__stats {
        flex-wrap: wrap;
    }

    .cd-instructor__stat {
        min-width: calc(50% - var(--space-4));
    }

    .cd-instructor__other-course {
        grid-template-columns: 1fr;
        gap: var(--space-1);
    }
}


/* ===== 7. RELATED COURSES ===== */

.cd-related {
    position: relative;
    background: var(--color-midnight-950);
    padding-block: var(--space-16);
}

.cd-related::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--color-midnight-900));
    pointer-events: none;
    z-index: 0;
}

.cd-related__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block-end: var(--space-8);
}

.cd-related__heading {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.cd-related__link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-default);
    flex-shrink: 0;
}

.cd-related__link:hover {
    color: var(--link-hover);
}

.cd-related__grid {
    display: grid;
    gap: var(--space-6);
    grid-template-columns: 1fr;
}

@media (min-width: 36em) {
    .cd-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 64em) {
    .cd-related__grid {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* ===== 8. BOTTOM CTA ===== */

.cd-cta {
    position: relative;
    background: var(--color-midnight-900);
    padding-block: var(--space-16);
}

.cd-cta__card {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--color-midnight-800);
    border: 1px solid var(--color-midnight-700);
    border-radius: var(--radius-xl);
    max-width: 40rem;
    margin-inline: auto;
}

.cd-cta__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-3);
}

@media (min-width: 48em) {
    .cd-cta__title {
        font-size: var(--text-3xl);
    }
}

.cd-cta__text {
    font-size: var(--text-base);
    color: var(--color-slate-400);
    margin-block-end: var(--space-8);
}

.cd-cta__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Why the card's button is disabled, under the buttons. */
.cd-cta__note {
    max-width: 48ch;
    margin: var(--space-5) auto 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}


/* ===== VIDEO PLAY BUTTON (hero image card) ===== */

.cd-hero__play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.cd-hero__play-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(11, 17, 32, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-normal) var(--ease-out);
}

.cd-hero__play-btn:hover .cd-hero__play-circle {
    background: rgba(193, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(193, 0, 0, 0.4);
}

.cd-hero__play-circle svg {
    color: var(--color-white);
    margin-left: 3px; /* optical centering for play triangle */
}

.cd-hero__play-label {
    position: absolute;
    bottom: var(--space-5);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    background: rgba(11, 17, 32, 0.7);
    backdrop-filter: blur(8px);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
}

/* ===== VIDEO MODAL ===== */

.cd-video-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: var(--z-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
}

.cd-video-modal {
    position: relative;
    width: 100%;
    max-width: 960px;
}

.cd-video-modal__close {
    position: absolute;
    top: calc(-1 * (var(--tap-min) + var(--space-2)));
    right: 0;
    width: var(--tap-min);
    height: var(--tap-min);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-default);
}

.cd-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cd-video-modal__player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cd-video-modal__player video,
.cd-video-modal__player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.cd-video-modal__external {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    width: 100%;
    height: 100%;
    padding: var(--space-6);
    text-align: center;
    color: var(--color-slate-300);
}


/* ===== CURRICULUM TAB (live Canvas outline) ===== */

.cd-curric__syllabus {
    font-family: var(--font-reading);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-300);
    padding: var(--space-5);
    margin-block-end: var(--space-6);
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-md);
    overflow-wrap: break-word;
}

.cd-curric__syllabus a {
    color: var(--color-cb-blue);
    text-decoration: underline;
}

.cd-curric__syllabus ul,
.cd-curric__syllabus ol {
    padding-inline-start: var(--space-6);
    margin-block: var(--space-3);
}

/* Canvas-specific additions to the original .cd-curriculum__* design: the
   item type (replaces the old lesson duration) and module SubHeader rows. */
.cd-curriculum__lesson-type {
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--text-muted);
    flex-shrink: 0;
}

.cd-curriculum__subheader {
    padding: var(--space-3) var(--space-5) var(--space-1);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--color-slate-400);
    border-top: 1px solid var(--color-midnight-700);
}

.cd-curric__loading {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6);
    color: var(--color-slate-400);
    font-size: var(--text-sm);
}



/* ===== REVIEWS TAB ===== */

.cd-reviews__header {
    margin-block-end: var(--space-6);
}

.cd-reviews__summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-block-start: var(--space-2);
}

.cd-reviews__avg {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
}

.cd-reviews__stars {
    color: var(--neon-gold);
    letter-spacing: var(--tracking-wider);
}

.cd-reviews__count {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.cd-reviews__empty {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-400);
    padding: var(--space-5);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
}

.cd-reviews__list {
    display: grid;
    gap: var(--space-3);
}

.cd-reviews__card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: var(--space-5);
}

.cd-reviews__card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-block-end: var(--space-2);
}

.cd-reviews__card-stars {
    color: var(--neon-gold);
    letter-spacing: var(--tracking-wider);
}

.cd-reviews__card-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.cd-reviews__card-title {
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-white);
    margin-block-end: var(--space-2);
}

.cd-reviews__card-body {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-slate-300);
    margin-block-end: var(--space-3);
}

.cd-reviews__card-byline {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-slate-400);
}


/* ===== INSTRUCTORS: one block per Teacher in Canvas ===== */

.cd-instructor + .cd-instructor {
    margin-block-start: var(--space-10);
    padding-block-start: var(--space-10);
    border-top: 1px solid var(--color-midnight-800);
}
