/* HOJA DE ESTILOS PRINCIPAL            *
/* 
 * Este es el archivo CSS principal que define el diseño base de todo el sitio.
 * Incluye:
 * - Reset y configuración base del navegador
 * - Estilos del header con navegación fija
 * - Tipografía y colores 
 * - Footer
 * - Diseño responsive
 * - Selector de idiomas TODO
 */
/* RESET Y CONFIGURACIÓN BASE DEL NAVEGADOR *

/* Configuración */
body {
  margin: 0;                    
  padding: 0;                   
  background-color: #000;      
  color: #eaeaea;              
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif; 
}

/* Configuración del elemento*/
html {
  scroll-behavior: smooth;     
  scroll-padding-top: 140px; /* Aumentar espacio para compensar el header fijo */
}

/* Contenedor princip */
main {
  margin-top: 110px;           
  padding: 2rem;               /* Espacio interno general */
}


.content-wrap {
  padding-inline: clamp(1rem, 4vw, 3rem); /* Padding lateral que se adapta */
}
/* HEADER *

/* Header, permanece visible */
.site-header {
  position: fixed;             /* Se mantiene en la misma posición al hacer scroll */
  top: 0;                      
  left: 0;                     
  width: 100%;                 
  display: flex;               
  align-items: center;         
  justify-content: space-between; 
  padding: 1rem;               /* Reducir padding para más espacio */
  background-color: #000;      
  border-bottom: 1px solid #222; 
  z-index: 100;                
  height: auto;                /* Altura automática para mejor adaptabilidad */
  min-height: 80px;            /* Altura mínima */
  flex-wrap: wrap;             /* Permitir wrap si es necesario */
  gap: 1rem;                   /* Espacio entre elementos */
}
/* LOGO Y TÍTULO DEL SITIO *

/* Contenedor que agrupa logo y el, título */
.logo-container { 
  display: flex;               
  align-items: center;       
  gap: 15px;                   
  flex-shrink: 0;              /* No permitir que se encoja */
  min-width: 0;                /* Permitir que el texto se ajuste */
}

/* Imagen del logo */
.logo { 
  height: 40px;                /* Reducir tamaño del logo */
  width: auto;                 
  flex-shrink: 0;              /* No permitir que el logo se encoja */
}

/* Título principal */
.site-title {
  font-family: 'Space Grotesk', sans-serif; 
  font-weight: 700;            
  font-size: clamp(0.8rem, 2vw, 1.1rem); /* Tamaño responsive */
  color: #fff;              
  letter-spacing: 1px;         
  white-space: nowrap;         /* Evitar que el título se parta */
  overflow: hidden;            /* Ocultar overflow si es necesario */
  text-overflow: ellipsis;     /* Mostrar ... si el texto es muy largo */
}
/* BARRA DE NAVEGACIÓN *

/* Contenedor de los enlaces */
.navbar {
  display: flex;              
  gap: 1rem;                  /* Reducir espacio entre enlaces */
  align-items: center;
  flex-wrap: wrap;            /* Permitir wrap en pantallas pequeñas */
  justify-content: center;    /* Centrar cuando hay wrap */
}

/* Estilo de cada enlace de navegación */
.navbar a {
  text-decoration: none;       /* Quita el subrayado */
  color: #fff;             
  text-transform: uppercase;   
  font-size: clamp(0.7rem, 1.5vw, 0.9rem); /* Tamaño responsive más pequeño */
  letter-spacing: 0.3px;       /* Reducir letter-spacing */
  transition: all 0.3s ease; 
  white-space: nowrap;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 0.5rem;          /* Añadir padding horizontal */
}

/* Efecto hover en enlaces de navegación */
.navbar a:hover { 
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  border-radius: 4px;          /* Añadir border radius al hover */
}

/* SISTEMA DE TIPOGRAFÍA *

/* Títulos principales y de sección */
.hero-title, .section-title {
  font-family: 'Space Grotesk', sans-serif; 
  font-weight: 700;            
  line-height: 1.2;           
  margin-bottom: 0.5rem;       
}

