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

html {
  scroll-behavior: smooth;
}

body {
  display: grid;
  height: 100%;
  width: auto;
  grid-template-areas:
    "menu"
    "seccion-principal"
    "footer";
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  font-family: sans-serif;
}

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

}

.logo img {
  width: 65px;
  height: 45px;
}

.logo span {
  font-weight: bold;
  font-size: 18px;

}

nav {
  grid-area: menu;
  background-color: #446d4e;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1000;

}

nav span {
  font-weight: bold;
  margin-left: 10px;
}

nav a {
  color: white;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none !important;  /* forzar quitar subrayado*/
}

nav a:hover {
  background: rgb(47, 51, 48);
  color: black;
  font-weight: bold;

}

.menu-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;

}

.menu-left ul {
  list-style: none;

}

.menu-left ul li {
  margin-bottom: 20px;
}

.menu-item ul li a {
  color: white;

}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: lighter;
  font-size: 14px;
}

.menu-item ul {
  display: flex !important;
  flex-direction: row;
  gap: 20px;
  background-color: transparent;
  padding: 0;
}

main {
  grid-area: seccion-principal;
  padding: 20px;
}

section {
  margin-bottom: 40px;
}

footer {
  grid-area: footer;
  text-align: center;
  color: #446d4e;
  padding-top: 10px;

}

footer .RSS {
  margin-bottom: 10px;
  font-size: 20px;
}

/* Tarjetas */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

@media (min-width: 576px) and (max-width: 991px) {
  body {
    grid-template-areas:
      "menu"
      "seccion-principal"
      "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
  }

  .logo {
    flex: 0 0 auto;
    order: 0;
  }

  .menu-left {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    flex: 1;
    gap: 20px;
  }

  .menu-item ul {
    display: flex !important;
    flex-direction: row;
    gap: 20px;
    background-color: transparent;
    padding: 0;
  }

  .menu-item ul li {
    margin: 0;
  }

  .menu-item ul li a {
    color: white;
    font-weight: normal;
  }

  .cards {
    grid-template-columns: 1fr 1fr;
  }

  footer {
    grid-area: footer;
    text-align: center;
    padding: 20px;
  }
}

@media (min-width: 992px) {
  body {
    grid-template-areas:
      "menu seccion-principal"
      "menu footer";
    grid-template-columns: 250px 1fr;
    grid-template-rows: 1fr;
  }

  nav {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;   /* menú fijo en lateral */
    top: 0;
    left: 0;
    height: 100vh;  /* ocupa toda la altura */
    width: 250px;

  }

  nav .menu-left ul {
    color: white;
    padding: 10px;
    border-radius: 5px;
    list-style: none;
    font-weight: normal;
  }


  nav .menu-left ul li a {
    color: white;
  }

  nav .menu-left ul li a:hover {
    text-decoration: underline;
  }

  .menu-item ul {
    display: block !important;
  }

  .menu-item ul l {
    display: block !important;
  }

  .cards {
    grid-template-columns: 1fr 1fr 1fr;
  }

}

.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background-color: #ffffff;
  text-align: center;

}

.card img {
  width: 100%;
  height: 200px;
  border-radius: 5px;
  object-fit: cover;
}

.card img:hover {
  transform: scale3d(1.25, 1.15, 1);
  transition: transform 0.3s ease;
}

.card-body {
  display: flex;
  flex-direction: column;
  margin: 10px 0;
}

.card-body h3 {
  margin-bottom: 5px;
}

.card-body p {
  margin-top: 0;
  margin-bottom: 10px;
}

.card button {
  background: #446d4e;
  color: white;
  border: none;
  padding: 8px;
  border-radius: 5px;
  cursor: pointer;
}

.card button:hover {
  background: #446d4e;
}
