/*--------------------------------------*
 *  Estilos generales
 *--------------------------------------*/

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background-color: rgb(47, 47, 47);
  font-family: sans-serif;
  color: white;
}

/*--------------------------------------*
 *  Contenedor de cuadrícula
 *--------------------------------------*/
.grid-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
}

.left-panel {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
}

.main-section {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
}

.footer {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
}

/*--------------------------------------*
 *  Header
 *--------------------------------------*/
.page-header {
  background-color: rgb(255, 255, 255);
  text-align: center;
  padding: 20px;
}

.page-header img {
  max-width: 100%;
  height: auto;
}

/*--------------------------------------*
 *  Menú lateral
 *--------------------------------------*/
.sidebar {
  background-color: rgb(47, 47, 47);
  padding: 20px 0;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.menu-link {
  display: block;
  color: white;
  text-decoration: none;
  padding: 16px 20px;
  font-size: 16px;
  transition: background-color 0.3s ease, border-left 0.3s ease;
}

.menu-link:hover {
  background-color: rgb(97, 97, 97);
}

/* 🔹 Estilo original si se usa .menu-link.active */
.menu-link.active {
  background-color: rgb(80, 80, 80);
  border-left: 4px solid rgb(0, 200, 0);
  font-weight: bold;
}

/* 🔹 NUEVO: aplicar el mismo estilo cuando el activo está en el <li> */
.menu-list li.active > .menu-link {
  background-color: rgb(80, 80, 80);
  border-left: 4px solid rgb(0, 200, 0);
  font-weight: bold;
}

/*--------------------------------------*
 *  Sección principal
 *--------------------------------------*/
.main-section {
  padding: 20px;
  background-color: rgba(233, 237, 240, 255);
  color: rgb(0, 0, 0);
  overflow-y: auto;
}

.main-section h1 {
  font-size: 28px;
  margin-top: 0;
}

.main-section p {
  font-size: 18px;
  line-height: 1.6;
  margin-top: 10px;
}

/*--------------------------------------*
 *  Pie de página
 *--------------------------------------*/
.footer {
  background-color: rgb(90, 90, 90);
  color: white;
  text-align: center;
  padding: 12px;
  font-size: 0.9rem;
}

.footer::after {
  margin-left: 5px;
  font-style: italic;
}

/*--------------------------------------*
 *  Adaptación responsiva
 *--------------------------------------*/
@media screen and (max-width: 600px) {
  .grid-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header"
      "aside"
      "section"
      "footer";
  }

  .menu-link {
    padding: 14px 16px;
    font-size: 14px;
  }
}
