/* =========================================================================
   Video Lectures element — userfiles/modules/fame-page-elements/video-lectures
   Loaded on demand by fame_pe_style('video-lectures'); nothing here belongs in
   the theme's global fame-style.css.

   Layout: a floating "shelf" card that overlaps the hero above it, holding a
   responsive grid of lecture-series tiles. Each tile is one link: a play
   badge, the title, and a chevron that slides in on hover.
   ========================================================================= */

.fame-el-video-lectures {
    /* Tokens — one place to retheme, and what the live-edit Style Editor
       overrides land on top of. */
    --fame-vl-ink: #121f3e;
    --fame-vl-ink-soft: #5b6b86;
    --fame-vl-accent: var(--fame-blue, #0566e3);
    --fame-vl-accent-soft: #eef4ff;
    --fame-vl-line: #e7ecf5;
    --fame-vl-tile: #fff;
    --fame-vl-radius: 16px;

    /* No surface of its own — the tiles float directly on whatever the page
       puts behind them. Only the bg_image setting paints anything here. */
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    width: 100%;
    padding: 0;
    background: transparent;
    border: 0;
}

/* A configured background image gets its own rounded panel + inner padding so
   the artwork frames the tiles instead of running edge to edge. */
.fame-el-video-lectures.has-bg {
    padding: clamp(20px, 3vw, 40px);
    border-radius: 24px;
    overflow: hidden;
}

/* ---- grid --------------------------------------------------------------- */
.fame-el-video-lectures .fame-vl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 12px;
}

.fame-el-video-lectures .fame-vl-list li {
    margin: 0;
    padding: 0;
    /* index.php sets --fame-vl-c per <li> from the item's saved colour; this is
       the fallback for anything it could not resolve. */
    --fame-vl-c: var(--fame-vl-accent);
}

/* ---- tile --------------------------------------------------------------- */
.fame-el-video-lectures .fame-vl-link {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
    padding: 12px 14px;
    text-decoration: none;
    background: var(--fame-vl-tile);
    border: 1px solid var(--fame-vl-line);
    border-radius: var(--fame-vl-radius);
    box-shadow: 0 1px 2px rgba(16, 32, 73, .04);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;

    /* Tinted in the item's own colour. Declared after the plain values above,
       so a browser without color-mix() keeps the white tile rather than
       dropping the rule. */
    background: color-mix(in srgb, var(--fame-vl-c) 7%, #fff);
    border-color: color-mix(in srgb, var(--fame-vl-c) 22%, #fff);
    box-shadow: 0 1px 2px color-mix(in srgb, var(--fame-vl-c) 18%, transparent);
}

.fame-el-video-lectures .fame-vl-link:hover,
.fame-el-video-lectures .fame-vl-link:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(5, 102, 227, .35);
    box-shadow: 0 12px 26px rgba(8, 20, 102, .12);

    /* The lift is coloured too: the shadow is the item's colour, so the grid
       glows in a different hue under every tile. */
    background: color-mix(in srgb, var(--fame-vl-c) 13%, #fff);
    border-color: color-mix(in srgb, var(--fame-vl-c) 45%, #fff);
    box-shadow:
        0 14px 28px -10px color-mix(in srgb, var(--fame-vl-c) 55%, transparent),
        0 4px 10px -6px color-mix(in srgb, var(--fame-vl-c) 40%, transparent);
}

.fame-el-video-lectures .fame-vl-link:focus-visible {
    outline: 2px solid var(--fame-vl-accent);
    outline-offset: 2px;
}

.fame-el-video-lectures .fame-vl-link:active {
    transform: translateY(0);
}

/* Play badge — replaces the old diamond check glyph. */
.fame-el-video-lectures .fame-vl-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--fame-vl-accent-soft);
    color: var(--fame-vl-accent);
    transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;

    background: color-mix(in srgb, var(--fame-vl-c) 15%, #fff);
    color: var(--fame-vl-c);
}

.fame-el-video-lectures .fame-vl-ico svg {
    width: 17px;
    height: 17px;
    display: block;
}

.fame-el-video-lectures .fame-vl-link:hover .fame-vl-ico,
.fame-el-video-lectures .fame-vl-link:focus-visible .fame-vl-ico {
    background: var(--fame-vl-accent);
    color: #fff;
    transform: scale(1.06);

    /* Solid in the item's colour, with a matching glow. */
    background: var(--fame-vl-c);
    box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--fame-vl-c) 65%, transparent);
}

/* Title — capped at two lines so a stray long entry can't stretch the row.
   overflow-wrap keeps unbroken strings inside the tile. */
.fame-el-video-lectures .fame-vl-text {
    flex: 1 1 auto;
    min-width: 0;
    font-style: normal;
    font-weight: 600;
    font-size: 15.5px;
    line-height: 1.4;
    color: var(--fame-vl-ink);
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.fame-el-video-lectures .fame-vl-link:hover .fame-vl-text,
.fame-el-video-lectures .fame-vl-link:focus-visible .fame-vl-text {
    color: var(--fame-vl-accent);
    color: var(--fame-vl-c);
}

/* Chevron — faint at rest, slides right on hover. */
.fame-el-video-lectures .fame-vl-go {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    color: var(--fame-vl-ink-soft);
    opacity: .35;
    transition: opacity .18s ease, transform .18s ease, color .18s ease;
}

.fame-el-video-lectures .fame-vl-go svg {
    width: 16px;
    height: 16px;
    display: block;
}

.fame-el-video-lectures .fame-vl-link:hover .fame-vl-go,
.fame-el-video-lectures .fame-vl-link:focus-visible .fame-vl-go {
    opacity: 1;
    color: var(--fame-vl-accent);
    color: var(--fame-vl-c);
    transform: translateX(3px);
}

/* ---- on a background image ---------------------------------------------- */
/* Over artwork the tiles go slightly translucent so the image reads through —
   keeping their colour tint, just diluted into the translucent white. */
.fame-el-video-lectures.has-bg .fame-vl-link {
    background: rgba(255, 255, 255, .92);
    border-color: rgba(255, 255, 255, .85);

    background: color-mix(in srgb, var(--fame-vl-c) 10%, rgba(255, 255, 255, .92));
    border-color: color-mix(in srgb, var(--fame-vl-c) 25%, rgba(255, 255, 255, .85));
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1279px) {
    .fame-el-video-lectures {
        max-width: calc(100% - 32px);
        margin-top: -120px;
    }
}

@media (max-width: 991px) {
    .fame-el-video-lectures {
        /* Below the hero's overlap point the grid sits in normal flow —
           a negative margin here would swallow the hero's own text. */
        margin-top: 24px;
    }
    .fame-el-video-lectures.has-bg { border-radius: 18px; }
    .fame-el-video-lectures .fame-vl-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 575px) {
    .fame-el-video-lectures {
        max-width: calc(100% - 20px);
    }
    .fame-el-video-lectures.has-bg { padding: 16px; }
    .fame-el-video-lectures .fame-vl-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .fame-el-video-lectures .fame-vl-ico { width: 34px; height: 34px; border-radius: 10px; }
    .fame-el-video-lectures .fame-vl-text { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .fame-el-video-lectures .fame-vl-link,
    .fame-el-video-lectures .fame-vl-ico,
    .fame-el-video-lectures .fame-vl-go {
        transition: none;
    }
    .fame-el-video-lectures .fame-vl-link:hover,
    .fame-el-video-lectures .fame-vl-link:focus-visible,
    .fame-el-video-lectures .fame-vl-link:hover .fame-vl-ico,
    .fame-el-video-lectures .fame-vl-link:hover .fame-vl-go {
        transform: none;
    }
}
