/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
  font-size: 100%; /* Equivalente a 16px por defecto */
}

body {
  background-color: #f9f9f9;
  color: #222;
  line-height: 1.6;
  font-size: 1rem; /* Usa la unidad relativa rem */
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 8px solid #ddd;
  border-top: 8px solid #004080;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header */
header {
  background-color: #003366;
  color: #fff;
  padding: 15px 0;
  position: relative;
  z-index: 1000;
}

.sticky-header {
  position: sticky;
  top: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.main-nav ul li a {
  color: #fff !important;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.main-nav ul li a:visited {
  color: #fff !important; /* Asegura que los enlaces visitados también sean blancos */
}

.main-nav ul li a:hover {
  /* color: #ffb347; */ /* Eliminado para que no cambie de color al pasar el ratón */
}

.search-social {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-social input[type="search"] {
  padding: 7px 10px;
  border-radius: 4px;
  border: none;
  outline: none;
  width: 180px;
  transition: width 0.3s ease;
}

.search-social input[type="search"]:focus {
  width: 250px;
}

.social-icons a {
  display: inline-block;
  width: 24px;
  height: 24px;
}

.social-icons img {
  width: 100%;
  height: 100%;
  filter: invert(100%);
  transition: filter 0.3s ease;
}

.social-icons a:hover img {
  filter: invert(70%) sepia(50%) saturate(500%) hue-rotate(15deg);
}

/* Trending Ticker */
.trending-ticker {
  background-color: #004080;
  color: #fff;
  padding: 10px 0;
  overflow: hidden;
  font-weight: 600;
  font-size: 1rem;
}

.ticker-content {
  white-space: nowrap;
  display: inline-block;
  animation: tickerMove 20s linear infinite;
}

@keyframes tickerMove {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Carrusel */
.carousel {
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.carousel-wrapper {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  display: block;
  border-radius: 6px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.4);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 50%;
  user-select: none;
  z-index: 10;
}

.carousel-btn.prev {
  left: 10px;
}

.carousel-btn.next {
  right: 10px;
}

/* Estilos del menú hamburguesa */
.hamburger-menu {
  display: none; /* Oculto por defecto */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1010;
}

.hamburger-box {
  width: 30px;
  height: 24px;
  display: inline-block;
  position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
  width: 100%;
  height: 3px;
  background-color: #fff;
  position: absolute;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.hamburger-inner {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-inner::before,
.hamburger-inner::after {
  content: '';
  display: block;
}

.hamburger-inner::before {
  top: -10px;
}

.hamburger-inner::after {
  bottom: -10px;
}

/* Animación del menú hamburguesa a cruz */
.hamburger-menu.is-active .hamburger-inner {
  transform: rotate(45deg);
}

.hamburger-menu.is-active .hamburger-inner::before {
  top: 0;
  transform: rotate(0);
}

.hamburger-menu.is-active .hamburger-inner::after {
  bottom: 0;
  transform: rotate(90deg);
}

/* Secciones principales */
.news-section {
  margin-bottom: 40px;
}

.news-section h2 {
  font-size: 1.6rem;
  margin-bottom: 15px;
  border-left: 6px solid #004080;
  padding-left: 10px;
  color: #004080;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.news-item {
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.news-item:hover {
  transform: translateY(-6px);
}

.news-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.news-content {
  padding: 12px 15px;
}

.news-content h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: #222;
}

.news-content p {
  font-size: 0.9rem;
  color: #555;
  height: 45px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botón Ir arriba */
#btnIrArriba {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #004080;
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

#btnIrArriba:hover {
  background-color: #ffb347;
}

/* Footer */
footer {
  background-color: #003366;
  color: #fff;
  padding: 25px 0;
}

.footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.footer-nav a {
  color: #ffb347;
  text-decoration: none;
  margin: 0 8px;
  font-weight: 600;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.suscripcion-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.suscripcion-form input[type="email"] {
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  outline: none;
  font-size: 1rem;
}

.suscripcion-form button {
  background-color: #ffb347;
  border: none;
  color: #003366;
  padding: 7px 15px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.suscripcion-form button:hover {
  background-color: #e69900;
}

/* Scroll Reveal - clases para usar con JS */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.anuncio {
  background-color: #e0e0e0;
  border: 2px dashed #999;
  color: #333; /* Color de texto mejorado para contraste */
  text-align: center;
  padding: 15px;
  margin: 20px 0;
  border-radius: 6px;
  font-weight: 700;
  font-style: italic;
  user-select: none;
  transition: background-color 0.3s ease;
  display: flex; /* Usar flexbox para centrar el contenido */
  justify-content: center; /* Centrar horizontalmente */
  align-items: center; /* Centrar verticalmente */
  overflow: hidden; /* Asegura que el contenido no se desborde */
}

.anuncio iframe {
  max-width: 100% !important; /* Asegura que el iframe no exceda el ancho del contenedor */
  height: auto !important; /* Ajusta la altura automáticamente */
  display: block !important; /* Elimina espacios extra debajo del iframe */
  line-height: normal !important; /* Asegura que no haya line-height que afecte */
}

.anuncio:hover {
  background-color: #ccc;
}

.anuncio-top {
  /* height: 90px; */ /* Eliminado para que la altura se ajuste al contenido */
  line-height: normal; /* Ajustado para flexbox */
}

.anuncio-sidebar {
  width: 300px;
  height: 600px;
  position: sticky;
  top: 80px;
  margin-left: 20px;
}

.anuncio-bloque {
  /* height: 250px; */ /* Eliminado para que la altura se ajuste al contenido */
}

.anuncio-footer {
  /* height: 100px; */ /* Eliminado para que la altura se ajuste al contenido */
  margin-top: 40px;
}

.anuncio-movil-fijo {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #004080cc;
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-weight: 700;
  cursor: pointer;
  display: none;
  z-index: 1100;
}

/* Mostrar banner móvil en pantallas pequeñas */
@media (max-width: 600px) {
  .anuncio-sidebar {
    display: none;
  }
  /* .anuncio-movil-fijo {
    display: block;
  } */ /* Eliminado */
}
.btn-cerrar-anuncio {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: #666;
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Móviles y tablets */
@media (max-width: 991px) {
  .container {
    width: 95%; /* Aumenta el ancho en pantallas medianas */
  }

  header {
    padding: 10px 0; /* Reduce el padding del header en móvil */
  }

  .hamburger-menu {
    display: block; /* Mostrar en pantallas pequeñas */
  }

  .main-nav {
    display: none; /* Ocultar navegación por defecto */
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #003366;
    flex-direction: column;
    padding: 10px 0; /* Reduce el padding del nav en móvil */
  }

  .main-nav.is-active {
    display: flex; /* Mostrar al hacer clic */
  }

  .main-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 5px; /* Reduce el espacio entre elementos del nav en móvil */
  }

  .main-nav ul li a {
    font-weight: 700 !important; /* Más negrita para mayor visibilidad */
    padding: 8px 15px; /* Añade padding para hacerlos más grandes y fáciles de tocar */
    display: block; /* Para que el padding funcione correctamente */
  }

  .main-nav.is-active ul li {
    background-color: rgba(255, 255, 255, 0.1); /* Fondo sutil para resaltar el elemento activo */
    border-radius: 4px;
  }
  
  .header-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-social {
    width: 100%;
    justify-content: center;
    margin-top: 5px; /* Reduce el margen superior en móvil */
  }

  .search-social input[type="search"] {
    width: 100%;
    max-width: 300px;
  }

  .carousel-btn {
    font-size: 1.5rem;
    padding: 5px 10px;
  }

  .news-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .news-section {
    margin-bottom: 25px; /* Reduce el margen inferior */
  }

  .news-section h2 {
    margin-bottom: 10px; /* Reduce el margen inferior */
  }
}

/* Pantallas pequeñas */
@media (max-width: 480px) {
  html {
    font-size: 90%; /* Reduce el tamaño de la fuente base a 14.4px */
  }

  .main-nav ul {
    flex-direction: column;
  }

  .search-social {
    flex-direction: column;
  }

  .search-social input[type="search"] {
    max-width: 100%;
  }

  .news-list {
    grid-template-columns: 1fr;
  }

  .social-icons a {
    width: 20px;
    height: 20px;
  }
}

/* Estilos para el botón "Cargar más" */
.load-more-button {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background-color: #004080;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.load-more-button:hover {
  background-color: #0056b3;
}

/* Estilos para la Modal de Noticias */
.news-modal {
  display: none; /* Oculto por defecto */
  position: fixed; /* Permanece en la misma posición incluso al hacer scroll */
  z-index: 10000; /* Se sitúa por encima de todo */
  left: 0;
  top: 0;
  width: 100%; /* Ancho completo */
  height: 100%; /* Alto completo */
  overflow: auto; /* Habilita el scroll si el contenido es demasiado grande */
  background-color: rgba(0,0,0,0.8); /* Fondo semi-transparente oscuro */
  padding-top: 60px; /* Espacio desde la parte superior */
}

.news-modal-content {
  background-color: #fefefe;
  margin: 5% auto; /* 5% desde arriba y centrado horizontalmente */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Ancho de la modal */
  max-width: 700px; /* Ancho máximo */
  border-radius: 8px;
  position: relative;
}

.news-modal-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 15px;
  border-radius: 4px;
}

.news-modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #003366;
}

.news-modal-content p {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 10px;
}

.news-modal-content a {
  color: #004080;
  text-decoration: none;
  font-weight: bold;
}

.news-modal-content a:hover {
  text-decoration: underline;
}

.close-button {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  right: 20px;
}

.close-button:hover,
.close-button:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

/* Responsive para la modal */
@media (max-width: 768px) {
  .news-modal-content {
    width: 95%;
    margin: 10% auto; /* Más espacio desde arriba en móviles */
  }
}
