/* Race Results section — builds on the shared tokens in style.css. */

.rr-crumbs { font-size: .82rem; color: var(--muted); margin: 0 0 6px; }
.rr-crumbs a { color: var(--muted); text-decoration: none; }
.rr-crumbs a:hover { color: var(--accent-dk); text-decoration: underline; }
.rr-crumb-sep { margin: 0 7px; opacity: .5; }

.rr-empty { color: var(--muted); padding: 24px 0; }

/* -- Event list -- */
.rr-event-list { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 10px; }
.rr-event-card {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: 14px 18px;
}
.rr-event-card h3 { margin: 0 0 3px; font-size: 1.05rem; }
.rr-event-card h3 a { color: var(--ink); text-decoration: none; }
.rr-event-card h3 a:hover { color: var(--accent-dk); }
.rr-event-meta { margin: 0; font-size: .85rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.rr-org { color: var(--muted); }
.rr-event-aside { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.rr-date { font-family: var(--numeral); font-size: 1.02rem; color: var(--ink); }
.rr-count { font-size: .8rem; color: var(--muted); }

/* -- Session list -- */
.rr-session-list { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 8px; }
.rr-session-link {
    display: flex; justify-content: space-between; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--line); border-radius: 9px;
    padding: 12px 16px; text-decoration: none; color: var(--ink);
}
.rr-session-link:hover { border-color: var(--muted); }
.rr-session-name { font-weight: 600; }
.rr-session-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.rr-tag { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
    border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.rr-tag-soft { border-color: var(--line-soft); }

/* -- Status pills -- */
.rr-pill { font-size: .72rem; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.rr-pill.is-official   { background: rgba(46,125,79,.12); color: var(--green); }
.rr-pill.is-provisional{ background: rgba(181,52,31,.10); color: var(--accent-dk); }
.rr-pill.is-other      { background: var(--line-soft); color: var(--muted); }

/* -- Class filter -- */
.rr-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.rr-class-pill {
    font: inherit; font-size: .82rem; cursor: pointer;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 999px; padding: 5px 13px;
}
.rr-class-pill:hover { border-color: var(--muted); }
.rr-class-pill.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* -- Results table -- */
.rr-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.rr-results { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rr-results thead th {
    text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
    white-space: nowrap; background: var(--paper);
}
.rr-results td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.rr-results .rr-num { text-align: right; font-family: var(--numeral); white-space: nowrap; }
.rr-pos { font-family: var(--numeral); font-weight: 600; white-space: nowrap; }
.rr-no { font-family: var(--numeral); color: var(--muted); }
.rr-name { font-weight: 500; }
.rr-diff { font-family: var(--numeral); color: var(--muted); white-space: nowrap; }

.rr-row.has-laps { cursor: pointer; }
.rr-row.has-laps:hover td { background: var(--paper); }
.rr-row.is-open td { background: var(--paper); }
.rr-row.is-dnf .rr-name, .rr-row.is-dnf .rr-pos { color: var(--muted); }
.rr-status { color: var(--accent-dk); font-weight: 600; font-family: var(--body); }
.rr-caret { display: inline-block; margin-left: 5px; font-size: .7rem; color: var(--muted); transition: transform .12s; }
.rr-row.is-open .rr-caret { transform: rotate(90deg); }
.rr-classwin { color: var(--accent); margin-left: 4px; }
.rr-classpos { color: var(--muted); font-size: .78rem; margin-left: 5px; }

/* -- Lap detail -- */
.rr-laps-row > td { background: var(--paper); padding: 0 12px 12px 28px; }
.rr-laps { width: auto; min-width: 320px; border-collapse: collapse; font-size: .82rem; margin: 4px 0 6px; }
.rr-laps th { text-align: right; color: var(--muted); font-weight: 600; padding: 5px 14px 5px 0; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.rr-laps th:first-child { text-align: left; }
.rr-laps td { border: 0; padding: 3px 14px 3px 0; font-family: var(--numeral); text-align: right; }
.rr-laps td:first-child { text-align: left; }
.rr-laps tr.rr-pit td { color: var(--accent-dk); }
.rr-pit-tag { font-size: .64rem; color: var(--accent-dk); font-family: var(--body); }

.rr-hint { font-size: .82rem; color: var(--muted); margin: 12px 0 32px; }

@media (max-width: 640px) {
    .rr-results { font-size: .82rem; }
    .rr-results td, .rr-results thead th { padding: 8px 8px; }
    .rr-speed-col { display: none; }
    .rr-event-card { flex-direction: column; align-items: flex-start; gap: 8px; }
    .rr-event-aside { text-align: left; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
