/* =========================================================
   Sticky iFrame Player v2 — sticky-iframe-player.css
   ========================================================= */

/* ---------- Wrapper ---------- */
.sip-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    contain: style;
}

/* ---------- Placeholder ----------
   Holds layout space via padding-top trick. Visible as a dark
   slot when the float is sticky (so the page doesn't reflow). */
.sip-placeholder {
    width: 100%;
    background: #111;
}

/* ---------- Float box ----------
   Lives on top of the placeholder in inline mode (position:absolute).
   Switches to position:fixed when .is-sticky is on the wrapper.
   The iframe is always inside here — it NEVER moves. */
.sip-float {
    position: absolute;
    inset: 0;           /* stretches to fill wrapper exactly */
    background: #000;
    overflow: hidden;
    z-index: 1;
    transition: box-shadow .25s ease, border-radius .25s ease;
}

/* ---------- Iframe ---------- */
.sip-float iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* ---------- Sticky state ---------- */
.sip-wrapper.is-sticky .sip-float {
    position: fixed;
    inset: auto;                            /* reset the inset:0 above */
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    border-radius: 8px;
    z-index: 9999;
    /* width + aspect-ratio set by JS so height self-adjusts */
}

.sip-wrapper.is-sticky .sip-float:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,.75);
}

/* Desktop corner positions */
.sip-wrapper.is-sticky .sip-float[data-pos="bottom-right"] { bottom: 20px; right: 20px; }
.sip-wrapper.is-sticky .sip-float[data-pos="bottom-left"]  { bottom: 20px; left:  20px; }
.sip-wrapper.is-sticky .sip-float[data-pos="top-right"]    { top:    70px; right: 20px; }
.sip-wrapper.is-sticky .sip-float[data-pos="top-left"]     { top:    70px; left:  20px; }

/* ---------- Close button (only when sticky) ---------- */
.sip-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
}
.sip-wrapper.is-sticky .sip-close { display: flex; }
.sip-close:hover { background: rgba(180,0,0,.85); }

/* ---------- Dismissed ---------- */
.sip-wrapper.is-dismissed .sip-float { display: none; }

/* ---------- Mobile (≤767px) ----------
   Size and position are set by JS (repositionAll).
   Only visual overrides here. */
@media (max-width: 767px) {
    .sip-wrapper.is-sticky .sip-float {
        border-radius: 6px;
    }
}

/* ---------- Entrance animations ---------- */
@keyframes sip-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes sip-slide-down {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sip-wrapper.is-sticky.sip-animate .sip-float[data-pos="bottom-right"],
.sip-wrapper.is-sticky.sip-animate .sip-float[data-pos="bottom-left"] {
    animation: sip-slide-up .22s ease forwards;
}
.sip-wrapper.is-sticky.sip-animate .sip-float[data-pos="top-right"],
.sip-wrapper.is-sticky.sip-animate .sip-float[data-pos="top-left"] {
    animation: sip-slide-down .22s ease forwards;
}
