/* VARIABLES GLOBALES */
:root {
    --primary-red: #E30613;
    --dark-black: #0A0A0A;
    --light-grey: #F8F9FA;
    --border-grey: #E5E5E5;
    --text-muted: #555555;
    --white: #FFFFFF;
}

/* RESET GENERAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    text-transform: uppercase; /* Forzar estética deportiva en mayúsculas */
}

body {
    font-family: 'Oswald', sans-serif;
    background-color: var(--white);
    color: var(--dark-black);
    overflow-x: hidden;
}

/* REUTILIZABLES */
.text-red { color: var(--primary-red); }
img { width: 100%; display: block; }

/* HEADER / NAVBAR */
.header {
    width: 100%;
    height: 90px;
    background-color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-grey);
}

.logo img {
    width: 140px;
    height: auto;
}

.navbar {
    display: flex;
    gap: 30px;
}

.navbar a {
    text-decoration: none;
    color: var(--dark-black);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 32px 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
    color: var(--primary-red);
}

/* Línea roja superior del menú activo */
.navbar a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--primary-red);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-header a {
    color: var(--dark-black);
    margin-left: 15px;
    font-size: 18px;
    transition: color 0.3s;
}

.social-header a:hover {
    color: var(--primary-red);
}

.menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

/* HERO SECTION (SLIDER SIMULADO) */
.hero {
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: 
        linear-gradient(75deg, rgba(0,0,0,0.6) 30%, rgba(0,0,0,0.2) 60%),
        url('../assets/img/FTJMC00-3103.jpg') no-repeat;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    padding: 0 8%;
    position: relative;
}

/* El recorte rojo deportivo del hero de la foto */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 35%;
    height: 100%;
    background: linear-gradient(115deg, transparent 40%, var(--primary-red) 40%);
    z-index: 1;
    opacity: 0.85;
    pointer-events: none;
}

.hero-content {
    color: var(--white);
    max-width: 650px;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: clamp(50px, 7vw, 95px);
    line-height: 0.95;
    font-weight: 700;
    font-style: italic; /* Toque veloz */
    letter-spacing: -1px;
    margin-bottom: 15px;
}

.hero-content p {
    font-family: Arial, sans-serif; /* Para balancear legibilidad como la foto */
    text-transform: none; 
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 35px;
    max-width: 500px;
    color: rgba(255,255,255,0.9);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* BOTONES ESTILO CUADRADO */
.btn {
    padding: 14px 35px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-solid {
    background-color: var(--primary-red);
    color: var(--white);
}

.btn-solid:hover {
    background-color: var(--dark-black);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--dark-black);
}

.slider-indicators {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.slider-indicators .dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255,255,255,0.4);
    border-radius: 50%;
    cursor: pointer;
}

.slider-indicators .dot.active {
    background-color: var(--white);
    width: 25px;
    border-radius: 5px;
    transition: width 0.3s ease;
}

/* SECCIONES EN GENERAL */
section {
    padding: 100px 5%;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: 1px;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

/* Subrayado corto del título */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 45px;
    height: 3px;
    background-color: var(--primary-red);
}

/* SECCIÓN HISTORIA Y LOGROS */
.historia-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 60px;
}

.historia-left p {
    font-family: Arial, sans-serif;
    text-transform: none;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.btn-readmore {
    display: inline-block;
    padding: 8px 25px;
    border: 1px solid var(--dark-black);
    color: var(--dark-black);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.btn-readmore:hover {
    background-color: var(--dark-black);
    color: var(--white);
}

/* CONTADORES DE LOGROS */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    border-left: 1px solid var(--border-grey);
    padding-left: 20px;
}

.stat-box {
    text-align: center;
    padding: 15px 5px;
    position: relative;
}

/* Líneas sutiles de división entre números */
.stat-box:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 25%;
    width: 1px;
    height: 50%;
    background-color: var(--border-grey);
}

.stat-icon {
    font-size: 28px;
    color: var(--dark-black);
    margin-bottom: 10px;
}

.stat-number {
    display: block;
    font-size: 45px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* SECCIÓN PILOTOS */
.section-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-view-all {
    text-decoration: none;
    color: var(--primary-red);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--primary-red);
    padding: 6px 15px;
    transition: 0.3s ease;
}

.btn-view-all:hover {
    background-color: var(--primary-red);
    color: var(--white);
}

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

.card-piloto {
    background-color: var(--light-grey);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-grey);
}

.piloto-img-wrapper {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    background-color: #EAEAEA;
}

.card-piloto img {
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-piloto:hover img {
    transform: scale(1.03);
}

/* Número gigante transparente/sólido detrás */
.piloto-number {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 75px;
    font-weight: 700;
    font-style: italic;
    color: var(--dark-black);
    line-height: 0.8;
    z-index: 2;
}

/* Tarjeta flotante interna de información */
.piloto-info-box {
    background-color: var(--white);
    padding: 25px;
    margin: -50px 20px 20px 20px;
    position: relative;
    z-index: 3;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    flex-grow: 1;
}

.piloto-info-box h3 {
    font-size: 22px;
    font-weight: 700;
    font-style: italic;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-grey);
    padding-bottom: 5px;
}

