/* ==========================================================
   CSDI ACADEMY — its own visual identity
   ==========================================================
   Academy is a distinct product within the CSDI ecosystem —
   same institution, its own identity, the way OpenResearch has
   its own navy-and-serif system distinct from the main site's
   green. Academy's identity: warm amber/ochre + deep ink,
   pill-shaped CTAs, Sora for headings — closer in spirit to
   global learning platforms (Coursera, Udemy: one confident
   accent color, pill buttons, warm-neutral canvas, real photos
   over icon grids) than to either sibling's look.

   Scoped to #academy-wrapper (wraps the whole Academy layout —
   see layouts/master.php) rather than touching every view file:
   every .csdi-btn / .csdi-card / .csdi-section usage already
   built inherits the new identity automatically because CSS
   custom properties resolve at point of use, not definition.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap');

#academy-wrapper {

    /* Primary identity: warm amber/ochre replaces CSDI green */
    --csdi-green-primary:   #B45309;
    --csdi-green-secondary: #92400E;
    --csdi-green-forest:    #1F2937;   /* deep ink — dark sections, footer */
    --csdi-green-leaf:      #34D399;   /* small green kept only for positive/success signals */
    --csdi-green-soft:      #FEF3E2;

    --csdi-navy-text:   #1F2937;
    --csdi-text-muted:  #6B7280;
    --csdi-text-subtle: #9CA3AF;

    --csdi-earth-amber: #D97706;
    --csdi-earth-clay:  #9A3412;

    --csdi-surface-white: #FFFFFF;
    --csdi-surface-soft:  #FFFBF5;
    --csdi-surface-tint:  #FFF8EE;
    --csdi-border:        #F0E4D4;

    /* Headings in Sora (own display face); body stays Inter —
       one deliberate pairing, not a wholesale font swap */
    --csdi-h1: 700 clamp(2rem, 4vw, 3.25rem)/1.15 'Sora', var(--csdi-font);
    --csdi-h2: 700 clamp(1.5rem, 3vw, 2.25rem)/1.25 'Sora', var(--csdi-font);
    --csdi-h3: 600 1.25rem/1.35 'Sora', var(--csdi-font);
    --csdi-eyebrow: 700 0.75rem/1.4 'Sora', var(--csdi-font);

    /* Pill buttons — distinct from the main site's asymmetric
       corner and OpenResearch's rounded-rectangle */
    --csdi-btn-radius: 999px;
    --csdi-card-radius: 16px;

}

/* One literal (non-variable) color in the shared button hover
   state that a custom-property override can't reach */
#academy-wrapper .csdi-btn-primary:hover {
    background: #7C2D12;
}

#academy-wrapper h1,
#academy-wrapper h2,
#academy-wrapper h3,
#academy-wrapper .academy-brand-name {
    font-family: 'Sora', var(--csdi-font);
}

body {
    font: var(--csdi-body);
    color: var(--csdi-navy-text);
}

/* --------------------------------------------------------
   Header
   -------------------------------------------------------- */

.academy-header {
    background: #fff;
    border-bottom: 1px solid var(--csdi-border);
    position: sticky;
    top: 0;
    z-index: 999;
}

.academy-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.academy-brand-logo {
    height: 46px;
    width: auto;
}

.academy-footer .academy-brand-logo {
    height: 56px;
}

.academy-brand-mark {
    font: 700 1rem var(--csdi-font);
    color: var(--csdi-green-primary);
    letter-spacing: 1px;
}

.academy-brand-name {
    font: 700 1.35rem var(--csdi-font);
    color: var(--csdi-navy-text);
}

.academy-header .nav-link {
    font: 500 0.9375rem var(--csdi-font);
    color: var(--csdi-navy-text);
    padding: 0.5rem 1rem !important;
}

.academy-header .nav-link:hover {
    color: var(--csdi-green-primary);
}

/* --------------------------------------------------------
   Hero — asymmetric photo + text, one orchestrated reveal
   -------------------------------------------------------- */

.academy-hero {
    background: var(--csdi-surface-tint);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.academy-hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: stretch;
    min-height: 560px;
}

.academy-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem);
}

.academy-hero-copy h1 {
    font: 700 clamp(2rem, 3.6vw, 3rem)/1.15 var(--csdi-font);
    color: var(--csdi-navy-text);
    margin-bottom: 1.25rem;
    max-width: 15ch;
    opacity: 0;
    animation: academyHeroRise 0.8s 0.15s cubic-bezier(.2,.7,.2,1) forwards;
}

