// tourDifficultyColors
$tb-color-difficulty-easy: #2175C9;
$tb-color-difficulty-medium: #ba1934;
$tb-color-difficulty-hard: #1d2024;

.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: 13.75rem;
    }

    .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__marketing-price__prefix {
    font-weight: bold;
}

.tb-teaser__marketing-price__value {
    font-size: theme('fontSize.lg');
    color: theme('colors.gray.900');
    font-weight: bold;

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

.tb-teaser__topline-category {
    color: theme('colors.gray.600');
    text-transform: uppercase;

    .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__difficulty-wrapper {
    display: block;
    margin-top: theme('margin.2');
}

.tb-teaser-difficulty,
.tb-teaser-slope-difficulty {
    display: inline-block;
    border-width: 1px;
    border-style: solid;
    border-radius: .125rem;
    line-height: 1.25;
    padding: .25rem .5rem;
}
.tb-teaser-difficulty {
    text-transform: lowercase;
}
.tb-teaser-difficulty--easy {
    color: $tb-color-difficulty-easy;
    border-color: $tb-color-difficulty-easy;
}
.tb-teaser-difficulty--medium {
    color: $tb-color-difficulty-medium;
    border-color: $tb-color-difficulty-medium;
}
.tb-teaser-difficulty--hard {
    color: $tb-color-difficulty-hard;
    border-color: $tb-color-difficulty-hard;
}

.tb-teaser-slope-difficulty {
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.tb-teaser-slope-difficulty--easy {
    background-color: $tb-color-difficulty-easy;
    border-color: $tb-color-difficulty-easy;
}
.tb-teaser-slope-difficulty--medium {
    background-color: $tb-color-difficulty-medium;
    border-color: $tb-color-difficulty-medium;
}
.tb-teaser-slope-difficulty--hard {
    background-color: $tb-color-difficulty-hard;
    border-color: $tb-color-difficulty-hard;
}

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

.tb-teaser-date {
    @apply text-gray-800 border-b-2 mb-2 pb-1 border-gray-800;
}

.tb-teaser-date__month {
    @apply font-bold leading-tight;

    font-size: 1.75rem;
}

.tb-teaser-date__year {
    @apply text-gray-600 inline-block text-sm uppercase;

    margin-left: .125rem;
}

.tb-teaser__cancelled {
    @apply inline-block text-xs rounded-sm uppercase px-2 py-1;
    width: fit-content;
    color: #fff;
    background-color: theme('colors.negative.500');
}


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