/*
 * Sapp Media — Privacy Video Facade
 * Thumbnail + play button replaces the iframe until user clicks.
 */

.sapp-video-facade {
    position: relative;
    display: block;
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 2px;
    cursor: pointer;
    /* 16:9 aspect ratio placeholder until image loads */
    aspect-ratio: 16 / 9;
}

.sapp-video-embed .sapp-video-facade {
    margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Thumbnail                                                             */
/* ------------------------------------------------------------------ */
.svf-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s ease;
}

.sapp-video-facade:hover .svf-thumb,
.sapp-video-facade:focus-within .svf-thumb {
    filter: brightness(0.75);
}

@media (prefers-reduced-motion: reduce) {
    .svf-thumb {
        transition: none;
    }
}

/* Blank placeholder when no thumbnail is available */
.svf-thumb--blank {
    position: absolute;
    inset: 0;
    background: #1a1a1a;
}

/* ------------------------------------------------------------------ */
/* Play button                                                            */
/* ------------------------------------------------------------------ */
.svf-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.svf-play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.svf-play-icon {
    width: 72px;
    height: 72px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

/* Triangle */
.svf-play-icon::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 14px solid transparent;
    border-bottom: 14px solid transparent;
    border-left: 22px solid #fff;
    margin-left: 4px; /* optical centering */
}

.sapp-video-facade:hover .svf-play-icon,
.svf-play:focus-visible .svf-play-icon {
    background: #c00; /* YouTube-esque red — works well for all platforms */
    transform: scale(1.1);
}

@media (prefers-reduced-motion: reduce) {
    .svf-play-icon {
        transition: none;
    }
    .sapp-video-facade:hover .svf-play-icon,
    .svf-play:focus-visible .svf-play-icon {
        transform: none;
    }
}

/* ------------------------------------------------------------------ */
/* Loaded iframe                                                          */
/* ------------------------------------------------------------------ */
.svf-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ------------------------------------------------------------------ */
/* Caption (sapp/video-embed block)                                      */
/* ------------------------------------------------------------------ */
.svf-caption {
    display: block;
    text-align: center;
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.5rem;
}
