.team-wrapper {
  background-color: white;
}

/* Main Container */
.team-container {
  width: 100%;
  height: auto;
  text-align: center;
  padding: 40px 0;
}

/* Header */
.team-header {
  background-color: color-mix(in srgb, var(--lnu-yellow) 10%, transparent);
  width: 100%;
  padding: 40px 0;
  text-align: center;
}

.team-title {
  font-size: clamp(1.5rem, calc(1.4vw + 1rem), 2.5rem);
  font-weight: bold;
  text-align: center;
  color: var(--lnu-black);
  padding: 0px 20px;
}

.team-description {
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);
  color: var(--lnu-gray);
  margin: 10px 0 0;
  text-align: center;
  padding: 0px 20px;
}

/* Team Member Cards */
.team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.team-header-wrapper--alumni {
  background-color: color-mix(in srgb, var(--lnu-yellow) 6%, var(--lnu-background-shade) 94%);
}

.team-wrapper--alumni {
  background-color: var(--lnu-background-shade);
}

.team-title--alumni {
  color: #2e7d32;
}

.team-description--alumni {
  color: rgba(18, 13, 38, 0.72);
}

.team-members--alumni {
  flex-direction: column;
  align-items: stretch;
}

.team-empty {
  width: 100%;
  margin: 0;
  padding: 40px 0;
  font-size: clamp(0.9rem, calc(0.8vw + 0.4rem), 1.2rem);
  color: rgba(18, 13, 38, 0.7);
  text-align: center;
}

.team-empty--alumni {
  color: rgba(46, 125, 50, 0.9);
}

/* Outer Box (bb) */
.bb {
  width: clamp(220px, 90%, 300px); /* Adjust width for different screen sizes */
  background: white;
  border: 1px solid white;
  border-radius: 16px;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: center;
  height: auto;
  min-height: 400px; /* Maintain baseline size */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.member_image img {
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* Creates a 1:1 aspect ratio (square) */
  object-fit: cover;
  object-position: top;
  display: block;
  border-radius: 16px;
  position: relative;
}

/* Alternative approach using explicit height */
.member_image {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 Aspect Ratio */
  overflow: hidden;
  border-radius: 16px;
}

.member_image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 16px;
}

/* Member Info */
.bb h3 {
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);
  font-weight: bold;
  color: #120d26;
  margin-bottom: auto;
}

.bb p {
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);
  color: var(--lnu-gray);

  /* TODO: this webkit tool might not work with every browser, there must be a better way */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bb q {
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);
  margin-top: auto;
}

.project-button {
  display: inline-block;
  padding: 10px 20px;
  background: var(--lnu-yellow);
  color: var(--lnu-black);
  text-decoration: none;
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);
  font-weight: bold;
  border: none;
  border-radius: 20px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-width: 120px; /* Ensure buttons have a consistent minimum width */
  text-align: center; /* Center-align text */
  touch-action: manipulation; /* Ensures faster response on touch devices */
  -webkit-tap-highlight-color: transparent; /* Removes gray highlight on mobile */
  margin-top: 10px;
}

/* Button Hover Effect */
.project-button:hover {
  transform: translateY(-3px);
  box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.2);
}

/* Press Effect (More Noticeable) */
.project-button:active {
  transform: translateY(6px); /* Move it further down */
  box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.2); /* Reduce shadow for "pressed" effect */
  background: rgba(255, 200, 0, 1); /* Slightly darker yellow */
}

/* Mobile-Specific Press Effect */
@media (hover: none) {
  .project-button:active {
    transform: scale(0.92) translateY(8px); /* Stronger press effect */
    box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3);
  }
}

/* Pop up styles */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

#popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  min-width: clamp(14rem, calc(12vw + 4rem), 18rem);
  max-width: fit-content; /*If the project name is too long, the popup gets elongated*/
  padding: clamp(1rem, calc(0.9vw + 0.8rem), 2rem);
  box-sizing: border-box;
  max-height: object-fit;
  z-index: 200;
  border-radius: 30px;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
}

