/* Vimeo poster facade + shared overlay player.
   Ported from the EmranVisuals (SpicyVision) design-system.css; the original's
   --sv-* design tokens are inlined here so this drops into the product page
   with no extra variables. */

/* 16:9 responsive wrapper the facade/iframe positions against. */
.sv-vimeo-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.sv-vimeo-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

/* Poster facade — a full-bleed button that stands in for the Vimeo iframe
   until clicked (vimeo-facade.js swaps in the real player). */
.sv-vimeo-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #000;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
}
.sv-vimeo-facade-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.sv-vimeo-facade-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease, color .25s ease;
}
.sv-vimeo-facade-play svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    margin-left: 3px; /* optically centre the triangle in the circle */
}
.sv-vimeo-facade:hover .sv-vimeo-facade-poster,
.sv-vimeo-facade:focus-visible .sv-vimeo-facade-poster {
    transform: scale(1.04);
}
.sv-vimeo-facade:hover .sv-vimeo-facade-play,
.sv-vimeo-facade:focus-visible .sv-vimeo-facade-play {
    background: #ffc107;
    color: #111;
}
.sv-vimeo-facade:focus-visible {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .sv-vimeo-facade-poster { transition: none; }
    .sv-vimeo-facade:hover .sv-vimeo-facade-poster,
    .sv-vimeo-facade:focus-visible .sv-vimeo-facade-poster { transform: none; }
}

/* Shared video overlay — the facade opens the player here, large and centred,
   so it gets full controls and only one ever plays. */
.sv-video-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.88);
    opacity: 0;
    transition: opacity .2s ease;
}
.sv-video-modal[hidden] { display: none; }
.sv-video-modal.is-open { opacity: 1; }
body.sv-modal-open { overflow: hidden; }

.sv-video-modal-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
.sv-video-modal-dialog {
    position: relative;
    z-index: 1;
    /* Fit the 16:9 player to whichever of viewport width / height binds first,
       leaving headroom for the external close button on desktop. */
    width: min(92vw, calc((100vh - 7rem) * 16 / 9));
    width: min(92vw, calc((100dvh - 7rem) * 16 / 9));
    max-width: 1200px;
}
.sv-video-modal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.sv-video-modal-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}
.sv-video-modal-close {
    position: absolute;
    top: -3.25rem;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease;
}
.sv-video-modal-close svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
.sv-video-modal-close:hover,
.sv-video-modal-close:focus-visible {
    background: #ffc107;
    color: #111;
}
.sv-video-modal-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
