/* =========================================================================
   Shared video rail components — used by the dictionary index page sidebar
   AND the bs_related_videos blog widget. Selectors are NOT scoped under
   #bs-dictionary-page so they work in any container.

   Structural rules only. The dictionary index page may add cosmetic tweaks
   in bs-dictionary-page.css that scope under #bs-dictionary-page.
   ========================================================================= */

/* ----- Mobile featured card ----- */
.bs-dict-video-mobile {
    display: flex;
    gap: 14px;
    padding: 12px;
    margin: 16px 0 24px;
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.bs-dict-video-mobile-thumb {
    position: relative;
    flex: 0 0 auto;
    width: 84px;
    aspect-ratio: 9 / 16;
    border: 0;
    padding: 0;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}

.bs-dict-video-mobile-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bs-dict-video-mobile-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.bs-dict-video-mobile-eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bs-text-muted, #6b7280);
}

.bs-dict-video-mobile-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--bs-text, #111827);
    text-decoration: none;
    line-height: 1.25;
}

.bs-dict-video-mobile-title:hover {
    color: var(--bs-link, #2563eb);
}

.bs-dict-video-mobile-caption {
    font-size: 13px;
    color: var(--bs-text-muted, #6b7280);
    margin: 0;
}

.bs-dict-video-mobile-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bs-dict-video-mobile-cta:hover {
    background: #dc2626;
}

@media (min-width: 1024px) {
    .bs-dict-video-mobile {
        display: none;
    }
}

/* ----- Desktop sidebar rail ----- */
.bs-dict-video-rail {
    position: sticky;
    top: 96px;
    background: var(--bs-card-bg, #fff);
    border: 1px solid var(--bs-border-color, #e5e7eb);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

@media (max-width: 1023px) {
    .bs-dict-video-rail {
        position: static;
    }
    .bs-dict-video-rail .bs-dict-video-stage {
        aspect-ratio: 9 / 14;
        max-height: 480px;
    }
}

/* Header rendered via ListWidgetHelper::renderHeader — see .bs-lw-header
   styles in the global theme stylesheet. */

.bs-dict-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.bs-dict-video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: #000;
    cursor: pointer;
    overflow: hidden;
}

.bs-dict-video-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bs-dict-video-thumb-overlay-eyebrow {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

.bs-dict-video-thumb-overlay-title {
    position: absolute;
    top: 30px;
    left: 14px;
    right: 14px;
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
}

.bs-dict-video-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: radial-gradient(circle at center, rgba(0,0,0,0) 30%, rgba(0,0,0,.15) 70%);
    transition: transform .18s ease;
}

.bs-dict-video-thumb-play svg {
    background: #ef4444;
    border-radius: 50%;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(239,68,68,.5);
    transition: transform .18s ease;
}

.bs-dict-video-thumb:hover .bs-dict-video-thumb-play svg {
    transform: scale(1.06);
}

.bs-dict-video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bs-dict-video-meta {
    margin-bottom: 12px;
    text-align: center;
}

.bs-dict-video-term-link {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--bs-text, #111827);
    text-decoration: none;
    line-height: 1.25;
}

a.bs-dict-video-term-link:hover {
    color: var(--bs-link, #2563eb);
}

.bs-dict-video-caption {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--bs-text-muted, #6b7280);
}

.bs-dict-video-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.bs-dict-video-pager button {
    width: 36px;
    height: 32px;
    border: 1px solid var(--bs-border-color, #e5e7eb);
    background: var(--bs-card-bg, #fff);
    color: var(--bs-text, #111827);
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.bs-dict-video-pager button:hover {
    border-color: var(--bs-link, #2563eb);
    color: var(--bs-link, #2563eb);
}

.bs-dict-video-pager-state {
    flex: 1;
    text-align: center;
    font-size: 13px;
    color: var(--bs-text-muted, #6b7280);
    font-variant-numeric: tabular-nums;
}

.bs-dict-video-browse {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--bs-border-color, #e5e7eb);
    background: transparent;
    color: var(--bs-text, #111827);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.bs-dict-video-browse:hover {
    border-color: var(--bs-link, #2563eb);
    color: var(--bs-link, #2563eb);
}

/* ----- Mobile lightbox ----- */
.bs-dict-video-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 16px;
}

.bs-dict-video-lightbox.is-open {
    display: flex;
}

.bs-dict-video-lightbox-frame {
    position: relative;
    aspect-ratio: 9 / 16;
    height: 100%;
    max-height: calc(100vh - 80px);
    max-width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.bs-dict-video-lightbox-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.bs-dict-video-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.bs-dict-video-lightbox-close:hover {
    background: rgba(0, 0, 0, .85);
}
