.team-section {
  text-align: center;
  color: #fff;
  padding: 0 20px 70px 20px; /* Added side padding for mobile */
}

.team-section h2 {
  font-size: 2.5rem;
  margin-bottom: 50px;
  font-weight: 700;
  color: #00a5ff; /* Kept consistent with your other sections */
}

.team-grid {
  display: grid;
  /* Desktop: creates columns that are at most 1fr, but won't exceed the card's natural size */
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin: 0 auto;
  max-width: 1200px; /* Prevents the grid from getting too wide on ultrawide screens */
  justify-content: center;
}

.team-card {
  padding: 30px; /* Reduced slightly from 40px for better balance */
  background-color: #003552;
  border: 1px solid #00a5ff;
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.team-card:hover {
  transform: translateY(-5px);
}

.team-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px; /* Optional: rounds the photo corners slightly */
}

.team-info {
  padding-top: 20px;
}

.team-info h3 {
  color: #00a5ff;
  margin: 0 0 10px 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.team-info p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #fff;
  margin: 0;
}

/* --- Mobile Specific Adjustments --- */
@media (max-width: 768px) {
  .team-section h2 {
    font-size: 1.8rem; /* Adjusted for better visibility than 1.3rem */
    margin-bottom: 30px;
  }

  .team-grid {
    /* On tablets/larger phones, go 1-column or 2-column automatically */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
  }

  .team-card {
    padding: 20px; /* Save space on mobile */
    max-width: 100%; /* Allow cards to fill width */
  }
}

@media (max-width: 480px) {
  .team-section h2 {
    font-size: 1.5rem;
  }

  .team-grid {
    grid-template-columns: 1fr; /* Force single column on small phones */
  }

  .team-info h3 {
    font-size: 1.25rem;
  }

  .team-info p {
    font-size: 0.9rem;
  }
}
