.video {
    position: relative;
    aspect-ratio: 13 / 9;
    background: #979797;
    object-fit: cover;
    overflow: hidden;
    cursor: pointer;
    max-width: 700px;
    margin: 0 auto 1.5em;
}

.video.ration13x9 {
    aspect-ratio: 13 / 9;
}

.video.lazy.loading:after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.6);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
}

.video.lazy.loading .video-toggle {
    display: none;
}

.video.lazy video {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.video video {
    object-fit: cover;
    display: block;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

.video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-thumb.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-toggle {
    position: absolute;
    top: 11%;
    left: 53%;
    z-index: 3;
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: #003558;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s ease, transform 0.3s ease;
    animation: pulse 2s infinite;
}

.video-toggle:hover {
    transform: scale(1.1);
}

/* Play icon (default) */
.video-toggle::before {
    content: "";
    width: 46px;
    height: 46px;
    background-color: #fff;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

/* Pause icon when playing */
.video-toggle.playing::before {
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 19h4V5H6zm8-14v14h4V5h-4z'/%3E%3C/svg%3E");
}

@media screen and (min-width: 768px) {
    .video {
        aspect-ratio: 16 / 9;
    }

    .video-toggle {
        top: 12%;
        left: 52%;
        width: 82px;
        height: 82px;
    }
}

/* Pulse animation */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    70% { box-shadow: 0 0 0 15px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
