/**
 * Driver Profiles CSS Component Library
 * Rush Auto Works - Driver Showcase System
 *
 * F1/IMSA-inspired driver cards and roster page styles
 * Version: 20260108
 */

/* ==========================================================================
   Drivers Page - Global Styles
   ========================================================================== */

/* Driver roster page wrapper */
.driver-roster {
    background: #0a1628;
    min-height: 100vh;
    padding: 0;
}

/* Override any parent backgrounds */
body:has(.driver-roster),
body:has(.driver-roster) .site-content,
body:has(.driver-roster) .content-area,
body:has(.driver-roster) .entry-content {
    background: #0a1628;
}

/* Hide WordPress page titlebar on drivers page */
.page-id-17147 .titlebar,
body:has(.driver-roster) .titlebar,
body:has(.driver-roster) .entry-header {
    display: none !important;
}

/* Ensure content area doesn't add light background */
body:has(.driver-roster) .site-content,
body:has(.driver-roster) .content-area,
body:has(.driver-roster) .entry-content {
    background: transparent;
}

/* Reduce top padding */
.page-id-17147 > .container, .post-17130 > .container {
    padding-top: 0 !important;
}


/* ==========================================================================
   WordPress Integration Fixes
   ========================================================================== */

/* Reset WordPress defaults on driver cards */
.driver-card h2,
.driver-card h3,
.driver-card h4 {
    margin: 0;
}

.driver-card p {
    margin: 0;
}

/* Override wpautop br tags */
.driver-card br {
    display: none;
}

/* ==========================================================================
   Card Grid Layouts
   ========================================================================== */

.card-grid {
    display: grid;
    gap: 24px;
}

.card-grid--featured {
    /* auto-fill (not auto-fit) so a single filtered result stays at its natural
       width instead of stretching to fill the row and warping the hero image. */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card-grid--standard {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ==========================================================================
   Base Driver Card
   ========================================================================== */

.driver-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.driver-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.driver-card a,
.driver-card a:hover,
.driver-card a:focus,
.driver-card a:visited {
    text-decoration: none !important;
    color: inherit;
}

.driver-card__inner {
    position: relative;
    height: 400px;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Featured Driver Card Variant
   ========================================================================== */

.driver-card--featured {
    border-left: 4px solid var(--raw-orange);
}

.driver-card--featured:hover {
    box-shadow: 0 20px 40px rgba(255, 128, 0, 0.2);
}

/* ==========================================================================
   Car Number Watermark Background
   ========================================================================== */

.driver-card__number-bg {
    position: absolute;
    top: -13px;
    right: 5px;
    font-family: var(--font-display);
    font-size: 100px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04) !important;
    line-height: 1;
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease;
}

.driver-card:hover .driver-card__number-bg {
    color: rgba(255, 128, 0, 0.08);
}

/* ==========================================================================
   Driver Photo Area
   ========================================================================== */

.driver-card__photo {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 65%;
    height: 85%;
    z-index: 2;
}

.driver-card__photo img,
.driver-card__photo-driver {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0)),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 1) 100%);
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0)),
                        linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 15%, rgba(0, 0, 0, 1) 100%);
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
}

/* Car image overlay on featured cards */
.driver-card__photo-car {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 55%;
    height: 45%;
    object-fit: cover;
    object-position: center;
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0)),
                linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0)),
                        linear-gradient(to top, rgba(0, 0, 0, 1) 70%, rgba(0, 0, 0, 0));
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
    z-index: 1;
}

