/* SSP Programs showcase — immersive, infinitely-looping active-program cards.
   Self-contained (works wherever [ssp_programs] is placed); honors the
   Immersive Home theme vars when present, falls back to the brand palette. */
.ssp-programs {
    --ssp-ink: var(--ssp-ink, #05070d);
    --ssp-accent: var(--ssp-accent, #2b6bff);
    --ssp-accent-2: var(--ssp-accent-2, #6bcbff);
    --ssp-cyan: var(--ssp-cyan, #90fffb);
    --ssp-text: #eaf1ff;
    --ssp-muted: #8b96b3;

    position: relative;
    overflow: hidden;
    padding: clamp(48px, 8vw, 110px) 0 clamp(56px, 9vw, 120px);
    /* Match the Immersive Home backdrop: accent glow over near-black ink. */
    background:
        radial-gradient(120% 80% at 50% -8%, color-mix(in srgb, var(--ssp-accent) 26%, transparent), transparent 60%),
        radial-gradient(90% 70% at 100% 110%, color-mix(in srgb, var(--ssp-accent-2) 14%, transparent), transparent 62%),
        var(--ssp-ink);
    color: var(--ssp-text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    isolation: isolate;
}

.ssp-programs__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.9;
}

.ssp-programs__head {
    position: relative;
    z-index: 2;
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto clamp(28px, 4vw, 48px);
    text-align: center;
}

.ssp-programs__kicker {
    margin: 0 0 10px;
    color: var(--ssp-accent-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.26em;
    text-transform: uppercase;
}

.ssp-programs__title {
    margin: 0 0 14px;
    font-size: clamp(34px, 6vw, 76px);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.02em;
    /* Solid, high-contrast colour — the gradient text-clip kept rendering invisible
       on this route, so the title is now reliably visible on the immersive backdrop. */
    color: #f3f8ff;
    -webkit-text-fill-color: #f3f8ff;
    text-shadow: 0 2px 22px rgba(0, 0, 0, 0.35);
}

/* Virtual /programs/ route: self-contained immersive document. */
body.ssp-programs-page {
    margin: 0;
    background: var(--ssp-ink, #05070d);
}

.ssp-programs__copy {
    margin: 0 auto;
    max-width: 560px;
    color: var(--ssp-muted);
    font-size: clamp(14px, 1.6vw, 18px);
    line-height: 1.5;
}

.ssp-programs__empty {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--ssp-muted);
    font-size: 15px;
}

/* Marquee viewport — edge fades, track moved by JS (transform). */
.ssp-programs__viewport {
    position: relative;
    z-index: 2;
    overflow: hidden;
    padding: 8px 0;
    cursor: grab;
    /* Let vertical page scroll pass through, but keep horizontal drag-scrub smooth
       on touch (otherwise the browser fights the pointer drag → janky on phones). */
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.ssp-programs__viewport.is-dragging {
    cursor: grabbing;
}

.ssp-programs__track {
    display: inline-flex;
    align-items: stretch;
    gap: 18px;
    will-change: transform;
    padding: 4px 9px;
}

/* Cards */
.ssp-program-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: clamp(248px, 26vw, 320px);
    padding: 22px 22px 20px;
    border-radius: 22px;
    border: 1px solid rgba(107, 203, 255, 0.18);
    background:
        radial-gradient(135% 120% at 0% 0%, rgba(43, 107, 255, 0.16), transparent 58%),
        rgba(10, 14, 26, 0.72);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 24px 50px -28px rgba(0, 0, 0, 0.9);
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), border-color 220ms ease, box-shadow 260ms ease;
}

.ssp-programs__track:hover .ssp-program-card {
    /* dim siblings slightly so the hovered one pops */
    opacity: 0.78;
}
.ssp-program-card:hover {
    opacity: 1 !important;
    transform: translateY(-6px);
    border-color: rgba(107, 203, 255, 0.55);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 34px 70px -30px rgba(0, 0, 0, 0.95),
        0 0 80px -28px rgba(43, 107, 255, 0.7);
}

/* Every card is a full-bleed media tile (host video > host image > site logo),
   with a readable overlay holding the name, bio, links and CTA. */
.ssp-program-card.has-image,
.ssp-program-card.has-video,
.ssp-program-card.has-text {
    position: relative;
    width: clamp(248px, 24vw, 312px);
    aspect-ratio: 3 / 4;
    padding: 0;
    overflow: hidden;
    border-color: rgba(107, 203, 255, 0.22);
}
.ssp-program-card.has-video {
    width: clamp(244px, 22vw, 300px);
    aspect-ratio: 9 / 16;
}

/* Media element fills the whole card. */
.ssp-program-card__media-el {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    background: var(--ssp-ink, #05070d);
}
/* Site-logo fallback (until the host uploads an image/video): contained + centered
   on the immersive card gradient, so it reads as branding rather than a stretched icon. */
.ssp-program-card__media-el--logo {
    background-repeat: no-repeat;
    background-position: center 40%;
    background-size: min(62%, 186px);
    background-color: transparent;
    opacity: 0.92;
}

/* Small volume toggle (top-right of video cards): videos autoplay muted; tap to unmute.
   Scoped with .ssp-programs and appearance:none so the host theme's <button> styles
   (the ugly red box) can't bleed through. Icon uses the brand blue. */
.ssp-programs .ssp-program-card__sound {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(107, 203, 255, 0.35);
    border-radius: 999px;
    background: rgba(5, 7, 13, 0.45);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--ssp-accent-2, #6bcbff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    outline: none;
    cursor: pointer;
    pointer-events: auto;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.ssp-programs .ssp-program-card__sound:hover {
    background: rgba(13, 22, 40, 0.82);
    border-color: var(--ssp-accent-2, #6bcbff);
    color: var(--ssp-cyan, #90fffb);
    transform: scale(1.08);
}
.ssp-programs .ssp-program-card__sound:focus-visible {
    outline: 2px solid var(--ssp-accent-2, #6bcbff);
    outline-offset: 2px;
}
.ssp-program-card__sound svg { width: 16px; height: 16px; display: block; }
.ssp-program-card__sound .ssp-program-card__sound-on { display: none; }
.ssp-program-card__sound.is-unmuted .ssp-program-card__sound-off { display: none; }
.ssp-program-card__sound.is-unmuted .ssp-program-card__sound-on { display: inline; }
.ssp-programs .ssp-program-card__sound.is-unmuted {
    background: color-mix(in srgb, var(--ssp-accent, #2b6bff) 58%, rgba(5, 7, 13, 0.5));
    border-color: var(--ssp-accent-2, #6bcbff);
    color: #ffffff;
}
.ssp-program-card__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 66px 18px 18px;
    /* Measured opacity: media stays visible up top, text reads clearly at the base. */
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(5, 7, 13, 0.16) 28%,
        rgba(5, 7, 13, 0.70) 60%,
        rgba(5, 7, 13, 0.93) 100%);
    /* Scrim + text are non-interactive so the whole card opens via the stretched link;
       the real links/CTA below re-enable pointer events. */
    pointer-events: none;
}
.ssp-program-card__overlay .ssp-program-card__link,
.ssp-program-card__overlay .ssp-program-card__cta {
    pointer-events: auto;
}
.ssp-program-card__overlay .ssp-program-card__name {
    font-size: 21px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
}
.ssp-program-card__overlay .ssp-program-card__bio {
    flex: 0 0 auto;
    color: #c6d4ef;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.72);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Bio rolls upward (credits-style) within the bottom-third window. */
.ssp-program-card__scrollwrap {
    position: relative;
    height: 30%;
    min-height: 78px;
    max-height: 150px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.ssp-program-card__scroll {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    animation: sspBioRoll 14s linear infinite;
}
.ssp-program-card.has-video:hover .ssp-program-card__scroll {
    animation-play-state: paused;
}
.ssp-program-card__scroll p {
    margin: 0;
    padding-top: 150px; /* match scrollwrap max-height; 100% was card width (250-320px) causing blank scroll */
    color: #d7e2f5;
    font-size: 13px;
    line-height: 1.55;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
@keyframes sspBioRoll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}
@media (prefers-reduced-motion: reduce) {
    .ssp-program-card__scroll { animation: none; }
    .ssp-program-card__scroll p { padding-top: 0; }
    .ssp-program-card__scrollwrap { overflow-y: auto; }
}
.ssp-program-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ssp-program-card__link {
    display: inline-flex;
    align-items: center;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid rgba(107, 203, 255, 0.22);
    background: rgba(10, 14, 26, 0.6);
    color: #cfe4ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.ssp-program-card__link:hover {
    border-color: rgba(107, 203, 255, 0.6);
    background: rgba(15, 26, 48, 0.92);
    color: #eaf1ff;
}

.ssp-program-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 11px 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(144, 255, 251, 0.4);
    background: rgba(144, 255, 251, 0.08);
    color: var(--ssp-cyan);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.ssp-program-card__badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--ssp-cyan);
    box-shadow: 0 0 10px var(--ssp-cyan);
    animation: sspPulse 1.8s ease-in-out infinite;
}

.ssp-program-card__name {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ssp-text);
}

.ssp-program-card__bio {
    margin: 0;
    flex: 1 1 auto;
    color: var(--ssp-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.ssp-program-card__cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 8px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ssp-accent), var(--ssp-accent-2));
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-decoration: none;
    box-shadow: 0 12px 26px -12px rgba(43, 107, 255, 0.9);
    transition: transform 160ms ease, filter 180ms ease, background 200ms ease;
}
.ssp-program-card__cta:hover {
    transform: translateX(2px);
    filter: brightness(1.06);
    background: linear-gradient(135deg, var(--ssp-accent-2), var(--ssp-cyan));
    color: #ffffff;
}
.ssp-program-card__cta svg { stroke: currentColor; }

/* Scroll reveal for the header */
.ssp-programs [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1), transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ssp-programs [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

@keyframes sspPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce) {
    .ssp-program-card__badge::before { animation: none; }
    .ssp-programs [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* =========================================================================
   Modern card treatment — animated gradient glow border + shine sweep + lift,
   plus the click-to-open stretched link. (Inspired by the uiverse references.)
   ========================================================================= */
@property --ssp-card-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.ssp-program-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}
.ssp-program-card.is-clickable { cursor: pointer; }

/* Stretched click target → the program's submission form. */
.ssp-program-card__open {
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    text-indent: -9999px;
    overflow: hidden;
}
.ssp-program-card__open:focus-visible {
    outline: 2px solid var(--ssp-cyan);
    outline-offset: -3px;
}
/* Keep the real links + CTA above the stretched link so they still work. */
.ssp-program-card__link,
.ssp-program-card__cta {
    position: relative;
    z-index: 6;
}
.ssp-program-card__badge { z-index: 6; }

/* Shine sweep on hover */
.ssp-program-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.13) 48%, transparent 60%);
    transform: translateX(-130%);
    transition: transform 760ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.ssp-program-card:hover::before { transform: translateX(130%); }

/* Rotating gradient glow border (masked ring so it sits over the media edge) */
.ssp-program-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    padding: 1.6px;
    background: conic-gradient(
        from var(--ssp-card-angle),
        rgba(43, 107, 255, 0) 0deg,
        var(--ssp-accent) 90deg,
        var(--ssp-cyan) 150deg,
        var(--ssp-accent-2) 210deg,
        rgba(43, 107, 255, 0) 320deg
    );
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 380ms ease;
    pointer-events: none;
    animation: sspCardSpin 4.5s linear infinite;
}
.ssp-program-card:hover::after,
.ssp-program-card:focus-within::after { opacity: 1; }

.ssp-program-card:hover {
    transform: translateY(-8px) scale(1.012);
}

@keyframes sspCardSpin {
    to { --ssp-card-angle: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
    .ssp-program-card::after { animation: none; }
    .ssp-program-card::before { transition: none; }
    .ssp-program-card:hover { transform: translateY(-4px); }
}

/* =========================================================================
   Card Style variants (set in Immersive Home → Theme → Card style). Default
   "glow" is the base look above; these override it for the other feels.
   ========================================================================= */
/* GLASS — frosted, soft, no rotating ring or shine sweep. */
.ssp-programs[data-ssp-cards="glass"] .ssp-program-card::after,
.ssp-programs[data-ssp-cards="glass"] .ssp-program-card::before { display: none !important; }
.ssp-programs[data-ssp-cards="glass"] .ssp-program-card {
    border-color: rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(10, 14, 26, 0.52));
    -webkit-backdrop-filter: blur(22px) saturate(1.1);
    backdrop-filter: blur(22px) saturate(1.1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        0 20px 50px -30px rgba(0, 0, 0, 0.8);
}
.ssp-programs[data-ssp-cards="glass"] .ssp-program-card:hover {
    border-color: rgba(255, 255, 255, 0.34);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 30px 60px -30px rgba(0, 0, 0, 0.85);
}

/* MINIMAL — flat, thin border, no glow, no lift. */
.ssp-programs[data-ssp-cards="minimal"] .ssp-program-card::after,
.ssp-programs[data-ssp-cards="minimal"] .ssp-program-card::before { display: none !important; }
.ssp-programs[data-ssp-cards="minimal"] .ssp-program-card {
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(8, 11, 18, 0.84);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}
.ssp-programs[data-ssp-cards="minimal"] .ssp-program-card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
}
.ssp-programs[data-ssp-cards="minimal"] .ssp-programs__track:hover .ssp-program-card { opacity: 1; }

/* EDITORIAL — no frame at all; media + type sit on the background. */
.ssp-programs[data-ssp-cards="editorial"] .ssp-program-card::after,
.ssp-programs[data-ssp-cards="editorial"] .ssp-program-card::before { display: none !important; }
.ssp-programs[data-ssp-cards="editorial"] .ssp-program-card {
    border: 0;
    border-radius: 14px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}
.ssp-programs[data-ssp-cards="editorial"] .ssp-program-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: none;
}

/* NEON — bright accent outline + strong static glow (no rotation). */
.ssp-programs[data-ssp-cards="neon"] .ssp-program-card::after { display: none !important; }
.ssp-programs[data-ssp-cards="neon"] .ssp-program-card {
    border: 1.5px solid color-mix(in srgb, var(--ssp-accent-2, #6bcbff) 80%, transparent);
    background: rgba(6, 10, 20, 0.7);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ssp-accent, #2b6bff) 30%, transparent),
        0 0 28px -6px color-mix(in srgb, var(--ssp-accent-2, #6bcbff) 70%, transparent),
        inset 0 0 24px -10px color-mix(in srgb, var(--ssp-accent-2, #6bcbff) 55%, transparent);
}
.ssp-programs[data-ssp-cards="neon"] .ssp-program-card:hover {
    border-color: var(--ssp-cyan, #90fffb);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ssp-cyan, #90fffb) 40%, transparent),
        0 0 44px -4px color-mix(in srgb, var(--ssp-accent-2, #6bcbff) 90%, transparent),
        inset 0 0 30px -8px color-mix(in srgb, var(--ssp-accent-2, #6bcbff) 65%, transparent);
}

/* ---------- Search bar + filtered grid mode ---------- */
.ssp-programs__search {
    position: relative;
    z-index: 2;
    width: min(520px, 92%);
    margin: 6px auto 2px;
}

.ssp-programs__search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 20px;
    border-radius: 999px;
    border: 1px solid rgba(107, 203, 255, 0.28);
    background: rgba(10, 14, 26, 0.72);
    color: #eaf2ff;
    font-size: 15px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.ssp-programs__search-input::placeholder {
    color: rgba(190, 210, 240, 0.5);
}

.ssp-programs__search-input:focus {
    outline: none;
    border-color: var(--ssp-accent-2, #6bcbff);
    box-shadow: 0 0 0 3px rgba(107, 203, 255, 0.18);
}

.ssp-programs__noresults {
    position: relative;
    z-index: 2;
    text-align: center;
    color: rgba(200, 212, 238, 0.7);
    margin: 18px 0 0;
}

/* When searching, freeze the marquee and lay matches out as a wrapping grid. */
.ssp-programs.is-searching .ssp-programs__viewport {
    overflow: visible;
    cursor: default;
    touch-action: auto;
    -webkit-mask-image: none;
    mask-image: none;
}

.ssp-programs.is-searching .ssp-programs__track {
    transform: none !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.ssp-programs.is-searching .ssp-program-card[aria-hidden="true"],
.ssp-programs.is-searching .ssp-program-card.ssp-no-match {
    display: none !important;
}
