/**
 * VELA Video Library Widget — layout + animation. Colors driven by Elementor controls.
 */

.elementor-widget-vela-video-library > .elementor-widget-container { padding: 0; }

.vela-vl {
    box-sizing: border-box;
    --vela-vl-cols: 3;
    --vela-vl-cols-tablet: 2;
    --vela-vl-thumb-a: #162F58;
    --vela-vl-thumb-b: #1E3F72;
}
.vela-vl *,
.vela-vl *::before,
.vela-vl *::after { box-sizing: inherit; }

.vela-vl__inner { width: 100%; }

/* ── Heading ────────────────────────────── */
.vela-vl__intro {
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
    max-width: 720px;
}
.vela-vl__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.vela-vl__eyebrow::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 2px;
    background: currentColor;
}
.vela-vl__title { margin: 0 0 12px; }
.vela-vl__desc  { margin: 0; }

/* ── Layout ─────────────────────────────── */
.vela-vl__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 880px) {
    .vela-vl__layout {
        grid-template-columns: 1fr !important;
        gap: 24px;
    }
}

/* ── Sidebar filter ─────────────────────── */
.vela-vl__sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 96px; /* under sticky header */
}
@media (max-width: 880px) {
    .vela-vl__sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        position: static;
        gap: 8px;
    }
}
.vela-vl__filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-left: 3px solid transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
    font: inherit;
    transition: background-color .2s, color .2s, border-color .2s;
    appearance: none;
    -webkit-appearance: none;
}
.vela-vl__filter:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.vela-vl__filter-label { flex: 1; }
.vela-vl__count {
    font-size: 12px;
    flex-shrink: 0;
}
@media (max-width: 880px) {
    .vela-vl__filter { width: auto; border-left: 0; }
}

/* ── Topic groups ───────────────────────── */
.vela-vl__specialty + .vela-vl__specialty { margin-top: 48px; }
.vela-vl__topic-block + .vela-vl__topic-block { margin-top: 32px; }
.vela-vl__topic {
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid;
    font-size: 18px;
}

/* ── Card grid ──────────────────────────── */
.vela-vl__grid {
    display: grid;
    grid-template-columns: repeat(var(--vela-vl-cols), 1fr);
    gap: 16px;
}
@media (max-width: 1100px) {
    .vela-vl__grid {
        grid-template-columns: repeat(var(--vela-vl-cols-tablet), 1fr);
    }
}
@media (max-width: 600px) {
    .vela-vl__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card ───────────────────────────────── */
.vela-vl__card {
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    padding: 0 !important;
    background: transparent;
    color: inherit;
    font: inherit;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;            /* allow shrinking inside CSS grid */
    max-width: 100%;
    transition: transform .2s ease, box-shadow .2s ease;
}
.vela-vl__card:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.vela-vl__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--vela-vl-thumb-a) 0%, var(--vela-vl-thumb-b) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    overflow: hidden;
}
.vela-vl__play {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}
.vela-vl__play svg { margin-left: 2px; }
.vela-vl__card:hover .vela-vl__play {
    transform: scale(1.08);
}

.vela-vl__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.vela-vl__breadcrumb,
.vela-vl__name {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.vela-vl__breadcrumb {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.4;
}
.vela-vl__name {
    font-weight: 500;
    font-size: 15px;
    line-height: 1.4;
}

/* ── Modal ──────────────────────────────── */
.vela-vl__overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.vela-vl.is-modal-open .vela-vl__overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease, visibility 0s;
}

.vela-vl__modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 92%;
    max-width: 880px;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, transform .3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear .3s;
}
.vela-vl.is-modal-open .vela-vl__modal {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity .3s ease, transform .4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0s;
}

.vela-vl__modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.15) !important;
    background-image: none !important;
    color: #FFFFFF !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1 !important;
    font-size: 0 !important;
    box-shadow: none !important;
    transition: background-color .2s ease, transform .2s ease !important;
}
.vela-vl__modal-close:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: scale(1.05) !important;
}
.vela-vl__modal-close:focus-visible {
    outline: 2px solid #FFFFFF !important;
    outline-offset: 2px !important;
}
.vela-vl__modal-close svg {
    width: 18px !important;
    height: 18px !important;
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
    fill: none !important;
    pointer-events: none;
}

.vela-vl__modal-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    line-height: 0;
}
.vela-vl__modal-frame iframe {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
    aspect-ratio: 16 / 9 !important;
    max-width: 100% !important;
}
.vela-vl__modal-caption {
    padding: 12px 16px;
    color: rgba(255,255,255,0.85);
    font: 400 13px/1.4 'DM Sans', sans-serif;
    background: rgba(0,0,0,0.6);
    text-align: center;
}
