/* ============================================================
   BSB MECCA — CSS extracted from single-rider.php
   Externalized Session 4 (2026-04-21) for caching across page views.
   ============================================================ */

/* --- block 0 from single-rider.php --- */
/* ============================================================
   MOTORESULTS — SINGLE RIDER TEMPLATE v4
   Aesthetic: Warm editorial newspaper (Tablet Magazine style)
   Fonts: Playfair Display (headlines) + DM Sans (body) + Barlow Condensed (badges/stats)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Barlow+Condensed:wght@400;600;700;800;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

.mr2-page {
    --accent:    #C8102E;
    --bg:        #F5F3EE;
    --bg-alt:    #EDEAE3;
    --text:      #1A1A1A;
    --text-sec:  #444444;
    --text-muted:#888888;
    --border:    #1A1A1A;
    --border-lt: #CCCCCC;
    --gold:      #c9a227;
    --silver:    #7a7a7a;
    --bronze:    #a0522d;

    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 60vh;
}

/* ── DOTTED RULE MIXIN ──────────────────────────────────────────────────── */
.mr2-dotted-rule {
    background-image: linear-gradient(to right, #1A1A1A 24%, transparent 0%);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: bottom;
}

/* ── HERO (Article-style, centred) ──────────────────────────────────────── */
.mr2-hero {
    position: relative;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.mr2-hero-inner {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 56px 24px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
}

.mr2-hero-photo {
    flex-shrink: 0;
    position: relative;
}
.mr2-hero-photo img {
    display: block;
    width: 200px;
    height: 240px;
    object-fit: cover;
    object-position: top center;
    filter: grayscale(1);
    mix-blend-mode: multiply;
    transition: filter 0.4s ease, mix-blend-mode 0.4s ease;
}
.mr2-hero-photo:hover img {
    filter: grayscale(0);
    mix-blend-mode: normal;
}

.mr2-hero-content {
    flex: 1;
    min-width: 0;
}

.mr2-hero-number {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.mr2-hero-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.5px;
    margin: 0 0 14px;
    color: var(--text);
}

.mr2-flag { font-size: 0.55em; }

.mr2-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
    margin-bottom: 28px;
}
.mr2-hero-byline {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-sec);
}
.mr2-hero-byline + .mr2-hero-byline::before {
    content: '\00b7';
    margin-right: 16px;
    color: var(--text-muted);
}

.mr2-hero-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}
.mr2-highlight {
    text-align: center;
    padding: 12px 24px;
    border-right: 1px solid var(--border-lt);
    min-width: 80px;
}
.mr2-highlight:last-child { border-right: none; }
.mr2-highlight:first-child { padding-left: 0; }
.mr2-highlight-num {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}
.mr2-highlight-lbl {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── BODY ───────────────────────────────────────────────────────────────── */
.mr2-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ── SECTION TITLE (Barlow Condensed uppercase, solid bottom border) ──── */
.mr2-section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

/* ── SERIES BLOCKS ──────────────────────────────────────────────────────── */
.mr2-series-block {
    margin-bottom: 40px;
    overflow: hidden;
}

.mr2-series-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-lt);
}

.mr2-series-accent {
    width: 4px;
    height: 22px;
    background: var(--series-color, var(--accent));
    flex-shrink: 0;
}

.mr2-series-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.mr2-series-span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── CLASS CARDS ────────────────────────────────────────────────────────── */
.mr2-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border-lt);
}

.mr2-class-card {
    background: var(--bg);
    padding: 20px;
}

.mr2-class-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--series-color, var(--accent));
    margin-bottom: 2px;
}

