/* =========================================== */
/* === 1. VARIABLES Y ESTILOS GLOBALES === */
/* =========================================== */
/* Usamos variables para un mantenimiento más sencillo y consistencia de diseño */
:root {
    --color-primary: #0056b3; /* Un azul más vibrante */
    --color-light-gray: #e9ecef;
    --color-dark-gray: #495057;
    --color-text: #212529;
    --background-color: #f8f9fa;
    --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-deep: 0 8px 25px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition-speed: 0.5s;
    --transition-timing: cubic-bezier(0.25, 0.8, 0.25, 1);
  }
  
  /* Importamos una fuente más moderna desde Google Fonts (opcional) */
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');
  
  .eventos {
    background-color: var(--background-color);
    /* Un gradiente sutil para dar profundidad */
    background-image: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    padding: 5rem 0;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    overflow: hidden;
  }
  
  .section__title {
    font-size: 2.8rem;
    color: var(--color-text);
    text-align: center;
    /* Aumentamos un poco el margen para compensar el padding eliminado */
    margin-bottom: 4rem; 
    font-weight: 600;
  }
  
  /* =========================================== */
  /* === 2. ESTILOS DEL CARRUSEL === */
  /* =========================================== */
  
  .carousel {
    position: relative;
    width: 90%;
    max-width: 1200px; /* Un ancho máximo para pantallas grandes */
    margin: 0 auto; /* Centramos el carrusel en la página */
    padding: 2rem 0;
  }
  
  .carousel__container {
    display: flex;
    align-items: center;
    transition: transform var(--transition-speed) var(--transition-timing);
  }
  
  .carousel__item {
    flex: 0 0 33.33%; /* Ligeramente más grande para mejor visibilidad */
    box-sizing: border-box;
    padding: 0 1rem;
    /* Estado por defecto (previsualización) */
    transform: scale(0.8);
    opacity: 0.6;
    filter: blur(2px); /* Un desenfoque sutil para los no activos */
    transition: all var(--transition-speed) ease;
    cursor: pointer;
  }
  
  /* Estilo para el item activo (el del centro) */
  .carousel__item--active {
    transform: scale(1); /* Tamaño completo y centrado */
    opacity: 1; /* Totalmente visible */
    filter: blur(0);
    cursor: default;
  }
  
  /* Efecto hover sutil para los items inactivos */
  .carousel__item:not(.carousel__item--active):hover {
      transform: scale(0.85);
      opacity: 0.8;
  }
  
  .carousel__item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: box-shadow 0.3s ease;
  }
  
  /* Hacemos que la imagen activa se sienta "levantada" */
  .carousel__item--active img {
    box-shadow: var(--shadow-deep);
  }
  
  
  /* =========================================== */
  /* === 3. CONTROLES (BOTONES Y BARRA) === */
  /* =========================================== */
  
  .carousel__button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    
    /* Efecto "cristal esmerilado" para un look moderno */
    background-color: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    
    color: var(--color-dark-gray);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
  }
  
  .carousel__button:hover {
    background-color: white;
    transform: translateY(-50%) scale(1.1);
    color: var(--color-primary);
    box-shadow: var(--shadow-deep);
  }
  
  .carousel__button--left {
    left: 10px;
  }
  
  .carousel__button--right {
    right: 10px;
  }
  
  /* --- BARRA DE PROGRESO --- */
  .carousel__dots {
    position: absolute;
    bottom: -15px; /* Más espacio */
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 8px;
    background-color: var(--color-light-gray);
    border-radius: 4px;
    display: block;
    overflow: hidden; /* Oculta lo que se salga del contenedor */
  }
  
  .carousel__dots-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 100%;
    /* Un gradiente para el indicador */
    background: linear-gradient(90deg, var(--color-primary), #007bff);
    border-radius: 4px;
    transition: transform var(--transition-speed) var(--transition-timing);
  }
  
  /* Ocultamos los puntos originales */
  .carousel__dot {
    display: none;
  }
  
  
  /* =========================================== */
  /* === 4. ESTILOS PARA MÓVILES === */
  /* =========================================== */
  
  @media (max-width: 768px) {
    .section__title {
      font-size: 2.2rem;
    }
    
    /* En móvil mostramos una imagen principal y un poco de la siguiente */
    .carousel__item {
      flex: 0 0 70%;
      padding: 0 8px;
    }
    
    .carousel__button {
      width: 40px;
      height: 40px;
    }
  
    .carousel__button--left {
      left: 5px;
    }
  
    .carousel__button--right {
      right: 5px;
    }
  }
  
  @media (max-width: 480px) {
    .eventos {
      padding: 3rem 0;
    }
  
    /* En pantallas muy pequeñas, centramos una sola imagen */
    .carousel__item {
      flex: 0 0 85%;
      /* Desactivamos efectos para no distraer */
      transform: scale(0.95);
      opacity: 0.8;
      filter: blur(0);
    }
    
    .carousel__item--active {
      transform: scale(1);
      opacity: 1;
    }
  }

  /* =========================================== */
/* === 5. ESTILOS PARA LA VENTANA MODAL === */
/* =========================================== */

/* El contenedor del modal (fondo oscuro) */
.modal {
    position: fixed; /* Se queda fijo en la pantalla */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85); /* Fondo oscuro semitransparente */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Se asegura de que esté por encima de todo */
    opacity: 0; /* Inicialmente invisible */
    visibility: hidden; /* Inicialmente oculto */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px); /* Desenfoque del fondo */
  }
  
  /* Clase para mostrar el modal */
  .modal--visible {
    opacity: 1;
    visibility: visible;
  }
  
  /* La imagen dentro del modal */
  .modal__image {
    max-width: 90%;
    max-height: 90vh; /* Ocupa máximo el 90% del alto de la ventana */
    display: block;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* Animación de entrada */
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .modal--visible .modal__image {
    transform: scale(1); /* La imagen crece a su tamaño final */
  }
  
  /* Botón para cerrar el modal */
  .modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  
  .modal__close:hover {
    transform: scale(1.1);
    background-color: #fff;
  }
  
  /* Evita el scroll del body cuando el modal está abierto */
  .modal-open {
    overflow: hidden;
  }