.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--poster {
        position: relative;
        height: 21rem;

        @screen md {
            height: 17rem;
        }
    }
}

.tb-teaser__image-wrapper {
    display: block;
    flex: none;
    min-width: 100px;
    overflow: hidden;
    position: relative;
    height: 13rem;
    width: 100%;
    border-radius: theme('borderRadius.md');

    @screen md {
        height: 19.5rem;
    }

    .tb-teaser--poster & {
        height: 100%;
    }

    .tb-teaser--poster &:after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: linear-gradient(to top, #000, rgba(0,0,0,0) 80%);
        opacity: .5;
        transition: opacity .25s linear;
    }

    .tb-teaser--poster:hover &:after {
        opacity: .8;
    }

    .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__label-box {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 1rem;
    background-color: theme('colors.white');
    text-align: center;
}

.tb-teaser__title {
    color: theme('colors.black');
    font-size: theme('fontSize.xl');
    font-weight: bold;
    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--poster & {
        color: theme('colors.white');
    }
}

.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--poster & {
        position: absolute;
        bottom: 0;
        box-sizing: border-box;
        width: 100%;
        padding: theme('padding.6') theme('padding.4');
        color: theme('colors.white');
        background-color: transparent;
    }
}

.tb-teaser__topline {
    color: theme('colors.gray.700');
    font-size: theme('fontSize.sm');
    margin: 0;

    .tb-teaser--poster & {
        color: theme('colors.white');
    }
}

.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__location {
    font-weight: bold;
    color: theme('colors.gray.600');
    margin-top: 0;
    margin-bottom: .25rem;

    .tb-teaser--poster & {
        color: theme('colors.white');
    }
}

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

    .tb-teaser--poster & {
        color: theme('colors.white');
    }
}

.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;
    margin-bottom: theme('padding.2');
    height: 5rem;
}

.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%;
        height: 9rem;
    }
}
