/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  font-family: Arial, sans-serif;
  font-size: 14px;
  background-color: #f5f5f5;
  color: #333;
  background-image: url('../img/gobierno.jpeg'); 
  background-size: cover; 
  background-position: center; 
  background-attachment: fixed; 
}

@media (max-width: 768px) {
  body {
    background-size: cover;
    background-position: center;
  }
}


@media (max-width: 480px) {
  body {
    background-attachment: scroll;
  }
}


/* Header */
header {
  background: linear-gradient(90deg, #682b2c, #5e2728);
  color: white;
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center; /* Esto asegura que los elementos estén alineados verticalmente */
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  width: 100%;
}

/* Logo */
.logo img {
  height: 70px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

/* Botón hamburguesa */
.btn-menu {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  margin-left: auto; /* Mueve el botón a la derecha */
  align-self: center; /* Alinea el botón a la misma altura que el logo */
}

/* Nav */
nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
  justify-content: center;
}

/* Enlaces dentro del menú */
nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease, background-color 0.3s ease; /* Añadimos transición */
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 4px;
}

nav ul li a:hover {
  color: #f0f0f0;
  background-color: rgba(255, 255, 255, 0.2);
}

/* Bienvenida */
.bienvenida {
  padding: 60px 20px;
  max-width: 800px;
  margin: auto;
  text-align: center;
  flex: 1 0 auto;
}

.bienvenida h2 {
  font-size: 2rem;
  color: #863031;
  margin-bottom: 20px;
}

.bienvenida p {
  font-size: 1rem;
  line-height: 1.6;
}

/* === Footer === */
footer {
  background: linear-gradient(90deg, #dfe0e2, #a99e9d);
  color: black;
  padding: 30px 20px;
  text-align: center;
  font-size: 14px;
  width: 100%;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
  margin-top: auto;
  flex-shrink: 0;
}

/* ===================== */
/* ==== RESPONSIVE ===== */
/* ===================== */

/* Tablets (pantallas medianas) */
@media (max-width: 992px) {
  header {
    padding: 15px 20px;
  }

  .logo img {
    height: 60px;
  }

  nav ul {
    gap: 15px;
  }

  nav ul li a {
    font-size: 0.95rem;
  }
}

/* Móviles (pantallas pequeñas) */
@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 15px 20px;
  }

  .logo img {
    height: 55px;
  }

  /* Mostrar botón hamburguesa */
  .btn-menu {
    display: block;
  }

  /* Ocultar menú por defecto */
  nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(90deg, #682b2c, #5e2728);
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    justify-content: flex-end; 
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 999;
  }

  /* Cuando el menú esté activo (clase .active en JS) */
  nav ul.active {
    display: flex;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a {
    display: block;
    padding: 12px 0;
    text-align: left;
    padding-left: 10px;
    border-bottom: 1px solid rgba(222, 218, 218, 0.2);
  }
}

/* Extra pequeño (pantallas <480px) */
@media (max-width: 480px) {
  header {
    padding: 10px 15px;
  }

  .logo img {
    height: 45px;
  }
}
