/* ===================================== */
/*               RACE HERO               */
/* ===================================== */

.race-hero {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    height: 100vh;
    padding: 0;
}

.race-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100vh;
    object-fit: cover;
}

.race-hero-left {
    position: relative;
    z-index: 2;
    width: 60%;
    height: 100%;
}

.hero-city-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.hero-city-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    font-family: 'F1-Black';
    font-size: clamp(32px, 8vw, 150px);
    line-height: 0.9;
    text-align: center;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.16);
    filter: blur(10px);
    opacity: 0;
    pointer-events: none;
}
@supports not (filter: blur(10px)) {
    .hero-city-canvas {
        display: none;
    }
    .hero-city-fallback {
        opacity: 1;
    }
}

.race-hero-right {
    position: relative;
    z-index: 2;
    top: 60px;
    width: 40%;
    height: calc(100% - 60px);
    background-color: rgba(10, 10, 20, 0.75);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 12.5%;
}

.hero-gp-name{
    font-size: 36px;
    margin: 0;
    line-height: 1;
    font-family: 'F1-Black';
}

.emoji {
    margin-left: 0 !important;
}

.hero-gp-flag {
    flex-shrink: 0;
    font-size: 36px;
    line-height: 1;
}

.hero-underline{
    font-family: 'F1-Regular';
    font-size: 16px;
    letter-spacing: 0.1px;
    margin: 0 12.5%;
    line-height: 1;
}

.hero-divider {
    height: 1px;
    margin: 28px 12.5% 0;
    background: rgba(255, 255, 255, 0.15);
}

.hero-schedule-label {
    margin: 20px 18.75% 0;
    font-family: 'F1-Regular';
    font-size: 16px;
    letter-spacing: 0.1px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.hero-schedule {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 18.75% 0;
}

.hero-schedule-days {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-circuit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-family: 'F1-Regular';
    font-size: 16px;
    letter-spacing: 0.5px;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.hero-circuit-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.14);
}

.hero-circuit-btn-arrow {
    font-size: 16px;
    transition: transform 0.15s ease;
}

.hero-circuit-btn:hover .hero-circuit-btn-arrow {
    transform: translateX(4px);
}

/* ── Day card ── */
/* Each day is its own contained block, so the weekend reads as 3 clearly
   separate days rather than one continuous list. */

.schedule-day {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s ease;
}

.schedule-day-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.day-weekday {
    font-family: 'F1-Regular';
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.day-date {
    font-family: 'F1-Regular';
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.schedule-session {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 14px;
    padding: 5px 0;
}

.schedule-session-name {
    font-family: 'F1-Regular';
    text-transform: uppercase;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.75);
    transition: color 0.15s ease, opacity 0.15s ease;
}

.schedule-session-time {
    font-family: 'F1-Regular';
    font-size: 16px;
    letter-spacing: 1px;
    color: #ffffff;
    transition: color 0.15s ease, opacity 0.15s ease;
}   

.schedule-session-tag {
    display: none;
    align-items: center;
    font-family: 'F1-Regular';
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: opacity 0.15s ease;
}

.schedule-session-finished .schedule-session-name,
.schedule-session-finished .schedule-session-time {
    opacity: 0.4;
}

.schedule-session-finished .schedule-session-tag {
    display: inline-flex;
    color: rgba(255, 255, 255, 0.4);
}

.schedule-session-live .schedule-session-name,
.schedule-session-live .schedule-session-time {
    color: #ff7070;
}

.schedule-session-live .schedule-session-tag {
    display: inline-flex;
    color: #ff7070;
    background: rgba(232, 0, 45, 0.12);
}

.schedule-session-live .schedule-session-tag::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.5s infinite;
}

