/*
 * TTF Nav: the cars linked from category and make pages (Hub Run Sheet H4.4).
 *
 * "Popular cars in {category}" in the category header (header.php's slot, filled by cars-links.php): a row
 * like "Top brands" (hub-header.css) of split chips, the car's name linking its generation page and the count
 * beside it linking the category narrowed to the car. The make page's generations by model (cars-page.php):
 * cars.css plus the model grid. cars-links.php and cars-page.php enqueue this file where either shows.
 * Class prefixes ttf-hh (the strip) and ttf-car (the make page).
 */

/* "Popular cars in {category}". */
.ttf-hh__cars {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .9rem;
    margin-top: .9rem;
}
.ttf-hh__car-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.ttf-hh__car-list > li { margin: 0; padding: 0; }
.ttf-hh__car {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    background: var(--color-info-light, #F1F3F5);
    font-size: .8125rem;
    line-height: 1.2;
    white-space: nowrap;
}
.ttf-hh__car > a {
    display: inline-flex;
    align-items: center;
    padding: .4rem .6rem;
    color: var(--color-text-primary, #212529);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.ttf-hh__car > .ttf-hh__car-name { padding-left: .85rem; font-weight: 600; border-radius: 999px 0 0 999px; }
.ttf-hh__car > .ttf-hh__car-n {
    padding-right: .85rem;
    border-left: 1px solid var(--color-info-dark, #DEE2E6);
    border-radius: 0 999px 999px 0;
    color: var(--color-text-description, #868E96);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.ttf-hh__car > a:hover,
.ttf-hh__car > a:focus-visible {
    background: var(--color-primary-lighter, #FFF4F6);
    color: var(--color-primary, #EF233C);
}

/* The make page: its generations by model. */
.ttf-car__models {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem 1.5rem;
}
.ttf-car .ttf-car__model-title {
    --ttf-h3: .9375rem; /* ttf-page-zoom.php sizes every h3 through this property, with !important */
    margin: 0 0 .4rem;
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text-primary, #212529);
}
.ttf-car__models .ttf-car__gens { flex-direction: column; flex-wrap: nowrap; gap: .3rem; font-size: .875rem; }

/*
 * Phones: the strip's chips scroll sideways in one row. The row is the containing block of the screen-reader labels
 * in its count links (position: absolute): without it they sat at their place in the row, far past the screen's
 * edge, outside the row's clipping, and made the whole page wider (5,038 px on Suspension).
 */
@media (max-width: 767.98px) {
    .ttf-hh__cars { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .5rem; }
    .ttf-hh__car-list { position: relative; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .ttf-hh__car-list::-webkit-scrollbar { display: none; }
    .ttf-car__models { grid-template-columns: 1fr; gap: .9rem; }
}
