.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  padding: 0 15px;
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 100%;
}

.team-card {
  width: 100%;
  max-width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  text-align: center;
  position: relative;
  margin: 20px auto;
  box-sizing: border-box;
}

.team-image-box {
  position: relative;
}

.team-image-box img {
  width: 100%;
  display: block;
}

.read-more-btn {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #781c1c;
  color: #fff;
  padding: 6px 14px;
  font-size: 13px;
  
  font-weight: 600;
  display: none;
  cursor: pointer;
  border: none;
}

.team-image-box:hover .read-more-btn {
  display: block;
}

.team-info {
  padding: 15px 10px 20px;
}

.team-name {
  font-size: 20px;
  font-weight: bold;
  color: #781c1c;
  margin: 10px 0 4px;
  text-transform: uppercase;
}

.team-position {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Popup styles */
.team-popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: #fff;
  max-width: 1000px;
  width: 90%;
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  position: relative;
  border-radius: 12px;
}

.popup-image {
  flex: 1 1 40%;
  padding-right: 20px;
}

.popup-image img {
  width: 100%;
  border-radius: 8px;
}

.popup-details {
  flex: 1 1 60%;
}

.popup-details h3 {
  color: #781c1c;
  margin-bottom: 10px;
}

.popup-position {
  font-weight: 600;
  margin-bottom: 10px;
}

.popup-description {
  color: #444;
  line-height: 1.5;
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
  font-weight: bold;
}
/* Make popup scrollable on small screens */
@media (max-width: 768px) {
  .team-popup {
    align-items: flex-start;
    overflow-y: auto;
    padding: 30px 10px;
  }

  .popup-content {
    flex-direction: column;
    max-height: unset;
    height: auto;
    margin: auto;
  }

  .popup-image {
    width: 100%;
    padding: 0 0 20px 0;
  }

  .popup-details {
    width: 100%;
  }
}
