/* ============================================================
   VELOCITY VANGUARD RACING — STYLESHEET
   ============================================================ */

/* ── Variables ── */
:root {
    --bg-app:      #ff2e2e;
    --bg-nav:      #000000;
    --border-nav:  #3f3f3f;
    --icon-idle:   #5c5c63;
    --icon-hover:  #d4d4d9;
    --icon-active: #cc1717;
    --head-bg:     #ce2929;
    --text-main:   #e8e8ec;
    --text-dim:    #8a8a92;
    --accent-color:#000000;
    --navbar-bar:  #cc1717;
    --footer-bg:   #131313;
    --content-bg:  #050505;
}

/* ── Light mode variables ── */
body.light {
    --bg-app:      #cc1717;
    --bg-nav:      #f5f5f5;
    --border-nav:  #ddd;
    --icon-idle:   #999;
    --icon-hover:  #333;
    --icon-active: #cc1717;
    --head-bg:     #cc1717;
    --text-main:   #111;
    --text-dim:    #555;
    --accent-color:#ffffff;
    --navbar-bar:  #cc1717;
    --footer-bg:   #e8e8e8;
    --content-bg:  #cacaca;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-app);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
    color: var(--text-main);
}

body {
    min-height: 100vh;
}

/* ── Theme transitions ── */
body, .sidebar, .nav-item, .driver-card, .contact-card,
.partner-box, .event-row, .team-stat, .page, header {
    transition: background-color 0.4s ease, color 0.3s ease,
                border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================================
   SIDEBAR / NAV
   ============================================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 72px;
    flex-shrink: 0;
    background: var(--bg-nav);
    border-right: 2px solid var(--border-nav);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 8px;
    z-index: 100;
}

.logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    border-radius: 10px;
    transition: background 0.25s ease, transform 0.15s ease;
}

.logo:active { transform: scale(0.94); }

.logo img {
    width: auto;
    height: 30px;
    max-width: 100%;
    object-fit: contain;
}
.nav-divider {
    width: 32px;
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin-bottom: 10px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    justify-content: space-evenly;
    flex: 1;
}

.nav-list li {
    display: flex;
    justify-content: center;
    width: 100%;
}

.nav-item {
    position: relative;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--icon-idle);
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease;
}

.nav-item svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.25s ease;
}

.nav-item:hover {
    color: var(--icon-hover);
    background: rgba(255,255,255,0.05);
}

.nav-item.active { color: var(--icon-active); }

.nav-item .tooltip {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    background: #1f1f23;
    color: var(--text-main);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;              /* 👈 confirma que esta línea siga ahí */
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-item:hover .tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Active indicator bar */
.active-indicator {
    position: absolute;
    right: -2px;
    width: 3px;
    height: 28px;
    background: var(--navbar-bar);
    border-radius: 2px;
    top: 0;
    transition: top 0.38s cubic-bezier(0.65, 0, 0.35, 1);
}

.active-indicator.no-anim { transition: none !important; }

/* Theme toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--icon-idle);
    font-size: 16px;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.25s ease, background 0.25s ease;
    margin-top: 8px;
}

.theme-toggle:hover {
    color: var(--icon-hover);
    background: rgba(255,255,255,0.05);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.page-wrapper {
    position: relative;  /* 👈 evita el overflow que genera el margen raro */
    margin-left: 72px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    background: var(--content-bg);
    padding: 48px;
}

/* ============================================================
   PAGES & ANIMATIONS
   ============================================================ */

.page {
    display: none;
    animation: fadeSlideIn 0.35s ease;
}

.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.page h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 600;
}

.page p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
    max-width: 520px;
}

.page-header-logo {
    display: block;
    margin: 0 auto 28px;
    height: 56px;
    width: auto;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Section heading */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 32px;
}

.section-heading h2 {
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 36px);
    letter-spacing: 2px;
    margin: 0;
    white-space: nowrap;
}

