/* ===================================
   Members Page – Reference Design Match
   borgaon.aaplipanchayat.com/members
   =================================== */

/* --- Page Background --- */
.members-section {
  background: #f0f4f8; /* specific light grey-blue background from reference */
  padding: 40px 0 60px;
  min-height: 80vh;
}

/* --- Section Title --- */
.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 30px;
}

/* --- Filter Buttons --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 10px 24px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-btn:hover,
.filter-btn.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #1e3a8a;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* --- Member Card Grid --- */
#membersGrid {
  /* Using CSS grid directly inside the row */
  /* Bootstrap handles row g-4, so we adapt columns */
}

/* --- Member Card (The Main Container) --- */
.member-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  padding: 16px;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #f3f4f6;
  overflow: hidden; /* To ensure the before element is clipped */
}

.member-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

/* --- Tri-Color Top Bar --- */
.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  /* Green -> Yellow -> Blue */
  background: linear-gradient(90deg, #16a34a 0%, #16a34a 33%, #fbbf24 33%, #fbbf24 66%, #2563eb 66%, #2563eb 100%);
  z-index: 10;
}

/* --- Image Container (Perfect Portrait) --- */
.member-img-container {
  background: #f3f4f6;
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 4 / 5; /* Professional portrait aspect ratio */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 20px;
}

.member-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* Better for profile headshots */
}

/* On mobile, maintain the aspect ratio instead of using fixed height */
@media (max-width: 576px) {
  .member-img-container {
    height: auto; /* Allow aspect-ratio to dictate height */
    margin-top: 6px;
    margin-bottom: 15px;
  }
}

/* --- Member Info Block --- */
.member-info {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1; /* Pushes contact info to bottom */
}

/* --- Name (Bold, Dark Blue) --- */
.member-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a; /* deep blue */
  margin: 0 0 12px 0;
  line-height: 1.3;
}

/* --- Role Badge (Indigo Pill) --- */
.member-role {
  display: inline-block;
  background-color: #f5f3ff;
  color: #5b21b6;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid #ddd6fe;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  white-space: nowrap;
}

/* --- Contact Link (Phone) --- */
.member-contact {
  margin-top: auto; /* Force to bottom of card info area */
  color: #1d4ed8;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-bottom: 10px;
}

.member-contact i {
  color: #16a34a; /* success green */
  font-size: 1.1rem;
}

.member-contact:hover {
  color: #1e3a8a;
  text-decoration: underline;
}

/* --- Animation items --- */
.member-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .member-name {
    font-size: 1.05rem;
  }
  .member-role {
    font-size: 0.85rem;
    padding: 5px 14px;
  }
  .member-contact {
    font-size: 0.9rem;
  }
  .member-contact i {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .filter-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
  }
  .filter-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
  .member-card {
    padding: 8px;
    border-radius: 8px;
  }
  .member-name {
    font-size: 0.82rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }
  .member-role {
    font-size: 0.65rem;
    padding: 3px 8px;
    margin-bottom: 8px;
  }
  .member-img-container {
    margin-bottom: 10px;
    border-radius: 6px;
  }
  .member-contact {
    font-size: 0.75rem;
    gap: 4px;
    padding-bottom: 4px;
  }
  .member-contact i {
    font-size: 0.8rem;
  }
}