.schedule-session-cta {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
    max-width: 256px;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(14, 14, 20, 0.25);
    font-family: 'F1-Regular';
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    opacity: 0;
    transform: translateY(3px);
    pointer-events: none;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.schedule-session-cta-arrow {
    transition: transform 0.15s ease;
}

.schedule-session-content-hidden .schedule-session-name,
.schedule-session-content-hidden .schedule-session-time,
.schedule-session-content-hidden .schedule-session-tag {
    opacity: 0;
}

.schedule-session-cta-visible .schedule-session-cta {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.schedule-session-cta:hover {
    background: rgba(232, 0, 45, 0.85);
    border-color: rgba(232, 0, 45, 0.5);
}

.schedule-session-cta:hover .schedule-session-cta-arrow {
    transform: translateX(3px);
}

.schedule-session-cta-live {
    background: rgba(14, 14, 20, 0.92);
    border-color: rgba(232, 0, 45, 0.3);
    color: #ff7070;
    text-decoration: none;
}

.schedule-session-cta-live:hover {
    background: rgba(232, 0, 45, 0.85);
    border-color: rgba(232, 0, 45, 0.5);
    color: #ffffff;
}

/* ── Responsive ──────────────────────────────────────────────────── */
/* Same breakpoints as the season calendar / standings sections below,
   so the whole page shifts tiers together: 1100px = smaller laptops/
   tablets (keep the two columns, just tighten them up), 600px = phones
   (stack the image on top of the panel). */

@media (max-width: 1100px) {
    .hero-title-row,
    .hero-underline,
    .hero-divider,
    .hero-schedule-label,
    .hero-schedule{
        margin-left: 8%;
        margin-right: 8%;
    }

    .hero-gp-name {
        font-size: 28px;
    }

    .hero-gp-flag {
        font-size: 28px;
    }

    .hero-underline {
        font-size: 14px;
    }
}

@media (max-width: 600px) {
    .race-hero {
        flex-direction: column;
        height: auto;
    }

    .race-hero-bg {
        height: 100%;
    }

    .race-hero-left {
        width: 100%;
        height: 58vh;
        min-height: 340px;
    }

    .race-hero-right {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding: 28px 0 32px;
    }

    .hero-title-row,
    .hero-underline,
    .hero-divider,
    .hero-schedule-label,
    .hero-schedule {
        margin-left: 6%;
        margin-right: 6%;
    }

    .hero-gp-name {
        font-size: 22px;
    }

    .hero-gp-flag {
        font-size: 22px;
    }

    .hero-underline {
        font-size: 13px;
    }

    .hero-schedule-label {
        font-size: 12px;
    }

    .schedule-day {
        padding: 16px 12px 12px 12px;
    }

    .schedule-session-name,
    .schedule-session-time {
        font-size: 13px;
    }

    .day-weekday,
    .day-date {
        font-size: 13px;
    }

    .schedule-session-cta {
        max-width: 220px;
        font-size: 11px;
    }

    .hero-circuit-btn {
        font-size: 13px;
        padding: 14px;
    }
}



/* =========================================== */
/*               SEASON CALENDAR               */
/* =========================================== */

.race-calendar {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: var(--content-width);
    margin-inline: auto;
    padding: var(--content-rhythm) var(--content-gutter);
    scroll-margin-top: 80px;
}

.calendar-header {
    grid-column: 1 / -1;
    margin-bottom: 0.5rem;
}

/* Fila que contiene titulo + switcher de anio en la misma linea */
.season-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-title {
    font-family: 'F1-Black';
    padding-left: 15px;
    border-left: 5px solid var(--primary-red);
    font-size: 56px;
    text-transform: uppercase;
    line-height: 0.9;
}

/* Grupo derecho: < ANIO > */
.season-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.season-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
}

.season-nav-btn svg {
    width: 20px;
    height: 20px;
}

.season-nav-btn:hover:not(:disabled) {
    color: #fff;
}

.season-nav-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

.season-year-label {
    font-family: 'F1-Black';
    font-size: 32px;
    color: rgba(255, 255, 255, 0.75);
    min-width: 4ch;
    text-align: center;
    letter-spacing: 0.02em;
}

.race-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.race-card::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
}

.race-card:hover {
    transform: translateY(-4px);
    cursor: default;
}

.race-card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0;
    padding: 13px 16px 16px 16px;
}

.race-card-content h3 {
    margin-bottom: 4px;
    font-family: 'F1-Regular';
    font-size: 24px;
    line-height: 1.3;
    text-transform: uppercase;
}

.race-card-content h3 img.emoji,
.race-card-next-title img.emoji {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-bottom: 2px;
}

