/* --- Responsive Design (Mobile First overrides) --- */

/* Tablet & Smaller Laptops */
@media screen and (max-width: 1024px) {
  .hero h1 {
    font-size: 3.5rem;
  }

  .stats-grid, .blog-grid {
    gap: 20px;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Tablets (Portrait) & Mobile */
@media screen and (max-width: 768px) {

  /* Header */
  .navbar {
    padding: 15px 0;
  }

  /* Theme Toggle Mobile Adjustment */
  .theme-toggle-btn {
    margin-left: 0;
    margin-top: 15px;
    align-self: center; /* Center it if flex parent allows */
  }

  .nav-container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-links {
    gap: 15px; /* Reduce gap */
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .logo {
    font-size: 1.8rem;
  }

  /* Hero */
  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    letter-spacing: 2px;
  }

  .btn {
    padding: 10px 25px;
    font-size: 0.9rem;
  }

  /* Stats (Nosotros) */
  .stats-grid {
    grid-template-columns: 1fr; /* Stack vertically */
  }

  .stat-card {
    padding: 30px;
  }

  /* Eventos */
  .event-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .event-date {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 10px;
    width: 100%;
    flex-direction: row;
    gap: 10px;
  }

  .event-info {
    margin-bottom: 10px;
  }

  .event-action {
    margin-left: 0;
  }

  /* Resultados */
  .results-table th, .results-table td {
    padding: 10px 15px;
    font-size: 0.9rem;
  }

  /* Blog */
  .blog-grid {
    grid-template-columns: 1fr; /* Stack vertically */
  }

  .blog-card {
    max-width: 400px;
    margin: 0 auto;
  }

  /* Contacto */
  .contact-form {
    padding: 25px;
    clip-path: none; /* Simplify shape on mobile if needed, or keep it */
    border-radius: 10px; /* Fallback for complex shapes if buggy */
  }
}

/* Small Mobile */
@media screen and (max-width: 480px) {
  .section-padding {
    padding: 50px 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .nav-links {
    display: none; /* Hide by default on tiny screens without JS toggle logic, or... */
    /* To ensure usability without JS, let's allow them to be visible but vertical stack */
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  /* Optional: If we had JS, we'd toggle .nav-links.active */

  .stats-grid {
    gap: 15px;
  }

  .stat-number {
    font-size: 2.5rem;
  }
}

/* --- Racing Effects: Mobile Optimization --- */
@media screen and (max-width: 768px) {
  /* Disable speed-lines canvas on mobile (performance) */
  #speed-lines-canvas {
    display: none !important;
  }

  /* Hide cursor glow on mobile */
  .cursor-glow {
    display: none !important;
  }

  /* Reduce section divider weight */
  .section-divider-checkered {
    height: 15px;
  }

  /* Simplify hero title for mobile */
  .hero h1 {
    font-size: 2.5rem;
    letter-spacing: 2px;
  }

  /* Disable body speed lines background on mobile */
  body::before {
    display: none;
  }

  /* Simpler reveal on mobile */
  .reveal {
    transform: translateY(20px);
  }
  .reveal-right {
    transform: translateY(20px);
  }

  /* Page Hero on mobile */
  .page-hero-events,
  .page-hero-results {
    min-height: 35vh;
    padding: 100px 0 40px;
  }

  .page-hero-title {
    font-size: 2.2rem;
    letter-spacing: 3px;
  }

  .hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 3px;
  }

  /* Timeline on mobile */
  .events-timeline {
    padding-left: 20px;
  }

  .timeline-event-card {
    padding: 20px;
  }

  .timeline-event-indicator {
    left: -32px;
  }

  .timeline-day {
    font-size: 1.5rem;
  }

  .timeline-event-info h3 {
    font-size: 1rem;
  }

  /* Result stat cards */
  .result-stat-card .stat-number {
    font-size: 2rem;
  }
}

/* Tablet adjustments for hero */
@media screen and (max-width: 1024px) {
  .hero h1 {
    font-size: 3.5rem;
    letter-spacing: 3px;
    margin-top: 7rem;
  }
}

/* Touch device: disable tilt via CSS (JS also checks) */
@media (hover: none) {
  .glass-panel[data-tilt] {
    transform: none !important;
  }
}


