/* =========================================================
   FSC AFRICA - COURSE DETAILS
   Approved-template styling, scoped to course detail pages.
   ========================================================= */

body.fsc-site.fsc-course-detail-page {
    --cd-navy: #000000;
    --cd-teal: #195353;
    --cd-lime: #b78332;
    --cd-soft: #f6f6f6;
    --cd-soft-green: #e9eeea;
    --cd-text: #424242;
    --cd-border: #d9d9d9;
    --cd-white: #ffffff;
}

/* -----------------------------
   TITLE VISIBILITY - HARD RULES
   ----------------------------- */
body.fsc-site.fsc-course-detail-page .cdx-light h1,
body.fsc-site.fsc-course-detail-page .cdx-light h2,
body.fsc-site.fsc-course-detail-page .cdx-light h3,
body.fsc-site.fsc-course-detail-page .cdx-summary h3,
body.fsc-site.fsc-course-detail-page .cdx-resource-panel h2,
body.fsc-site.fsc-course-detail-page .cdx-resource-panel h3,
body.fsc-site.fsc-course-detail-page .cdx-date h3,
body.fsc-site.fsc-course-detail-page .cdx-no-dates h3,
body.fsc-site.fsc-course-detail-page .cdx-notice h3 {
    color: var(--cd-navy) !important;
}

body.fsc-site.fsc-course-detail-page .fsc-page-hero h1,
body.fsc-site.fsc-course-detail-page .cdx-video-section h1,
body.fsc-site.fsc-course-detail-page .cdx-video-section h2,
body.fsc-site.fsc-course-detail-page .cdx-video-section h3,
body.fsc-site.fsc-course-detail-page .cdx-final-cta h1,
body.fsc-site.fsc-course-detail-page .cdx-final-cta h2,
body.fsc-site.fsc-course-detail-page .cdx-final-cta h3 {
    color: #ffffff !important;
}

/* -----------------------------
   HERO
   ----------------------------- */
body.fsc-site.fsc-course-detail-page .cdx-hero {
    min-height: clamp(540px, 68vh, 720px);
}

body.fsc-site.fsc-course-detail-page .cdx-hero .fsc-page-hero__media img {
    object-position: center 42%;
}

body.fsc-site.fsc-course-detail-page .cdx-hero__content {
    max-width: 900px;
}

body.fsc-site.fsc-course-detail-page .cdx-hero h1 {
    max-width: 900px;
    text-shadow: 0 3px 24px rgba(0, 0, 0, .38);
}

body.fsc-site.fsc-course-detail-page .cdx-hero__category {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--cd-lime) !important;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

body.fsc-site.fsc-course-detail-page .cdx-hero__category::before {
    width: 26px;
    height: 1px;
    background: var(--cd-lime);
    content: "";
}

body.fsc-site.fsc-course-detail-page .cdx-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

/* -----------------------------
   FACT BAND
   ----------------------------- */
.cdx-facts {
    position: relative;
    z-index: 3;
    background: var(--cd-navy);
    border-top: 1px solid rgba(255, 255, 255, .10);
}

.cdx-facts__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cdx-fact {
    min-width: 0;
    padding: 26px 28px;
    border-right: 1px solid rgba(255, 255, 255, .12);
}

.cdx-fact:first-child {
    border-left: 1px solid rgba(255, 255, 255, .12);
}

.cdx-fact small {
    display: block;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, .58);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cdx-fact strong {
    display: block;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
}

/* -----------------------------
   OVERVIEW
   ----------------------------- */
.cdx-overview { background: #fff; }

.cdx-overview__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.38fr) minmax(300px, .62fr);
    gap: clamp(45px, 7vw, 100px);
    align-items: start;
}

.cdx-copy { max-width: 800px; }
.cdx-copy .fsc-lead { max-width: 760px; }
.cdx-copy p:not(.fsc-lead) {
    max-width: 760px;
    color: var(--cd-text);
    line-height: 1.8;
}

/* -----------------------------
   SUMMARY
   ----------------------------- */
.cdx-summary {
    position: sticky;
    top: 120px;
    overflow: hidden;
    padding: 32px;
    background: var(--cd-soft-green);
    border-radius: 22px;
}

.cdx-summary__top {
    margin-bottom: 25px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(2, 22, 35, .12);
}

