/* === VIDEO MODAL (lazy loaded on click) === */
    .video-modal-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(8, 24, 43, 0.84);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 10000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
    }

    .video-modal-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    .video-modal-dialog {
        background: #0f172a;
        width: 100%;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        overflow: hidden;
        box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
        transform: scale(0.93) translateY(12px);
        transition: max-width 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .video-modal-backdrop.open .video-modal-dialog {
        transform: scale(1) translateY(0);
    }

    .video-modal-dialog.mode-portrait {
        max-width: 100vw;
    }

    .video-modal-dialog.mode-square {
        max-width: 100vw;
    }

    .video-modal-dialog.mode-landscape {
        max-width: 100vw;
    }

    .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 20px;
        background: #1e293b;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        gap: 12px;
        align-self: stretch;
        width: 100%;
    }

    .modal-title-group {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .modal-title {
        color: #ffffff;
        font-size: 15.5px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .modal-close-btn {
        background: transparent;
        border: none;
        color: #94a3b8;
        cursor: pointer;
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        outline: none;
    }

    .modal-close-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    /* Floating close button — pinned to top-right of the viewport,
       always visible regardless of modal size. */
    .video-modal-floating-close {
      position: fixed;
    top: 14%;
    left: 26%;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    padding: 0;
    transition: background-color 0.2s ease, transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    }

    .video-modal-floating-close:hover {
        background: rgba(220, 38, 38, 0.95);
        border-color: rgba(255, 255, 255, 0.35);
        transform: scale(1.08);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    }

    .video-modal-floating-close:active {
        transform: scale(0.96);
    }

    .video-modal-floating-close:focus-visible {
        outline: 2px solid #ffffff;
        outline-offset: 3px;
    }

    @media (max-width: 600px) {
        .video-modal-floating-close {
            top: 12px;
            right: 12px;
            width: 42px;
            height: 42px;
        }
    }

    .video-player-box {
        position: relative;
        width: 100%;
        background: #000000;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        min-height: 220px;
        transition: max-height 0.3s ease;
        flex-shrink: 0;
    }

    .video-player-box video {
        width: 100%;
        height: 100%;
        max-height: 100%;
        object-fit: contain;
        display: block;
        background: #000000;
    }