.section-line {
    flex: 1;
    max-width: 200px;
    height: 1px;
    background: rgba(255,255,255,0.1);
}

.accent-red { color: var(--icon-active); }

/* Partner box */
.partner-box {
    width: 120px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #1a1a1a;
    padding: 10px;
    text-decoration: none;
    transition: border-color 0.2s ease;

}

.partner-box:hover { border-color: var(--bg-app); }

.partner-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* ============================================================
   HOME — HERO
   ============================================================ */

.hero {
    height: 40vh;
    min-height: 220px;
    display: flex;
    margin: -48px -48px 40px -48px;
    background: var(--head-bg);
    overflow: hidden;
}

.hero-text {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6%;
    text-align: center;
}

.hero-text h2 {
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-weight: 400;
    font-size: clamp(41px, 12vw, 80px);
    line-height: 1.02;
    letter-spacing: 1px;
    margin: 0;
    color: var(--text-main);
}

.hero-text h2 .accent { color: var(--accent-color); }

.hero-image {
    width: 50%;
    position: relative;
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%);
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(13,13,16,0.5) 0%, rgba(13,13,16,0) 35%);
}

/* ============================================================
   HOME — ABOUT
   ============================================================ */

.about {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 80px;
    padding: 32px 8px 56px;
}

.about-left {
    width: 340px;
    max-width: 340px;
    flex-shrink: 0;
}

.about-title {
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-weight: 400;
    font-size: clamp(30px, 4vw, 52px);
    letter-spacing: 1px;
    margin: 0 0 12px 0;
    color: var(--text-main);
}

.about-divider {
    width: 2px;
    height: 140px;
    background: var(--icon-active);
    transform: rotate(18deg);
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(204,23,23,0.5);
}

.about-image {
    flex: 0 0 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-image img {
    width: 100%;
    max-width: 320px;
    height: 220px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

.about-text {
    flex: 0 1 340px;
    display: flex;
    justify-content: center;
}

.about-text p {
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.7;
    max-width: 380px;
    margin: 0;
}

/* ============================================================
   HOME — TEAM STATS
   ============================================================ */

.team-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 0 56px;
}

.team-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 16px;
    background: var(--content-bg);
    text-align: center;
}

.team-stat:hover { background: rgba(204,23,23,0.06); }

.team-stat-num {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(24px, 3vw, 36px);
    color: var(--icon-active);
    letter-spacing: 1px;
    line-height: 1;
}

.team-stat-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================================
   HOME — UPCOMING EVENTS
   ============================================================ */

.upcoming-events { margin-bottom: 56px; }

.events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.event-row {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: #0d0d0d;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    transition: border-color 0.25s ease, transform 0.2s ease;
}

.event-row:hover {
    border-color: var(--icon-active);
    transform: translateX(4px);
}

.event-date {
    font-family: "Bebas Neue", sans-serif;
    font-size: 15px;
    color: var(--icon-active);
    letter-spacing: 1px;
    white-space: nowrap;
}

.event-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0 0 2px;
}

.event-track {
    font-size: 12px;
    color: var(--text-dim);
    margin: 0;
}

.event-class {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--icon-active);
    color: var(--icon-active);
    white-space: nowrap;
}

.events-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    padding: 32px;
}

/* ============================================================
   HOME — CONTACT
   ============================================================ */

.contact { padding: 40px 8px 64px; }

.contact-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 40px;
}

.contact-heading .line {
    flex: 1;
    max-width: 260px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bg-app));
}

.contact-heading .line.right {
    background: linear-gradient(90deg, var(--bg-app), transparent);
}

.contact-heading h2 {
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 44px);
    letter-spacing: 3px;
    margin: 0;
    color: var(--text-main);
    white-space: nowrap;
}

.contact-heading h2 .accent { color: var(--icon-active); }

.contact-cards {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}

.contact-card {
    width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px 24px;
    background: #101012;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--icon-active);
    background: #141416;
}

.contact-card .contact-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(204,23,23,0.12);
    color: var(--icon-active);
    font-size: 22px;
    margin-bottom: 4px;
}

