.tb-gallery-preview {
    position: relative;
    display: flex;
    width: 100%;
    height: 450px;

    @media screen and (min-width: 992px) {
        height: 500px;
    }
}

.tb-gallery-preview__main {
    padding-right: theme('margin.1');
    width: theme('width.2/3');

    .tb-gallery-preview__link {
        height: 100%;
    }
}

.tb-gallery-preview__button {
    font-size: theme('fontSize.base');
    background-color: theme('colors.white');
    color: theme('colors.gray.900');
    border-radius: theme('borderRadius.sm');
    border: 1px solid theme('colors.gray.100');
    padding: theme('padding.2') theme('padding.3');
    position: absolute;
    bottom: theme('padding.4');
    right: theme('padding.4');

    .c-icon {
        margin-right: theme('margin.1');
        top: 0;
    }

    @media screen and (max-width: 767px) {
        padding: theme('padding.2');
        bottom: theme('padding.2');
        right: theme('padding.2');
        font-size: theme('fontSize.sm');
    }
}

.tb-gallery-preview__flex-wrapper {
    display: flex;
    align-items: center;
}

.tb-gallery-preview__aside {
    padding-left: theme('margin.1');
    width: theme('width.1/3');
    display: flex;
    flex-direction: column;

    @media screen and (min-width: 640px) {
        .tb-gallery-preview__link:first-child {
            margin-bottom: theme('margin.2');
        }
    }
}

@media screen and (max-width: 639px) {
    .tb-gallery-preview {
        flex-direction: column;
    }

    .tb-gallery-preview__main {
        width: 100%;
        padding: 0;
        height: 75%;

        .tb-gallery-preview__link {
            width: 100%;
        }
    }

    .tb-gallery-preview__aside {
        height: 25%;
        flex-direction: row;
        width: 100%;
        padding: 0;
        margin-top: theme('margin.1');

        .tb-gallery-preview__link:first-child {
            padding-bottom: 0;
            margin-right: theme('margin.1');
        }

        .tb-gallery-preview__link {
            height: auto;
            width: 50%;
        }
    }
}

.tb-gallery-preview__link {
    position: relative;
    display: block;
    height: 50%; // IE11 compat
    height: calc(50% - .25rem);
}

.tb-gallery-preview__image {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.tb-gallery-preview__link--video .tb-gallery-preview__image::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .4);
}

.tb-gallery-preview__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: theme('padding.4');
    padding-top: theme('padding.8');
    width: 100%;
    color: white;
    font-size: theme('fontSize.sm');
    background-image: linear-gradient(transparent 0%, rgba(0, 0, 0, .6) 100%);
}

.tb-gallery-preview--single-image .tb-gallery-preview__main {
    padding-right: 0;
    width: 100%;
}

.tb-gallery-preview__video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-gallery-preview__video-icon {
    color: theme('colors.white');
    font-size: theme('fontSize.4xl');

    @media screen and (min-width: 640px) {
        font-size: theme('fontSize.5xl');
    }
}

.tb-gallery-preview__badges {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.tb-gallery-preview__badge {
    display: inline-block;
    width: 4.5rem;
    transition: 200ms opacity ease;

    &:not(:last-child) {
        margin-right: .25rem;
    }
}

.tb-gallery-preview__badge:hover {
    opacity: .85;
}
