/* ==========================================================================
   Vimeo Lightbox Block — vimeo-lightbox.css
   ========================================================================== */

/* ── Block wrapper ───────────────────────────────────────────────────────── */

.vlb-block {
    position: relative;
    width: 100%;
}

/* ── Inline player ───────────────────────────────────────────────────────── */

.vlb-inline {
    position: relative;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px; /* adjust or remove to taste */
    background: #000;
}

/* 16:9 aspect ratio container */
.vlb-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}

.vlb-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.vlb-click-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    cursor: pointer;
}

/* Poster image — overlays the iframe until the player is ready */
.vlb-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.vlb-poster.is-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Play hint icon — subtle indicator the video is clickable */
.vlb-play-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.15);
}

.vlb-inline:hover .vlb-play-hint,
.vlb-inline:focus-visible .vlb-play-hint {
    opacity: 1;
}

.vlb-inline:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* ── Caption ─────────────────────────────────────────────────────────────── */

.vlb-caption {
    margin: 0.5em 0 0;
    font-size: 0.875em;
    color: inherit;
    opacity: 0.7;
}

/* ── Lightbox overlay ────────────────────────────────────────────────────── */

.vlb-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* hidden attribute — override display so transitions work */
.vlb-lightbox[hidden] {
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
}

/* Backdrop */
.vlb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.vlb-lightbox.is-open .vlb-backdrop {
    opacity: 1;
}

/* Inner container — animates from inline rect to viewport-filling */
.vlb-lightbox-inner {
    position: absolute;
    background: #000;
    overflow: hidden;
    border-radius: 4px;

    /* Initial state matches inline player position — set via JS */
    transform-origin: top left;
    transition:
        top    0.42s cubic-bezier(0.4, 0, 0.2, 1),
        left   0.42s cubic-bezier(0.4, 0, 0.2, 1),
        width  0.42s cubic-bezier(0.4, 0, 0.2, 1),
        height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
        border-radius 0.42s ease;
}

.vlb-lightbox.is-open .vlb-lightbox-inner {
    border-radius: 0;
}

/* Player inside lightbox */
.vlb-lightbox-player {
    width: 100%;
    height: 100%;
}

.vlb-lightbox-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Close button */
.vlb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition:
        opacity 0.25s ease 0.2s,
        transform 0.25s ease 0.2s,
        background 0.15s ease;
    padding: 0;
    line-height: 1;
}

.vlb-lightbox.is-open .vlb-close {
    opacity: 1;
    transform: scale(1);
}

.vlb-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.vlb-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ── Editor placeholder ──────────────────────────────────────────────────── */

.vlb-placeholder {
    padding: 2em;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    text-align: center;
    border-radius: 4px;
    color: #666;
}

.vlb-editor-thumb {
    position: absolute;
    inset: 0;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */

/* Prevent body scroll while lightbox is open */
body.vlb-open {
    overflow: hidden;
}
