* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

html, body {
  overflow: auto;
}

body{
  background-image: url(../images/fondo.jpg);
  background-repeat: repeat;
  background-size: auto;
  display: grid;
  min-height: 100dvh;
  grid-template-rows: auto 1fr auto;
}

#header {
  width: 100%;
  background: linear-gradient(135deg, #00247D 0%, #CF142B 50%, #FFFFFF 100%);
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  padding: 20px 0;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  z-index: 1000;
}

/*Al final me has convencido con la animacion en el titulo*/
#header h2 {
  animation: aparecer 1s ease-out forwards;
  opacity: 0;
  font-family: math;
}

@keyframes aparecer {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#titulo {
  font-size: clamp(10px, 3.5vw, 20px);
  width: 35%;
  text-align: left;
  color: rgb(230, 230, 230);
  text-shadow: -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000,
    1px 1px 1px #275b96, 2px 2px 4px #000;
}

#directorio {
  width: 60%;
  text-align: right;
}

div {
  display: inline-block;
  vertical-align: middle;
}

li{
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav {
  position: relative;  
  display: flex;
  justify-content: flex-end;
  
}

.nav-links {
  display: ruby;
}


/* Botón hamburguesa oculto por defecto */
.menu-toggle {
  display: none;
  text-decoration: none;
  font-size: 20px;
  padding: clamp(3px, 3.5vw, 5px) clamp(6px, 3vw, 10px);
  border-radius: 5px;
  cursor: pointer;
  background: rgba(52, 55, 224, 0.5);
  backdrop-filter: blur(4px);
  color: white;
  border: 2px solid #3437e0;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-toggle:hover {
  transform: scale(1.05);
  box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.6);
  }

.nav-a {
  font-family: sans-serif;
  padding: 10px 15px;
  color: rgb(230, 230, 230);
  text-decoration: none;
  text-shadow: -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000,
    1px 1px 1px rgb(5, 77, 160), 2px 2px 4px #000;
  width: 100%;
  display: flex;
  justify-content: center;

  font-weight: bold;
  border-radius: 6px;
  
  transition: background 0.3s, transform 0.2s;
}

.nav-a:hover {
  background: #FFF5E1;
  color: #2071a7f2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  border-radius: 5px;
  width: 100%;
  display: flex;
  justify-content: center;
  text-shadow: none;
}

#footer {
  margin-top: auto;
  width: 100%;
  background-color: #3f3f3f;
  text-align: center;
  font-weight: bold;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  align-items: center;
}

#footer nav div {
  display: inline-flex;
}

#redes {
  text-align: center;
}

#footer p{
  color: white;
  margin-bottom: 30px;
  padding: 0 30px;
}

#footer p a{
  color: lightcoral;
}

.nav-b {
  flex: 1;
  padding: 10px 15px;
  color: rgb(230, 230, 230);
  text-decoration: none;
  width: 100%;
  display: flex;
  justify-content: center;
  font-weight: bold;
  border-radius: 5px;
  
  transition: background 0.3s, transform 0.2s;
}

.nav-b:hover {
  background: #FFF5E1;
  color: #2071a7f2;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  border-radius: 5px;
  width: 100%;
  display: flex;
  justify-content: center;
}

#redes nav {
  display: inline-block;
  padding: 0.7em;
  align-items: center;
  justify-content: center;
}

#redes nav div{
  margin: 0px 20px;
}

#redes nav a {
  display: flex;
  align-items: center;
  justify-content: center;
}

#redes nav img {
  width: 30px;
  height: 30px;
  /*margin: 0 0 0 7px;*/
}

#redes nav p {
  font-size: 20px;
  font-weight: bold;
}

.divider-gradient {
  width: 90%;
  border: 0;
  height: 2.5px;
  background: linear-gradient(to right, #40aef8, #ff7272);
  margin: 40px 0;
}

/* Responsive */

@media (max-height: 600px) {
  #header{
    position: relative;
    margin-bottom: -80px;
  }
}

@media (max-width: 1260px) {

  #directorio{
    width: 10%;
  }

  #titulo{
    width: 80%;
  }

  .menu-toggle {
    display: inline-block;
  }

  .nav-a:hover{
    background: white;
  }

  .nav-links {
    opacity: 0;
    transform: scaleY(0.95);
    pointer-events: none;
    
    display: flex;
    flex-direction: column;
    background: rgb(164, 165, 216);
    position: absolute;
    width: 200px;
    padding: 0px;
    top: 50px;
    outline: #3437e0 2px solid;
    border-radius: 5px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 5;
  }

  .nav-links.show {
    opacity: 1;
    transform-origin: top;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: scaleY(1);
    pointer-events: all;
  }
}

@media (max-width: 650px) {

  .divider-gradient{
    margin: 20px 0px;   
  }

}
