/* =================================
   Meet Our Team Section
   ================================= */

.meet-team-section-header {
  margin-bottom: var(--space-21);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-13);
}

.meet-team-section-cta {
  display: inline-flex;
  justify-content: center;
  margin-top: var(--space-11);
}

/* =================================
   Grid — 1 col mobile, 2 col desktop
   ================================= */

.meet-team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-13);
}

@media (min-width: 992px) {
  .meet-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Lone last card: centred at half width */
  .meet-team-grid > .meet-team-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 50%;
    margin-inline: auto;
  }
}

/* =================================
   Card shell
   ================================= */

.meet-team-card {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--bs-primary-100);
}

/* =================================
   COLLAPSED VIEW
   Desktop: flex row, bio visible
   Mobile:  flex row, bio hidden, button shown
   ================================= */

.meet-team-collapsed-view {
  display: flex;
  flex-direction: row;
  height: 100%;
}

/* =================================
   Info panel (left side of collapsed)
   ================================= */

.meet-team-info-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--space-11);
  background: var(--bs-primary-100);
  border-right: 1px solid var(--bs-success);
  border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
}

@media (min-width: 576px) {
  .meet-team-info-panel {
    padding: var(--space-13);
  }
}

.meet-team-info-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
  height: 100%;
}

/* Name + designation */
.meet-team-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.meet-team-name {
  margin: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  color: var(--bs-primary-700);
  line-height: var(--line-height-heading);
}

@media (min-width: 992px) {
  .meet-team-name {
    font-size: var(--font-size-3xl);
  }
}

.meet-team-designation {
  margin: 0;
  font-size: var(--font-size-xs);
  font-weight: 400;
  color: var(--bs-primary-700);
  font-family: var(--font-family-mono);
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (min-width: 992px) {
  .meet-team-designation {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-regular);
  }
}

/* Green rule under designation */
.meet-team-designation::after {
  content: "";
  width: 6rem;
  height: 1.5px;
  background: var(--bs-success);
}

/* =================================
   Bio content inside collapsed view
   Desktop: always visible
   Mobile:  hidden (button triggers expanded view instead)
   ================================= */

.meet-team-collapsed-view .meet-team-bio-content {
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--bs-primary-700);
  /* Desktop: shown */
  display: block;
}

@media (max-width: 575.98px) {
  /* Mobile: hide bio inside collapsed view */
  .meet-team-collapsed-view .meet-team-bio-content {
    display: none;
  }
}

/* =================================
   Read Bio button — mobile only
   ================================= */

.meet-team-read-bio-btn {
  /* Hidden on desktop */
  display: none;
}

@media (max-width: 575.98px) {
  .meet-team-read-bio-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;
    /* push to bottom of info panel */
    padding: 0;
    background: none;
    border: none;
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--bs-primary-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: color var(--transition-base);
  }

  .meet-team-read-bio-btn:hover {
    color: var(--bs-primary-800);
  }

  .meet-team-read-bio-btn svg {
    width: 1.0625rem;
    height: 1.0625rem;
    flex-shrink: 0;
    transition: transform var(--transition-base);
  }

  .meet-team-read-bio-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
}

/* =================================
   Image panel (right side of collapsed)
   ================================= */

.meet-team-image-panel {
  width: 10rem;
  flex-shrink: 0;
  background: var(--neutral-50);
  border-radius: 0 var(--radius-2xl) var(--radius-2xl) 0;
  overflow: hidden;
  display: flex;
}

@media (min-width: 576px) {
  .meet-team-image-panel {
    width: 15rem;
  }
}

.meet-team-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.meet-team-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center bottom;
}

@media (min-width: 576px) {
  .meet-team-image {
    max-width: 12.75rem;
    max-height: 14rem;
  }
}

/* =================================
   EXPANDED VIEW  (mobile only)
   Full-width card, no image, close button top-right
   Hidden by default via [hidden] attribute (set in PHP)
   ================================= */

