/*
 * Cultina Video widget — poster tile + play button; plays inline (replacing the
 * poster) or in a lightbox. Most values come from the widget's Style controls;
 * this file holds the structure and the inline/lightbox mechanics.
 */

.cv { display: block; width: 100%; }

.cv__stage {
    position: relative;
    width: 100%;
    height: 650px;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-color: #1a1a1a;
    cursor: pointer;
}
@media (max-width: 1024px) { .cv__stage { height: 460px; } }
@media (max-width: 767px)  { .cv__stage { height: 360px; } }

.cv__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.15);
    pointer-events: none;
    transition: background-color 200ms ease;
}

.cv__play {
    position: absolute;
    top: 50%;
    left: 50%;
    /* centred by default; --cv-play-x/y nudge it (0/0 = centre). */
    transform: translate(calc(-50% + var(--cv-play-x, 0px)), calc(-50% + var(--cv-play-y, 0px)));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 75px;
    line-height: 1;
    color: #FFFFFF;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease,
                transform 200ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cv__play i,
.cv__play svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}
.cv:hover .cv__play {
    transform: translate(calc(-50% + var(--cv-play-x, 0px)), calc(-50% + var(--cv-play-y, 0px))) scale(1.08);
}
.cv__play:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
    border-radius: 50%;
}
.cv__play[disabled] { opacity: 0.5; cursor: default; }

/* inline player fills the stage; poster/overlay/button hidden once playing */
.cv--playing .cv__overlay,
.cv--playing .cv__play { display: none; }
.cv--playing .cv__stage { cursor: default; }
.cv__stage video,
.cv__stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}
.cv__stage video { object-fit: cover; }

/* ----- lightbox (appended to <body> by the JS) -------------------------- */
.cv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background-color: rgba(20, 20, 20, 0.92);
    opacity: 0;
    transition: opacity 200ms ease;
}
.cv-lightbox.is-open { opacity: 1; }
.cv-lightbox__inner {
    position: relative;
    width: 100%;
    max-width: 1080px;
    aspect-ratio: 16 / 9;
    background: #000;
}
.cv-lightbox__inner video,
.cv-lightbox__inner iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.cv-lightbox__close {
    position: absolute;
    top: -46px;
    right: 0;
    width: 40px;
    height: 40px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #FFFFFF;
    font-size: 34px;
    line-height: 1;
}
body.cv-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .cv__play, .cv-lightbox { transition: none; }
}