.cdx-summary__top small {
    display: block;
    margin-bottom: 8px;
    color: var(--cd-teal);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cdx-summary__top h3 {
    margin: 0;
    font-size: 25px;
    line-height: 1.2;
}

.cdx-summary__list { margin: 0 0 27px; }

.cdx-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(2, 22, 35, .10);
}

.cdx-summary__row span { color: #687274; font-size: 13px; }
.cdx-summary__row strong { color: var(--cd-navy); font-size: 13px; font-weight: 600; text-align: right; }
.cdx-summary__actions { display: grid; gap: 9px; }
.cdx-summary__actions .fsc-button { justify-content: center; }

/* -----------------------------
   PROGRESSION
   ----------------------------- */
.cdx-progression { background: var(--cd-soft); }
.cdx-section-heading { max-width: 760px; margin-bottom: 44px; }

.cdx-progression__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid rgba(2, 22, 35, .14);
}

.cdx-stage {
    min-height: 280px;
    padding: 32px 34px 35px 0;
    border-right: 1px solid rgba(2, 22, 35, .14);
}

.cdx-stage + .cdx-stage { padding-left: 34px; }
.cdx-stage:last-child { border-right: 0; }
.cdx-stage__number { display: inline-flex; margin-bottom: 56px; color: var(--cd-teal); font-size: 12px; font-weight: 600; letter-spacing: .12em; }
.cdx-stage h3 { margin: 0 0 12px; font-size: clamp(22px, 2vw, 29px); }
.cdx-stage p { max-width: 350px; margin: 0; color: #62696b; line-height: 1.7; }

/* -----------------------------
   NOTICE
   ----------------------------- */
.cdx-notice-wrap { margin-top: 40px; }

.cdx-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 22px;
    padding: 26px 28px;
    background: var(--cd-soft-green);
    border-radius: 18px;
}

.cdx-notice__icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    background: var(--cd-lime);
    border-radius: 50%;
    color: var(--cd-navy);
    font-size: 18px;
    font-weight: 700;
}

.cdx-notice h3 { margin: 0 0 5px; font-size: 19px; }
.cdx-notice p { margin: 0; color: #5d6668; }

/* -----------------------------
   VIDEO
   ----------------------------- */
.cdx-video-section {
    overflow: hidden;
    background: var(--cd-navy) !important;
}

.cdx-video-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.cdx-video-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 22px;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .28);
}

.cdx-video-shell iframe,
.cdx-video-shell video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.cdx-video-shell video { object-fit: cover; }

.cdx-video-loading,
.cdx-video-error {
    position: absolute;
    inset: 0;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 12px;
    padding: 30px;
    background: linear-gradient(180deg, rgba(2, 22, 35, .2), rgba(2, 22, 35, .88));
    color: rgba(255, 255, 255, .82);
    text-align: center;
}

.cdx-video-loading__mark,
.cdx-video-error__mark {
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    background: var(--cd-lime);
    border-radius: 50%;
    color: var(--cd-navy);
    font-size: 22px;
}

