.tb-gallery-preview {
    position: relative;
    display: flex;
    width: 100%;
}

.tb-gallery-preview:not(.tb-gallery-preview--single-image):not(.tb-gallery-preview--orientation-vertical) {
    height: 450px;

    @include mappy-bp(lg) {
        height: 500px;
    }
}

.tb-gallery-preview--orientation-vertical {
    display: block;
}

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

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

.tb-gallery-preview--orientation-vertical .tb-gallery-preview__main {
    width: 100%;
    padding: 0;
}

.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;
    }

    @include mappy-bp(max md) {
        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;

    .tb-gallery-preview__link:first-child {
        padding-bottom: .5rem;
    }
}

.tb-gallery-preview--orientation-vertical .tb-gallery-preview__aside {
    flex-direction: row;
    width: 100%;
    padding: 0;
    margin-top: config('margin.2');

    .tb-gallery-preview__link:first-child {
        margin-bottom: 0;
        margin-right: config('margin.2');
    }
}

@include mappy-bp(max sm) {
    .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%;
}

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

.tb-gallery-preview__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: config('padding.4');
    padding-top: config('padding.8');
    width: 100%;
    color: white;
    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%;
}