.contact-card h3 {
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-weight: 400;
    font-size: 22px;
    letter-spacing: 1px;
    margin: 0;
}

.contact-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
}

/* ============================================================
   HOME — PARTNERS STRIP
   ============================================================ */

.home-partners { margin-bottom: 40px; }

.home-partners-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* ============================================================
   DRIVERS PAGE
   ============================================================ */

.drivers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.driver-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.driver-card:hover {
    border-color: var(--bg-app);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.driver-info {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.driver-nationality {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

.driver-bio {
    font-size: 13px;
    color: #aaa;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

.driver-bio.expanded {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.driver-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-top: 0.5px solid #1a1a1a;
    border-bottom: 0.5px solid #1a1a1a;
}

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

.detail-label {
    font-size: 11px;
    color: #555;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 13px;
    color: #ccc;
    font-weight: 400;
}

.driver-socials {
    display: flex;
    gap: 14px;
}

.driver-socials a {
    font-size: 18px;
    color: #555;
    transition: color 0.3s ease;
    text-decoration: none;
}

.driver-socials a:hover { color: var(--icon-active); }

.staff-badge {
    font-size: 11px;
    font-weight: 700;
    color: #cc0000;
    text-shadow: 0 0 8px rgba(204,0,0,0.8), 0 0 16px rgba(204,0,0,0.4);
    letter-spacing: 1.5px;
    vertical-align: middle;
    margin-left: 8px;
}

.read-more-btn {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    font-family: inherit;
    text-shadow: 0 0 8px rgba(204,0,0,0.5);
    transition: text-shadow 0.3s ease;
}

.read-more-btn:hover { text-shadow: 0 0 12px rgba(204,0,0,0.8); }

/* ============================================================
   RESULTS PAGE — POST FEED & MODAL
   ============================================================ */

.page-tagline {
    text-align: center;
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-size: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--icon-active);
    margin: 0 0 4px !important;
}

#page-results h1 { text-align: center; margin-bottom: 32px; }
#page-drivers h1 { text-align: center; margin-bottom: 8px; }
#page-garage h1 { text-align: center; margin-bottom: 8px; }
#page-gallery h1 { text-align: center; margin-bottom: 8px; }
#page-partners h1 { text-align: center; margin-bottom: 8px; }

.results-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 8px;
}

.result-card {
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.25s ease;
}

.result-card:hover {
    border-color: var(--bg-app);
    transform: translateY(-4px);
}

.result-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.result-card:hover::after {
    opacity: 1;
}

.result-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    background: #101012;
}

.result-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-card-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.result-card-date {
    font-size: 11px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.result-card-excerpt {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 2px 0 4px;
}

.results-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
    padding: 48px 0;
    grid-column: 1 / -1;
}

/* Modal */
.results-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.results-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.results-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(2px);
}

.results-modal-content {
    position: relative;
    width: min(560px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background: #0d0d0d;
    border: 1px solid #1a1a1a;
    border-radius: 14px;
    transform: translateY(12px);
    transition: transform 0.25s ease;
}

.results-modal.open .results-modal-content { transform: translateY(0); }

.results-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.results-modal-close:hover { background: var(--icon-active); }

.results-modal-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    background: #000;
}

.results-modal-body {
    padding: 22px 24px 28px;
}

.results-modal-body h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
}

.results-modal-date {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 14px;
}

.results-modal-body #results-modal-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
    white-space: pre-wrap;
}

/* ============================================================
   PARTNERS PAGE
   ============================================================ */

.partner-feature {
    padding: 20px 8px 64px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.partner-block {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 48px;
}

.partner-block.reverse { grid-template-columns: 1fr 1fr; }

.partner-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #101012;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}

.partner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.partner-copy {
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
}

.partner-copy h3 {
    font-family: "Bebas Neue", "Inter", sans-serif;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    color: var(--text-main);
}

.partner-copy p {
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dim);
}

