.team-container {
  display: grid;
  grid-template-columns: repeat(3, 220px); /* 3 columnas fijas */
  gap: 20px;
  justify-content: center; /* centra el bloque (no usa todo el ancho) */
  box-sizing: border-box;
}

.socios {
  margin-bottom: 20px; /* mantiene separación entre socios y resto */
}

.team-member {
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
  padding: 10px;
  background: #fff;
  box-shadow: 0px 2px 4px rgba(4, 45, 89, 0.2);
  position: relative; /* importante para el + */
}

.team-member:hover {
  box-shadow: 0px 4px 12px rgba(4, 45, 89, 0.6);
  transform: scale(1.05);
}

.team-member img {
  transition: transform 0.3s;
  max-width: 100%;
  height: auto;
}

.team-member:hover img {
  transform: scale(1.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  width: 90%;
  max-width: 500px;
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 2001;
  box-sizing: border-box;
  margin: 0 auto;
}

.modal-content img {
  width: 120px;
  border-radius: 50%;
  margin-bottom: 10px;
  max-width: 100%;
  height: auto;
}

.modal-content h3 {
  font-size: 22px;
  margin-bottom: 5px;
  word-break: break-word;
}

.modal-content p {
  font-size: 16px;
  text-align: center;
  word-break: break-word;
}

.linkedin-icon {
  width: 32px;
  margin-top: 10px;
  max-width: 100%;
  height: auto;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #333;
  z-index: 2002;
}

.close:hover {
  color: red;
}

.modal-trigger {
  display: flex;
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 25px;
  height: 25px;
  background-color: #042d59;
  color: white;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
  justify-content: center;
  align-items: center;
  text-align: center;
  line-height: 1;
}

.modal-trigger:hover {
  background-color: #031c3c;
}

/* Responsive: 2 columnas centradas + modal móvil/tablet */
@media (max-width: 992px) {
  .team-container {
    grid-template-columns: repeat(2, 220px);
    padding: 20px;
  }

  .modal {
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 20px 16px;
    overflow-y: auto;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: none;
    margin: 0 auto;
  }

  .close {
    top: 12px;
    right: 12px;
    font-size: 28px;
  }
}

/* Responsive: 1 columna centrada */
@media (max-width: 600px) {
  .team-container {
    grid-template-columns: 220px;
    padding: 20px;
  }
}