.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: config('margin.1');
    width: config('width.2/3');

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

.tb-gallery-preview__button {
    font-size: config('textSizes.base');
    background-color: config('colors.white');
    color: config('colors.grey-darkest');
    border-radius: config('borderRadius.sm');
    border: 1px solid config('colors.grey-lightest');
    padding: config('padding.2') config('padding.3');
    position: absolute;
    bottom: config('padding.4');
    right: config('padding.4');

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

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

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

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

    @media screen and (min-width: 640px) {
        .tb-gallery-preview__link:first-child {
            margin-bottom: config('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: config('margin.1');

        .tb-gallery-preview__link:first-child {
            padding-bottom: 0;
            margin-right: config('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: config('padding.4');
    padding-top: config('padding.8');
    width: 100%;
    color: white;
    font-size: config('textSizes.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: config('colors.white');
    font-size: config('textSizes.4xl');

    @media screen and (min-width: 640px) {
        font-size: config('textSizes.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;
}