.cdx-video-copy .fsc-eyebrow { color: var(--cd-lime) !important; }
.cdx-video-copy h2 { max-width: 540px; margin-bottom: 18px; }
.cdx-video-copy p { max-width: 520px; margin: 0; color: rgba(255, 255, 255, .72); line-height: 1.8; }
.cdx-video-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cdx-video-meta span { padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; color: rgba(255, 255, 255, .68); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* -----------------------------
   DATES + RESOURCES
   ----------------------------- */
.cdx-dates-resources { background: #fff; }

.cdx-dates-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: clamp(50px, 7vw, 90px);
    align-items: start;
}

.cdx-dates__heading { max-width: 650px; margin-bottom: 30px; }
.cdx-date-list { border-top: 1px solid var(--cd-border); }

.cdx-date {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 22px;
    align-items: center;
    padding: 23px 0;
    border-bottom: 1px solid var(--cd-border);
}

.cdx-date__calendar {
    display: grid;
    overflow: hidden;
    width: 68px;
    border: 1px solid rgba(2, 22, 35, .15);
    border-radius: 12px;
    text-align: center;
}

.cdx-date__calendar span { padding: 5px; background: var(--cd-teal); color: #fff; font-size: 9px; font-weight: 600; letter-spacing: .10em; text-transform: uppercase; }
.cdx-date__calendar strong { padding: 8px 4px 9px; color: var(--cd-navy); font-size: 23px; line-height: 1; }
.cdx-date__copy h3 { margin: 0 0 5px; font-size: 18px; }
.cdx-date__copy p { margin: 0; color: #707779; font-size: 13px; }
.cdx-date__action { white-space: nowrap; }

.cdx-resource-panel {
    padding: 32px;
    background: var(--cd-soft);
    border-radius: 22px;
}

.cdx-resource-panel__intro { margin-bottom: 27px; }
.cdx-resource-panel h2 { margin: 5px 0 9px; font-size: 29px; }
.cdx-resource-panel__intro p { margin: 0; color: #62696b; font-size: 14px; line-height: 1.65; }
.cdx-resources { display: grid; gap: 10px; }

.cdx-resource {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 76px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid rgba(2, 22, 35, .10);
    border-radius: 14px;
    color: var(--cd-navy);
    text-decoration: none;
    transition: border-color .2s ease, background-color .2s ease;
}

button.cdx-resource { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.cdx-resource:hover { background: var(--cd-soft-green); border-color: rgba(25, 83, 83, .35); color: var(--cd-navy); }
.cdx-resource__icon { display: grid; width: 46px; height: 46px; place-items: center; background: var(--cd-lime); border-radius: 50%; }
.cdx-resource__icon svg { width: 20px; height: 20px; }
.cdx-resource__copy { min-width: 0; }
.cdx-resource__copy small { display: block; margin-bottom: 2px; color: #747b7d; font-size: 10px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; }
.cdx-resource__copy strong { display: block; overflow: hidden; color: var(--cd-navy); font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.cdx-resource__arrow { color: var(--cd-teal); font-size: 18px; }

.cdx-no-dates { padding: 28px; background: var(--cd-soft-green); border-radius: 16px; }
.cdx-no-dates h3 { margin: 0 0 7px; font-size: 20px; }
.cdx-no-dates p { margin: 0 0 20px; color: #60686a; }

/* -----------------------------
   RESPONSIVE
   External CSS = normal @media, no Razor escaping needed.
   ----------------------------- */
@media (max-width: 1050px) {
    .cdx-overview__grid,
    .cdx-video-grid,
    .cdx-dates-layout { grid-template-columns: 1fr; }
    .cdx-summary { position: static; max-width: 680px; }
    .cdx-resource-panel { max-width: 760px; }
}

@media (max-width: 820px) {
    .cdx-facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cdx-fact:nth-child(2) { border-right: 0; }
    .cdx-fact:nth-child(n+3) { border-top: 1px solid rgba(255, 255, 255, .12); }
    .cdx-progression__grid { grid-template-columns: 1fr; }
    .cdx-stage,
    .cdx-stage + .cdx-stage { min-height: 0; padding: 28px 0; border-right: 0; border-bottom: 1px solid rgba(2, 22, 35, .14); }
    .cdx-stage:last-child { border-bottom: 0; }
    .cdx-stage__number { margin-bottom: 28px; }
}

@media (max-width: 620px) {
    body.fsc-site.fsc-course-detail-page .cdx-hero__actions { display: grid; }
    body.fsc-site.fsc-course-detail-page .cdx-hero__actions .fsc-button { justify-content: center; }
    .cdx-facts__grid { grid-template-columns: 1fr; }
    .cdx-fact,
    .cdx-fact:first-child,
    .cdx-fact:nth-child(2) { border-right: 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
    .cdx-fact:first-child { border-top: 0; }
    .cdx-summary,
    .cdx-resource-panel { padding: 24px 20px; border-radius: 17px; }
    .cdx-video-shell { border-radius: 15px; }
    .cdx-date { grid-template-columns: 62px minmax(0, 1fr); gap: 15px; }
    .cdx-date__calendar { width: 58px; }
    .cdx-date__action { grid-column: 2; }
    .cdx-notice { grid-template-columns: 1fr; }
    .cdx-resource { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 11px; }
    .cdx-resource__icon { width: 42px; height: 42px; }
}

@media print {
    .fsc-header,
    .fsc-footer,
    .cdx-video-section,
    .cdx-final-cta,
    .cdx-resource-panel,
    #fscGlobalBackToTop { display: none !important; }
    .fsc-section { padding: 35px 0 !important; }
    .cdx-summary { position: static; break-inside: avoid; }
}
