/* ==========================================================================
   RESET & VARIABLES GLOBALES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #000918 /*#2a3038*/;         /* Fondo oscuro para Hero / Header / Footer */
  --bg-card-dark: #3a414b;    /* Tarjetas oscuras */
  --bg-light: #f4f6f8;        /* Fondo claro general */
  --bg-card-light: #ffffff;   /* Tarjetas sobre fondo claro */
  --text-light: #f1f5f9;      /* Texto sobre fondo oscuro */
  --text-dark: #1e293b;       /* Texto sobre fondo claro */
  --text-muted: #94a3b8;      /* Texto secundario */
  --accent-color: #a8e063;    /* Verde lima CoSMo */
  --accent-hover: #8ecf4c;
  --border-radius: 12px;
  --transition-speed: 0.3s;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  line-height: 1.6;
}

/* ==========================================================================
   HEADER & NAVEGACIÓN (STICKY)
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 5%;
  background-color: var(--bg-dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color var(--transition-speed);
}

/* Botón Hamburguesa (oculto por defecto en pantallas grandes) */

.menu-toggle {
  display: none; /* Oculto por defecto en pantallas grandes */
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}

.menu-toggle img {
  width: 32px; /* Ajusta el ancho deseado del icono */
  height: 32px; /* Ajusta el alto deseado */
  display: block;
  object-fit: contain;
  transition: transform var(--transition-speed, 0.3s) ease;
  filter: invert(90%);
}

.menu-toggle img:hover {
  transform: scale(1.1); /* Efecto hover suave al pasar el cursor */
}

/* Comportamiento Responsive para tablets/celulares */
@media (max-width: 900px) {
  .menu-toggle {
    display: flex; /* Muestra el botón y alinea la imagen al centro */
    align-items: center;
    justify-content: center;
  }

  .nav {
    display: none; /* Oculta el menú por defecto */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
  }

  /* Clase que activa la visibilidad al pulsar el botón */
  .nav.nav-open {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
  }

  .nav ul {
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
  }
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  max-height: 45px;
  width: auto;
  display: block;
  object-fit: contain;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  padding-bottom: 4px;
  position: relative;
  transition: color var(--transition-speed);
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
}

.nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

/* ==========================================================================
   LÓGICA VISUAL SPA & ANIMACIONES
   ========================================================================== */
.view {
  display: none;
  width: 100%;
}

.view.active-view {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

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

#equipo,
#proyectos,
#contacto {
  min-height: calc(100vh - 140px);
  background-color: var(--bg-light);
}

/* ==========================================================================
   SECCIÓN HERO (CARRUSEL DE NOTICIAS)
   ========================================================================== */
.hero-section {
  width: 100%;
  /* Ocupa exactamente la pantalla completa menos la altura del header (70px) */
  height: calc(100vh - 70px); 
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 3%;
  background-color: var(--bg-dark);
  box-sizing: border-box;
  overflow: hidden; /* Garantiza que nada sobrepase la pantalla inicial */
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1300px;
  /* La altura de la tarjeta se calcula restando el espacio de los indicadores y paddings */
  height: calc(100vh - 160px); 
  max-height: 600px; /* Límite para pantallas Ultra-Wide */
  margin: 0 auto;
}

.carousel-track-container {
  width: 100%;
  height: 100%; /* Llama directamente al alto del contenedor para no sobrepasar */
  overflow: hidden;
  border-radius: var(--border-radius);
  background-color: #0d1117;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.carousel-track {
  display: flex;
  list-style: none;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease-in-out;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center; /* Conserva la información del extremo izquierdo */
  display: block;
}

/* Flechas sin hover de globo */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
  transition: color var(--transition-speed);
}

.carousel-btn:hover {
  color: var(--accent-color);
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

.carousel-nav {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
  height: 12px; /* Altura fija para que no empuje el layout */
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.indicator.current-slide {
  background-color: var(--accent-color);
}

/* ==========================================================================
   SECCIONES GENERALES (FONDO CLARO)
   ========================================================================== */
.content-section {
  background-color: var(--bg-light);
  color: var(--text-dark);
  padding: 4rem 8%;
}

.content-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2.5rem;
  color: var(--text-dark);
}

/* ==========================================================================
   VISTA INICIO - DATOS DEL GRUPO & ÁREAS & MÉTRICAS
   ========================================================================== */
.spotlight-card_we {
  background-color: var(--bg-card-light);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.spotlight-body_we {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2.5rem;
  align-items: center;
}

.spotlight-image-container_we {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border-radius: 8px;
  overflow: hidden;
}

.spotlight-img_we {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotlight-info_we h3 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.summary_we {
  font-size: 0.98rem;
  color: #4b5563;
  line-height: 1.6;
  text-align: justify;
  margin-bottom: 0.8rem;
}

.grid-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.area-card {
  background-color: var(--bg-card-light);
  padding: 2.5rem 1.5rem;
  border-radius: var(--border-radius);
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed);
}

.area-card:hover {
  transform: translateY(-5px);
}

.area-icon img {
  max-width: 60px;
  margin-bottom: 1rem;
}

.metrics-section {
  background-color: #ffffff;
}

.metrics-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
}

.metric-box {
  text-align: center;
}

.metric-number {
  display: block;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--bg-dark);
  line-height: 1;
}