/* Título principal de la página (hero) */
.hero-title { 
  font-size: clamp(2rem, 4vw, 4rem); /* Tamaño responsive */
}

/* Títulos de sección */
.section-title { 
  font-size: clamp(1.5rem, 2.2vw, 2.25rem); /* Tamaño responsive subtitulos */
  margin-top: 3rem; /* Aumentar margen superior */
  margin-bottom: 1rem; /* Agregar margen inferior */
}

/* Texto destacado (lead paragraph) */
.lead { 
  font-size: 1.1rem;           
  line-height: 1.7;            
  color: #eaeaea;              
  max-width: 72ch;
  text-align: center;
  margin: 0 auto;
}

/* Párrafos normales */
p { 
  color: #b5b5b5;            
  line-height: 1.6;          }

/* FOOTER: *

/* Contenedor principal del footer */
.site-footer {
  background-color: #111;     
  border-top: 1px solid #333; 
  padding: 2rem 0 1.5rem;     /* Reducir padding para móvil */
  margin-top: 4rem;           
}

/* Contenido interno del footer */
.footer-content {
  max-width: 1200px;          
  margin: 0 auto;              
  padding: 0 1rem;            /* Reducir padding lateral */
  display: grid;               /* Grid para organizar columnas */
  grid-template-columns: 1fr 1fr; /* Dos columnas de igual tamaño */
  gap: 2rem;                  
}

/* Títulos dentro del footer */
.footer-section h3 {
  font-family: 'Space Grotesk', sans-serif; 
  color: #fff;                
  font-size: 1.2rem;          
  margin-bottom: 1rem;       
  text-align: center;         /* Centrar en móvil */
}

/* Párrafos dentro del footer */
.footer-section p { 
  color: #b5b5b5;             
  line-height: 1.6;          
  margin-bottom: 0.5rem;      
  text-align: center;         /* Centrar en móvil */
}

/* Enlaces en el footer */
.footer-section a {
  color: #1e90ff;
  text-decoration: none;
  word-break: break-all;      /* Permitir quiebre de palabras largas */
}

.footer-section a:hover {
  color: #00bfff;
  text-decoration: underline;
}

/* Texto destacado en el footer */
.footer-section strong { 
  color: #1e90ff;           
}

/* DISEÑO DE SECCIONES PRINCIPALES *

/* Configuración base para todas las secciones */
section {
  min-height: 100vh;           
  display: flex;             
  flex-direction: column;      
  justify-content: flex-start; /* Cambiar a flex-start para mejor control */
  padding: 8rem 0 4rem;       /* Aumentar padding superior a 8rem */
  border-bottom: 1px solid #111; 
}

/* Secciones impares con fondo negro */
section:nth-of-type(odd) { 
  background-color: #000;     
}

/* Secciones pares con fondo ligeramente diferente */
section:nth-of-type(even) { 
  background-color: #0a0a0a;   /* Gris muy oscuro para crear contraste */
}

/* Sección hero con espacio extra arriba */
.hero-section { 
  padding-top: 10rem;          /* Aumentar espacio extra para compensar header fijo */
  justify-content: center;     /* Mantener centrado para secciones hero */
}

/* SELECTOR DE IDIOMAS *

/* Contenedor del selector de idioma */
.lang-switcher {
  display: flex;              
  align-items: center;         
}

/* Estilo del dropdown de selección de idioma */
#langSelect {
  background: #0f1115;        
  color: #eaeaea;           
  border: 1px solid #1f2a44;  
  border-radius: 10px;         
  padding: .5rem .8rem;       
  font-weight: 600;           
  letter-spacing: .3px;      
  cursor: pointer;             /* Cursor de mano */
  outline: none;               /* Sin outline al hacer focus */
  box-shadow: 0 0 10px rgba(30,144,255,.15) inset; 
}

/* Efecto hover del selector de idioma */
#langSelect:hover { 
  border-color: #1e90ff;      
}


/* MENÚ HAMBURGUESA PARA MÓVILES Y ZOOM */

