/*
 * Programme landing page (/course/{slug}) — 125 pages, one template.
 *
 * Brand tokens live on :root so the catalogue, the programme page and whatever
 * comes next share one scale. Components are namespaced .prog so nothing leaks
 * into the purchased theme, and every inline-direction value uses logical
 * properties: the same stylesheet serves the Arabic RTL pages unchanged.
 */

/* Colours come from the active palette, injected into :root in <head>.
   Only the non-colour tokens live here. */
:root {
    --sc-ease: cubic-bezier(.22, .61, .36, 1);
    --sc-shadow: 0 14px 34px -18px rgba(10, 16, 51, .42);
    --sc-radius: 18px;
}

.prog { color: var(--sc-ink); }

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

.prog-hero {
    position: relative;
    background:
        radial-gradient(120% 140% at 85% 0%, rgba(49, 57, 200, .40) 0%, transparent 62%),
        linear-gradient(135deg, var(--sc-navy) 0%, var(--sc-navy-soft) 100%);
    color: #fff;
    overflow: hidden;
}

.prog-hero--photo::before {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-image: var(--prog-hero-image);
    opacity: .28;
}

.prog-hero > .container { position: relative; }

.prog-crumbs { font-size: .82rem; color: rgba(255, 255, 255, .7); }
.prog-crumbs a { color: rgba(255, 255, 255, .88); text-decoration: none; }
.prog-crumbs a:hover { text-decoration: underline; }

.prog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: .8rem;
    font-weight: 700;
}

.prog-title {
    font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.9rem);
    line-height: 1.2;
    letter-spacing: -.015em;
    font-weight: 800;
}

.prog-lead {
    max-width: 62ch;
    color: rgba(255, 255, 255, .8);
    line-height: 1.8;
}

/* Facts the catalogue already proves we have for every programme. */
.prog-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: .75rem;
}

.prog-fact {
    padding: .9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .17);
}

.prog-fact-label {
    font-size: .72rem;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .62);
}

.prog-fact-value { font-size: .95rem; font-weight: 700; margin-top: .3rem; }

/* --------------------------------------------------------------- subnav --- */

.prog-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--sc-line);
}

.prog-nav-list {
    display: flex;
    gap: .35rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: .5rem;
    margin: 0;
    list-style: none;
}

.prog-nav-list::-webkit-scrollbar { display: none; }

.prog-nav-list a {
    display: block;
    white-space: nowrap;
    padding: .55rem .9rem;
    border-radius: 999px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--sc-muted);
    text-decoration: none;
    transition: background .2s var(--sc-ease), color .2s var(--sc-ease);
}

.prog-nav-list a:hover { background: var(--sc-tint); color: var(--sc-blue); }
.prog-nav-list a.is-current { background: var(--sc-navy); color: #fff; }

/* -------------------------------------------------------------- sections --- */

.prog-section { scroll-margin-top: 72px; padding-block: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.prog-section + .prog-section { border-top: 1px solid var(--sc-line); }
.prog-section--tint { background: var(--sc-tint); }

.prog-kicker {
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--sc-blue);
}

.prog-h2 {
    font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
    font-weight: 800;
    line-height: 1.3;
    margin-block: .4rem .9rem;
}

/* Editor HTML comes from the admin; keep it readable whatever it contains. */
.prog-rich { font-size: 1rem; line-height: 1.9; color: var(--sc-ink); max-width: 72ch; }
.prog-rich :is(h2, h3, h4) { font-weight: 700; margin-block: 1.4em .5em; line-height: 1.35; }
.prog-rich p { margin-block: 0 1em; }
.prog-rich :is(ul, ol) { margin-block: 0 1em; padding-inline-start: 1.4em; }
.prog-rich li { margin-block: .35em; }
.prog-rich a { color: var(--sc-blue); text-underline-offset: .18em; }
.prog-rich img { max-width: 100%; height: auto; border-radius: 12px; }
.prog-rich strong { color: var(--sc-navy); }

/* ---------------------------------------------------------------- blocks --- */

.prog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1rem;
}

.prog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: #fff;
    transition: transform .22s var(--sc-ease), box-shadow .22s var(--sc-ease);
}

.prog-card:hover { transform: translateY(-3px); box-shadow: var(--sc-shadow); }

.prog-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--sc-tint); }
.prog-card-media img { width: 100%; height: 100%; object-fit: cover; }
.prog-card-body { padding: 1.15rem 1.25rem; }
.prog-card-title { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.prog-card-title .prog-index {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-inline-end: .5rem;
    border-radius: 8px;
    background: rgba(49, 57, 200, .1);
    color: var(--sc-blue-deep);
    font-size: .78rem;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------- faq --- */

.prog-faq {
    border: 1px solid var(--sc-line);
    border-radius: 14px;
    background: #fff;
    margin-bottom: .6rem;
    overflow: hidden;
}

.prog-faq summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.15rem;
    font-weight: 700;
    font-size: .98rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.prog-faq summary::-webkit-details-marker { display: none; }

.prog-faq summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--sc-blue);
    transition: transform .2s var(--sc-ease);
}

.prog-faq[open] summary::after { content: "\2212"; }
.prog-faq-body { padding: 0 1.15rem 1.15rem; }

/* ------------------------------------------------------------- side rail --- */

.prog-rail {
    position: sticky;
    top: 84px;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: #fff;
    box-shadow: var(--sc-shadow);
    overflow: hidden;
}

.prog-rail-head { padding: 1.15rem 1.25rem; background: linear-gradient(135deg, var(--sc-navy) 0%, var(--sc-navy-soft) 100%); color: #fff; }
.prog-rail-body { padding: 1.25rem; }

.prog-rail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-block: .6rem;
    font-size: .88rem;
    border-bottom: 1px dashed var(--sc-line);
}

.prog-rail-row:last-of-type { border-bottom: 0; }
.prog-rail-row dt { color: var(--sc-muted); margin: 0; }
.prog-rail-row dd { margin: 0; font-weight: 700; text-align: end; }

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

.prog-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    gap: .5rem;
    padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--sc-line);
}

.prog-bar .rbt-btn { flex: 1; justify-content: center; }

@media (min-width: 992px) { .prog-bar { display: none; } }

/* -------------------------------------------------------------- a11y/motion --- */

.prog a:focus-visible,
.prog summary:focus-visible,
.prog button:focus-visible {
    outline: 3px solid var(--sc-blue);
    outline-offset: 2px;
}

.prog-reveal { opacity: 0; transform: translateY(14px); }
.prog-reveal.is-in { opacity: 1; transform: none; transition: opacity .4s var(--sc-ease), transform .4s var(--sc-ease); }

@media (prefers-reduced-motion: reduce) {
    .prog-reveal,
    .prog-reveal.is-in { opacity: 1; transform: none; transition: none; }

    .prog-card { transition: none; }
    .prog-card:hover { transform: none; }
}
