.video-background {
    background-color: transparent;
    background-image: linear-gradient(to bottom,
            transparent 50%,
            #edf0f0 50%);
}

.video-preview-trigger {
    cursor: pointer;
    position: relative;
    max-width: 640px;
    margin: 0 auto;
}

/* --- 16:9 --- */
.video-preview-trigger.video-horizontal {
    max-width: 1022px;
}

.video-preview-trigger.video-horizontal .ytp-cued-thumbnail-overlay {
    padding-bottom: 56.25%;
}

/* --- Vertical Videos --- */
.video-preview-trigger.video-vertical {
}

.video-preview-trigger.video-vertical .ytp-cued-thumbnail-overlay {
    padding-bottom: 177.77%;
}

/* Thumbnail */
.ytp-cued-thumbnail-overlay {
    height: 0;
    position: relative;
    overflow: hidden;
}

.ytp-cued-thumbnail-overlay-image {
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    position: absolute;
}

.custom-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 2;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.custom-play-button img {
    width: 80px;
    height: auto;
    display: block;
}

.video-preview-trigger:hover .custom-play-button {
    opacity: 1;
}

.ytp-large-play-button {
    display: none !important;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none !important;
    background-color: #00000056;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 90%;
    box-shadow: 29px 25px 21.9px 0 rgba(0, 0, 0, 0.37);
    max-width: 1022px;
}

.modal-content.modal-horizontal {
    aspect-ratio: 16 / 9;
}

.modal-content.modal-vertical {
    max-width: 400px;
    aspect-ratio: 9 / 16;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: none;
}

.modal-close-button {
    position: absolute;
    top: 0px;
    right: -40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    z-index: 1000;
}

.ytp-cued-thumbnail-overlay .preview-overlay{
    position: absolute;
    left: 0;
    width: 100%;
    background: #00000056;
    pointer-events: none;
}

.ytp-cued-thumbnail-overlay .preview-overlay {
    top: 0;
    height: 100%;
}

@media (max-width: 768px) {
    .modal-close-button {
        top: -50px;
        right: 0px;
        font-size: 50px;
    }
}
