/* =============================================================================
   Brand page v2 (/Tyre/{brand}/)

   The page runs on the tyres-for design system (tyres-for.css is loaded on
   the route and supplies every .tf- and shared .tsz- class; tyre-score.css
   supplies the sticky jump nav). This file adds only what is brand-specific,
   prefixed .tbr-. Patterns deliberately mirror the tyre-type section's tty-
   pieces - the two files stay separate so the pages can be edited
   independently.
   ========================================================================== */

/* --- Sticky jump nav (tyre-jump-nav.js, base styles in tyre-score.css) ----- */

.tbr .tyre-jump-nav { margin-bottom: 0; }

.tbr .tyre-jump-nav__scroller {
    max-width: var(--tf-wrap, 1180px);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Hero: logo chip + identity -------------------------------------------- */

.tbr-headgrid {
    display: flex;
    align-items: flex-start;
    gap: 22px;
    margin-top: 14px;
}

/* The source logos are designed for white; the chip gives them one, with the
   brand's own colour as a quiet signature underneath. */
.tbr-logochip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    min-height: 74px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 12px;
    border-bottom: 4px solid var(--tbr-bc, var(--tf-cyan, #0db1e7));
}

.tbr-logochip img {
    max-width: 100%;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.tbr-headmain { min-width: 0; }

.tbr-headmain .tf-head__title { margin-top: 0; }

.tbr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 2px;
}

.tbr-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
}

a.tbr-chip--link { text-decoration: none; }

a.tbr-chip--link:hover {
    border-color: var(--tf-cyan, #0db1e7);
    color: var(--tf-cyan, #0db1e7);
}

@media screen and (max-width: 640px) {
    .tbr-headgrid { flex-direction: column; gap: 14px; }
    .tbr-logochip { width: 128px; min-height: 62px; }
}

/* --- Test record ------------------------------------------------------------ */

.tbr-testyear {
    font-family: var(--tf-mono);
    font-weight: 700;
    white-space: nowrap;
    width: 1%;
}

/* "#3 / 12" finishing position: mono numerals, win and podium tinted. */
.tbr-pos {
    font-family: var(--tf-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.tbr-pos--win { color: var(--tf-good, #1d9e55); }

.tbr-pos--podium { color: var(--tf-mid, #b57a00); }

.tbr-chip--tr {
    background: var(--tf-cyan, #0db1e7);
    color: #fff;
    border-color: var(--tf-cyan, #0db1e7);
}

/* Per-group tyre count beside the season headings. */
.tbr-count {
    font-family: var(--tf-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--tf-muted, #5d6a75);
    margin-left: 6px;
}

/* --- Cards: condition leaders and EU label headliners ---------------------- */

.tbr-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 6px;
}

.tbr-card {
    background: var(--tf-paper, #fff);
    border: 1px solid var(--tf-line, #dde3e9);
    border-radius: 12px;
    padding: 18px;
}

.tbr-card__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.tbr-card__claim {
    font-size: 0.86rem;
    color: var(--tf-muted, #5d6a75);
    margin: 0 0 10px;
}

.tbr-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: tbr-rank;
}

.tbr-card__list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-top: 1px solid var(--tf-mist, #eef1f4);
    font-size: 0.9rem;
}

/* Ranked lists number themselves; unordered label lists don't. */
ol.tbr-card__list li::before {
    counter-increment: tbr-rank;
    content: counter(tbr-rank);
    font-family: var(--tf-mono);
    font-weight: 700;
    color: var(--tf-muted, #5d6a75);
    min-width: 1.2em;
}

ol.tbr-card__list li a { flex: 1; }

.tbr-card__list a { font-weight: 600; }

.tbr-card__score {
    font-family: var(--tf-mono);
    font-weight: 700;
    color: var(--tf-cyan, #0db1e7);
    white-space: nowrap;
}

/* EU label class chips, same grammar as the size and type pages. */
.tbr-labelclass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 7px;
    border-radius: 7px;
    font-family: var(--tf-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    background: var(--tf-muted, #5d6a75);
    flex-shrink: 0;
}

.tbr-labelclass--a { background: var(--tf-good, #1d9e55); }
.tbr-labelclass--b { background: #71a91c; }
.tbr-labelclass--c { background: #b9a012; }
.tbr-labelclass--db { background: var(--tf-ink, #0e1216); font-size: 0.78rem; }

/* --- Awards ----------------------------------------------------------------- */

.tbr-awardbody {
    display: block;
    font-size: 0.78rem;
    color: var(--tf-muted, #5d6a75);
    margin-top: 2px;
}

/* --- Owner strengths bars --------------------------------------------------- */

.tbr-strengths {
    list-style: none;
    margin: 6px 0 12px;
    padding: 0;
    max-width: 560px;
}

.tbr-strengths li {
    display: grid;
    grid-template-columns: 130px 1fr 58px;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.9rem;
}

.tbr-strengths__label { font-weight: 600; }

.tbr-strengths__bar {
    height: 8px;
    border-radius: 999px;
    background: var(--tf-line, #dde3e9);
    overflow: hidden;
}

.tbr-strengths__bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--tf-cyan, #0db1e7);
}

.tbr-strengths__n {
    font-family: var(--tf-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

@media screen and (max-width: 480px) {
    .tbr-strengths li { grid-template-columns: 104px 1fr 52px; gap: 8px; }
}

/* --- Comparisons ------------------------------------------------------------ */

.tbr-vsgrid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.tbr-vs {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tbr-vs__a,
.tbr-vs__b {
    font-weight: 600;
    font-size: 0.92rem;
}

.tbr-vs__vs {
    font-family: var(--tf-mono);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--tf-cyan, #0db1e7);
}

/* Brand-vs-brand cards carry the rival's colour as a left signature. */
.tbr-vsbrand { border-left: 4px solid var(--tbr-vsc, var(--tf-line, #dde3e9)); }

.tbr-vstyres-title { margin-top: 26px; }

/* --- Articles list ---------------------------------------------------------- */

.tbr-articles {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 760px;
}

.tbr-articles li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--tf-line, #dde3e9);
    font-size: 0.95rem;
}

.tbr-articles li:first-child { border-top: 0; }

.tbr-articles a { font-weight: 600; }

.tbr-articles__date {
    font-family: var(--tf-mono);
    font-size: 0.78rem;
    color: var(--tf-muted, #5d6a75);
    white-space: nowrap;
}

/* --- Unreviewed tyres (native disclosure) ----------------------------------- */

.tbr-details {
    margin-top: 16px;
    border-top: 1px solid var(--tf-line, #dde3e9);
    padding-top: 12px;
}

.tbr-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--tf-muted, #5d6a75);
}

.tbr-details summary:hover { color: var(--tf-cyan, #0db1e7); }

.tbr-namecloud {
    margin: 10px 0 0;
    font-size: 0.88rem;
    line-height: 1.9;
    color: var(--tf-muted, #5d6a75);
}

/* --- About the brand -------------------------------------------------------- */

.tbr-about {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
    gap: 24px;
    align-items: start;
}

.tbr-about__desc {
    font-size: 0.98rem;
    line-height: 1.7;
    max-width: var(--tr-measure);
}

.tbr-about__desc p { margin: 0 0 1em; }

.tbr-about__desc p:last-child { margin-bottom: 0; }

.tbr-about__facts {
    background: var(--tf-paper, #fff);
    border: 1px solid var(--tf-line, #dde3e9);
    border-radius: 12px;
    padding: 18px;
}

.tbr-about__facts-title {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 0 0 8px;
}

.tbr-factlist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tbr-factlist li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-top: 1px solid var(--tf-mist, #eef1f4);
    font-size: 0.9rem;
}

.tbr-factlist li:first-child { border-top: 0; }

.tbr-factlist li span { color: var(--tf-muted, #5d6a75); }

.tbr-factlist li b {
    font-family: var(--tf-mono);
    font-size: 0.85rem;
    text-align: right;
}

.tbr-siblings {
    margin: 12px 0 0;
    font-size: 0.88rem;
    line-height: 1.8;
    color: var(--tf-muted, #5d6a75);
}

.tbr-siblings a { font-weight: 600; }

@media screen and (max-width: 767px) {
    .tbr-about { grid-template-columns: 1fr; }
}

/* --- Lineup at a glance (inside the range section) ------------------------ */

.tbr-lu { margin: 18px 0 30px; }

.tbr-lu__lede {
    max-width: var(--tr-measure);
    margin: 0 0 14px;
    font-size: 0.95rem;
    color: var(--tf-muted, #5d6a75);
}

/* Names the scope when there is only one; with pills the pills name it, so
   the heading stays for screen readers and <noscript> only. */
.tbr-lu-scope {
    margin: 0 0 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.tbr-lu-scope--tabbed {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.tbr-lu-panel--off { display: none; }

/* The sporty -> comfort axis the tiers are laid out along. */
.tbr-lu-axis {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 7px;
    margin-bottom: 12px;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--tf-ink, #0e1216), var(--tf-cyan, #0db1e7)) 1;
    font-family: var(--tf-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tf-muted, #5d6a75);
}

/* Tiers are columns spread along the axis, the first at the sporty end and
   the last at the comfort end; a long lineup scrolls sideways rather than
   wrapping, because wrapping would break the left-to-right order. */
.tbr-lu-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(168px, 250px);
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 0 8px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    /* Contains the absolutely positioned visually-hidden brand names, which
       would otherwise escape the scroller and widen the page on phones. */
    position: relative;
}

.tbr-lu-tier {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    scroll-snap-align: start;
}

.tbr-lu-tier__name {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--tf-muted, #5d6a75);
}

.tbr-lu-tyres {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tbr-lu-tyre {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    background: var(--tf-paper, #fff);
    border: 1px solid var(--tf-line, #dde3e9);
    border-radius: 12px;
}

.tbr-lu-tyre > a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.25;
    color: var(--tf-text, #17202a);
    text-decoration: none;
}

.tbr-lu-tyre > a:hover { color: var(--tf-cyan, #0db1e7); }

.tbr-lu-tyre img,
.tbr-lu-tyre__noimg {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.tbr-lu-tyre__noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--tf-line, #dde3e9);
}

.tbr-lu-tyre__replaces {
    font-size: 0.76rem;
    color: var(--tf-muted, #5d6a75);
}

.tbr-lu-tyre__replaces a { font-weight: 600; }

@media screen and (max-width: 640px) {
    .tbr-lu-grid { grid-auto-columns: 78%; }
}

/* --- Season filter pills (complete record) ---------------------------------- */

.tbr-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}

.tbr-filter__btn,
.tbr-lu-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border: 1px solid var(--tf-line, #dde3e9);
    border-radius: 999px;
    background: var(--tf-paper, #fff);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tf-text, #17202a);
    cursor: pointer;
}

.tbr-filter__btn:hover,
.tbr-lu-tab:hover { border-color: var(--tf-cyan, #0db1e7); }

.tbr-filter__btn.is-active,
.tbr-lu-tab.is-active {
    background: var(--tf-ink, #0e1216);
    border-color: var(--tf-ink, #0e1216);
    color: #fff;
}

.tbr-filter__n {
    font-family: var(--tf-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--tf-muted, #5d6a75);
}

.tbr-filter__btn.is-active .tbr-filter__n,
.tbr-lu-tab.is-active .tbr-filter__n { color: rgba(255, 255, 255, 0.72); }

/* While a season filter is active, the collapse gives way: matching rows in
   the collapsed tail must be visible (non-matching rows carry inline
   display:none from the filter, which wins), and "Show all" pauses. */
.tsz-collapse.tbr-filtered tr.tsz-more { display: table-row; }

.tsz-collapse.tbr-filtered .tsz-showall { display: none; }