.meet-team-expanded-view {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
  padding: var(--space-11);
  background: var(--bs-primary-100);
  border-radius: var(--radius-2xl);
  width: 100%;
}

/* Close button — top-right corner */
.meet-team-close-btn {
  position: absolute;
  top: var(--space-9);
  right: var(--space-9);
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bs-primary-700);
  line-height: 1;
  transition: color var(--transition-base);
}

.meet-team-close-btn:hover {
  color: var(--bs-primary-800);
}

.meet-team-close-btn svg {
  width: 1.0625rem;
  height: 1.0625rem;
  display: block;
}

/* Bio inside expanded view */
.meet-team-expanded-view .meet-team-bio-content {
  font-weight: 400;
  line-height: var(--line-height-body);
  color: var(--bs-primary-700);
}

/* On desktop the expanded view should never show
   (JS only opens it when isMobile() is true, but belt-and-braces) */
@media (min-width: 576px) {
  .meet-team-expanded-view {
    display: none !important;
  }
}

/* =================================
   Accessibility
   ================================= */

@media (prefers-reduced-motion: reduce) {
  .meet-team-read-bio-btn svg,
  .meet-team-close-btn svg {
    transition: none;
  }
}

@media (max-width: 991px) {
  .meet-team-section-header {
    margin-bottom: 0;
    align-items: start;
  }
}

@media (max-width: 767px) {
  .meet-team-section-header {
    gap: 0;
  }

  .meet-team-bio-content.text-description {
    margin-top: 20px;
  }
}

@media (max-width: 575px) {
  .meet-team-grid {
    gap: 16px;
  }

  .meet-team-parent {
    /* height: 500px; */
    overflow: hidden;
  }

  .meet-team-parent {
    position: relative;
  }

  .meet-team-parent:before {
    background: linear-gradient(0deg, #0f2c2b 19.17%, rgba(15, 44, 43, 0) 100%);
    height: 250px;
    left: -20px;
    right: -20px;
    content: "";
    position: absolute;
    bottom: -20px;
    z-index: 1;
  }

  /* .meet-team-parent:before {
    background: linear-gradient(
      0deg,
      #0f2c2b 19.17%,
      rgba(15, 44, 43, 0) 483.33%
    );
    height: 80px;
    left: -20px;
    right: -20px;
    content: "";
    position: absolute;
    bottom: -20px;
    z-index: 1;
  } */
  .meet-team-section .btn {
    border-radius: 50px;
    justify-self: center;
    max-width: 135px;
    margin: -16px auto 0;
    display: block;
  }

  .meet-team-section .btn svg {
    transform: rotate(90deg);
    transition: all 0.5s ease;
  }

  .meet-team-section .btn {
    border-color: #fff !important;
    color: #fff !important;
    background-color: transparent !important;
    padding-right: 32px;
    text-align: left;
    z-index: 1;
  }

  .meet-team-section .btn:after {
    background-image: url(../../images/expand_more.svg);
    height: 10px;
    width: 12px;
    content: "";
    display: inline-block;
    filter: invert(1);
    background-position: center;
    margin-left: 8px;
    position: absolute;
    top: 14px;
  }

  .meet-team-section .btn .chev {
    display: none;
  }

  .meet-team-parent.expanded::before {
    display: none;
  }

  .meet-team-parent.expanded ~ .btn {
    margin-top: 20px;
    max-width: 145px;
  }

  .meet-team-parent.expanded ~ .btn:after {
    transform: rotate(-180deg);
  }

  .meet-team-info-panel {
    padding: 12px;
  }

  .meet-team-name {
    font-weight: 700;
    font-size: 20px;
  }

  .meet-team-designation {
    font-size: 12px;
    gap: 10px;
  }

  .meet-team-read-bio-btn {
    font-size: 14px;
  }

  .meet-team-image-panel {
    width: 131px;
    height: 133px;
  }

  .meet-team-info-content {
    gap: 10px;
  }

  .meet-team-card-header {
    gap: 4px;
  }

  .meet-team-designation::after {
    width: 50px;
  }
}
