/* ==========================================================
   Imàtica Suite — Video Widget
   ========================================================== */

.im-video-frame {
    position: relative;
    width: 100%;
}

.im-video-mode-normal {
    aspect-ratio: 16 / 9; /* overridden inline per instance / by "auto" */
}

.im-video-frame iframe,
.im-video-frame video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.im-video-mode-normal iframe,
.im-video-mode-normal video {
    position: absolute;
    inset: 0;
}

.im-video-mode-normal video {
    object-fit: contain;
    background: #000;
}

/* ---- Background mode ---- */
.im-video-bg-wrap {
    position: relative;
    width: 100%;
    height: 60vh; /* overridden by the responsive "Alçada" control */
    overflow: hidden;
}

/* "Ocupar tot l'ample de pantalla" — classic full-bleed break-out, escapes
   whatever Elementor container/column width the widget is nested inside. */
.im-video-full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.im-video-mode-bg {
    position: absolute;
    inset: 0;
    pointer-events: none; /* purely decorative — clicks pass through to content above */
}

.im-video-mode-bg iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    /* Oversize + center-crop so the video always covers the frame regardless
       of its native aspect ratio, mimicking object-fit:cover (iframes don't
       support object-fit). 177.77% ≈ 16:9 width needed to cover a 9:16 box
       and vice versa; the min-* fallback covers the opposite extreme. */
    min-width: 100%;
    min-height: 100%;
    width: 177.77vh;
    height: 56.25vw;
    transform: translate(-50%, -50%);
}

.im-video-mode-bg video {
    object-fit: cover;
}