.partner-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    border: 1px solid var(--icon-active);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: rgba(204,23,23,0.12);
    position: relative;
    z-index: 0;
    isolation: isolate;
    box-shadow: 0 0 22px 2px rgba(204,23,23,0.35);
    transition: box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.partner-btn::before {
    content: "";
    position: absolute;
    inset: -6px;
    z-index: -1;
    background: radial-gradient(circle, rgba(204,23,23,0.55), transparent 70%);
    filter: blur(14px);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.partner-btn i { transition: transform 0.25s ease; }

.partner-btn:hover {
    opacity: 0.9; opacity: 0.9; ;
    box-shadow: 0 0 32px 6px rgba(204,23,23,0.6);
}

.partner-btn:hover::before { opacity: 0.9; }
.partner-btn:hover i { transform: translateX(4px); }

/* ============================================================
   CAR VIEWER (GARAGE)
   ============================================================ */

#car-viewer {
    position: relative;
    width: 100%;
    max-width: 900px;
    height: 480px;
    margin: 24px auto;
    border-radius: 12px;
    overflow: hidden;
    background: #0b0d10;
}

#car-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viewer-hint {
    position: absolute;
    bottom: 10px;
    left: 14px;
    font-size: 12px;
    color: #8891a0;
    margin: 0;
    pointer-events: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    padding: 12px 48px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: var(--footer-bg);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-copy,
.footer-credit {
    margin: 0;
    font-size: 12px;
    color: var(--text-dim);
}

/* ============================================================
   LIGHT MODE OVERRIDES
   ============================================================ */

body.light .nav-item:hover { background: rgba(0,0,0,0.05); }
body.light .nav-item .tooltip { background: #fff; color: #111; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
body.light .nav-divider { background: rgba(0,0,0,0.1); }

body.light .sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.3) !important;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08) !important;
}

body.light .team-stats {
    border: 1px solid rgba(190, 33, 33, 0.644) !important;
    box-shadow: 0 2px 8px rgba(48, 48, 48, 0.493) !important;
}

body.light .team-stat:hover { background: rgba(204,23,23,0.04); }
body.light .team-stat { border-right: 1px solid rgba(0,0,0,0.08); }
body.light .team-stat:last-child { border-right: none; }

body.light .event-row {
    background: #f8f8f8 !important;
    border: 1px solid rgba(0,0,0,0.12) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
}

body.light .event-row:hover {
    border-color: var(--icon-active) !important;
    box-shadow: 0 2px 8px rgba(204,23,23,0.12) !important;
}

body.light .section-line { background: rgba(0,0,0,0.15); }

body.light .contact-card {
    background: #f8f8f8 !important;
    border: 1px solid rgba(0, 0, 0, 0.322) !important;
}

body.light .contact-card:hover {
    background: #efefef !important;
    border-color: var(--icon-active) !important;
    box-shadow: 0 5px 16px rgba(218, 8, 8, 0.397) !important;
    transform: translateY(-4px);
}

