/*
 * Homepage.
 *
 * Reuses the :root brand tokens defined in programme.css, so the homepage,
 * the catalogue and every programme page share one scale. Components are
 * namespaced .hp and use logical properties, so the Arabic RTL page needs no
 * separate stylesheet.
 */

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

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

.hp-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(110% 130% at 82% 0%, rgba(49, 57, 200, .42) 0%, transparent 62%),
        linear-gradient(135deg, var(--sc-navy) 0%, var(--sc-navy-soft) 100%);
}

.hp-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hp-hero-image, none);
    background-size: cover;
    background-position: center;
    opacity: .22;
}

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

.hp-h1 {
    font-size: clamp(2rem, 1.2rem + 3.1vw, 3.5rem);
    line-height: 1.15;
    letter-spacing: -.02em;
    font-weight: 800;
    max-width: 20ch;
}

.hp-lead {
    max-width: 58ch;
    font-size: clamp(1rem, .95rem + .25vw, 1.15rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, .82);
}

.hp-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 1.75rem;
    padding-top: 1.75rem;
    margin-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.hp-trust-figure { font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.hp-trust-label { font-size: .8rem; color: rgba(255, 255, 255, .68); margin-top: .35rem; max-width: 22ch; }

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

.hp-section { padding-block: clamp(2.75rem, 1.6rem + 3.4vw, 5rem); }
.hp-section--tint { background: var(--sc-tint); }
.hp-section--line { border-top: 1px solid var(--sc-line); }

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

.hp-h2 {
    font-size: clamp(1.5rem, 1.15rem + 1.3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.25;
    margin-block: .45rem .75rem;
}

.hp-sub { max-width: 68ch; color: var(--sc-muted); line-height: 1.8; }

/* ------------------------------------------------------------------ grids --- */

.hp-grid { display: grid; gap: 1rem; }
.hp-grid--levels { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.hp-grid--bodies { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.hp-grid--cards { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.hp-tile {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 124px;
    padding: 1.1rem;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: #fff;
    text-decoration: none;
    color: var(--sc-ink);
    transition: transform .22s var(--sc-ease), box-shadow .22s var(--sc-ease), border-color .22s var(--sc-ease);
}

.hp-tile:hover { transform: translateY(-4px); box-shadow: var(--sc-shadow); border-color: rgba(49, 57, 200, .42); }
.hp-tile-name { font-weight: 700; font-size: .95rem; line-height: 1.35; }
.hp-tile-count { margin-top: auto; font-size: .78rem; color: var(--sc-muted); font-variant-numeric: tabular-nums; }

.hp-body-card { display: flex; align-items: center; gap: .85rem; }

.hp-mark {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    padding: 6px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--sc-blue) 0%, var(--sc-blue-deep) 100%);
    color: #fff;
    font-weight: 800;
    font-size: .92rem;
}

.hp-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }

.hp-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    background: #fff;
    text-decoration: none;
    transition: transform .22s var(--sc-ease), box-shadow .22s var(--sc-ease), border-color .22s var(--sc-ease);
}

.hp-card:hover { transform: translateY(-4px); box-shadow: var(--sc-shadow); border-color: rgba(49, 57, 200, .42); }
.hp-card-media { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--sc-navy) 0%, var(--sc-blue-deep) 100%); display: grid; place-items: center; overflow: hidden; }
.hp-card-media img { width: 100%; height: 100%; object-fit: cover; }
.hp-card-mark { color: rgba(255, 255, 255, .9); font-weight: 800; font-size: 1.4rem; letter-spacing: .05em; }
.hp-card-body { display: flex; flex-direction: column; gap: .4rem; flex: 1; padding: 1.05rem 1.15rem; }
.hp-card-title { font-size: .97rem; font-weight: 700; color: var(--sc-ink); line-height: 1.45; }
.hp-card-meta { font-size: .8rem; color: var(--sc-muted); }
.hp-card-more { margin-top: auto; padding-top: .55rem; font-size: .8rem; font-weight: 700; color: var(--sc-blue); }

/* ------------------------------------------------------------------ bands --- */

.hp-band {
    border-radius: 22px;
    padding: clamp(1.5rem, 1rem + 2vw, 3rem);
    background: linear-gradient(135deg, var(--sc-navy) 0%, var(--sc-navy-soft) 100%);
    color: #fff;
}

