/* ── Video Canvas Block — Front-end styles ──────────────────────────────── */

.wp-block-vcb-video-canvas {
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* ── Video layer ─────────────────────────────────────────────────────────── */

.wp-block-vcb-video-canvas .vcb-video-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Hosted <video>: covers the container like a background image */
.wp-block-vcb-video-canvas video.vcb-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    border: 0;
}

/*
 * YouTube iframe cover trick.
 *
 * YouTube videos are 16:9. The container can be any aspect ratio.
 * We make the iframe larger than the container in both dimensions
 * and centre it, so it crops cleanly on all viewport sizes without
 * letterboxing or pillarboxing.
 */
.wp-block-vcb-video-canvas iframe.vcb-yt-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    /* Ensure coverage: whichever dimension is constraining, the other overflows */
    width:  max(100%, calc(100vh * 16 / 9));
    height: max(100%, calc(100vw * 9 / 16));
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 0;
}

/* ── Overlay ─────────────────────────────────────────────────────────────── */

.wp-block-vcb-video-canvas .vcb-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ── Outer flex (vertical alignment wrapper) ─────────────────────────────── */

.wp-block-vcb-video-canvas .vcb-outer {
    position: relative;
    z-index: 2;
    width: 100%;
    box-sizing: border-box;
}

/* ── Inner content ───────────────────────────────────────────────────────── */

.wp-block-vcb-video-canvas .vcb-content {
    box-sizing: border-box;
    width: 100%;
}

.wp-block-vcb-video-canvas .vcb-content > * {
    width: 100%;
	
}

/* ── Accessibility ───────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .wp-block-vcb-video-canvas video.vcb-video-el {
        animation: none !important;
    }
}

/* ── Unmute button ───────────────────────────────────────────────────────── */

.wp-block-vcb-video-canvas .vcb-unmute-btn {
    /* Positioning — bottom-left corner of the block */
    position: absolute;
    bottom: 20px;
    left: 3em;
    z-index: 10;

    /* Layout */
    display: inline-flex;
    align-items: center;
    gap: 8px;

    /* Appearance */
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    padding: 8px 16px 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    font-family: inherit;

    /* Smooth hover + hide transitions */
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.35s ease, transform 0.35s ease;

    /* Don't let it block InnerBlocks clicks */
    pointer-events: auto;
}

.wp-block-vcb-video-canvas .vcb-unmute-btn:hover,
.wp-block-vcb-video-canvas .vcb-unmute-btn:focus-visible {
    background: rgba(0, 0, 0, 0.78);
    border-color: rgba(255, 255, 255, 0.85);
    outline: none;
}

.wp-block-vcb-video-canvas .vcb-unmute-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.wp-block-vcb-video-canvas .vcb-unmute-btn svg {
    display: block;
    flex-shrink: 0;
}

/* Fade-out animation triggered by JS after click */
.wp-block-vcb-video-canvas .vcb-unmute-btn--hiding {
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
}