.metric-label {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* PUBLICACIÓN DESTACADA */
.spotlight-card {
  background-color: var(--bg-card-light);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.spotlight-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
}

.spotlight-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
}

.spotlight-image-container {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #e2e8f0;
}

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

.spotlight-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spotlight-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.authors {
  font-size: 0.95rem;
  color: #6b7280;
  margin-bottom: 1rem;
  font-weight: 500;
}

.summary {
  font-size: 0.98rem;
  color: #4b5563;
  line-height: 1.6;
}

.spotlight-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color var(--transition-speed);
}

.btn-primary {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

.btn-primary:hover {
  background-color: #1e232a;
}

.destacado-indexacion{
    background-color: #e2e8f0;
    color: #475569;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
}

/* ==========================================================================
   VISTA - EQUIPO
   ========================================================================== */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 2.5rem;
  padding-top: 1rem;
  position: relative;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0;
}

@media (min-width: 1024px) {
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.team-card {
  background-color: var(--bg-card-light);
  border-radius: var(--border-radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.member-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.member-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.member-role {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 1rem;
}

.member-bio {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 1.2rem;
}

.member-socials {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: auto;
}

.member-socials a {
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  background-color: #f1f5f9;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.member-socials a:hover {
  background-color: var(--bg-dark);
  color: var(--accent-color);
}

/* ==========================================================================
   VISTA - PROYECTOS
   ========================================================================== */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card {
  background-color: var(--bg-card-light);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--accent-color);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  padding: 2rem;
  align-items: center;
  height: auto;
}

.box_art_proyectos {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background-color: transparent;
  margin: 0 auto;
}

.img_art_proyectos {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.datos_proyecto {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.status_proyecto p {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  background-color: #e2e8f0;
  color: #475569;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.title_proyecto h3 {
  font-size: 1.4rem;
  color: var(--text-dark);
}

.investigadores_proyecto,
.resumen_proyecto,
.doi_proyecto {
  font-size: 0.95rem;
  color: #4b5563;
}

.resumen_proyecto {
  text-align: justify;
}

.investigadores_proyecto p1,
.resumen_proyecto p1,
.doi_proyecto p1 {
  font-weight: 700;
  color: var(--text-dark);
}

.doi_proyecto a {
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
}

.doi_proyecto a:hover {
  text-decoration: underline;
}

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
}

.pagination-btn {
  background-color: var(--bg-dark);
  color: var(--text-light);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color var(--transition-speed);
}

.pagination-btn:hover:not(:disabled) {
  background-color: var(--accent-color);
  color: var(--bg-dark);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-number {
  background-color: transparent;
  border: 1px solid #cbd5e1;
  color: var(--text-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-speed);
}

.pagination-number:hover,
.pagination-number.active {
  background-color: var(--bg-dark);
  color: var(--accent-color);
  border-color: var(--bg-dark);
}

/* ==========================================================================
   VISTA - CONTACTO
   ========================================================================== */
#contacto .content-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.form_contact {
  width: 100%;
  max-width: 500px;
  background-color: var(--bg-dark);
  color: var(--text-light);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form_contact p {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.form_contact input,
.form_contact textarea {
  width: 100%;
  padding: 0.75rem;
  border-radius: 6px;
  border: 1px solid #4b5563;
  background-color: #1f242d;
  color: var(--text-light);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-speed);
  font-family: inherit;
}

.form_contact input:focus,
.form_contact textarea:focus {
  border-color: var(--accent-color);
}

.btn_submit_contact {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background-color: var(--accent-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.btn_submit_contact:hover {
  background-color: var(--accent-hover);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  background-color: var(--bg-dark);
  color: var(--text-muted);
  padding: 1.5rem 8%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.datos_footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.contacto_footer,
.direccion_footer,
.social_media {
  font-size: 0.85rem;
  color: var(--text-light);
}

.social_media {
  padding-left: 30%;
}

.contacto_footer h1,
.direccion_footer h1,
.title_social_media h1 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.contacto_footer p,
.direccion_footer p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.img_contacto_footer {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  vertical-align: middle;
  filter: invert(65%);
}

.btn_social_media {
  display: flex;
  gap: 12px;
  margin-top: 0.5rem;
}

.boton-social img {
  width: 32px;
  height: 32px;
  filter: invert(65%);
  transition: transform var(--transition-speed), opacity var(--transition-speed);
}

.boton-social:hover img {
  transform: scale(1.1);
  opacity: 0.9;
}

.derechos_footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVO)
   ========================================================================== */
@media (max-width: 900px) {
  .spotlight-body_we,
  .spotlight-body,
  .project-card,
  .datos_footer {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .box_art_proyectos {
    width: 100%;
    max-width: 200px;
    height: 200px;
  }

  .social_media {
    padding-left: 0;
  }

  .hero-section {
    height: auto; /* Desactiva el full screen rígido en pantallas pequeñas */
    min-height: auto;
    padding: 1.5rem 1rem;
  }

  .carousel-container {
    height: auto;
    aspect-ratio: 4 / 3; /* Proporción limpia de tarjeta en celulares */
    max-height: 400px;
  }

  .carousel-btn {
    font-size: 1.5rem;
    padding: 0.2rem;
  }

  .prev-btn { left: 8px; }
  .next-btn { right: 8px; }
}