/* Video Embed Block Styles */

.video-embed-block {
    margin: 0 0 2rem 0;
}

.video-embed-block__wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    background: #000;
    border-radius: 5px;
    overflow: hidden;
}

.video-embed-block__wrapper .plyr {
    width: 100%;
    height: 100%;
    --plyr-color-main: var(--accent);
}

/* Make video thumbnail full width */
.video-embed-block__wrapper .plyr--youtube .plyr__video-wrapper,
.video-embed-block__wrapper .plyr--vimeo .plyr__video-wrapper {
    width: 100%;
    height: 100%;
}

.video-embed-block__wrapper .plyr iframe {
    width: 100%;
    height: 100%;
}

/* Editor preview styles */
.video-embed-block__preview {
    position: relative;
    width: 100%;
}

.video-embed-block__preview img {
    width: 100%;
    height: auto;
    display: block;
}

.video-embed-block__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Hide controls until playing */
.video-embed-block__wrapper .plyr__controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.video-embed-block__wrapper .plyr--playing .plyr__controls,
.video-embed-block__wrapper .plyr:hover .plyr__controls {
    opacity: 1;
    pointer-events: auto;
}

/* Keep the large play button visible */
.video-embed-block__wrapper .plyr__control--overlaid {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive aspect ratio */
.video-embed-block__wrapper::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.video-embed-block__wrapper > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Editor preview */
.wp-block-acf-video-embed {
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    .video-embed-block {
        margin: 1rem 0;
    }
}