/* Photo placeholder for drivers without photos */
.driver-card__photo-placeholder {
    background: linear-gradient(135deg, #1a2a3a 0%, #0d1e33 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-card__photo-placeholder svg {
    width: 60px;
    height: 60px;
    fill: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   Content Overlay
   ========================================================================== */

.driver-card__content {
    position: relative;
    z-index: 3;
    padding: 12px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(to right, rgba(13, 30, 51, 0.85) 0%, rgba(13, 30, 51, 0.4) 40%, transparent 70%);
}

/* ==========================================================================
   Number Plate (Rush SR decal style)
   ========================================================================== */

.driver-card__number-plate {
    position: relative;
    width: 100px;
    margin-bottom: 16px;
    top: 60px;
    left: -12px;
}

.driver-card__number-plate-bg {
    width: 100%;
    height: auto;
    display: block;
}

.driver-card__number {
    position: absolute;
    top: 45%;
    left: 38%;
    transform: translate(-50%, -50%);
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 34px;
    font-weight: 900;
    color: #000;
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Driver Name
   ========================================================================== */

.driver-card__name {
    margin-top: 44px;
    margin-bottom: 8px;
}

.driver-card__name-first {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.driver-card__name-last {
    display: block;
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* Hover effect: cyan name with orange first letter */
.driver-card:hover .driver-card__name-last {
    color: var(--raw-cyan) !important;
}

.driver-card:hover .driver-card__name-last::first-letter {
    color: var(--raw-orange) !important;
}

/* ==========================================================================
   Tagline
   ========================================================================== */

.driver-card__tagline {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-dim);
    height: 65px;
    margin-bottom: 5px;
    overflow: hidden;
}

.driver-card__tagline-text {
    display: inline-block;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
    background: linear-gradient(225deg, rgba(0, 0, 0, 0.6), transparent);
    border-radius: 4px;
    padding: 1px 7px 1px 0;
}

/* ==========================================================================
   Stats Row
   ========================================================================== */

.driver-card__stats {
    display: flex;
    gap: 20px;
    margin: 16px 0;
}

.driver-card__stat {
    display: flex;
    flex-direction: column;
}

.driver-card__stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--raw-cyan);
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.driver-card__stat-label {
    font-family: var(--font-body);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   Social Links
   ========================================================================== */

.driver-card__social {
    position: absolute;
    bottom: 4px;
    left: 23px;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.driver-card__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgb(41, 53, 71);
    border-radius: 4px;
    color: var(--text-dim);
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.driver-card__social a:hover {
    background: var(--raw-cyan);
    color: var(--raw-navy);
    text-decoration: none !important;
}

.driver-card__social svg {
    width: 16px;
    height: 16px;
    fill: currentcolor;
}

/* ==========================================================================
   Series Badge (bottom right logo)
   ========================================================================== */

.driver-card__series {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 5;
}

.driver-card__series-logo {
    height: 32px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   Position Badge (for top 3 podium finishers)
   ========================================================================== */

.driver-card__position {
    position: absolute;
    top: 12px;
    left: 22px;
    padding: 6px 10px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    z-index: 6;
    white-space: nowrap;
}

.driver-card__position--1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
}

.driver-card__position--2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #000;
}

.driver-card__position--3 {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: #fff;
}

.driver-card__position--other {
    background: rgba(71, 199, 252, 0.2);
    color: var(--raw-cyan);
    border: 1px solid rgba(71, 199, 252, 0.4);
}

/* ==========================================================================
   Standard (Compact) Driver Card Variant
   ========================================================================== */

.driver-card--standard .driver-card__inner {
    height: 120px;
    flex-direction: row;
    align-items: center;
}

.driver-card--standard .driver-card__photo {
    position: relative;
    width: 100px;
    height: 100%;
    flex-shrink: 0;
}

.driver-card--standard .driver-card__photo img {
    mask-image: none;
    -webkit-mask-image: none;
}

.driver-card--standard .driver-card__content {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: none;
}

.driver-card--standard .driver-card__info {
    flex: 1;
}

.driver-card--standard .driver-card__name {
    margin: 0 0 4px;
}

.driver-card--standard .driver-card__name-first {
    display: inline;
    font-size: 14px;
    text-shadow: none;
}

.driver-card--standard .driver-card__name-last {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    text-shadow: none;
}

.driver-card--standard:hover .driver-card__name-last::first-letter {
    color: var(--raw-orange);
}

.driver-card--standard .driver-card__stats {
    margin: 0;
    gap: 16px;
}

.driver-card--standard .driver-card__stat-value {
    font-size: 18px;
    text-shadow: none;
}

.driver-card--standard .driver-card__stat-label {
    font-size: 9px;
    text-shadow: none;
}

.driver-card--standard .driver-card__number-bg {
    font-size: 80px;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
}

/* Hide the SR div (using ::after instead) */
.driver-card--standard .driver-card__series {
    display: none;
}

/* SR badge for standard cards */
.driver-card--standard::after {
    content: 'SR';
    position: absolute;
    bottom: 0;
    right: 0;
    background: #3B82F6;
    color: white;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    padding: 4px 4px 4px 10px;
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%);
    letter-spacing: 0.06em;
}

/* ==========================================================================
   Roster Page Header
   ========================================================================== */

.roster-header {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    padding: 60px 0 0;
    background: linear-gradient(180deg, var(--bg-section) 0%, #0a1628 100%);
    box-sizing: border-box;
}

.roster-header div.container {
    background: none;
}

.roster-header__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.roster-header__title {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--raw-cyan, #47C7FC);
    margin: 0;
}

.roster-header__title span {
    color: var(--raw-orange, #FF8000);
}

/* Season selector */
.roster-header__season {
    display: flex;
    align-items: center;
    gap: 12px;
}

.roster-header__season-label {
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.roster-header__season-select {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 40px 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Controls row */
.roster-header__controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* Search input */
.roster-header__search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.roster-header__search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 12px 16px 12px 44px;
    color: var(--text-primary);
    font-size: 14px;
}

.roster-header__search input::placeholder {
    color: var(--text-dim);
}

.roster-header__search input:focus {
    outline: none;
    border-color: var(--raw-cyan);
}

.roster-header__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
}

/* Header stats */
.roster-header__stats {
    display: flex;
    gap: 32px;
}

.roster-header__stat {
    text-align: center;
}

.roster-header__stat-value {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--raw-cyan);
}

.roster-header__stat-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.roster-header__stat-label svg {
    vertical-align: middle;
    margin-left: 4px;
    transition: transform 0.2s ease;
    display: inline
}

.roster-header__stat--clickable {
    cursor: pointer;
    padding: 8px 12px;
    margin: -8px -12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.roster-header__stat--clickable:hover {
    background: rgba(71, 199, 252, 0.1);
}

.roster-header__stat--clickable.is-open svg {
    transform: rotate(180deg);
}

/* Season selector */
.roster-header__season {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.roster-header__season-select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(71, 199, 252, 0.1);
    border: 1px solid rgba(71, 199, 252, 0.3);
    border-radius: 6px;
    padding: 8px 36px 8px 16px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--raw-cyan);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2347C7FC' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.roster-header__season-select:hover {
    background-color: rgba(71, 199, 252, 0.15);
    border-color: rgba(71, 199, 252, 0.5);
}

.roster-header__season-select:focus {
    outline: none;
    border-color: var(--raw-cyan);
    box-shadow: 0 0 0 3px rgba(71, 199, 252, 0.2);
}

.roster-header__season-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ==========================================================================
   Events Accordions (Past & Upcoming) - Shared Styles
   ========================================================================== */

/* Grid animation for auto height */
.past-events,
.upcoming-events {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease, margin 0.3s ease;
    margin-top: 0;
}

.past-events--open,
.upcoming-events--open {
    grid-template-rows: 1fr;
    margin-top: 20px;
}

.past-events__inner,
.upcoming-events__inner {
    overflow: hidden;
}

/* Year sections (both past and upcoming events) */
.past-events__year,
.upcoming-events__year {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(71, 199, 252, 0.15);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.past-events__year:last-child,
.upcoming-events__year:last-child {
    margin-bottom: 0;
}

.past-events__year-title,
.upcoming-events__year-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--raw-orange);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Event lists */
.past-events__list,
.upcoming-events__list {
    display: grid;
    gap: 8px;
}

/* Event items - shared base styles */
.past-events__item,
.upcoming-events__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none;
}

.past-events__item:last-child,
.upcoming-events__item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Track names */
.past-events__track,
.upcoming-events__track {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

/* Dates */
.past-events__date,
.upcoming-events__date {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Link items (upcoming events with URLs) - hover effect */
.upcoming-events__item--link {
    padding: 8px 12px;
    margin: 0 -12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.upcoming-events__item--link:hover {
    background: rgba(71, 199, 252, 0.1);
}

/* Orange first word, rest of track name cyan on links */
.upcoming-events__item--link .upcoming-events__track {
    color: var(--raw-cyan);
}

.upcoming-events__item--link .upcoming-events__track .text-orange {
    color: var(--raw-orange);
}

.upcoming-events__date svg {
    opacity: 0.6;
}

/* ==========================================================================
   Roster Sections
   ========================================================================== */

.roster-section {
    padding: 5% 0;
}

.roster-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.roster-section__title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--raw-cyan);
}

.roster-section__title span {
    color: var(--raw-orange);
}

.roster-section__count {
    font-size: 14px;
    color: var(--text-dim);
}

/* ==========================================================================
   Load More Button
   ========================================================================== */

.load-more {
    text-align: center;
    padding: 40px 5%;
}

.load-more__button {
    background: transparent;
    border: 2px solid var(--raw-cyan);
    color: var(--raw-cyan);
    padding: 14px 48px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more__button:hover {
    background: var(--raw-cyan);
    color: var(--raw-navy);
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    /* Roster header */
    .roster-header__top {
        flex-direction: column;
        gap: 24px;
    }

    .roster-header__title {
        font-size: 40px;
    }

    .roster-header__controls {
        flex-direction: column;
        width: 100%;
    }

    .roster-header__search {
        max-width: none;
        width: 100%;
    }

    .roster-header__stats {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 16px;
    }

    .roster-header__season {
        width: 100%;
        margin-left: 0;
        justify-content: center;
        margin-top: 8px;
    }

    .roster-header__season-select {
        width: 100%;
        max-width: 200px;
        text-align: center;
    }

    /* Card grids */
    .card-grid--featured {
        grid-template-columns: 1fr;
    }

    .card-grid--standard {
        grid-template-columns: 1fr;
    }

    /* Featured cards on mobile */
    .driver-card__inner {
        height: 350px;
    }

    .driver-card__name-last {
        font-size: 28px;
    }

    .driver-card__stat-value {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .roster-header {
        padding: 40px 4% 30px;
    }

    .roster-header__title {
        font-size: 32px;
    }

    .roster-section {
        padding: 30px 0;
    }

    .driver-card__number-plate {
        width: 80px;
        top: 60px;
    }

    .driver-card__number {
        font-size: 28px;
    }
}

/* ==========================================================================
   DRIVER PROFILE PAGE STYLES
   Individual driver profile page (single-driver.php)
   ========================================================================== */

/* ==========================================================================
   Profile Page Container
   ========================================================================== */

.driver-profile {
    background: #0a1628;
    /* min-height: 100vh removed — forced the wrapper to viewport height even
       on short profiles (sparse stats / no race reports), pushing the footer
       down and leaving a giant empty band. The body bg already matches so
       the page still looks contiguous on tall content. */
}

/* Content container for driver profile sections */
.driver-profile .container {
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */

.driver-breadcrumb {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-section) 100%);
    border-bottom: 1px solid rgba(71, 199, 252, 0.15);
    padding: 14px 0;
}

.driver-breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.driver-breadcrumb__link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--raw-cyan);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: all 0.2s ease;
}

.driver-breadcrumb__link:hover {
    color: var(--raw-orange);
}

.driver-breadcrumb__link svg {
    opacity: 0.8;
    transition: transform 0.2s ease;
}

.driver-breadcrumb__link:hover svg {
    transform: translateX(-3px);
}

.driver-breadcrumb__sep {
    color: var(--raw-cyan);
    opacity: 0.4;
    font-weight: 300;
}

.driver-breadcrumb__current {
    color: var(--raw-orange);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.driver-breadcrumb__dashboard {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--raw-cyan, #47C7FC);
    border-radius: 4px;
    color: var(--raw-cyan, #47C7FC);
    font-family: var(--font-display, inherit);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.driver-breadcrumb__dashboard:hover {
    background: var(--raw-cyan, #47C7FC);
    color: var(--raw-navy, #041E42);
}

@media (max-width: 640px) {
    .driver-breadcrumb__dashboard {
        margin-left: 0;
        padding: 6px 12px;
        font-size: 11px;
    }
    .driver-breadcrumb .container {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.driver-hero {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-section) 50%, var(--bg-primary) 100%);
    overflow: hidden;
}

.driver-hero__container {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 500px;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* Large watermark number background */
.driver-hero__number-bg {
    position: absolute;
    top: -50px;
    left: 4%;
    font-family: var(--font-display);
    font-size: 400px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    line-height: 1;
    pointer-events: none;
    z-index: 1;
}

/* Driver photo */
.driver-hero__photo {
    position: absolute;
    bottom: 0;
    right: 5%;
    width: 45%;
    max-width: 500px;
    height: 90%;
    z-index: 2;
}

.driver-hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0)),
                linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 100%);
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 1) 50%, rgba(0, 0, 0, 0)),
                        linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 10%, rgba(0, 0, 0, 1) 100%);
    mask-composite: intersect;
    -webkit-mask-composite: source-in;
}

/* Content overlay */
.driver-hero__content {
    position: relative;
    z-index: 3;
    max-width: 600px;
}

/* Number plate in hero */
.driver-hero__plate {
    position: relative;
    width: 140px;
    margin-bottom: 20px;
}

.driver-hero__plate-bg {
    width: 100%;
    height: auto;
    display: block;
}

.driver-hero__plate-number {
    position: absolute;
    top: 45%;
    left: 40%;
    transform: translate(-50%, -50%);
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #000;
    text-align: center;
    letter-spacing: 0.05em;
    text-shadow: 0px 0px 2px rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Driver name */
.driver-hero__name {
    margin-bottom: 12px;
}

.driver-hero__name-first {
    display: block;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 400;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.driver-hero__name-last {
    display: block;
    font-family: var(--font-display);
    font-size: 72px;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 0.9;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

/* Tagline below name */
.driver-hero__tagline {
    font-size: 18px;
    color: var(--raw-cyan);
    margin-bottom: 24px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Social links */
.driver-hero__social {
    display: flex;
    gap: 12px;
}

.driver-hero__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-dim);
    transition: all 0.2s ease;
}

.driver-hero__social a:hover {
    background: var(--raw-cyan);
    color: var(--raw-navy);
}

.driver-hero__social svg {
    width: 20px;
    height: 20px;
    fill: currentcolor;
}

/* Series badge */
.driver-hero__series {
    position: absolute;
    bottom: 5px;
    right: 5%;
    z-index: 5;
}

.driver-hero__series img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   Stats Section
   ========================================================================== */

.driver-stats {
    background: var(--bg-card);
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Sticky positioning - desktop only */
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Season tabs */
.driver-stats__tabs-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    min-width: 0;
}

.driver-stats__name-stuck {
    display: none; /* shown only when mobile + sticky-active */
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary, #fff);
    font-size: 15px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

.driver-stats__tabs {
    display: flex;
    gap: 8px;
}

.driver-stats__tab {
    padding: 10px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-dim);
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.driver-stats__tab:hover {
    border-color: var(--raw-cyan);
    color: var(--raw-cyan);
}

.driver-stats__tab--active {
    background: var(--raw-orange);
    border-color: var(--raw-orange);
    color: white;
}

/* Stats grid */
.driver-stats__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
    max-width: 1000px;
}

.driver-stats__item {
    text-align: center;
}

.driver-stats__value {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 800;
    color: var(--raw-cyan);
    line-height: 1;
    margin-bottom: 4px;
}

.driver-stats__value--highlight {
    color: var(--raw-orange);
}

.driver-stats__label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 768px) {
    .driver-stats {
        padding: 8px 0;
        transition: padding 0.15s ease;
    }
    .driver-stats__tabs-row {
        margin-bottom: 8px;
        gap: 8px;
    }
    .driver-stats__tabs {
        gap: 4px;
        flex: 1 1 auto;
        min-width: 0;
    }
    .driver-stats__tab {
        padding: 6px 12px;
        font-size: 14px;
    }
    /* (Mobile stat layout — 3-up grid + stacked value/label — is defined
       in the second @media (max-width: 768px) block further down. Old
       flex+inline rules were overridden there but the `display: flex`
       leaked through and broke the intended grid. Layout now lives in
       one place; this block only handles tabs + spacing.) */

    /* Sticky-active state: show driver name next to the season tabs and
       drop the second row of stats + the per-event results strip, so the
       bar collapses to one compact line plus a 3-up stat row. */
    .driver-stats.is-stuck {
        padding: 6px 0;
    }
    .driver-stats.is-stuck .driver-stats__name-stuck {
        display: inline-block;
    }
    .driver-stats.is-stuck .driver-stats__tabs {
        flex: 0 1 auto;
        margin-left: auto;
    }
    .driver-stats.is-stuck .driver-stats__tab {
        padding: 4px 10px;
        font-size: 12px;
    }
    .driver-stats.is-stuck .driver-stats__tabs-row {
        margin-bottom: 4px;
    }
    .driver-stats.is-stuck .driver-stats__grid {
        gap: 2px 12px;
    }
    /* Hide the "second row" — items 4, 5, 6 (Podiums / Starts / Avg
       Finish for season tabs; Starts / Avg for the Career tab). Always
       leaves the three most-important stats up top. */
    .driver-stats.is-stuck .driver-stats__item:nth-child(n+4) {
        display: none;
    }
    .driver-stats.is-stuck .driver-results-strip-wrap {
        display: none;
    }
}

/* ==========================================================================
   Content Sections
   ========================================================================== */

.driver-content {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.driver-section {
    margin-bottom: 60px;
}

.driver-section__title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--raw-orange);
    display: inline-block;
}

/* ==========================================================================
   About Section (Two-Column with Video)
   ========================================================================== */

.driver-about {
    display: block;
}

.driver-about--has-video,
.driver-about--has-media {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 48px;
    align-items: start;
}

.driver-about__bio {
    flex: 1;
}

.driver-about__media {
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 400px;
    max-width: 100%;
}

.driver-about__car {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
}

.driver-about__car-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

.driver-about__video {
    /* No longer sticky - parent media container handles it */
}

.driver-about__video-embed {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.driver-about__video-embed iframe {
    display: block;
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 500px;
}

/* YouTube embeds are 16:9 */
.driver-about__video-embed iframe[src*="youtube"] {
    aspect-ratio: 16/9;
    max-height: none;
}

/* Instagram embeds need more height */
.driver-about__video-embed blockquote.instagram-media {
    margin: 0 !important;
    min-width: 100% !important;
}

@media (max-width: 900px) {
    .driver-about--has-video,
    .driver-about--has-media {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .driver-about__media {
        position: static;
        order: -1;
    }

    .driver-about__video {
        position: static;
        order: -1;
    }

    .driver-about__video-embed iframe {
        max-height: 400px;
    }
}

/* ==========================================================================
   Bio Section
   ========================================================================== */

.driver-bio {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.driver-bio__text {
    margin-top: 16px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dim);
}

.driver-bio__text p {
    margin-bottom: 16px;
}

/* Quote sidebar */
.driver-bio__quote {
    background: var(--bg-card);
    padding: 32px;
    border-left: 4px solid var(--raw-orange);
    border-radius: 0 8px 8px 0;
    margin-top: 24px;
}

.driver-bio__quote-text {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 500;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 16px;
}

.driver-bio__quote-attr {
    font-size: 14px;
    color: var(--text-dim);
}

/* ==========================================================================
   Press Kit / Share Module
   ========================================================================== */

.driver-share {
    padding: 48px 0 24px;
}

.driver-share__card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 32px;
    padding: 32px;
    border-radius: 12px;
    background: linear-gradient(135deg,
        rgba(71, 199, 252, 0.08) 0%,
        rgba(255, 128, 0, 0.06) 100%);
    border: 1px solid rgba(71, 199, 252, 0.18);
}

.driver-share__copy {
    flex: 1 1 320px;
    min-width: 0;
}

.driver-share__title {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--raw-cyan);
    margin: 0 0 8px;
    text-transform: uppercase;
}

.driver-share__lede {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0;
    max-width: 52ch;
}

.driver-share__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.driver-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
    line-height: 1;
}

.driver-share__btn--primary {
    background: var(--raw-orange);
    color: var(--raw-navy);
    border-color: var(--raw-orange);
}

.driver-share__btn--primary:hover,
.driver-share__btn--primary:focus-visible {
    background: #ffa040;
    border-color: #ffa040;
    color: var(--raw-navy);
}

.driver-share__btn--secondary {
    background: transparent;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

.driver-share__btn--secondary:hover,
.driver-share__btn--secondary:focus-visible {
    background: rgba(71, 199, 252, 0.1);
    border-color: var(--raw-cyan);
    color: var(--raw-cyan);
}

.driver-share__btn svg {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .driver-share__card {
        padding: 24px;
        gap: 20px;
    }
    .driver-share__title {
        font-size: 24px;
    }
    .driver-share__actions {
        width: 100%;
    }
    .driver-share__btn {
        flex: 1 1 140px;
        justify-content: center;
    }
}

/* ==========================================================================
   Race Reports (list on driver profile + single report page)
   ========================================================================== */

.driver-reports__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.driver-reports__item {
    margin: 0;
}

.driver-reports__link {
    display: block;
    padding: 18px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: inherit;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.driver-reports__link:hover,
.driver-reports__link:focus-visible {
    background: rgba(71, 199, 252, 0.08);
    border-color: rgba(71, 199, 252, 0.4);
    transform: translateY(-1px);
}

.driver-reports__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.driver-reports__pos {
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 128, 0, 0.18);
    color: var(--raw-orange);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.driver-reports__title {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 22px;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.driver-reports__sub {
    font-size: 14px;
    color: var(--text-muted);
}

/* Single race report page */

.race-report__hero {
    padding: 40px 0 24px;
}

.race-report__event {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 14px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--raw-cyan);
    margin: 0 0 6px;
}

.race-report__title {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.race-report__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.race-report__facts li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
}

.race-report__fact-label {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 500;
}

.race-report__replay { padding: 24px 0; }
.race-report__section-title {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    font-size: 24px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--raw-cyan);
    margin: 0 0 16px;
}

/* Default embed container: passive, lets the embed render at its own size.
   The 16:9 hard-aspect treatment is now ONLY applied to --replay (which
   genuinely is a multi-cam 16:9 player). IG / portrait-orientation embeds
   used to get squished into 16:9; that was the bug. */
.race-report__embed {
    margin: 16px 0;
}

.race-report__embed--replay {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.race-report__embed--replay iframe,
.race-report__embed--replay video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.race-report__body { padding: 24px 0 40px; }

.race-report__writeup {
    max-width: 70ch;
    color: var(--text-primary);
    font-size: 17px;
    line-height: 1.7;
}

.race-report__writeup p { margin: 0 0 1em; }
.race-report__writeup h2,
.race-report__writeup h3 {
    font-family: var(--font-display, 'Barlow Condensed'), sans-serif;
    color: var(--raw-cyan);
    margin-top: 1.5em;
}

.race-report__onboard { margin-top: 32px; }

.race-report__back {
    padding: 24px 0 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Back Button (Bottom Navigation)
   ========================================================================== */

.driver-profile__nav {
    padding: 40px 0 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.driver-profile__back-btn {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.driver-profile__back-btn:hover {
    background: var(--raw-cyan);
    border-color: var(--raw-cyan);
}

.driver-profile__back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--raw-cyan);
    transition: all 0.3s ease;
}

.driver-profile__back-btn:hover .driver-profile__back-icon {
    background: rgba(0, 0, 0, 0.2);
    color: var(--raw-navy);
}

.driver-profile__back-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.driver-profile__back-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    transition: color 0.3s ease;
}

.driver-profile__back-btn:hover .driver-profile__back-label {
    color: rgba(0, 0, 0, 0.6);
}

.driver-profile__back-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.driver-profile__back-btn:hover .driver-profile__back-title {
    color: var(--raw-navy);
}

/* ==========================================================================
   Lap Times Section
   ========================================================================== */

.driver-laptimes {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.driver-laptimes__header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.driver-laptimes__row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
}

.driver-laptimes__row:last-child {
    border-bottom: none;
}

.driver-laptimes__track {
    font-weight: 600;
    color: var(--text-primary);
}

.driver-laptimes__time {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--raw-cyan);
}

.driver-laptimes__time--best {
    color: var(--raw-orange);
}

.driver-laptimes__delta {
    color: var(--text-dim);
    font-size: 14px;
}

.driver-laptimes__date {
    color: var(--text-dim);
    font-size: 14px;
}

/* Raw lap times (AJAX loaded) - two columns on desktop */
.raw-lap-times {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

@media (max-width: 900px) {
    .raw-lap-times {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.raw-lap-times__track {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
}

.raw-lap-times__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.raw-lap-times__header h4 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--raw-orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.raw-lap-times__date {
    font-size: 13px;
    color: var(--text-dim);
}

/* Override sr-consumables-table for lap times: make time column cyan */
.raw-lap-times .sr-consumables-table td.lap-time {
    color: var(--raw-cyan);
    font-weight: 600;
}

/* ==========================================================================
   Media Section
   ========================================================================== */

.driver-media__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.driver-media__embed {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 14px;
}

.driver-media__embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Gallery Section
   ========================================================================== */

.driver-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.driver-gallery__item {
    aspect-ratio: 1;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.driver-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.driver-gallery__item:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   Sponsors Section
   ========================================================================== */

.driver-sponsors__grid {
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
}

.driver-sponsors__logo {
    height: 48px;
    width: auto;
    filter: grayscale(100%) brightness(2);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.driver-sponsors__logo:hover {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
}

/* ==========================================================================
   Profile Page Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    /* Driver Focus titlebar is pure chrome — drop it on mobile so the
       hero sits right under the site header. */
    .titlebar--driver-focus { display: none; }

    /* Hero section mobile — compact: photo sits above content as a
       fixed-height band, content fills below with tight spacing. */
    .driver-hero {
        min-height: 0;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 0;
    }
    .driver-hero__container {
        min-height: 0;
        padding-top: 180px; /* clears the absolutely-positioned photo above */
        padding-bottom: 12px;
        align-items: stretch;
    }
    /* Place the number plate on the left of the name row instead of
       stacking it above — recovers the plate's vertical footprint and
       keeps both visually balanced. Tagline + socials sit below, full
       width. */
    .driver-hero__content {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 8px;
        align-items: center;
        max-width: none;
    }
    .driver-hero__plate {
        grid-column: 1;
        grid-row: 1;
        margin: 0;
        align-self: center;
    }
    .driver-hero__name {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        align-self: center;
        min-width: 0;
    }
    .driver-hero__tagline,
    .driver-hero__social {
        grid-column: 1 / -1;
    }
    .driver-hero__photo {
        width: 60%;
        max-width: 320px;
        height: 180px;
        top: 0;
        bottom: auto;
        right: 0;
    }
    /* Hide the giant watermark number — it's mostly clipped by the photo
       on mobile anyway and adds zero info. */
    .driver-hero__number-bg { display: none; }

    .driver-hero__plate {
        width: 100px;
        margin-bottom: 8px;
    }
    .driver-hero__plate-number { font-size: 34px; }

    .driver-hero__name { margin-bottom: 6px; }
    .driver-hero__name-first {
        font-size: 14px;
        letter-spacing: 0.18em;
    }
    .driver-hero__name-last {
        font-size: 44px;
        line-height: 0.95;
    }
    .driver-hero__tagline {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 10px;
    }
    .driver-hero__social { gap: 8px; }
    .driver-hero__social a { width: 36px; height: 36px; }
    .driver-hero__social svg { width: 16px; height: 16px; }
    /* Pin the series chip to the top-right corner over the photo area
       instead of a dedicated row at the bottom of the hero. */
    .driver-hero__series {
        top: 10px;
        right: 10px;
        bottom: auto;
    }
    .driver-hero__series img { height: 28px; }

    /* Stats grid mobile — tighter values + tighter gaps so two rows of
       three don't dominate the viewport. */
    .driver-stats {
        padding: 14px 0;
    }
    .driver-stats__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px 12px;
    }
    .driver-stats__value {
        font-size: 28px;
        display: block;
        margin: 0;
    }
    .driver-stats__label {
        display: block;
        margin: 0;
        font-size: 10px;
        line-height: 1.2;
    }
    .driver-stats__item { text-align: left; }

    /* Bio section mobile */
    .driver-bio {
        grid-template-columns: 1fr;
    }

    /* Media grid mobile */
    .driver-media__grid {
        grid-template-columns: 1fr;
    }

    /* Gallery grid mobile */
    .driver-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Lap times table mobile */
    .driver-laptimes__header,
    .driver-laptimes__row {
        grid-template-columns: 1.5fr 1fr 1fr;
    }

    .driver-laptimes__date {
        display: none;
    }
}

@media (max-width: 480px) {
    .driver-hero {
        padding-top: 0;
        min-height: 0;
    }
    .driver-hero__container {
        padding-top: 160px;
    }
    .driver-hero__photo {
        height: 160px;
        width: 65%;
    }

    .driver-hero__name-first {
        font-size: 13px;
    }

    .driver-hero__name-last {
        font-size: 36px;
    }

    .driver-hero__tagline {
        font-size: 13px;
    }

    .driver-hero__plate {
        width: 88px;
    }

    .driver-hero__plate-number {
        font-size: 30px;
    }

    .driver-hero__number-bg {
        font-size: 150px;
    }

    .driver-stats__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .driver-stats__value {
        font-size: 32px;
    }

    .driver-content {
        padding: 40px 4%;
    }

    .driver-section {
        margin-bottom: 40px;
    }

    .driver-section__title {
        font-size: 22px;
    }

    .driver-laptimes__header,
    .driver-laptimes__row {
        grid-template-columns: 1fr 1fr;
        padding: 12px 16px;
    }

    .driver-laptimes__delta {
        display: none;
    }

    .driver-laptimes__time {
        font-size: 16px;
    }
}

/* ==========================================================================
   WordPress Profile Page Integration
   ========================================================================== */

/* Reset WordPress defaults on profile page */
.driver-profile h1,
.driver-profile h2,
.driver-profile h3,
.driver-profile h4 {
    margin: 0;
}

.driver-profile p {
    margin: 0;
}

/* Ensure proper link styling */
.driver-hero__social a,
.driver-hero__social a:visited {
    text-decoration: none;
}

/* Override wpautop br tags */
.driver-profile br {
    display: none;
}

/* Bio text allows paragraph margins */
.driver-bio__text p {
    margin-bottom: 16px;
}

/* ==========================================================================
   DRIVER MODAL
   Popup modal for standard drivers (non-featured)
   ========================================================================== */

.driver-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.driver-modal--open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.driver-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.driver-modal__content {
    position: relative;
    background: var(--bg-card, #0a1929);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(71, 199, 252, 0.2);
}

.driver-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 32px;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.driver-modal__close:hover {
    color: var(--raw-cyan, #47C7FC);
}

.driver-modal__body {
    padding: 0;
}

.driver-modal__layout {
    display: flex;
    gap: 0;
}

.driver-modal__photo {
    flex: 0 0 45%;
    min-height: 250px;
}

.driver-modal__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px 0 0 8px;
}

.driver-modal__info {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.driver-modal__header {
    margin-bottom: 20px;
}

.driver-modal__number {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--raw-orange, #FF8000);
    margin-bottom: 4px;
}

.driver-modal__name {
    display: flex;
    flex-direction: column;
}

.driver-modal__name-first {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.driver-modal__name-last {
    display: block;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    line-height: 1.1;
}

.driver-modal__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.driver-modal__stat {
    text-align: center;
}

.driver-modal__stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--raw-cyan, #47C7FC);
    line-height: 1;
    margin-bottom: 4px;
}

.driver-modal__stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.driver-modal__loading,
.driver-modal__error {
    text-align: center;
    color: var(--text-dim);
    padding: 40px;
}

/* Modal responsive */
@media (max-width: 480px) {
    .driver-modal__layout {
        flex-direction: column;
    }

    .driver-modal__photo {
        flex: none;
        min-height: 180px;
        max-height: 200px;
    }

    .driver-modal__photo img {
        border-radius: 8px 8px 0 0;
    }

    .driver-modal__info {
        padding: 20px;
    }

    .driver-modal__name-last {
        font-size: 20px;
    }

    .driver-modal__stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .driver-modal__stat-value {
        font-size: 18px;
    }
}

/* Modal Accordion */
.driver-modal__accordion {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.driver-modal__accordion-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 24px;
    background: transparent;
    border: none;
    color: var(--text-primary, #fff);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.driver-modal__accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.driver-modal__accordion-icon {
    transition: transform 0.3s ease;
    color: var(--raw-cyan, #47C7FC);
}

.driver-modal__accordion--open .driver-modal__accordion-icon {
    transform: rotate(180deg);
}

.driver-modal__accordion-content {
    padding: 0 16px 16px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

.driver-modal__lap-times .raw-lap-times__track {
    margin-bottom: 12px;
}

.driver-modal__lap-times .raw-lap-times__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.driver-modal__lap-times .raw-lap-times__header h4 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--raw-orange, #FF8000);
}

.driver-modal__lap-times .raw-lap-times__date {
    font-size: 11px;
    color: var(--text-dim);
}

.driver-modal__lap-times .sr-consumables-table {
    width: 100%;
    font-size: 12px;
    table-layout: fixed;
}

.driver-modal__lap-times .sr-consumables-table th,
.driver-modal__lap-times .sr-consumables-table td {
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.driver-modal__lap-times .sr-consumables-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    font-weight: 500;
}

.driver-modal__lap-times .lap-time {
    font-family: var(--font-display);
    color: var(--raw-cyan, #47C7FC);
}

.driver-modal__lap-times .driver-modal__loading {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.driver-modal__lap-times .driver-modal__no-times {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

@media (max-width: 600px) {
    .driver-modal__accordion-toggle {
        padding: 12px 16px;
        font-size: 12px;
    }

    .driver-modal__accordion-content {
        padding: 0 12px 12px;
        max-height: 220px;
    }

    .driver-modal__lap-times .sr-consumables-table {
        font-size: 11px;
    }

    .driver-modal__lap-times .sr-consumables-table th,
    .driver-modal__lap-times .sr-consumables-table td {
        padding: 3px 4px;
    }
}

/* Video link fallback for YouTube clips */
.driver-video-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--raw-orange);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 16px;
    transition: all 0.2s ease;
}
.driver-video-link:hover {
    background: var(--raw-orange);
    color: #fff;
    transform: translateY(-2px);
}
.driver-video-link__icon {
    font-size: 24px;
}

/* ==========================================================================
   DRIVER CAROUSEL
   Rotating featured drivers for homepage/landing pages
   ========================================================================== */

.driver-carousel {
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    padding: var(--space-3xl) 5%;
    background: linear-gradient(180deg, var(--bg-section) 0%, #0a1628 100%);
    box-sizing: border-box;
    overflow: hidden;
}

.driver-carousel .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.driver-carousel__header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.driver-carousel__title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.1;
    margin: 0 0 12px;
}

.driver-carousel__subtitle {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Track container */
.driver-carousel__track {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

/* Slides container */
.driver-carousel__slides {
    position: relative;
}

.driver-carousel__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}

.driver-carousel__slide.is-active {
    position: relative;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Navigation */
.driver-carousel__nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: var(--space-md);
}

.driver-carousel__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 44px;
    padding-top: 8px;
    color: var(--text-muted);
}

.driver-carousel__arrow:hover {
    background: var(--raw-cyan);
    border-color: var(--raw-cyan);
    color: var(--raw-navy);
}

.driver-carousel__dots {
    display: flex;
    gap: 10px;
}

.driver-carousel__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.driver-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.driver-carousel__dot.is-active {
    background: var(--raw-orange);
    transform: scale(1.2);
}

/* CTA button */
.driver-carousel__cta {
    text-align: center;
    margin-top: var(--space-2xl);
}

/* Featured card in carousel - center it and adjust height */
.driver-carousel__slide .driver-card--featured {
    max-width: 500px;
    margin: 0 auto;
}

/* ==========================================================================
   Carousel Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .driver-carousel {
        padding: var(--space-2xl) 4%;
    }

    .driver-carousel__slides {
        min-height: 380px;
    }

    .driver-carousel__arrow {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .driver-carousel__slides {
        min-height: 340px;
    }

    .driver-carousel__dots {
        gap: 8px;
    }

    .driver-carousel__dot {
        width: 10px;
        height: 10px;
    }
}

/* ==========================================================================
   Lap-times POS column — compact podium pill
   Pills are inline-blocks so they don't bump row height. Palette uses the
   brand orange + cyan rather than pure metallic gold/silver, so the badges
   feel native to the navy theme instead of bolted on. Only top-3 highlighted;
   everyone else stays plain.
   ========================================================================== */

.sr-consumables-table .lap-pos {
    text-align: center;
}

.lap-pos-badge {
    display: inline-block;
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

/* 1st: brand orange — winner */
.lap-pos-badge--p1 {
    background: var(--raw-orange, #FF8000);
    color: #1a0a00;
    box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.35);
}

/* 2nd: brand cyan — podium */
.lap-pos-badge--p2 {
    background: var(--raw-cyan, #47C7FC);
    color: #001824;
    box-shadow: 0 0 0 1px rgba(71, 199, 252, 0.35);
}

/* 3rd: muted bronze — podium */
.lap-pos-badge--p3 {
    background: #b87a4a;
    color: #1a0e05;
    box-shadow: 0 0 0 1px rgba(184, 122, 74, 0.35);
}

/* ==========================================================================
   Per-event results strip (under stats bar) — compact season-at-a-glance
   ========================================================================== */

.driver-results-strip-wrap {
    margin-top: 24px;
}

.driver-results-strip {
    display: block;
}

.driver-results-strip__year {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.driver-results-strip__year-label {
    display: none;
}

.driver-results-strip.is-career .driver-results-strip__year + .driver-results-strip__year {
    margin-top: 20px;
}

.driver-results-strip.is-career .driver-results-strip__year-label {
    display: block;
    flex-basis: 100%;
    margin: 0 0 4px;
    font-family: var(--font-display, inherit);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--raw-orange, #FF8000);
}

.driver-results-strip__event {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-secondary, rgba(255,255,255,0.04));
    border-radius: 6px;
    min-width: 0;
}

.driver-results-strip__event-label {
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--raw-cyan, #47C7FC);
    white-space: nowrap;
}

.driver-results-strip__cells {
    display: flex;
    gap: 4px;
    align-items: center;
}

.driver-results-strip__cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 4px 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.06);
    font-size: 11px;
    line-height: 1.1;
}

.driver-results-strip__cell-session {
    font-size: 9px;
    opacity: 0.7;
    letter-spacing: 0.04em;
}

.driver-results-strip__cell-pos {
    font-weight: 700;
    font-size: 13px;
}

/* Match the lap-pos-badge palette for visual consistency. */
.driver-results-strip__cell--p1 {
    background: var(--raw-orange, #FF8000);
    color: #1a0a00;
}
.driver-results-strip__cell--p1 .driver-results-strip__cell-session { opacity: 0.7; }

.driver-results-strip__cell--p2 {
    background: var(--raw-cyan, #47C7FC);
    color: #001824;
}
.driver-results-strip__cell--p2 .driver-results-strip__cell-session { opacity: 0.7; }

.driver-results-strip__cell--p3 {
    background: #b87a4a;
    color: #1a0e05;
}
.driver-results-strip__cell--p3 .driver-results-strip__cell-session { opacity: 0.7; }

.driver-results-strip__event-points {
    font-size: 11px;
    color: var(--raw-orange, #FF8000);
    font-weight: 600;
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .driver-results-strip__year {
        gap: 8px;
    }
    .driver-results-strip__event {
        padding: 6px 8px;
    }
    .driver-results-strip__cell {
        min-width: 24px;
        padding: 3px 5px;
    }
}

/* ==========================================================================
   Single Race Report — hero grid + sidebar layout
   ========================================================================== */

.race-report__hero {
    padding: 24px 0 32px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.race-report__hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
}

@media (min-width: 880px) {
    .race-report__hero-grid {
        grid-template-columns: 1fr 360px;
    }
}

.race-report__event {
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--raw-cyan, #47C7FC);
    margin: 0 0 8px;
}

.race-report__title {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    margin: 0 0 8px;
}

.race-report__byline {
    margin: 0 0 16px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}
.race-report__byline a {
    color: var(--raw-cyan, #47C7FC);
    text-decoration: none;
}
.race-report__byline a:hover { color: var(--raw-orange, #FF8000); }

.race-report__facts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
}
.race-report__facts li {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.race-report__fact-label {
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 2px;
}

.race-report__hero-photo {
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    aspect-ratio: 16 / 10;
}
.race-report__hero-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Layout: body on the left, results card on the right */
.race-report__main {
    padding: 32px 0;
}
.race-report__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: start;
}

@media (min-width: 880px) {
    .race-report__layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

.race-report__body {
    min-width: 0; /* prevent prose from forcing wider layout */
}
.race-report__writeup {
    font-size: 17px;
    line-height: 1.7;
}
.race-report__writeup p { margin: 0 0 1em; }

.race-report__sidebar {
    position: sticky;
    top: 90px;
}
.race-report__results-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 16px;
}
.race-report__sidebar-title {
    margin: 0 0 4px;
    color: var(--raw-cyan, #47C7FC);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.race-report__sidebar-track {
    margin: 0 0 12px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}
.race-report__sidebar-note {
    margin: 12px 0 0;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}
.race-report__sidebar-note a {
    color: var(--raw-cyan, #47C7FC);
    text-decoration: none;
}

/* Onboard embed wrapper */
.race-report__onboard {
    margin-top: 32px;
}

/* Compact table inside the race-report sidebar — the global
   .sr-consumables-table padding is far too wide for a 320px column. */
.race-report__sidebar .sr-consumables-table {
    margin: 8px 0 0;
    table-layout: fixed;
}
.race-report__sidebar .sr-consumables-table th,
.race-report__sidebar .sr-consumables-table td {
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.3;
}
.race-report__sidebar .sr-consumables-table th {
    font-size: 10px;
}
.race-report__sidebar .sr-consumables-table .lap-time {
    font-size: 12px;
    white-space: nowrap;
}
.race-report__sidebar .lap-pos-badge {
    min-width: 22px;
    padding: 1px 6px;
    font-size: 11px;
}

/* ============================================================
   Driver Dashboard ([raw_driver_dashboard])
   ============================================================ */
.driver-dashboard {
    max-width: 760px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    color: var(--text-primary, #fff);
    font-family: var(--font-body, inherit);
}

.driver-dashboard__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}
.driver-dashboard__welcome { flex: 1; min-width: 0; }

.driver-dashboard__title {
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    color: var(--raw-cyan, #47C7FC);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.05;
    margin: 0 0 6px;
    letter-spacing: 0.01em;
}
.driver-dashboard__lede {
    color: var(--text-muted, #b8c5d6);
    margin: 0;
    font-size: 14px;
}

.driver-dashboard__signout {
    color: var(--raw-cyan, #47C7FC);
    font-size: 13px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    flex-shrink: 0;
    padding-top: 4px;
}
.driver-dashboard__signout:hover { border-bottom-color: currentColor; }

/* Dashboard header actions: Edit profile + Sign out */
.driver-dashboard__actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}
.driver-dashboard__editform { margin: 0; }
.driver-dashboard__edit {
    background: var(--raw-orange, #FF8000);
    color: #041E42;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.driver-dashboard__edit:hover { filter: brightness(1.08); }

/* Owner edit link on the public driver profile hero */
.driver-hero__edit {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--raw-orange, #FF8000);
    color: #041E42;
    text-decoration: none;
    border-radius: 4px;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 14px;
    font-weight: 700;
}
.driver-hero__edit:hover { filter: brightness(1.08); }

/* Android Chrome jumps the scroll when the sticky stats bar resizes on pin.
   JS adds .raw-no-sticky on Android; drop the sticky there (iOS keeps it). */
.raw-no-sticky .driver-stats {
    position: static;
}

.driver-dashboard__heading {
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    color: var(--raw-cyan, #47C7FC);
    font-size: 18px;
    letter-spacing: 0.04em;
    margin: 24px 0 12px;
}

.driver-dashboard__empty {
    color: var(--text-muted, #b8c5d6);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 14px 16px;
    margin: 0;
}

.driver-dashboard__year {
    margin: 0 0 18px;
}
.driver-dashboard__year:last-child { margin-bottom: 0; }

.driver-dashboard__year-label {
    color: var(--raw-orange, #FF8000);
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 13px;
    margin: 0 0 8px;
    padding: 0 4px;
}

.driver-dashboard__events {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-dashboard__event {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}
.driver-dashboard__event.is-submitted {
    border-color: rgba(71, 199, 252, 0.25);
    background: rgba(71, 199, 252, 0.04);
}

.driver-dashboard__event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
    min-width: 0;
}
.driver-dashboard__event-name {
    color: var(--text-primary, #fff);
    font-weight: 600;
}
.driver-dashboard__event-date {
    color: var(--text-muted, #b8c5d6);
    font-size: 13px;
}
.driver-dashboard__event-flag {
    color: #6ddf8a;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-dashboard__event-btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--raw-orange, #FF8000);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
.driver-dashboard__event-btn:hover { filter: brightness(1.1); color: #fff; }
.driver-dashboard__event-btn.is-secondary {
    background: transparent;
    border: 1px solid var(--raw-cyan, #47C7FC);
    color: var(--raw-cyan, #47C7FC);
}
.driver-dashboard__event-btn.is-secondary:hover {
    background: rgba(71, 199, 252, 0.1);
    color: var(--raw-cyan, #47C7FC);
}

/* Login form (signed-out state) */
.driver-dashboard__login {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 480px;
    margin-top: 16px;
}
.driver-dashboard__field { display: block; }
.driver-dashboard__field-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #b8c5d6);
    margin-bottom: 6px;
}
.driver-dashboard__login input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary, #fff);
    border-radius: 4px;
}
.driver-dashboard__cta {
    padding: 12px 24px;
    background: var(--raw-orange, #FF8000);
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-display, inherit);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    cursor: pointer;
}
.driver-dashboard__cta:hover { filter: brightness(1.1); }

.driver-dashboard__notice {
    padding: 16px 18px;
    border-radius: 6px;
    border: 2px solid;
}
.driver-dashboard__notice--ok {
    color: #0f5a2a;
    background: #f0fdf4;
    border-color: #1a7f37;
}
.driver-dashboard__error {
    color: #ffb3b6;
    background: rgba(214, 54, 56, 0.12);
    border: 1px solid rgba(214, 54, 56, 0.4);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 0 0 12px;
}

@media (max-width: 540px) {
    .driver-dashboard { padding: 18px 14px 36px; }
    .driver-dashboard__event {
        flex-direction: column;
        align-items: stretch;
    }
    .driver-dashboard__event-btn { text-align: center; }
}

/* Driver modal: race recaps list */
.driver-modal__recaps {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.driver-modal__recaps-title {
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 14px;
    color: var(--raw-cyan, #47C7FC);
    margin-bottom: 8px;
}
.driver-modal__recaps-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.driver-modal__recap-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 4px;
    color: var(--text-primary, #e8eef4);
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.driver-modal__recap-link:hover {
    background: rgba(71, 199, 252, 0.1);
}
.driver-modal__recap-pos {
    flex: 0 0 auto;
    font-family: var(--font-display, 'Barlow Condensed', sans-serif);
    font-weight: 700;
    color: var(--raw-orange, #FF8000);
}
