:root {
    --rb-thumb: 100px;
    --rb-chip-h: 28px;
    --rb-gap: 2px;
    --rb-pad: 5px;
    --rb-col-gap: 4px;
}

.rb-card {
    --rb-card-accent: var(--color-5-1);
    position: relative;
    height: 100%;
    padding: 0 var(--rb-pad) var(--rb-pad);
    border: 0;
    border-top: 0;
    background: #fff;
    box-shadow: 0 5px 16px rgba(31, 45, 61, .13);
    transition: transform .18s ease, box-shadow .18s ease;
}

.rb-card::before {
    position: absolute;
    z-index: 1;
    top: 0;
    right: var(--rb-pad);
    left: calc(var(--rb-pad) + var(--rb-thumb) + var(--rb-col-gap));
    height: 5px;
    background: var(--rb-card-accent);
    content: "";
    pointer-events: none;
    transition: background-color .18s ease;
}

.rb-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.rb-badge {
    position: absolute;
    z-index: 5;
    top: -12px;
    right: auto;
    left: calc(50% + 52px);
    display: flex;
    align-items: center;
    height: 29px;
    padding: 0 22px;
    border: 0;
    background: var(--rb-card-accent);
    clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 9px 100%, 0 50%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transform: translateX(-50%);
    white-space: nowrap;
}

.rb-card-inner {
    display: grid;
    grid-template-columns: var(--rb-thumb) 1fr;
    column-gap: var(--rb-col-gap);
    align-items: stretch;
    height: var(--rb-thumb);
}

.rb-thumb {
    width: var(--rb-thumb);
    height: var(--rb-thumb);
    border: 1px solid var(--color-5-3);
    background: #f0f0f0;
    transition: border-color .18s ease;
}

.rb-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rb-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    min-width: 0;
    height: var(--rb-thumb);
    padding: 14px 0 0 2px;
}

.rb-titlebox {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: calc(var(--rb-thumb) - var(--rb-chip-h));
    padding: 0 2px;
    overflow: hidden;
}

.rb-title {
    display: -webkit-box;
    max-height: calc(1.2em * 3);
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.rb-stats {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: var(--rb-chip-h);
    margin: 0;
    gap: var(--rb-gap);
}

.rb-stat {
    display: flex;
    flex: 0 0 calc((100% - (2 * var(--rb-gap))) / 3);
    align-items: center;
    justify-content: center;
    max-width: calc((100% - (2 * var(--rb-gap))) / 3);
    height: var(--rb-chip-h);
    padding: 0 3px;
    overflow: hidden;
    background: var(--color-5-3);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    letter-spacing: .1px;
    white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
    .rb-card:hover {
        box-shadow: 0 9px 22px rgba(31, 45, 61, .18);
        transform: translateY(-2px);
    }

    .rb-card:hover .rb-badge {
        background: var(--color-4-1);
    }

    .rb-card:hover::before {
        background: var(--color-4-1);
    }

    .rb-card:hover .rb-thumb {
        border-color: var(--color-4-1);
    }

    .rb-card:hover .rb-stat {
        background: var(--color-4-3);
    }
}

.rb-card:active {
    box-shadow: 0 9px 22px rgba(31, 45, 61, .18);
    transform: translateY(-1px);
}

@media (max-width: 576px) {
    :root {
        --rb-thumb: 84px;
        --rb-chip-h: 24px;
        --rb-pad: 4px;
        --rb-col-gap: 3px;
        --rb-gap: 2px;
    }

    .rb-badge {
        top: -10px;
        left: calc(50% + 43.5px);
        height: 25px;
        padding: 0 18px;
        clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 7px 100%, 0 50%);
        font-size: 11.5px;
    }

    .rb-content {
        padding-top: 6px;
    }

    .rb-title {
        max-height: calc(1.2em * 3);
        font-size: 14px;
        line-height: 1.2;
    }

    .rb-stat {
        padding: 0 2px;
        font-size: 10.5px;
        letter-spacing: 0;
    }
}
.row > :has(> .rb-card) {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

@media (min-width: 992px) {
    .row > :has(> .rb-card) {
        width: 50% !important;
        max-width: 50% !important;
    }
}

@media (min-width: 1400px) {
    .row > :has(> .rb-card) {
        width: 33.333333% !important;
        max-width: 33.333333% !important;
    }
}