#popupclose {
  float: right;
  cursor: pointer;
  width: clamp(1.8rem, calc(2vw + 0.4rem), 2.4rem);
  height: 100%;
  margin-left: 10px;
}

#project-links {
  cursor: pointer;
}

.project-title {
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.4rem);
  font-weight: bold;
  color: var(--lnu-black);
  text-align: center;
}

.project-name {
  text-decoration: underline;
  font-size: clamp(0.8rem, calc(1vw + 0.3rem), 1.25rem);

  }

@media only screen and (max-width: 768px) {
  body {
    padding: 0 5px; /* Reduce padding on smaller devices */
  }

  .team-members {
    gap: 10px;
  }

  .bb {
    padding: 15px;
    min-height: 100px;
    width: 40%; /*So far this seemed the best solution to keep the member cards in pairs*/
    margin: 0px 5px;
  }
  
  .project-button {
    padding: 8px 15px; /* Adjust padding for smaller screens */
    min-width: 80px; /* Reduce minimum width */
  }

  .team-container {
    padding: 20px 0px;
  }
  .team-header {
    padding: 20px 0px;
  }
}


/* Horizontal member cards */
.member-card {
  width: 100%;
  display: flex;
  background: white;
  border-radius: 16px;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  overflow: hidden;
}

.member-card--alumni {
  background: #f3f8f2;
  border-left: 6px solid #2e7d32;
  box-shadow: 0px 16px 40px rgba(46, 125, 50, 0.12);
}

.member-card--founder {
  position: relative;
  border-left: 10px solid var(--lnu-yellow);
  padding: 14px 18px;
  gap: 18px;
  align-items: center;
  background: linear-gradient(145deg, rgba(255, 242, 191, 0.85), rgba(255, 255, 255, 0.95));
  box-shadow: 0px 18px 46px rgba(255, 200, 0, 0.22);
}

.member-image {
  flex: 0 0 250px;
  max-width: 250px;
  height: 250px; /* Make it a perfect square */
  overflow: hidden;
  position: relative;
  border-radius: 18px;
}

.member-card--founder .member-image {
  border-right: 4px solid rgba(255, 209, 0, 0.35);
  max-width: 240px;
  height: 240px;
  border-radius: 18px;
}

.member-card--founder .member-image img {
  object-position: top;
}

.member-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
  border-radius: 16px;
}

.member-info {
  flex: 1;
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.member-info__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.member-info .member-info__top h3 {
  margin: 0;
  margin-bottom: 0;
}

.member-info h3 {
  font-size: clamp(1rem, calc(1vw + 0.5rem), 1.5rem);
  margin-top: 0;
  margin-bottom: 10px;
}

.member-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.member-founder-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe24a, #ffd100);
  color: #120d26;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(18, 13, 38, 0.08);
  box-shadow: 0 10px 24px rgba(255, 200, 0, 0.24);
}

.program-info {
  font-size: clamp(0.8rem, calc(0.8vw + 0.3rem), 1.1rem);
  color: var(--lnu-gray);
  margin-bottom: 15px;
}

.member-info q {
  display: block;
  margin: 15px 0;
  font-style: italic;
}

.member-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  background-color: rgba(46, 125, 50, 0.12);
  color: #2e7d32;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

.project-container {
  margin-top: auto;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
  .member-card {
    flex-direction: column;
  }
  
  .member-image {
    flex: 0 0 auto;
    max-width: 100%;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Maintain 1:1 square aspect ratio */
    position: relative;
    overflow: hidden;
  }
  
  .member-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
  }

  .member-card--founder {
    padding: 12px 12px 20px;
    border-left-width: 8px;
  }

  .member-card--founder .member-image {
    max-width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-right: none;
    border-radius: 16px;
  }
  
  .member-info {
    padding: 20px;
  }

  .member-badges {
    margin-left: 0;
  }
  
  /* These cards no longer use the original BB class */
  .team-members .bb {
    display: none;
  }
}
