.contenedor-organigrama {
  text-align: center;
  color: var(--secondary);
  padding: 0px 50px 0px 50px;
}

h1 {
  margin-bottom: 60px;
  color: var(--secondary);
  text-transform: uppercase;
}

.organigrama {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

/* Niveles */
.nivel {
  display: flex;
  justify-content: center;
  gap: 60px;
  position: relative;
}

/* Nivel 1 */
.nivel1 .persona {
  width: 380px;
}

/* Nivel 2 */
.nivel2 {
  background-color: #e7daba;
  padding: 70px 30px 30px 30px;
  border-radius: 10px;
  max-width: 90vw;
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: nowrap;
}

.nivel2 > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.nivel2 .persona {
  width: 140px;
  height: 200px;
  padding-bottom: 20px;
  color: var(--secondary);
}

/* Cuadros adicionales */
.cuadro-texto {
  background: white;
  border-radius: 8px;
  padding: 8px 15px;
  border: 2px solid var(--primary);
  font-size: 0.9em;
  font-weight: bold;
  color: var(--secondary);
  text-align: center;
  user-select: none;
  cursor: default;
  box-shadow: none !important;
  margin-bottom: 0;
  max-width: 140px;
}

.cuadro-texto::before {
  display: none !important;
}

/* Nivel 3 */
.nivel3 {
  margin-top: 70px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  position: relative;
}

.nivel3 .persona {
  width: 120px;
  padding-bottom: 30px;
  color: var(--secondary);
  margin-bottom: 20px;
}

/* Persona */
.persona {
  background: white;
  padding: 15px 20px 30px 20px;
  border-radius: 8px;
  border: 2px solid var(--secondary);
  cursor: pointer;
  position: relative;
  color: var(--secondary);
  transition: all 0.3s ease;
}

.persona:hover {
  background-color: #DADFF1;
}

.persona img {
  width: 90px;
  height: 90px;
  border-radius: 60%;
  border: 3px solid var(--primary);
  margin-top: -60px;
  background: white;
  object-fit: cover;
  transition: all 0.5 ease;
}

.nombre {
  font-weight: bold;
  margin-top: 10px;
  font-size: 1.1em;
  color: var(--secondary);
}

.puesto {
  font-weight: normal;
  font-size: 1.1em;
  color: black;
  margin-top: 4px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 5000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  color: black;
  text-align: left;
  border: 4px solid var(--secondary); /* borde dorado */
  border-radius: 12px;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  
  max-width: 85%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative; /* Necesario para posicionar .cerrar */
  justify-content: left;
}

.cerrar {
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.3s;
}

.cerrar:hover {
  color: red;
}

/*Estilos texto modal*/
.modal-nombre {
  text-align: center;
  color: var(--secondary);
}
.formacion {
  color: var(--secondary);
}

/*Estilo de viñetas palomitas*/
.lista-palomitas {
  list-style: none;
  padding-left: 20px;
}

.lista-palomitas li {
  position: relative;
  padding-left: 25px; /* espacio para la palomita */
  margin-bottom: 8px;
  color: black;
}

.lista-palomitas li::before {
  content: "✓";
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* Consejo de Comisiones */
.consejo-comisiones {
  box-sizing: border-box;
  background-color: #D5DDFB;
  padding: 20px 30px;
  border-radius: 10px;
}
.titulo-comisiones {
  margin: 0;
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.3em;
  text-transform: uppercase;
  color: var(--secondary);
  text-align: center;
}

@media screen and (max-width: 1200px) {
  .contenedor-organigrama {
    padding: 0px 5% 0px 5%;
  }
  .consejo-comisiones {
    width: 100%;
  }

}

/* Responsive */
@media (max-width: 1100px) {
  .nivel {
    gap: 20px;
    flex-wrap: wrap;
  }

  .nivel1 .persona {
    width: 140px;
    height: 120px;
  }

  .nivel2 {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  .nivel2 > div {
    width: 140px;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }

  .nivel2 .persona {
    width: 110px;
    height: 155px;
    padding-bottom: 20px;
  }

  .cuadro-texto {
    max-width: 100%;
    font-size: 0.85em;
    padding: 6px 10px;
  }

  .nivel3 .persona {
    width: 90px;
    padding-bottom: 20px;
  }

  .persona img {
    width: 60px;
    height: 60px;
    margin-top: -45px;
  }

  .nombre {
    font-size: 1em;
  }

  .puesto {
    font-size: 0.8em;
  }

  .titulo-comisiones {
    font-size: 1.1em;
  }
}

@media (max-width: 500px) {
  .nivel {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }

  .nivel1 .persona,
  .nivel2 .persona,
  .nivel3 .persona {
    width: 100%;
    height: fit-content;
    box-sizing: border-box;
    margin: 0;
  }

  .cuadro-texto {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .nivel2 {
    flex-direction: column;
    align-items: center;
  }

  .nivel2 > div {
    width: 100%;
    /*max-width: 220px;*/
    margin-bottom: 20px;
  }

}