.academy-hero-copy p.lead {
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--csdi-text-muted);
    max-width: 46ch;
    opacity: 0;
    animation: academyHeroRise 0.8s 0.32s cubic-bezier(.2,.7,.2,1) forwards;
}

.academy-hero-copy .academy-hero-actions {
    opacity: 0;
    animation: academyHeroRise 0.8s 0.48s cubic-bezier(.2,.7,.2,1) forwards;
}

@keyframes academyHeroRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.academy-hero-photo {
    position: relative;
    overflow: hidden;
    clip-path: polygon(12% 0, 100% 0, 100% 100%, 0% 100%);
    background: var(--csdi-green-forest);
}

.academy-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.08);
    opacity: 0;
    animation: academyHeroPhoto 1.1s 0.05s cubic-bezier(.2,.7,.2,1) forwards;
}

@keyframes academyHeroPhoto {
    from { opacity: 0; transform: scale(1.14); }
    to   { opacity: 1; transform: scale(1.08); }
}

.academy-hero-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(31,41,55,0.6) 0%, rgba(31,41,55,0) 45%);
}

.academy-hero-photo-caption {
    position: absolute;
    left: 2rem;
    bottom: 1.75rem;
    right: 2rem;
    color: #fff;
    font-size: 0.8125rem;
    z-index: 2;
}

.academy-hero-photo-caption strong {
    display: block;
    font-size: 0.9375rem;
    margin-bottom: 0.15rem;
}

.academy-hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2.75rem;
    opacity: 0;
    animation: academyHeroRise 0.8s 0.6s cubic-bezier(.2,.7,.2,1) forwards;
}

.academy-hero-stats .stat-num {
    font: 700 1.75rem var(--csdi-font);
    display: block;
    color: var(--csdi-navy-text);
}

.academy-hero-stats .stat-label {
    font-size: 0.8125rem;
    color: var(--csdi-text-muted);
}

@media (max-width: 991px) {
    .academy-hero-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .academy-hero-photo {
        clip-path: none;
        min-height: 320px;
        order: -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .academy-hero-copy h1,
    .academy-hero-copy p.lead,
    .academy-hero-copy .academy-hero-actions,
    .academy-hero-stats,
    .academy-hero-photo img {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* --------------------------------------------------------
   Course landing page hero — dark, optionally with the
   course's own photo as a backdrop. Kept separate from
   .academy-hero (homepage-only asymmetric layout) so changing
   one never silently breaks the other.
   -------------------------------------------------------- */

/* --------------------------------------------------------
   Sidebar cards (course landing page) — .csdi-card sets
   height:100% for equal-height grids, which is wrong here: it
   was stretching this card to match the much taller overview
   column next to it. Override back to auto, compact padding.
   -------------------------------------------------------- */

.academy-sidebar-card {
    height: auto !important;
    padding: 1.25rem !important;
}

.academy-sidebar-card .instructor-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.academy-sidebar-card .instructor-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--csdi-surface-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--csdi-green-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.academy-course-hero {
    position: relative;
    color: #fff;
    padding: 3.5rem 0;
    background: linear-gradient(135deg, var(--csdi-green-forest), var(--csdi-green-primary));
    background-size: cover;
    background-position: center;
}

.academy-course-hero.has-photo {
    background-blend-mode: multiply;
}

.academy-course-hero .csdi-btn-outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

.academy-course-hero .csdi-btn-outline:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* --------------------------------------------------------
   Category pills
   -------------------------------------------------------- */

.academy-category-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid var(--csdi-border);
    border-left: 3px solid var(--academy-accent, var(--csdi-green-primary));
    border-radius: var(--csdi-card-radius);
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: var(--csdi-navy-text);
    height: 100%;
    transition: all 0.2s ease;
}

.academy-category-pill:hover {
    box-shadow: 0 10px 24px rgba(15,23,42,0.07);
    transform: translateY(-2px);
    color: var(--csdi-navy-text);
}

.academy-category-pill i {
    font-size: 1.35rem;
    color: var(--academy-accent, var(--csdi-green-primary));
}

.academy-category-pill .cat-name {
    font-weight: 600;
    font-size: 0.9375rem;
    display: block;
}

.academy-category-pill .cat-count {
    font-size: 0.75rem;
    color: var(--csdi-text-muted);
}

/* Accent color families — referenced via inline style="--academy-accent: ..."
   from academy_category_accent(), so a course/category's color always
   means the same thing everywhere it appears. */
.accent-green  { --academy-accent: var(--csdi-green-primary); }
.accent-clay   { --academy-accent: var(--csdi-earth-clay); }
.accent-forest { --academy-accent: var(--csdi-green-forest); }
.accent-amber  { --academy-accent: var(--csdi-earth-amber); }

/* --------------------------------------------------------
   Course card
   -------------------------------------------------------- */

.academy-course-card {
    background: #fff;
    border: 1px solid var(--csdi-border);
    border-radius: var(--csdi-card-radius);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

.academy-course-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--academy-accent, var(--csdi-green-primary));
    transform: scaleX(0.22);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
    z-index: 2;
}

.academy-course-card:hover::before {
    transform: scaleX(1);
}

.academy-course-card:hover {
    box-shadow: 0 16px 34px rgba(15,23,42,0.1);
    transform: translateY(-3px);
}

.academy-course-card .course-thumb {
    aspect-ratio: 16/9;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--academy-accent, var(--csdi-green-primary)) 0%, var(--csdi-green-forest) 130%);
}

