[x-cloak] {
    display: none;
}

video::-webkit-media-controls:not(.audio-only) input[pseudo="-webkit-media-controls-timeline" i]::-webkit-slider-thumb {
    background: #000 !important;
}

.rw-gallery-container {
    width: 100%;

    figure {
        margin: 0;
        height: 100%;
        width: 100%;
    }

    video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .brxe-rw-gallery {
        position: relative;
        overflow: hidden;
    }
}

.rw-gallery-image {
    height: 100%;
    cursor: pointer;

    &:hover {
        filter: brightness(0.7);
    }
}

.rw-gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    padding: 20px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 10px;
    color: #fff;

    .rw-gallery-lightbox-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1120px;
        width: 100%;
        margin-inline: auto;

        .pagination {
            font-size: 1.2em;
        }

        .close {
            cursor: pointer;
            background: none;
            border: none;
            font-size: 18px;
            display: flex;
            align-items: center;
            gap: 5px;
            color: #fff;

        }
    }

    .rw-gallery-lightbox-content {
        max-width: 1120px;
        width: 100%;
        height: 100%;
        margin-inline: auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;

        .rw-gallery-lightbox-image-container {
            display: flex;
            position: absolute;
            inset: 0;
            justify-content: center;
            align-items: center;
            max-width: 1040px;
            margin-inline: auto;

            div {
                border-radius: 25px;
                overflow: hidden;
                transition: opacity 0.3s ease, transform 0.3s ease;
            }

            img {
                width: auto;
                max-height: 80vh;
                object-fit: contain;
                transition: all 0.3s ease;
                pointer-events: none;
            }
        }

        .control {
            height: 50px;
            width: 50px;
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            color: #fff;
            background-color: rgb(0, 0, 0, 0);
            border: 1px solid currentColor;
            font-size: 24px;
            transition: all 0.3s ease;
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            z-index: 10;

            &:active {
                scale: 0.9;
            }
        }

        .control.prev {
            left: 0;
        }

        .control.next {
            right: 0;
            transform: translateY(-50%) rotate(180deg);
        }
    }

    .mute-btn {
        display: block;
    }
}

.rw-gallery-lightbox-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.rw-lg-image-transition {
    position: absolute;
    transition: all 0.3s linear;
}

.rw-lg-image-start div {
    opacity: 0;
    transform: scale(0.95);
}

.rw-lg-image-start img {
    transform: scale(1.05);
}

.rw-lg-image-end div {
    opacity: 1;
    transform: scale(1);
}

.rw-lg-image-end img {
    transform: scale(1);
}

.rw-lg-transition {
    transition: opacity 0.3s;
}

.rw-lg-start {
    opacity: 0;
}

.rw-lg-end {
    opacity: 1;
}

.rw-lg-transition .control {
    transition: all 0.4s ease-in-out;
}

.rw-lg-start .control.prev {
    transform: translateX(-15px) translateY(-50%);
    opacity: 1;
}

.rw-lg-start .control.next {
    transform: translateX(15px) translateY(-50%) rotate(180deg);
    opacity: 1;
}

.rw-lg-end .control.next {
    transform: translateX(0px) translateY(-50%) rotate(180deg);
    opacity: 1;
}

.rw-lg-end .control.prev {
    transform: translateX(0px) translateY(-50%);
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .rw-gallery-lightbox {
        .rw-gallery-lightbox-content .control {
            display: none;
        }
    }
    .rw-gallery-container {
        .brxe-rw-gallery {
            overflow: visible;
            
            li:not(:first-child)::after {
                content: "";
                position: absolute;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 55px;
                background-image: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
            }
        }
    }
}