/* Creative Edge Toolkit for YOOtheme Pro — Video Options */

/*
 * Box that takes the place of a <video> for a YouTube/Vimeo embed. Its
 * height comes from aspect-ratio (the element's Width/Height, else the
 * video's own 16:9 or 9:16); the iframe inside is a UIkit cover, so a
 * custom ratio crops like a local video instead of letterboxing.
 */
.cety-video-embed {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

/* Like a <video width="…"> attribute: any width class or style still wins. */
:where(.cety-video-embed) {
    width: var(--cety-video-width, auto);
}

.cety-video-frame {
    border: 0;
}

/* UIkit makes cover iframes click-through; allow clicks when controls show. */
iframe.cety-video-frame.cety-video-interactive {
    pointer-events: auto;
}

/* Focal point for embeds (UIkit centers cover iframes by default). */
iframe.cety-video-frame[data-cety-focal^="top-"] {
    top: 0;
    bottom: auto;
    --uk-position-translate-y: 0;
}

iframe.cety-video-frame[data-cety-focal^="bottom-"] {
    top: auto;
    bottom: 0;
    --uk-position-translate-y: 0;
}

iframe.cety-video-frame[data-cety-focal$="-left"] {
    left: 0;
    right: auto;
    --uk-position-translate-x: 0;
}

iframe.cety-video-frame[data-cety-focal$="-right"] {
    left: auto;
    right: 0;
    --uk-position-translate-x: 0;
}

/* Poster over an embed until it plays; clicking it starts playback. */
.cety-video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.cety-video-poster.cety-video-poster-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