.academy-course-card .course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
}

.academy-course-card:hover .course-thumb img {
    transform: scale(1.06);
}

.academy-course-card .course-thumb-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    font-size: 2rem;
}

.academy-course-card .course-thumb .badge-free {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font: 600 0.6875rem var(--csdi-font);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    z-index: 2;
}

.academy-course-card .course-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.academy-course-card .course-category {
    font: 600 0.6875rem var(--csdi-font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--academy-accent, var(--csdi-green-primary));
    margin-bottom: 0.5rem;
}

.academy-course-card h3 {
    font: 600 1.0625rem var(--csdi-font);
    color: var(--csdi-navy-text);
    margin-bottom: 0.5rem;
}

.academy-course-card .course-meta {
    font-size: 0.8125rem;
    color: var(--csdi-text-muted);
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1rem 0;
}

.academy-course-card .course-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--csdi-border);
}

.academy-course-card .course-price {
    font: 700 0.9375rem var(--csdi-font);
    color: var(--csdi-navy-text);
}

/* --------------------------------------------------------
   Photo-anchored feature section (replaces repeated icon-cards)
   -------------------------------------------------------- */

.academy-feature-photo {
    position: relative;
    border-radius: var(--csdi-card-radius);
    overflow: hidden;
    aspect-ratio: 4/5;
}

.academy-feature-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.academy-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.academy-feature-list li {
    display: flex;
    gap: 1rem;
    padding: 1.1rem 0;
    border-top: 1px solid var(--csdi-border);
}

.academy-feature-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.academy-feature-list .feature-num {
    font: 600 0.8125rem var(--csdi-font);
    color: var(--csdi-text-subtle);
    min-width: 1.5rem;
}

.academy-feature-list h3 {
    font: 600 1rem var(--csdi-font);
    color: var(--csdi-navy-text);
    margin-bottom: 0.25rem;
}

.academy-feature-list p {
    font-size: 0.875rem;
    color: var(--csdi-text-muted);
    margin: 0;
}

/* Credibility strip — a single real photo with a caption, used for the
   research/global-partnership moment rather than another card grid */
.academy-credibility-strip {
    position: relative;
    border-radius: var(--csdi-card-radius);
    overflow: hidden;
}

.academy-credibility-strip img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.academy-credibility-strip .strip-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(0deg, rgba(31,41,55,0.78), rgba(31,41,55,0));
    color: #fff;
    font-size: 0.875rem;
}

/* --------------------------------------------------------
   Course hero — stat chips
   -------------------------------------------------------- */

