.tb-teaser-list {
    margin-top: config('margin.6');
}

.tb-teaser {
    color: config('colors.grey-darkest');
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: config('maxWidth.sm');
    text-decoration: none;
}

.tb-teaser__image-wrapper {
    display: block;
    flex: none;
    min-width: 100px;
    overflow: hidden;
    position: relative;

    &::before {
        content: '';
        display: block;
        padding-top: 66.66%; // 3:2 aspect ratio
        width: 100%;
    }

    .tb-badge {
        left: config('margin.2');
        position: absolute;
        top: config('margin.2');
    }
}

.tb-teaser__image,
.tb-teaser__image-fallback {
    bottom: 0;
    font-family: inherit; // Makes sure that postcss-object-fit-images keeps the family
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
}

/*
 * If the teaser doesnt have an image, render the image-fallback div with a
 * background color that makes it a just visible area on a light background color.
 * If the project has dark background colors, this needs to be themed accordingy.
 */
.tb-teaser__image-fallback {
    background-color: config('colors.grey-lightest');

    .c-icon {
        bottom: 0;
        color: config('colors.grey');
        font-size: config('textSizes.4xl');
        left: 0;
        margin: auto;
        position: absolute;
        right: 0;
        top: 0;
    }
}

.tb-teaser__title {
    color: config('colors.black');
    font-size: config('textSizes.lg');
    margin-bottom: config('margin.2');
    margin-top: 0;

    // Add top spacing only if a topline comes before the title
    .tb-teaser__topline + & {
        margin-top: config('margin.1');
    }
}

.tb-teaser__text {
    background-color: config('colors.white');
    flex-grow: 1; // use this instead of flex: 1 due to IE11 overflow bug
    font-size: config('textSizes.sm');
    padding: config('padding.2');
}

.tb-teaser__topline {
    font-size: config('textSizes.sm');
    margin: 0;
}

.tb-teaser__topline--primary {
    font-weight: bold;
    text-transform: uppercase;
}

.tb-teaser__main-attribute {
    font-weight: bold;
    margin-bottom: config('margin.2');

    .tb-badge {
        margin-left: 1ch;
    }
}

.tb-teaser__description {
    margin-bottom: 0;
    margin-top: config('margin.2');
}

.tb-teaser__duration {
    color: config('colors.grey-dark');
    margin-top: 0;
}

.tb-teaser__characteristics {
    list-style: none;
    margin-bottom: config('margin.2');
    padding: 0;
}

.tb-teaser__characteristics-item {
    display: inline-block;

    &::after {
        content: ' · ';
    }

    &:last-child {
        &::after {
            display: none;
        }
    }
}

.tb-teaser__facets {
    font-size: config('textSizes.sm');
    list-style: none;
    margin-top: config('margin.2');
    padding: 0;
}

.tb-teaser-facet {
    display: inline-block;
    margin-right: config('margin.1');

    &:last-child {
        margin-right: 0;
    }
}

.tb-teaser-facet__icon {
    color: config('colors.grey');
}

.tb-teaser-facet__label {}

.tb-teaser--layout-horizontal {
    max-width: 100%;
    width: 100%;
}

.tb-teaser--layout-horizontal .tb-teaser__image-wrapper {
    flex-grow: 0;
    height: auto;
    margin-bottom: config('padding.2');
}

.tb-teaser--layout-horizontal .tb-teaser__text {
    background-color: transparent;
    padding-left: 0;
    padding-top: 0;
}

.tb-teaser__premium-partner {
    font-size: .875rem;
}

.tb-teaser__rating {
    margin-top: config('margin.2');
}

.tb-teaser-pricing {
    color: config('colors.grey-dark');
    margin-right: 1rem;
    margin-top: 0;
}

.tb-teaser-pricing__price {
    color: config('colors.primary');
    font-weight: config('fontWeights.bold');
}


@media screen and (min-width: 340px) {
    .tb-teaser--layout-horizontal {
        align-items: flex-start;
        flex-direction: row;
    }

    .tb-teaser--layout-horizontal .tb-teaser__image-wrapper {
        margin-bottom: 0;
        width: 25%;
    }

    .tb-teaser--layout-horizontal .tb-teaser__text {
        padding-left: config('padding.6');
        padding-right: config('padding.6');
    }
}

@media screen and (min-width: 768px) {
    .tb-teaser--layout-horizontal .tb-teaser__image-wrapper {
        width: 33%;
    }
}
