.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.team-member {
  text-align: center;
  background: #f8f8f8;
  border-radius: 12px;
  padding: 15px;
  transition: transform 0.3s ease;
  position: relative;
}

.team-member:hover {
  transform: translateY(-5px);
}

.team-member img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--primary);
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Overlay sub text */
.overlay {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  background: rgba(65, 0, 194, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 0 10px;
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
}

.team-member:hover .overlay {
  max-height: 100px; /* ajustezi după lungimea textului */
  padding: 10px;
}

.team-member h3 {
  margin: 10px 0 0 0;
  font-size: 1.2rem;
  color: var(--primary);
}

.team-member .position {
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 8px;
}
