/* team.css */

/* Team Hero Section */
.team-hero {
  position: relative;
  min-height: 350px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  /* margin-bottom: var(--spacing-xl); Removed margin, use section padding */
  padding: var(--spacing-xl) 0; /* Use standard section padding */
}

.team-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2) 0%,
    /* Lighter overlay */ rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 1;
}

.team-hero-content {
  position: relative;
  z-index: 2; /* Content above overlay */
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.team-hero .page-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-sm);
  color: var(--text-light);
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.team-hero .hero-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-light);
  opacity: 0.9;
  font-weight: 400;
  margin-bottom: 0;
}

/* Team Members Section */
.team-members {
  padding: var(--spacing-xl) 0; /* Use section padding */
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-xl);
  max-width: 1200px; /* Limit maximum width */
  margin: 0 auto; /* Center the grid */
}

/* Better handling for single team member */
@media (min-width: 769px) {
  .team-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(320px, 400px)
    ); /* Set max width for cards */
    justify-content: center; /* Center the cards when there are fewer items */
  }
}

.team-card {
  background: var(--bg-primary); /* Use primary bg */
  border-radius: var(--border-radius-md); /* Consistent radius */
  overflow: hidden;
  box-shadow: var(--shadow-sm); /* Standard shadow */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
  text-align: center; /* Center content */
  display: flex;
  flex-direction: column;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md); /* Standard hover shadow */
}

.team-image {
  position: relative;
  padding-top: 100%; /* 1:1 aspect ratio for profile pics */
  overflow: hidden;
  background-color: var(--bg-secondary); /* Placeholder bg */
}

.team-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure image covers */
  object-position: center top; /* Focus on face */
  transition: transform 0.4s ease; /* Smoother zoom */
}

.team-card:hover .team-image img {
  transform: scale(1.05);
}

.team-info {
  padding: var(--spacing-lg);
  flex-grow: 1; /* Allow info to take remaining space */
  display: flex;
  flex-direction: column;
}

.team-info h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-xs);
  color: var(--secondary-color); /* Use secondary color */
  font-family: var(--font-primary);
}

.team-title {
  /* Renamed from team-position for clarity */
  font-size: var(--font-size-sm);
  color: var(--primary-color); /* Highlight title */
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.team-description,
.team-bio {
  /* Combine bio and description styling */
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
  flex-grow: 1; /* Allow description to push social links down */
}
.team-description:last-child,
.team-bio:last-child {
  margin-bottom: 0; /* Remove margin if it's the last element before social */
}

.team-social {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md); /* Increase gap */
  margin-top: auto; /* Push to bottom */
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-color);
}

.team-social a {
  color: var(--text-secondary);
  font-size: var(--font-size-lg); /* Larger icons */
  transition: var(--transition-base);
  display: inline-block; /* Ensure transform works */
  line-height: 1; /* Prevent extra space */
}

.team-social a:hover {
  color: var(--primary-color);
  transform: scale(1.2); /* Make hover effect more pronounced */
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 991px) {
  /* Adjustments for centered 1-2 cards if that logic is used */
  /* .team-grid:has(> :nth-child(1):nth-last-child(1)),
    .team-grid:has(> :nth-child(1):nth-last-child(2)):not(:has(> :nth-child(3))) {
        max-width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    } */
}

@media (max-width: 768px) {
  .team-hero {
    min-height: 300px;
    padding: var(--spacing-lg) 0;
  }
  .team-hero .page-title {
    font-size: var(--font-size-2xl);
  }
  .team-hero .hero-subtitle {
    font-size: var(--font-size-md);
  }

  .team-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(260px, 1fr)
    ); /* Adjust minmax */
    gap: var(--spacing-lg);
  }
}

@media (max-width: 480px) {
  .team-grid {
    grid-template-columns: 1fr; /* Stack fully */
  }
  .team-info {
    padding: var(--spacing-md);
  }
  .team-info h3 {
    font-size: var(--font-size-md);
  }
  .team-title {
    font-size: var(--font-size-xs);
  }
}