.academy-stat-chips {
    display: flex;
    gap: 2.25rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.academy-stat-chip .chip-num {
    font: 700 2rem/1 'Sora', var(--csdi-font);
    color: #fff;
    display: block;
}

.academy-stat-chip .chip-label {
    font-size: 0.8125rem;
    color: rgba(255,255,255,0.75);
    max-width: 12ch;
    margin-top: 0.25rem;
}

/* --------------------------------------------------------
   Section eyebrow with number (legitimate here — these are
   the literal sequential top-level sections of one course page)
   -------------------------------------------------------- */

.academy-section-num {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.academy-section-num .num {
    font: 700 0.8125rem 'Sora', var(--csdi-font);
    color: var(--academy-accent, var(--csdi-green-primary));
    border: 1px solid currentColor;
    border-radius: 999px;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.academy-section-num .label {
    font: 700 0.75rem var(--csdi-font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--csdi-text-muted);
}

/* --------------------------------------------------------
   Numbered learning outcomes
   -------------------------------------------------------- */

.academy-outcome {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--csdi-border);
}

.academy-outcome:first-child {
    border-top: none;
    padding-top: 0;
}

.academy-outcome .outcome-num {
    font: 700 1.125rem 'Sora', var(--csdi-font);
    color: var(--csdi-border);
    min-width: 2rem;
}

.academy-outcome p {
    margin: 0;
    color: var(--csdi-navy-text);
}

/* --------------------------------------------------------
   Module explorer (tabbed curriculum — replaces the stacked
   accordion so learners can scan modules without endless scroll)
   -------------------------------------------------------- */

.academy-module-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--csdi-border);
    padding-bottom: 1rem;
}

.academy-module-tabs .nav-link {
    border: 1px solid var(--csdi-border);
    border-radius: 999px;
    padding: 0.5rem 1.1rem;
    font: 600 0.8125rem var(--csdi-font);
    color: var(--csdi-text-muted);
    background: #fff;
}

.academy-module-tabs .nav-link.active {
    background: var(--csdi-green-primary);
    border-color: var(--csdi-green-primary);
    color: #fff;
}

.academy-module-panel h3 {
    font: 600 1.0625rem var(--csdi-font);
    margin-bottom: 1rem;
}

.academy-module-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--csdi-border);
    border-radius: 10px;
    overflow: hidden;
}

.academy-module-panel li {
    display: flex;
    justify-content: space-between;
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
    color: var(--csdi-text-muted);
    background: #fff;
}

.academy-module-panel li:not(:last-child) {
    border-bottom: 1px solid var(--csdi-border);
}

/* --------------------------------------------------------
   Closing enrolment band
   -------------------------------------------------------- */

.academy-enrol-band {
    background: var(--csdi-green-forest);
    color: #fff;
    padding: 3.5rem 0;
    text-align: center;
}

.academy-enrol-band h2 {
    color: #fff;
    margin-bottom: 0.75rem;
}

.academy-enrol-band p {
    color: rgba(255,255,255,0.75);
    max-width: 480px;
    margin: 0 auto 1.75rem auto;
}

.academy-curriculum-module {
    border: 1px solid var(--csdi-border);
    border-radius: 10px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.academy-curriculum-module summary {
    padding: 1rem 1.25rem;
    font: 600 0.9375rem var(--csdi-font);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--csdi-surface-tint);
    list-style: none;
}

.academy-curriculum-module summary::-webkit-details-marker {
    display: none;
}

.academy-curriculum-module ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.academy-curriculum-module li {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--csdi-border);
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    color: var(--csdi-text-muted);
}

/* --------------------------------------------------------
   Progress bar
   -------------------------------------------------------- */

.academy-progress {
    height: 8px;
    border-radius: 20px;
    background: var(--csdi-border);
    overflow: hidden;
}

.academy-progress-bar {
    height: 100%;
    background: var(--csdi-green-primary);
}

/* --------------------------------------------------------
   Footer
   -------------------------------------------------------- */

.academy-footer {
    background: var(--csdi-green-forest);
    color: rgba(255,255,255,0.75);
    padding: 4rem 0 1.5rem 0;
}

.academy-footer h6 {
    color: #fff;
    font: 600 0.875rem var(--csdi-font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.academy-footer .text-muted-light {
    color: rgba(255,255,255,0.6);
}

.academy-footer-links li {
    margin-bottom: 0.6rem;
}

.academy-footer-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.875rem;
}

.academy-footer-links a:hover {
    color: #fff;
}

.academy-footer-divider {
    border-color: rgba(255,255,255,0.12);
    margin: 2rem 0 1.5rem 0;
}

.academy-page-header {
    background: var(--csdi-surface-tint);
    padding: 2rem 0;
    border-bottom: 1px solid var(--csdi-border);
}