/* Hamburger menu - oculto por defecto, se muestra en responsive */
.hamburger {
  display: none;               /* Oculto por defecto */
  flex-direction: column;     
  justify-content: space-around; 
  width: 30px;                
  height: 25px;                
  background: transparent;     
  border: none;               
  cursor: pointer;            
  padding: 0;               
  z-index: 101;              
}

/* Líneas del ícono hamburguesa */
.hamburger span {
  width: 100%;                
  height: 3px;                
  background-color: #eaeaea;  
  transition: all 0.3s ease;  
  transform-origin: center;   
  display: block;
}

/* Animación cuando el menú está abierto */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px); 
}

.hamburger.active span:nth-child(2) {
  opacity: 0;                  
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px); 
}

/* Menú de navegación móvil */
/* Estados del menú móvil cuando hamburger está activo */
@media (max-width: 900px) {
  .nav-menu {
    position: fixed;             
    top: 80px;                   /* Ajustar según altura del header */
    left: 0;                     
    width: 100%;               
    background-color: rgba(0, 0, 0, 0.98); 
    backdrop-filter: blur(10px); 
    flex-direction: column;      
    padding: 2rem 0;            
    z-index: 99;              
    transform: translateX(-100%); /* Oculto por defecto */
    transition: transform 0.3s ease; 
    align-items: center;
  }

  /* Estado activo del menú móvil */
  .nav-menu.active {
    transform: translateX(0);    /* Desliza hacia la vista */
  }

  /* Enlaces dentro del menú móvil */
  .nav-menu a {
    padding: 1rem 2rem;         
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    font-size: 1rem !important; /* Tamaño fijo en móvil */
  }

  /* Efecto hover en enlaces móviles */
  .nav-menu a:hover {
    background-color: rgba(30, 144, 255, 0.1); 
  }

  /* Ocultar selector de idioma en móvil */
  .lang-switcher {
    order: -1; /* Mover al principio */
    margin-bottom: 1rem;
  }
}

/* === ALERTAS: gradiente casi negro (deep space) === */
#alertas {
  position: relative;
  padding: 6rem 5vw;
  color: #fff;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 1) 0%,           
    rgba(2, 4, 10, 1) 20%,        
    rgba(5, 8, 15, 1) 50%,        
    rgba(3, 5, 10, 1) 80%,         
    rgba(0, 0, 0, 1) 100%         
  );
  z-index: 1;
}

/* Sombra superior para fusión suave con el video */
#alertas::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  z-index: 0;
}

#alertas .section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
}

#alertas p {
  font-size: 1.1rem;
  max-width: 800px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

.calendar-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
}

.calendar-content {
  background-color: #111;
  color: #fff;
  padding: 2rem;
  border-radius: 14px;
  width: 80%;
  max-width: 900px;
  box-shadow: 0 0 20px rgba(30,144,255,0.3);
  text-align: center;
  position: relative;
}

#close-calendar {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
}

#addGoogleEvent {
  margin-top: 1rem;
  background: #1e90ff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

#addGoogleEvent:hover {
  background: #00bfff;
}

.calendar-link {
  cursor: pointer;
  color: #1e90ff;
  font-weight: 600;
  transition: color 0.3s;
}

.calendar-link:hover {
  color: #00bfff;
}

/* Control de audio ambiental */
.audio-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  margin-top: 20px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.audio-control:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.audio-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Enhanced Known Meteorites Section Background */
#conocidos {
  position: relative;
  background: 
    linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0a0a0f 100%),
    radial-gradient(circle at 20% 80%, rgba(100, 255, 218, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(100, 255, 218, 0.03) 0%, transparent 50%);
  overflow: hidden;
}

#conocidos::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(1px 1px at 25px 25px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 75px 75px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 125px 50px, rgba(255, 255, 255, 0.4), transparent);
  background-size: 150px 150px, 200px 200px, 100px 100px;
  opacity: 0.6;
  pointer-events: none;
}

#conocidos::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.1) 50%,
    transparent 100%
  );
  pointer-events: none;
}

