/* =========================
   TEAM GRID BASE
   ========================= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  transition: opacity 0.4s ease;
}

.team-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.4s ease;
  text-align: center;
  opacity: 0;
  transform: translateY(10px);
}

.team-card.show {
  opacity: 1;
  transform: translateY(0);
}

.team-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

/* =========================
   TEAM CARD CONTENT
   ========================= */
.team-image-wrap {
  position: relative;
  background-color: #f5f5f5;
  height: 280px;
  overflow: hidden;
}

.team-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.team-card:hover .team-image-wrap img {
	transition: transform 0.3s ease;
}

.team-text {
  position: relative;
  padding: 18px 10%;
  line-height: 1.3;
	text-align:left;
}

.team-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--perfect-black);
  margin: 0;
}

.team-role {
  font-size: 14px;
  color: var(--perfect-black);
  margin: 0;
}

/* =========================
   TEAM MODAL
   ========================= */
#team-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

#team-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#team-modal .team-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

#team-modal .team-dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  z-index: 2;
  width: 90%;
  max-width: 560px;
  margin: 5vh auto;
  text-align: center;
  line-height: 1.4;
}

#team-modal .team-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 28px;
  color: #222;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
  transition: color 0.2s ease;
}

#team-modal .team-close:hover {
  color: var(--perfect-blue);
}

/* =========================
   MODAL CONTENT
   ========================= */
.team-modal-details{
	padding: 10px 58px 20px;
	text-align:left;
}

.team-modal-image-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.team-modal-image {
  display: block;
  object-fit: cover;
  border-radius: 12px 12px 0 0 !important;
  aspect-ratio: 4 / 3;
  position: relative;
  z-index: 2;
}


.team-modal-name {
  font-size: 20px;
  margin: 0;
  font-weight: 500;
  color: var(--perfect-black);
  padding-bottom:0;
}

.team-modal-title {
  font-size: 16px;
  color: var(--perfect-black);
  margin: 4px 0;
}

.team-modal-desc {
  font-size: 15px;
  color: var(--perfect-black);
  line-height: 1.55;
  margin: 0 auto 20px;
  overflow-y: auto;
}



/* =========================
   MODAL ARROWS
   ========================= */
.team-modal-arrows {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
}

.team-modal-arrows button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999;
}

.team-modal-arrows img{
	width: 24px;
    height: auto;
    opacity: 0.8;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.4));
    transition: opacity 0.2s 
ease, transform 0.2s 
ease;
}

.team-prev {
  left: -80px;
}

.team-next {
  right: -80px;
}


.team-modal-arrows button:hover {
  opacity: 0.8;
}

.team-modal-open {
  overflow: hidden !important;
  height: 100%;
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes teamFadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#team-modal.active .team-dialog {
  animation: teamFadeUp 0.35s ease forwards;
}

.team-image-wrap img.loaded {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.team-image-wrap img:not(.loaded) {
  opacity: 0;
}

/* =========================
   RESPONSIVE
   ========================= */
@media only screen and (max-width: 800px) {
  #team-modal .team-dialog {
    margin-left: 30px;
    margin-right: 30px;
  }
.team-prev {
  left: -30px;
}

.team-next {
  right: -30px;
}
}


@media only screen and (max-width: 580px) {
  .team-modal-name {
    font-size: 18px;
  }

  .team-modal-title {
    font-size: 14px;
  }

  .team-modal-desc {
    font-size: 14px;
  }
	
	#team-modal .team-close{
		right:0;
	}
	.team-modal-details{
	padding: 10px 30px;
}
	.team-modal-desc {
	max-height:250px;
	}
}