/* ============================================
   Hover Video Widget – hvw-style.css v1.5
   ============================================ */

.hvw-wrapper {
    position: relative;
    display: block;
    width: 100%;
    height: 400px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    touch-action: auto; /* never block scroll */
    -webkit-tap-highlight-color: transparent;
}

/* ── Local video ── */
.hvw-wrapper video.hvw-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
    pointer-events: none;
}

/* ── YouTube iframe ── */
.hvw-wrapper .hvw-yt-iframe {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    border: none;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.hvw-wrapper[data-controls="yes"] .hvw-yt-iframe {
    pointer-events: auto;
}

/* ── Poster ── */
.hvw-poster {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 3;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hvw-wrapper.hvw-playing .hvw-poster,
.hvw-wrapper.hvw-started .hvw-poster {
    opacity: 0;
}

/* ── Overlay — visual only ── */
.hvw-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.35);
    z-index: 4;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.hvw-wrapper.hvw-playing .hvw-overlay {
    opacity: 0;
}

/* ── Play Button ── */
.hvw-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;

    /* Visible by default (not yet playing) */
    opacity: 1;
}

.hvw-play-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    display: block;
    margin-left: 3px;
}

.hvw-icon-circle  { border-radius: 50%; background: rgba(0,0,0,0.55); }
.hvw-icon-square  { border-radius: 6px; background: rgba(0,0,0,0.55); }
.hvw-icon-minimal { background: transparent !important; }

/* Hide play icon ONLY while actively playing */
.hvw-wrapper.hvw-playing .hvw-play-btn {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

/* Show play icon when manually paused by user click */
.hvw-wrapper.hvw-user-paused .hvw-play-btn {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

/* ── Loading spinner ── */
.hvw-wrapper.hvw-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 36px; height: 36px;
    margin: -18px 0 0 -18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hvw-spin 0.7s linear infinite;
    z-index: 6;
    pointer-events: none;
}

@keyframes hvw-spin { to { transform: rotate(360deg); } }

/* ── Mobile ── */
@media (max-width: 768px) {
    .hvw-play-btn { width: 48px !important; height: 48px !important; }
    .hvw-play-btn svg { width: 22px !important; height: 22px !important; }
}