.race-card-next-title img.emoji {
    width: 52px;
    height: 42px;
    margin-bottom: 1px;
}

.race-round {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: var(--text-dim);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sprint-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 3px;
    background: rgba(245, 166, 35, 0.14);
    color: #f5a623;
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Sprint weekends get a gold top accent so the calendar isn't only red/blue/grey.
   Left out of race-card-next so the "NEXT" red highlight still wins there. */
.race-card-finished.race-card-sprint::before,
.race-card-upcoming.race-card-sprint::before {
    background: linear-gradient(
        90deg,
        #f5a623 0%,
        rgba(245, 166, 35, 0.35) 60%,
        rgba(245, 166, 35, 0) 100%
    );
}

.race-card-finished.race-card-sprint {
    border-color: rgba(245, 166, 35, 0.12);
}

.race-date {
    margin-bottom: 0;
    color: var(--text-dim);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.race-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 3px;
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ENDED — mini checkered-flag pattern, not a faded dot */
.status-finished {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    margin-top: 10px;
    margin-bottom: 12px;
}

/* NEXT — solid saturated fill, text-only */
.status-next {
    color: #ffffff;
    background: #e8002d;
    font-size: 11px;
}

/* UPCOMING — text-only */
.status-upcoming {
    color: #5dade2;
    background: rgba(52, 152, 219, 0.1);
    margin-top: 10px;
    margin-bottom: 12px;
}

/* CANCELLED — struck-through label says it all */
.status-cancelled {
    color: #ff6666;
    background: rgba(255, 77, 77, 0.08);
    text-decoration-thickness: 1.5px;
    margin-top: 10px;
    margin-bottom: 12px;
}

.race-card-top3 {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.race-card-top3-row {
    display: grid;
    grid-template-columns: 16px 28px 18px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
}

.top3-pos {
    color: var(--text-dim);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
}

.top3-team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.top3-team-logo-placeholder {
    width: 18px;
    height: 18px;
}

.top3-driver {
    overflow: hidden;
    color: var(--text-light);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.top3-delta {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.2);
    font-family: 'F1-Bold';
    font-size: 12px;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.top3-delta .res-delta {
    display: flex;
    align-items: center;
    gap: 4px;
}

.top3-delta .res-delta-arrow {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.top3-delta .res-delta--up   { color: #22c55e; }
.top3-delta .res-delta--down { color: var(--primary-red, #e8002d); }

.top3-delta .res-delta--same,
.top3-delta .res-delta--none {
    color: rgba(255, 255, 255, 0.2);
    font-family: 'F1-Regular';
    font-size: 12px;
}

.top3-time {
    color: var(--text-dim);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.race-link {
    width: 100%;
    margin-top: auto;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    font-family: 'F1-Regular';
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.race-link:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
}

.race-card-finished {
    background-color: var(--base-700);
}

.race-card-finished:hover {
    background-color: var(--base-600);
}

.race-card-finished .race-card-content h3 {
    color: var(--text-light);
}

.race-card-next {
    background-color: var(--base-700);
}

.race-card-next::before {
    background: linear-gradient(
        90deg,
        #e8002d,
        #ff6b6b,
        #e8002d
    );
}

.race-card-next:hover {
    box-shadow: 0 8px 32px rgba(232, 0, 45, 0.18);
}

.race-card-next h3 {
    color: #ffffff;
}

.race-card-next .race-round {
    color: rgba(255, 120, 120, 0.5);
}

.race-card-next .race-link {
    border-color: rgba(232, 0, 45, 0.3);
    color: #ff8a8a;
}

.race-card-next-expanded {
    grid-column: 1 / -1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.race-card-next-top-row {
    display: flex;
    align-items: stretch;
    gap: 24px;
}

.race-card-next-photo {
    flex: 0 0 360px;
    border-radius: 10px;
    overflow: hidden;
}

.race-card-next-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.race-card-next-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.race-card-next-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.race-card-next-title {
    font-family: 'F1-Black';
    font-size: 36px;
    text-transform: uppercase;
    line-height: 1;
}

.race-card-next-circuit {
    font-family: 'F1-Regular';
    font-size: 16px;
    color: var(--text-dim);
}

.race-card-next-cta {
    font-size: 14px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.race-card-next-cta-arrow {
    transition: transform 0.15s ease;
}

.race-card-next-cta:hover .race-card-next-cta-arrow {
    transform: translateX(4px);
}

.race-card-next .race-card-next-cta-live {
    background: rgba(232, 0, 45, 0.12);
    border-color: rgba(232, 0, 45, 0.4);
    color: #ff7070;
}

.race-card-next .race-card-next-cta-live:hover {
    background: rgba(232, 0, 45, 0.85);
    border-color: rgba(232, 0, 45, 0.5);
    color: #ffffff;
}

.race-card-next-layout {
    flex: 0 0 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.race-card-next-layout img {
    width: 100%;
    height: auto;
}

.race-card-next-layout-svg {
    filter: brightness(0) invert(1);
}

.race-card-next-schedule {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.race-card-next-schedule .schedule-day {
    flex: 1;
    min-width: 220px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

@media (max-width: 1100px) {
    .race-card-next-title { font-size: 24px; font-family: 'F1-Regular'; }
    .race-card-next-top-row { flex-direction: column; }
    .race-card-next-photo { flex: none; width: 100%; }
    .race-card-next-layout { display: none; }
    .race-card-next-photo { height: 180px; }
    .calendar-title { font-size: 48px; }
}

.race-card-upcoming {
    background-color: var(--base-700);
}

.race-card-upcoming::before {
    background: linear-gradient(
        90deg,
        #3498db 0%,
        rgba(52, 152, 219, 0.4) 50%,
        rgba(52, 152, 219, 0) 100%
    );
}

.race-card-upcoming:hover {
    background-color: var(--base-600);
}

.race-card-cancelled {
    opacity: 0.65;
    background-color: rgb(18, 8, 8);
}

.race-card-cancelled::before {
    background: linear-gradient(
        90deg,
        #ff4d4d 0%,
        rgba(255, 77, 77, 0.4) 50%,
        rgba(255, 77, 77, 0) 100%
    );
}

.race-card-cancelled:hover {
    opacity: 0.9;
}

/* Responsive */

@media (max-width: 1100px) {
    .race-calendar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .race-calendar { grid-template-columns: 1fr; }
}

/* Entrada */

/* Todo espera oculto hasta que el observer le pone .in-view (ver index.js).
   Las tarjetas que entran juntas se escalonan con --rc-delay. Las animaciones
   van con backwards (no both): al terminar sueltan los elementos, así el
   hover que levanta la tarjeta sigue funcionando. */
.calendar-title:not(.in-view),
.race-card:not(.in-view) { opacity: 0; }

/* Título: se descubre de izquierda a derecha, arrancando por la barra roja */
.calendar-title.in-view {
    animation: cal-title-in 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

/* Tarjeta: sube desenfocada y se asienta */
.race-card.in-view {
    animation: rc-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: var(--rc-delay, 0s);
}

/* La franja de color de arriba se dibuja de izquierda a derecha */
.race-card.in-view::before {
    transform-origin: left;
    animation: rc-bar-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.25s);
}

/* Contenido de las tarjetas chicas: ronda, nombre, fecha, estado, podio y
   botón suben de a uno, detrás de la tarjeta */
.race-card.in-view .race-card-content > *,
.race-card.in-view .race-card-top3-row {
    animation: rc-part-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.2s + var(--j, 0) * 0.06s);
}

.race-card-content > :nth-child(2) { --j: 1; }
.race-card-content > :nth-child(3) { --j: 2; }
.race-card-content > :nth-child(4) { --j: 3; }
.race-card-content > :nth-child(5) { --j: 4; }
.race-card-content > :nth-child(6) { --j: 5; }

/* Podio: los tres puestos entran desde la izquierda, uno detrás del otro,
   cuando la tabla ya está en su lugar */
.race-card.in-view .race-card-top3-row { animation-name: rc-row-in; }
.race-card-top3-row:nth-child(1) { --j: 5; }
.race-card-top3-row:nth-child(2) { --j: 6; }
.race-card-top3-row:nth-child(3) { --j: 7; }

/* Próxima carrera: la foto se descubre de izquierda a derecha mientras se
   aleja; la info entra desde la izquierda de a una línea; el trazado del
   circuito gira hasta su lugar; y los días del cronograma suben de a uno,
   cada uno con sus sesiones detrás. */
.race-card-next.in-view .race-card-next-photo {
    animation: rc-wipe-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.2s);
}

.race-card-next.in-view .race-card-next-photo img {
    animation: rc-zoom-in 1.4s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.2s);
}

.race-card-next.in-view .race-card-next-info > * {
    animation: rc-row-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.4s + var(--j, 0) * 0.08s);
}

.race-card-next-info > :nth-child(2) { --j: 1; }
.race-card-next-info > :nth-child(3) { --j: 2; }
.race-card-next-info > :nth-child(4) { --j: 3; }

.race-card-next.in-view .race-card-next-layout {
    animation: rc-layout-in 1s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.55s);
}

.race-card-next.in-view .schedule-day {
    animation: rc-part-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.7s + var(--j, 0) * 0.1s);
}

.race-card-next.in-view .schedule-session {
    animation: rc-row-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
    animation-delay: calc(var(--rc-delay, 0s) + 0.9s + var(--j, 0) * 0.1s + var(--k, 0) * 0.06s);
}

.schedule-day:nth-child(2) { --j: 1; }
.schedule-day:nth-child(3) { --j: 2; }
.schedule-day:nth-child(4) { --j: 3; }

/* Sesiones de cada día (el primer hijo es el título del día) */
.schedule-session:nth-child(3) { --k: 1; }
.schedule-session:nth-child(4) { --k: 2; }

@keyframes cal-title-in {
    from {
        clip-path: inset(-20% 100% -20% 0);
        transform: translateX(-24px);
    }
    to { clip-path: inset(-20% -5% -20% 0); }
}

@keyframes rc-in {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
        filter: blur(6px);
    }
}

@keyframes rc-bar-in {
    from { transform: scaleX(0); }
}

@keyframes rc-part-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes rc-row-in {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
}

@keyframes rc-wipe-in {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0); }
}

@keyframes rc-zoom-in {
    from { transform: scale(1.25); }
}

@keyframes rc-layout-in {
    from {
        opacity: 0;
        transform: scale(0.85) rotate(-8deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .calendar-title.in-view,
    .race-card.in-view,
    .race-card.in-view::before,
    .race-card.in-view .race-card-content > *,
    .race-card.in-view .race-card-top3-row,
    .race-card-next.in-view .race-card-next-photo,
    .race-card-next.in-view .race-card-next-photo img,
    .race-card-next.in-view .race-card-next-info > *,
    .race-card-next.in-view .race-card-next-layout,
    .race-card-next.in-view .schedule-day,
    .race-card-next.in-view .schedule-session { animation: none; }
}

/* Animation */

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.25;
    }
}
/* ============================================ */
/*             DRIVER STANDINGS                 */
/* ============================================ */

.standings-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: var(--content-width);
    margin-inline: auto;
    padding-inline: var(--content-gutter);
    margin-bottom: 100px;
    scroll-margin-top: 80px;
}

.standings-header {
    width: 100%;
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
}

.standings-title {
    font-family: 'F1-Black';
    font-size: 48px;
    text-transform: uppercase;
    line-height: 0.9;
    padding-left: 15px;
    border-left: 5px solid var(--primary-red);
}

.standings-subtitle {
    color: rgba(255, 255, 255, 0.35);
    font-family: 'F1-Regular', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── List ── */

.standings-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Row ── */

.standing-row {
    position: relative;
    display: grid;
    grid-template-columns: 56px 52px 1fr 140px auto auto;
    align-items: center;
    gap: 0 1rem;
    padding: 0 20px 0 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.standing-row::before {
    /* team-color left bar */
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
}

.standing-row:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(3px);
}

/* ── Team accent colors ── */

.team-mclaren::before   { background: #FF8000; }
.team-redbull::before   { background: #3671C6; }
.team-mercedes::before  { background: #27F4D2; }
.team-ferrari::before   { background: #E8002D; }
.team-williams::before  { background: #005AFF; }
.team-rbracing::before  { background: #6692FF; }
.team-alpine::before    { background: #FF69B4; }
.team-haas::before      { background: #B6BABD; }
.team-aston::before     { background: #229971; }
.team-audi::before      { background: #C00001; }
.team-cadillac::before  { background: #1C355E; }

/* ── Position number ── */

.standing-pos {
    padding: 18px 0 18px 20px;
    font-family: 'F1-Black', sans-serif;
    font-size: 22px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.15);
}

/* leader gets a brighter pos */
.standing-row:first-child .standing-pos {
    color: rgba(255, 255, 255, 0.7);
}

/* ── Driver avatar ── */

.standing-avatar {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: cover;
    object-position: top center;
    -webkit-mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 55%, transparent 100%);
    filter: saturate(0.9) contrast(1.05);
    transition: filter 0.2s ease;
}

.standing-row:hover .standing-avatar {
    filter: saturate(1.1) contrast(1.1);
}

/* ── Driver name ── */

/* ── Driver info (number + flag + name) ── */

.standing-driver {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.standing-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.standing-number {
    font-family: 'F1-Bold', sans-serif;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
}

.standing-flag {
    font-size: 12px;
    line-height: 1;
}

/* number color follows team accent */
.team-mclaren   .standing-number { color: #FF8000; }
.team-redbull   .standing-number { color: #3671C6; }
.team-mercedes  .standing-number { color: #27F4D2; }
.team-ferrari   .standing-number { color: #E8002D; }
.team-williams  .standing-number { color: #005AFF; }
.team-rbracing  .standing-number { color: #6692FF; }
.team-alpine    .standing-number { color: #FF69B4; }
.team-haas      .standing-number { color: #B6BABD; }
.team-aston     .standing-number { color: #229971; }
.team-audi      .standing-number { color: #C00001; }
.team-cadillac  .standing-number { color: #1C355E; }

.standing-name {
    font-family: 'F1-Bold', sans-serif;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
}

/* ── Team (logo + name) ── */

.standing-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.standing-team-logo {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.standing-team-name {
    font-family: 'F1-Regular', sans-serif;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Points ── */

.standing-pts {
    font-family: 'F1-Black', sans-serif;
    font-size: 20px;
    color: #ffffff;
    letter-spacing: -0.5px;
    min-width: 52px;
    text-align: right;
}

/* suffix PTS label */
.standing-pts::after {
    content: ' pts';
    font-family: 'F1-Regular', sans-serif;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 2px;
}

/* ── Delta ── */

.standing-delta {
    font-family: 'F1-Bold', sans-serif;
    font-size: 10px;
    letter-spacing: 0.5px;
    min-width: 28px;
    text-align: right;
}

.delta-neutral { color: rgba(255, 255, 255, 0.25); }
.delta-up      { color: #2ecc71; }
.delta-down    { color: #e8002d; }

/* ── Leader bar (top-1 highlight) ── */

.standing-row:first-child {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.08);
}

.standing-row:first-child .standing-name {
    color: #ffffff;
}

/* ── CTA ── */

.standings-cta {
    display: inline-flex;
    align-items: center;
    padding: 11px 24px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.7);
    font-family: 'F1-Bold', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-decoration: none;
    text-transform: uppercase;
    transition: all 0.25s ease;
}

.standings-cta:hover {
    background: rgba(232, 0, 45, 0.12);
    border-color: rgba(232, 0, 45, 0.35);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(232, 0, 45, 0.15);
}

/* ── Responsive ── */

@media (max-width: 600px) {
    .standings-section { gap: 1.25rem; }

    .standings-title {
        font-size: 32px;
    }

    .standing-pos {
        font-size: 16px;
        padding-left: 16px;
    }

    .standing-name {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .standing-pts {
        font-size: 15px;
        min-width: 40px;
    }

    .standing-pts::after {
        display: none;
    }

    .standing-avatar {
        width: 40px;
        height: 40px;
    }

    .standing-team {
        display: none;
    }

    .standing-meta {
        gap: 4px;
    }

    .standing-number {
        font-size: 9px;
    }

    .standing-flag {
        font-size: 10px;
    }

    .standing-row {
        grid-template-columns: 44px 40px 1fr auto auto;
        gap: 0 0.6rem;
    }
}