/* Subtle border accent */
#conocidos {
  border-top: 1px solid rgba(100, 255, 218, 0.1);
  border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

/* Enhanced section title for Known Meteorites */
#conocidos .section-title {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(100, 255, 218, 0.3);
}

#conocidos .lead {
  position: relative;
  z-index: 2;
}

/* === MEDIA QUERIES PARA RESPONSIVE DESIGN === */

/* Footer responsive para móviles */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr; /* Una sola columna en móvil */
    gap: 1.5rem;
    padding: 0 1rem;
    text-align: center;
  }
  
  .footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }
  
  .footer-section p {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    padding: 0 0.5rem;
  }
  
  .site-footer {
    padding: 1.5rem 0 1rem;
  }
}

/* Pantallas muy pequeñas - siempre mostrar hamburger */
@media (max-width: 480px) {
  .hamburger {
    display: flex !important;
  }
  
  .navbar {
    display: none !important;
  }
  
  .site-header {
    padding: 0.5rem;
  }
  
  .site-title {
    font-size: 0.8rem;
  }
  
  .logo {
    height: 30px;
  }
  
  /* Footer en pantallas muy pequeñas */
  .footer-content {
    padding: 0 0.5rem;
  }
  
  .footer-section h3 {
    font-size: 1rem;
  }
  
  .footer-section p {
    font-size: 0.85rem;
    line-height: 1.5;
  }
  
  .footer-section a {
    font-size: 0.85rem;
    display: inline-block;
    margin-top: 0.3rem;
  }
}

/* Pantallas pequeñas - mostrar hamburger si es necesario */
@media (max-width: 768px) {
  .navbar {
    gap: 0.5rem;
  }
  
  .navbar a {
    font-size: 0.7rem;
    padding: 0 0.3rem;
  }
  
  /* Footer más compacto en tablets */
  .footer-content {
    gap: 1rem;
  }
  
  .footer-section {
    margin-bottom: 1rem;
  }
}

/* Pantallas medianas - ajustar cuando hay mucho contenido */
@media (max-width: 1024px) {
  .site-header {
    padding: 0.8rem;
  }
  
  .navbar {
    gap: 0.8rem;
  }
  
  .navbar a {
    font-size: 0.8rem;
  }
}

/* Para zoom alto (cuando el contenido se ve muy grande) */
@media (max-width: 1200px) and (min-resolution: 144dpi) {
  .hamburger {
    display: flex !important;
  }
  
  .navbar {
    display: none !important;
  }
}

/* Mejoras para pantallas con zoom */
.site-header {
  overflow-x: auto;            /* Permitir scroll horizontal si es necesario */
  scrollbar-width: none;       /* Ocultar scrollbar en Firefox */
  -ms-overflow-style: none;    /* Ocultar scrollbar en IE/Edge */
}

.site-header::-webkit-scrollbar {
  display: none;               /* Ocultar scrollbar en Chrome/Safari */
}

/* Mostrar hamburger cuando el viewport es muy estrecho */
@media (max-width: 1400px) {
  .navbar a {
    font-size: clamp(0.6rem, 1.2vw, 0.8rem);
  }
}

/* Punto de quiebre crítico donde siempre mostrar hamburger */
@media (max-width: 900px) {
  .hamburger {
    display: flex !important;
  }
  
  .navbar {
    display: none !important;
  }
}

/* Mejoras para dispositivos en orientación horizontal (landscape) */
@media (max-width: 768px) and (orientation: landscape) {
  .site-footer {
    padding: 1rem 0;
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr; /* Mantener dos columnas en landscape */
    gap: 1rem;
  }
  
  .footer-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .footer-section p {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
  }
}

/* Mejora la legibilidad en pantallas intermedias */
@media (min-width: 481px) and (max-width: 767px) {
  .footer-content {
    padding: 0 2rem;
  }
  
  .footer-section h3 {
    font-size: 1.15rem;
  }
  
  .footer-section p {
    font-size: 0.95rem;
    margin-bottom: 0.7rem;
  }
}