.header-principal {
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center;
  background-color: #20264a;
  padding: 15px 20px;
  color: white;
  font-family: "Poppins", sans-serif;
  position: sticky; 
  top: 0;
  left: 0;
  width: 100%; 
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  border-bottom: 4px solid #004aad; 
}

.logo:hover img {
  transform: scale(1.15) rotate(-5deg);
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.logo:hover .titulo-principal {
  color: #ffd700;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.6), 0 0 10px #ff3b3f;
  transform: translateY(-3px) scale(1.05);
  transition: all 0.4s ease;
}


.header-principal .logo-titulo {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}


.header-principal .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
}

.header-principal .logo img {
  height: 50px; 
  width: auto;
  margin-right: 10px;
  border-radius: 50%;
}

.titulo-principal {
  font-family: 'Poppins', sans-serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: #ffffff;
  letter-spacing: 1px;
  text-align: center;
  white-space: nowrap; 
}

.titulo-principal span {
  font-family: 'Pacifico', cursive;
  font-size: 2rem;
  color: #ff3b3f;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
}


.modo-btn {
  margin-top: 10px;
  background-color: white;
  color: #004aad;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.modo-btn:hover {
  background-color: #004aad;
  color: white;
}


@media (max-width: 900px) {
  .header-principal {
    padding: 10px 10px;
  }

  .logo {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    justify-content: center;
  }

  .logo img {
    margin: 0 0 10px 0; 
    height: 45px;
    width: auto;
  }

  .titulo-principal {
    font-size: 1.5rem;
    white-space: normal;
    text-align: center;
  }

  .titulo-principal span {
    font-size: 1.7rem;
  }

  .modo-btn {
    margin-top: 10px;
  }
}

.modo-btn:hover {
  background-color: #004aad;
  color: white;
}

body {
  font-family: "Poppins", sans-serif;
  margin: 0;
  background-color: var(--fondo);
  color: var(--texto);
  transition: background-color 0.5s ease, color 0.5s ease;
}

main {
  max-width: 800px;
  margin: 50px auto;
  padding: 25px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: background-color 0.5s, color 0.5s, box-shadow 0.3s;
}

main img {
  width: 100%;
  border-radius: 10px;
  margin: 15px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

main img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

main h2 {
  font-size: 1.6rem;
  color: #004aad;
  margin-bottom: 10px;
  transition: color 0.3s, transform 0.3s;
  cursor: default;
}

main h2:hover {
  color: #007bff;
  transform: translateY(-2px);
}

.fecha {
  color: #888;
  font-size: 0.9rem;
}

:root {
  --fondo: #f5f6fa;
  --texto: #222;
}

body.dark {
  --fondo: #0e1116;
  --texto: #f0f0f0;
}

body.dark main {
  background-color: #1c1f26;
  box-shadow: 0 2px 15px rgba(255,255,255,0.05);
}

body.dark .modo-btn {
  background-color: #222;
  color: white;
}

body.dark .modo-btn:hover {
  background-color: white;
  color: #222;
}

.resolucion {
  width: 99%;
  text-align: center;
}

@media (max-width: 767px) {
  .desktop {
    display: none;
  }
  .tablet {
    display: none;
  }
}

@media (max-width: 768px) and (max-width: 990px) {
  .desktop {
    display: none;
  }
  .movil {
    display: none;
  }
}

@media (max-width: 991px) {
  .tablet {
    display: none;
  }
  .movil {
    display: none;
  }
}

@media (max-width: 900px) {
  header {
    flex-wrap: wrap;
    padding: 10px 15px;
  }
  
  .logo {
    flex: 1 1 100%;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .logo img {
    height: 45px;
    margin-right: 8px;
  }
  
  .titulo-principal {
    font-size: 1.6rem;
    text-align: center;
  }
  
  .titulo-principal span {
    font-size: 1.8rem;
  }
  
  .header-social {
    flex: 1 1 100%;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  .social-icon-top {
    width: 28px;
    height: 28px;
  }
  
  nav {
    flex: 1 1 100%;
    order: 3;
    width: 100%;
  }
  
  nav ul {
    top: 60px;
    right: 15px;
    width: calc(100% - 30px);
  }

  .banner-overlay {
    max-width: 95%;
    left: 10px;
    top: 10px;
  }
  
  .encabezado-principal {
    font-size: 1.5rem;
  }
  
  .subtitulo-importante {
    font-size: 1rem;
  }
  
  .descripcion-importante {
    font-size: 0.95rem;
  }
  
  .contenido-grid {
    flex-direction: column;
  }
  
  .banner-izquierda,
  .anuncios-derecha {
    width: 100%;
    flex: unset;
  }
  
  .anuncios-derecha h2 {
    font-size: 1.5rem;
  }
  
  .anuncio-item img {
    max-width: 90%;
  }
  
  .cubiculo.azul {
    max-width: 90%;
    padding: 15px;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .encabezado-principal {
    font-size: 1.8rem;
  }
  
  .subtitulo-importante {
    font-size: 1.1rem;
  }
  
  .descripcion-importante {
    font-size: 1rem;
  }
  
  .titulo-principal {
    font-size: 1.9rem;
  }
  
  .titulo-principal span {
    font-size: 2rem;
  }
  
  .logo img {
    height: 48px;
  }
  
  .social-icon-top {
    width: 30px;
    height: 30px;
  }
}

nav ul {
  transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
  overflow: hidden;
  max-height: 0; 
  opacity: 0;
  padding: 0;
}

nav ul.show {
  max-height: 500px; 
  opacity: 1;
  padding: 15px;
}