body.light .partner-box {
    background: #f8f8f8 !important;
    border: 1px solid rgba(0, 0, 0, 0.322) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

body.light .partner-box:hover { border-color: var(--icon-active) !important; }

body.light .driver-card {
    background: #f5f5f5;
    border-color: rgba(0,0,0, 0.322);
}

body.light .driver-card:hover { border-color: var(--icon-active); }
body.light .driver-details { border-top-color: #ddd; border-bottom-color: #ddd; }
body.light .partner-btn::before { opacity: 0.1; }
body.light .partner-btn:hover { background: var(--icon-active); color: white;}
body.light .driver-name { color: #111; }
body.light .driver-nationality { color: #999; }
body.light .driver-bio { color: #555; }
body.light .detail-label { color: #999; }
body.light .detail-value { color: #333; }
body.light .driver-socials a { color: #999; }
body.light .partner-media { border-color: #ddd; }
body.light .site-footer { border-top: 1px solid rgba(0, 0, 0, 0.322); }

body.light .result-card { background: #f5f5f5; border-color: rgba(0,0,0,0.322); }
body.light .result-card:hover { border-color: var(--icon-active); }
body.light .result-card-body h3 { color: #111; }
body.light .result-card-excerpt { color: #555; }
body.light .results-modal-content { background: #f5f5f5; border-color: rgba(0,0,0,0.2); }
body.light .results-modal-body h3 { color: #111; }
body.light .results-modal-body #results-modal-text { color: #555; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .about { gap: 48px; }
    .partner-feature { gap: 32px 40px; }
    .content { padding: 40px; }
    .hero { margin: -40px -40px 36px -40px; }
}

/* Tablet small */
@media (max-width: 900px) {
    .about { flex-direction: column; align-items: flex-start; gap: 24px; }
    .about-title { justify-content: center; text-align: center; }
    .about-left { width: 100%; max-width: 100%; }
    .about-divider { transform: none; width: 200px; height: 2px; margin: 0 auto; box-shadow: none; align-self: center; }
    .about-text { flex: none; width: 100%; }
    .about-text p { max-width: 100%; }
    .about-image { flex: none; width: 100%; }
    .about-image img { max-width: 100%; height: 200px; }
}

@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .page-wrapper { margin-left: 60px; }
    .page-header-logo { height: auto; width: 100px; }
    .nav-item { width: 40px; height: 40px; }
    .nav-item svg { width: 20px; height: 20px; }
    .logo { width: 34px; height: 34px; }
    .logo img { height: 26px; }
    .content { padding: 32px 24px; }
    .hero { margin: -32px -24px 32px -24px; }
    .partner-copy { max-width: 100%; }
    .team-stats { grid-template-columns: repeat(2, 1fr); }
    .event-row { grid-template-columns: 90px 1fr; }
    .event-class { display: none; }
    .drivers-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .hero { height: auto; flex-direction: column; }
    .hero-text, .hero-image { width: 100%; }
    .hero-image { clip-path: none; height: 160px; }
    .hero-text { padding: 24px 24px 16px; }
    .partner-block,
    .partner-block.reverse { grid-template-columns: 1fr; }
    .partner-block.reverse { display: flex; flex-direction: column; }
    .partner-block.reverse .partner-media { order: -1; }
}

@media (max-width: 600px) {
    .content { padding: 24px 16px; }
    .hero { margin: -24px -16px 28px -16px; min-height: 260px; }
    .page-header-logo { height: auto; width: 100px; }
    .about { padding: 24px 0 40px; }
    .contact { padding: 32px 0 48px; }
    .partner-feature { padding: 16px 0 48px; }
    .contact-card { width: 100%; max-width: 320px; }
    .contact-heading .line { max-width: 60px; }
    .site-footer { padding: 32px 20px 16px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 480px) {
    .team-stats { grid-template-columns: 1fr 1fr; }
    .event-row { grid-template-columns: 1fr; gap: 6px; }
    .drivers-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .sidebar { width: 52px; }
    .page-wrapper { margin-left: 52px; }
    .page-header-logo { height: auto; width: 100px; }
    .nav-item { width: 36px; height: 36px; }
    .nav-item .tooltip { display: none; }
    .hero-text h2 { font-size: clamp(28px, 10vw, 42px); }
    .about-title { font-size: clamp(24px, 7vw, 34px); }
    .contact-heading h2 { font-size: clamp(22px, 8vw, 32px); white-space: normal; }
}

/* ============================================================
   GARAGE PAGE
   ============================================================ */

/* ── Garage grid ── */
.garage-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.garage-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: 1px solid #1a1a1a;
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.garage-card:hover {
    border-color: var(--icon-active);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.garage-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.garage-card:hover .garage-img {
    transform: scale(1.05);
}

.garage-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(204,23,23,0.9);
    color: white;
    letter-spacing: 0.5px;
    backdrop-filter: blur(2px);
}

.garage-badge.gtp {
    background: rgba(255, 233, 32, 0.9);
    color:#000;
}

.garage-badge.lmp2 {
    background: rgba(35, 68, 255, 0.9);
    color:#ffffff;
}

.garage-card-footer {
    padding: 12px 14px;
}

.garage-car-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* ── Garage modal ── */
.garage-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(2px);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.garage-modal.active {
    opacity: 1;
    pointer-events: all;
}

.garage-modal-card {
    position: relative;
    width: 680px;
    max-width: 90vw;
    max-height: 85vh;
    background: #111;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.garage-modal.active .garage-modal-card {
    transform: translateY(0);
}

.garage-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s ease;
}

.garage-modal-close:hover {
    background: var(--icon-active);
}

.garage-modal-img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.garage-modal-body {
    padding: 24px 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.garage-modal-tags {
    display: flex;
    gap: 8px;
}

.garage-modal-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 99px;
    border: 1px solid var(--icon-active);
    color: var(--icon-active);
}

.garage-modal-title {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 400;
    color: var(--text-main);
    margin: 0;
    letter-spacing: 1px;
}

.garage-modal-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.7;
    margin: 0;
}

/* Light mode */
body.light .garage-card {
    background: #f5f5f5;
    border-color: #ddd;
}

body.light .garage-modal-card {
    background: #fff;
}

body.light .garage-modal-title { color: #111; }
body.light .garage-modal-desc  { color: #555; }

/* Responsive */
@media (max-width: 1024px) {
    .garage-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .garage-grid { grid-template-columns: repeat(2, 1fr); }
    .garage-modal-img { height: 200px; }
}

@media (max-width: 480px) {
    .garage-grid { grid-template-columns: 1fr; }
}

@media (hover: hover) and (pointer: fine) {
    *, *::before, *::after {
        cursor: none !important;
    }
}

@media (hover: none), (pointer: coarse) {
    .cursor-triangle {
        display: none !important;
    }
}

/* ── Custom cursor ── */
*, *::before, *::after {
    cursor: none !important;
}

.cursor-triangle {
    position: fixed;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 14px solid #d44141;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    opacity: 0.9;
    rotate: calc(-30deg);
}

body.cursor-hover.light .cursor-triangle {
  border-bottom-color: #000;   /* 👈 negro en modo claro */
}

body.light .event-name {
    color: black;
}

.cursor-flag svg {
    width: 100%;
    height: 100%;
}

/* Hover state */
body.cursor-hover .cursor-triangle {
    opacity: 1;
    border-bottom-color: white;
}

body.white .cursor-hover .cursor-triangle {
    border-bottom-color: #000000;
}

/* Page tagline centered */
.page-tagline {
    text-align: center;
    font-size: 14px;
    color: var(--text-dim);
    margin: -16px 0 32px;
    max-width: 100%;
    display: block;
}

/* ── Entrance animations ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Apply to elements */
.anim {
    opacity: 0;
    animation-fill-mode: forwards;
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-play-state: paused;
}

.anim.up    { animation-name: fadeUp; }
.anim.in    { animation-name: fadeIn; }
.anim.left  { animation-name: fadeLeft; }
.anim.right { animation-name: fadeRight; }

/* Stagger delays */
.anim.d1 { animation-delay: 0.05s; }
.anim.d2 { animation-delay: 0.12s; }
.anim.d3 { animation-delay: 0.19s; }
.anim.d4 { animation-delay: 0.26s; }
.anim.d5 { animation-delay: 0.33s; }
.anim.d6 { animation-delay: 0.40s; }
.anim.d7 { animation-delay: 0.47s; }
.anim.d8 { animation-delay: 0.54s; }

/* HIDE SCROLLBAR */
*::-webkit-scrollbar {
    display: none;
}

.events-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

.event-car-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
}

.event-car-tag.gt3 {
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border-color: rgba(220, 38, 38, 0.3);
}

.event-car-tag.gtp {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.3);
}

.event-car-tag.lmp2 {
  background: rgba(30, 64, 175, 0.2);
  color: #60a5fa;
  border-color: rgba(30, 64, 175, 0.4);
}

body.light .event-car-tag.lmp2 {
    color: #000;
}

body.light .event-car-tag.gtp {
    color: #000;
}

.event-card:hover {
  border-color: rgba(220, 38, 38, 0.7);
  transform: translateY(-2px);
}

.event-icon-wrap {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}

.event-icon-img {
  max-width: 90px;
  max-height: 100%;
  object-fit: contain;
}

.event-icon-fallback {
  font-size: 1.6rem;
  color: rgba(220, 38, 38, 0.6);
}

.event-divider {
  height: 1px;
  background: rgba(220, 38, 38, 0.35);
  width: 100%;
}

.event-body {
  padding: 10px 14px 14px;
}

.event-date {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: #ef4444;
}

.event-date i {
  font-size: 0.68rem;
}

.event-name {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #fff;
}

.event-car-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.events-empty {
  color: var(--muted, #999);
  text-align: center;
  padding: 20px;
  grid-column: 1 / -1;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.gallery-pill {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(220, 38, 38, 0.35);
  background: transparent;
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
  all 0.2s ease;
}

body.light .gallery-pill {
  color: #1a1a1a;
}

.gallery-pill:hover {
  border-color: rgba(220, 38, 38, 0.7);
  color: #fff;
}

.gallery-pill.active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: rgba(220, 38, 38, 0.6);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-empty {
  color: var(--muted, #999);
  text-align: center;
  padding: 30px;
  grid-column: 1 / -1;
}

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

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Lightbox ── */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.gallery-lightbox-img {
  position: relative;
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  z-index: 1;
}

.gallery-lightbox-caption {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.95rem;
  z-index: 1;
}

.gallery-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
}

.gallery-lightbox-close:hover {
  background: rgba(220, 38, 38, 0.6);
}

.event-card {
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.driver-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  margin: 40px 0 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.driver-section-title:first-of-type {
  margin-top: 24px;
  padding-top: 0;
  border-top: none;
}

.tier-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.tier-badge.gold {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.tier-badge.silver {
  background: rgba(192, 192, 192, 0.15);
  color: #c0c0c0;
  border: 1px solid rgba(192, 192, 192, 0.3);
}

.tier-badge.bronze {
  background: rgba(205, 127, 50, 0.15);
  color: #cd7f32;
  border: 1px solid rgba(205, 127, 50, 0.3);
}

body.light .driver-section-title { color: #555; border-top-color: rgba(0,0,0,0.1); }

/* Placeholder styling: cuando el valor es solo "-" */
.driver-detail:has(.detail-value:empty),
.driver-detail .detail-value {
  transition: color 0.2s ease;
}

.detail-value.empty {
  color: #444;
  font-style: italic;
}

body.light .detail-value.empty {
  color: #bbb;
}

/* ── Page transition overlay ── */
.page-transition {
    position: fixed;
    top: 0;
    left: 72px;                  /* respeta el ancho del sidebar */
    width: calc(100% - 72px);    /* cubre solo la zona de contenido */
    height: 100%;
    background: #ce2929;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.page-transition-logo {
    height: 80px;
    width: auto;
    opacity: 0;
}

.page-transition.run {
    display: flex;
    animation: pageTransitionSlide 0.45s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.page-transition.run .page-transition-logo {
    animation: pageTransitionLogoFade 0.45s ease forwards;
}

@keyframes pageTransitionSlide {
    0%   { transform: translateX(-100%); }
    45%  { transform: translateX(0%); }
    55%  { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

@keyframes pageTransitionLogoFade {
    0%   { opacity: 0; }
    35%  { opacity: 1; }
    65%  { opacity: 1; }
    100% { opacity: 0; }
}

html, body {
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .page-transition {
        left: 60px;
        width: calc(100% - 60px);
    }
}

@media (max-width: 420px) {
    .page-transition {
        left: 52px;
        width: calc(100% - 52px);
    }
}