.piloto-records h4 {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.piloto-records ul {
    list-style: none;
}

.piloto-records ul li {
    font-family: Arial, sans-serif;
    text-transform: none;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    position: relative;
    padding-left: 12px;
}

.piloto-records ul li::before {
    content: '•';
    color: var(--primary-red);
    position: absolute;
    left: 0;
    font-size: 16px;
    top: -2px;
}

/* Categoría en el borde inferior */
.piloto-category {
    background-color: var(--dark-black);
    color: var(--white);
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* COMPARTIDO: EVENTOS Y GALERÍA */
.eventos-galeria-section {
    background-color: var(--light-grey);
    border-top: 1px solid var(--border-grey);
}

.eg-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
}

/* Estilo lista de Eventos */
.eventos-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.evento-row {
    background-color: var(--white);
    border: 1px solid var(--border-grey);
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 20px;
}

.evento-date {
    background-color: var(--primary-red);
    color: var(--white);
    min-width: 65px;
    height: 65px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

.evento-date .day {
    font-size: 26px;
    line-height: 1;
}

.evento-date .month {
    font-size: 12px;
}

.evento-detail {
    flex-grow: 1;
}

.evento-detail h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 5px;
}

.evento-detail p {
    font-family: Arial, sans-serif;
    text-transform: none;
    font-size: 13px;
    color: var(--text-muted);
}

.evento-detail p i {
    color: var(--primary-red);
    margin-right: 4px;
}

.btn-details {
    padding: 8px 16px;
    border: 1px solid var(--dark-black);
    text-decoration: none;
    color: var(--dark-black);
    font-size: 12px;
    font-weight: 600;
    transition: 0.3s;
}

.btn-details:hover {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: var(--white);
}

.btn-full-width-action {
    display: block;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.btn-full-width-action:hover {
    background-color: var(--primary-red);
    color: var(--white);
}

/* CUADRÍCULA ASIMÉTRICA GALERÍA (MADAONRY FLAVOR) */
.galeria-masonry {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
    gap: 12px;
    margin-bottom: 25px;
}

.gal-item {
    overflow: hidden;
    position: relative;
}

.gal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.gal-item:hover img {
    transform: scale(1.05);
}

/* La foto grande de la izquierda ocupa 2 columnas de alto */
.galeria-masonry .big-item {
    grid-row: span 2;
}

/* FOOTER COMPLETO */
.footer {
    background-color: var(--dark-black);
    color: var(--white);
    position: relative;
    padding: 0;
}

/* El bloque Call to Action con diseño cortado diagonal */
.footer-cta {
    background: linear-gradient(135deg, #151515 70%, var(--primary-red) 70%);
    padding: 50px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #222;
    overflow: hidden;
    position: relative;
}

.cta-container h2 {
    font-size: 28px;
    font-style: italic;
    font-weight: 700;
    margin-bottom: 5px;
}

.cta-container p {
    font-family: Arial, sans-serif;
    text-transform: none;
    color: #999;
    font-size: 15px;
}
.cta-container a {
    margin-top: 10px;
    display: inline-block;
}

.btn-cta-red {
    background-color: var(--primary-red);
    color: var(--white);
    text-decoration: none;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
    z-index: 5;
}

.btn-cta-red:hover {
    background-color: var(--white);
    color: var(--dark-black);
}

.cta-logo-bg {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 300px;
    opacity: 0.05;
    pointer-events: none;
}

/* Base Footer inferior */
.footer-main {
    padding: 60px 8% 30px 8%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
    border-bottom: 1px solid #222;
    padding-bottom: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    width: 130px;
    filter: brightness(0) invert(1); /* Pasa el logo negro a blanco para fondo oscuro */
}

.footer-col h4 {
    font-size: 16px;
    letter-spacing: 1px;
    margin-bottom: 15px;
    color: #BBB;
}

.footer-social-icons a {
    color: var(--white);
    font-size: 18px;
    margin-right: 15px;
    transition: color 0.3s;
}

.footer-social-icons a:hover {
    color: var(--primary-red);
}

.footer-col p {
    font-family: Arial, sans-serif;
    text-transform: none;
    color: #888;
    font-size: 14px;
    margin-bottom: 6px;
}

.footer-bottom {
    text-align: center;
    font-family: Arial, sans-serif;
    text-transform: none;
    font-size: 13px;
    color: #666;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES COMPLETO DESDE MÓVILES A TABLETS)
   ========================================================================== */

@media (max-width: 1024px) {
    .historia-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .stats-container {
        border-left: none;
        padding-left: 0;
    }
    .eg-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 70px 6%;
    }
    
    .social-header {
        display: none; /* Ocultar en móviles de la barra superior */
    }
    
    .menu-btn {
        display: block;
        color: var(--dark-black);
    }
    
    /* Menú lateral responsivo desplegable */
    .navbar {
        position: fixed;
        top: 90px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 90px);
        background-color: var(--dark-black);
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        transition: right 0.4s ease-internal;
        box-shadow: -5px 5px 15px rgba(0,0,0,0.2);
    }
    
    .navbar.active {
        right: 0;
    }
    
    .navbar a {
        color: var(--white);
        padding: 20px 30px;
        width: 100%;
        border-bottom: 1px solid #1a1a1a;
    }
    
    .navbar a.active::before {
        top: 0;
        left: 0;
        width: 5px;
        height: 100%;
    }
    
    .hero::after {
        width: 50%;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .pilotos-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .piloto-img-wrapper {
        height: 420px;
    }
    
    .footer-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
        background: var(--dark-black); /* Simplificar corte en celular */
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 42px;
    }
    .stats-container {
        grid-template-columns: 1fr;
    }
    .evento-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .evento-date {
        width: 100%;
    }
    .btn-details {
        width: 100%;
        text-align: center;
    }
    .galeria-masonry {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
    .galeria-masonry .big-item {
        grid-row: span 1;
    }
}