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

.tb-teaser {
    color: theme('colors.gray.900');
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: theme('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: theme('margin.2');
        position: absolute;
        top: theme('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: theme('colors.gray.100');

    .c-icon {
        bottom: 0;
        color: theme('colors.gray.500');
        font-size: theme('fontSize.4xl');
        left: 0;
        margin: auto;
        position: absolute;
        right: 0;
        top: 0;
    }
}

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

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

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

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

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

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

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

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

.tb-teaser__duration {
    color: theme('colors.gray.600');
    margin-top: 0;
}

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

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

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

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

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

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

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

.tb-teaser-facet__icon {
    color: theme('colors.gray.500');
}

.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: theme('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: theme('margin.2');
}

.tb-teaser-pricing {
    color: theme('colors.gray.600');
    margin-right: 1rem;
    margin-top: 0;
}

.tb-teaser-pricing__price {
    color: theme('colors.primary.500');
    font-weight: theme('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: theme('padding.6');
        padding-right: theme('padding.6');
    }
}

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