.hp-band--light {
    background: #fff;
    color: var(--sc-ink);
    border: 1px solid var(--sc-line);
}

.hp-point { display: flex; gap: .75rem; align-items: flex-start; }
.hp-point-icon { flex: 0 0 auto; width: 22px; height: 22px; stroke: var(--sc-blue); fill: none; stroke-width: 2; margin-top: .15rem; }
.hp-point-title { font-weight: 700; font-size: .97rem; margin-bottom: .2rem; }
.hp-point-text { font-size: .88rem; color: var(--sc-muted); line-height: 1.7; }

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

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

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

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

    .hp-tile,
    .hp-card { transition: none; }

    .hp-tile:hover,
    .hp-card:hover { transform: none; }
}
/*
 * Homepage hero: image or video slides, or a plain first screen when nothing
 * is published. Colours come from the active palette; no literal values here.
 */

.hero {
    position: relative;
    min-height: clamp(26rem, 20rem + 22vw, 40rem);
    display: grid;
    isolation: isolate;
    background: var(--sc-ink);
    color: #fff;
}

.hero-slide {
    grid-area: 1 / 1;
    position: relative;
    display: grid;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .7s var(--sc-ease);
}

.hero-slide.is-active { opacity: 1; visibility: visible; }

.hero-media { position: absolute; inset: 0; overflow: hidden; }

.hero-media img,
.hero-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dark enough that white text clears 4.5:1 over any photograph. */
.hero-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .30) 55%, rgba(0, 0, 0, .20) 100%),
        linear-gradient(to right, color-mix(in srgb, var(--sc-ink) 72%, transparent) 0%, transparent 70%);
}

.hero-inner { position: relative; padding-block: clamp(3.5rem, 2rem + 7vw, 7rem); }

.hero-eyebrow {
    display: inline-block;
    margin-bottom: 1rem;
    padding: .35rem .9rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sc-accent) 88%, transparent);
    color: var(--sc-ink);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.hero-title {
    max-width: 18ch;
    margin: 0 0 1rem;
    font-size: clamp(2rem, 1.1rem + 3.6vw, 3.9rem);
    line-height: 1.1;
    letter-spacing: -.022em;
    font-weight: 800;
    text-wrap: balance;
}

.hero-lead {
    max-width: 54ch;
    margin: 0 0 2rem;
    font-size: clamp(1rem, .95rem + .3vw, 1.2rem);
    line-height: 1.75;
    color: rgba(255, 255, 255, .88);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-btn {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: .75rem 1.6rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .18s var(--sc-ease), background .18s var(--sc-ease), color .18s var(--sc-ease);
}

.hero-btn--solid { background: var(--sc-accent); color: var(--sc-ink); }
.hero-btn--solid:hover { background: #fff; color: var(--sc-ink); transform: translateY(-2px); }

.hero-btn--ghost { border: 1px solid rgba(255, 255, 255, .5); color: #fff; }
.hero-btn--ghost:hover { background: rgba(255, 255, 255, .12); transform: translateY(-2px); }

/* ------------------------------------------------------------- controls --- */

.hero-controls {
    position: absolute;
    inset-inline: 0;
    bottom: clamp(1rem, .5rem + 1.5vw, 2rem);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.hero-nav {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(0, 0, 0, .25);
    color: #fff;
    cursor: pointer;
    transition: background .18s var(--sc-ease);
}

.hero-nav:hover { background: rgba(0, 0, 0, .5); }
.hero-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* The chevrons point along the reading direction, so they flip with it. */
[dir="rtl"] .hero-nav svg { transform: scaleX(-1); }

.hero-dots { display: flex; gap: .5rem; }

.hero-dot {
    width: 32px;
    height: 4px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: rgba(255, 255, 255, .38);
    cursor: pointer;
    transition: background .2s var(--sc-ease), width .2s var(--sc-ease);
}

.hero-dot.is-active { background: var(--sc-accent); width: 54px; }

.hero :is(button, a):focus-visible { outline: 3px solid var(--sc-accent); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
    .hero-slide { transition: none; }
    .hero-btn:hover { transform: none; }
    .hero-media video { display: none; }
}