.mr2-class-years {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ── STAT GROUPS ────────────────────────────────────────────────────────── */
.mr2-stats-group {
    margin-bottom: 14px;
    padding-bottom: 14px;
    background-image: linear-gradient(to right, #1A1A1A 24%, transparent 0%);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: bottom;
}
.mr2-stats-group:last-of-type { background-image: none; margin-bottom: 0; padding-bottom: 0; }
.mr2-stats-group--muted .mr2-stat-val { color: var(--text-muted); font-size: 20px; }
.mr2-stats-group--muted .mr2-stats-group-label { color: #aaaaaa; }

.mr2-stats-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.mr2-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.mr2-stat { text-align: center; }
.mr2-stat-val {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}
.mr2-stat-lbl {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ── BAR ────────────────────────────────────────────────────────────────── */
.mr2-bar-track {
    height: 3px;
    background: rgba(26,26,26,0.1);
    overflow: hidden;
}
.mr2-bar-fill {
    height: 100%;
    transition: width 0.6s ease;
}

/* ── STREAKS ────────────────────────────────────────────────────────────── */
.mr2-streaks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.mr2-streak-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(217,80,10,0.08);
    border: 1px solid rgba(217,80,10,0.2);
    font-size: 11px;
}
.mr2-streak-chip--podium {
    background: rgba(201,162,39,0.08);
    border-color: rgba(201,162,39,0.2);
}
.mr2-streak-num {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.mr2-streak-lbl {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── CAREER TABLE ───────────────────────────────────────────────────────── */
.mr2-career-section, .mr2-bio-section {
    margin-bottom: 40px;
}
.mr2-table-wrap { overflow-x: auto; }
.mr2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mr2-table th {
    background: var(--bg-alt);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.mr2-table td {
    padding: 10px 14px;
    color: var(--text);
    background-image: linear-gradient(to right, #1A1A1A 24%, transparent 0%);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: bottom;
}
.mr2-table tbody tr:hover { background: var(--bg-alt); }
.mr2-pos { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 800; }
.mr2-gold   { color: var(--gold); }
.mr2-silver { color: var(--silver); }
.mr2-bronze { color: var(--bronze); }

.mr2-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(26,26,26,0.06);
    color: var(--text-sec);
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 0.5px;
}
.mr2-badge--mxgp { background: rgba(227,25,55,0.1); color: #c0162e; }
.mr2-badge--mx2  { background: rgba(0,87,184,0.1); color: #004c99; }
.mr2-badge--wmx  { background: rgba(155,45,134,0.1); color: #9b2d86; }

/* ── BIO ────────────────────────────────────────────────────────────────── */
.mr2-bio-dl { display: flex; flex-direction: column; gap: 0; }
.mr2-bio-row {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    align-items: baseline;
    background-image: linear-gradient(to right, #1A1A1A 24%, transparent 0%);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: bottom;
}
.mr2-bio-row:last-child { background-image: none; }
.mr2-bio-row dt {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
}
.mr2-bio-row dd { font-size: 14px; color: var(--text); margin: 0; }
.mr2-natcode { font-size: 11px; font-weight: 700; padding: 2px 5px; background: rgba(26,26,26,0.06); }

.mr2-no-data {
    padding: 48px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mr2-hero-inner { padding: 32px 16px 28px; }
    .mr2-hero-photo img { width: 140px; height: 172px; }
    .mr2-hero-name { font-size: 36px; }
    .mr2-highlight { padding: 10px 12px; }
    .mr2-class-grid { grid-template-columns: 1fr; }
    .mr2-stats-row { grid-template-columns: repeat(2, 1fr); }
    .mr2-highlight-num { font-size: 28px; }
}

/* ── RACE HISTORY TIMELINE ──────────────────────────────────────────────── */
.mr2-history-section { margin-bottom: 40px; }
.mr2-history-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.mr2-select {
    background: #fff;
    border: 1px solid var(--border-lt);
    color: var(--text);
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    outline: none;
}
.mr2-select:focus { border-color: var(--accent); }
.mr2-hist-legend {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: auto;
}
.mr2-hist-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.mr2-hist-win  { background: #c9a227; }
.mr2-hist-pod  { background: #C8102E; }
.mr2-hist-top5 { background: #1a56db; }
.mr2-hist-fin  { background: rgba(26,26,26,0.15); }

.mr2-history-loading {
    display: flex;
    justify-content: center;
    padding: 40px;
}
.mr2-hist-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border-lt);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: mr2spin 0.8s linear infinite;
}
@keyframes mr2spin { to { transform: rotate(360deg); } }

.mr2-hist-year-group { margin-bottom: 28px; }
.mr2-hist-year-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-lt);
}
.mr2-hist-rounds { display: flex; flex-direction: column; gap: 4px; }
.mr2-hist-round {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border-lt);
    transition: background .1s;
}
.mr2-hist-round:hover { background: var(--bg-alt); }
.mr2-hist-round-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mr2-hist-sessions { display: flex; gap: 6px; flex-wrap: wrap; }
.mr2-hist-session {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(26,26,26,0.04);
    border: 1px solid var(--border-lt);
    white-space: nowrap;
    color: var(--text-sec);
}
.mr2-hist-session.pos-1  { background: rgba(201,162,39,0.12); border-color: rgba(201,162,39,0.4); color: #8a6d0a; }
.mr2-hist-session.pos-2,
.mr2-hist-session.pos-3  { background: rgba(217,80,10,0.1);   border-color: rgba(217,80,10,0.3);  color: #b5430a; }
.mr2-hist-session.pos-4,
.mr2-hist-session.pos-5  { background: rgba(26,86,219,0.08);  border-color: rgba(26,86,219,0.25); color: #1a56db; }
.mr2-hist-champ-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(26,26,26,0.06);
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    font-family: 'Barlow Condensed', sans-serif;
}
.mr2-hist-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ── Ensure page bg matches inside WordPress theme ──────────────────────── */
#page, .site-main, body { background: #F5F3EE; }
.entry-content { background: transparent; padding: 0; }
.mr2-page a { color: inherit; text-decoration: none; }
.mr2-pos-note { font-size: 10px; opacity: 0.5; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-left: 4px; }

/* ── WORLD TITLES BREAKDOWN ─────────────────────────────────────────────── */
.mr2-titles-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-lt);
    width: 100%;
}
.mr2-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mr2-title-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.mr2-title-pips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.mr2-title-pip {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(201,162,39,0.1);
    border: 1px solid rgba(201,162,39,0.3);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    cursor: default;
}
.mr2-title-pip:hover {
    background: rgba(201,162,39,0.18);
}

/* ── CAREER ARC ─────────────────────────────────────────────────────────── */
.mr2-arc-row {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
    margin-bottom: 32px;
}
@media(max-width:800px) { .mr2-arc-row { grid-template-columns: 1fr; } }

.mr2-arc-chart-section, .mr2-best-season { }

.mr2-arc-svg-wrap {
    background: #fff;
    border: 1px solid var(--border-lt);
    padding: 12px;
    overflow: hidden;
}
.mr2-arc-svg {
    width: 100%;
    height: auto;
    display: block;
}
.mr2-arc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
}
.mr2-arc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}
.mr2-arc-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── BEST SEASON CARD ───────────────────────────────────────────────────── */
.mr2-bsc {
    background: #fff;
    border: 1px solid var(--border-lt);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.mr2-bsc::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}
.mr2-bsc-year {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    color: var(--gold);
    margin-bottom: 4px;
}
.mr2-bsc-pos {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mr2-bsc-crown { font-size: 20px; }
.mr2-bsc-champ {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.mr2-bsc-bike, .mr2-bsc-team {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.mr2-bsc-review {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-sec);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-lt);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mr2-bsc-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.mr2-bsc-link:hover { color: var(--text); }

/* ── SEASON COMPARISON TABLE ────────────────────────────────────────────── */
.mr2-season-comp { margin-bottom: 40px; }
.mr2-sc-table .mr2-pos { font-size: 15px; }
.mr2-sc-yr-link { color: var(--text); font-weight: 600; }
.mr2-sc-yr-link:hover { color: var(--accent); }
.mr2-sc-team { font-size: 12px; color: var(--text-muted); max-width: 240px; }

/* ── ANALYTICS SECTION ──────────────────────────────────────────────────── */
.mr2-analytics-section,
.mr2-circuits-section {
    padding: 0 0 24px;
    margin-bottom: 24px;
}
.mr2-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.mr2-analytics-card {
    background: #fff;
    border: 1px solid var(--border-lt);
    padding: 16px;
    text-align: center;
}
.mr2-analytics-card--elo {
    background: linear-gradient(135deg, rgba(201,162,39,0.08), rgba(217,80,10,0.05));
    border-color: rgba(201,162,39,0.25);
}
.mr2-analytics-card--wide {
    grid-column: span 2;
}
@media (max-width: 600px) {
    .mr2-analytics-grid { grid-template-columns: 1fr 1fr; }
    .mr2-analytics-card--wide { grid-column: span 2; }
}
.mr2-analytics-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-family: 'Barlow Condensed', sans-serif;
}
.mr2-analytics-card-value {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}
.mr2-analytics-unit {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
}
.mr2-elo-value {
    color: var(--gold);
    font-size: 36px;
}
.mr2-analytics-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── CIRCUIT PERFORMANCE TABLE ──────────────────────────────────────────── */
.mr2-circuits-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.mr2-circuits-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.mr2-circuits-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-family: 'Barlow Condensed', sans-serif;
}
.mr2-circuits-table td {
    padding: 8px 10px;
    color: var(--text);
    background-image: linear-gradient(to right, #1A1A1A 24%, transparent 0%);
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: bottom;
}
.mr2-circuits-table td a {
    color: var(--accent);
    text-decoration: none;
}
.mr2-circuits-table td a:hover { text-decoration: underline; }
.mr2-circuits-table tr:hover { background: var(--bg-alt); }
.mr2-muted { color: var(--text-muted); }
