/*
 * About Page - Team Section
 * Pixel-perfect styling from Figma design
 *
 * @package Sanjeevani
 */

.about-team {
  position: relative;
  padding: 80px 0 80px;
  background: #ffffff;
  overflow: visible;
}

.about-team__container {
  position: relative;
  max-width: 1370px;
  margin: 0 auto;
  padding: 0 24px;
  z-index: 1;
}

/* Decorative blur elements */
.about-team__blur {
  position: absolute;
  border-radius: 144px;
  filter: blur(200px);
  pointer-events: none;
}

.about-team__blur--left {
  left: -0.6px;
  top: calc(50% - 133px);
  width: 141px;
  height: 267px;
  background: #3574cf;
}

.about-team__blur--right {
  right: 0;
  top: calc(50% + 30px);
  width: 101px;
  height: 192px;
  background: #3574cf;
  transform: rotate(90deg);
}

.about-team__blur--center {
  left: 50%;
  bottom: 80px;
  width: 100px;
  height: 189px;
  background: #3574cf;
  transform: translateX(-50%);
}

/* Header */
.about-team__header {
  text-align: center;
  margin-bottom: 80px;
  padding-bottom: 40px;
}

.about-team__title {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 60px;
  line-height: 70px;
  color: #020817;
  margin: 0 0 32px;
}

.about-team__title-highlight {
  color: #00b894;
  position: relative;
}

/* Place the underline directly under the highlighted word "Mission" */
.about-team__title-highlight::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -5px;
  width: 222px;
  height: 11px;
  background: url('../../images/about/team-mission-underline.svg') no-repeat center / contain;
  pointer-events: none;
}

.about-team__title-underline img {
  display: block;
  width: 222px;
  height: 11px;
}

.about-team__description {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 28px;
  color: rgba(0, 0, 0, 0.7);
  max-width: 828px;
  margin: 0 auto;
}

/* Team Grid */
.about-team__grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Control spacing around the horizontal divider line */
  --team-gap-above-line: 44px;
  /* space above the line (from previous row) */
  --team-gap-below-line: 92px;
  /* increased space below the line (to next row) */
}

.about-team__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* spacing between member cards */
  --team-col-gap: 52px;
  /* add space between cards and vertical separators */
  column-gap: var(--team-col-gap);
  align-items: start;
  position: relative;
  /* track width used to position divider lines at the center of gaps */
  --team-track: calc((100% - (2 * var(--team-col-gap))) / 3);
}

/* Draw vertical dividers between the 3 columns using pseudo-elements */
.about-team__row::before,
.about-team__row::after {
  content: '';
  position: absolute;
  /* Default: only cover avatar overlap on the top of each row */
  top: -60px;
  /* extend down into the (top) gap so it meets the horizontal divider */
  bottom: calc(-1 * var(--team-gap-above-line));
  width: 1px;
  background: #e2e8f0;
  pointer-events: none;
  z-index: 2;
}

/* For rows that come AFTER a horizontal divider, extend up to meet that divider too */
.about-team__divider--horizontal+.about-team__row::before,
.about-team__divider--horizontal+.about-team__row::after {
  top: calc(-1 * max(var(--team-gap-below-line), 60px));
}

/* Do not extend the vertical separator below the last row */
.about-team__grid>.about-team__row:last-of-type::before,
.about-team__grid>.about-team__row:last-of-type::after {
  bottom: 0;
}

.about-team__row::before {
  /* first divider: after column 1, centered in the gap */
  left: calc(var(--team-track) + (var(--team-col-gap) / 2));
}

.about-team__row::after {
  /* second divider: after column 2, centered in the gap */
  left: calc((2 * var(--team-track)) + (3 * var(--team-col-gap) / 2));
}

.about-team__member {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 64px 32px 32px;
  text-align: center;
  position: relative;
  min-height: 247px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.about-team__avatar {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 120px;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  overflow: hidden;
}

.about-team__avatar-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #00b894 0%, #00614e 100%);
}

.about-team__avatar-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../../images/about/team-avatar-bg.png') no-repeat center / contain;
  opacity: 1;
}

.about-team__avatar-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 1;
}

.about-team__member-name {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  color: #020817;
  margin: 0 0 8px;
}

.about-team__member-role {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  font-size: 15px;
  line-height: 20px;
  color: #64748b;
  margin: 0 0 16px;
}

.about-team__member-bio {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 26px;
  color: #64748b;
  text-align: center;
  max-width: 338px;
  margin: 0;
}

/* Dividers */
.about-team__divider {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-team__divider--vertical {
  display: none !important;
  /* replaced with pseudo-lines on the row */
}

.about-team__divider--vertical img {
  display: none;
}

.about-team__divider--horizontal {
  grid-column: 1 / -1;
  height: 1px;
  /* separate control for space above (from previous row) and below (to next row) */
  margin: var(--team-gap-above-line) 0 var(--team-gap-below-line);
}

.about-team__divider--horizontal img {
  width: 100%;
  height: 1px;
  display: block;
}

/* Responsive */
@media (max-width: 1400px) {
  .about-team__row {
    grid-template-columns: 1fr;
    gap: 80px;
  }

  /* Hide vertical pseudo-lines on stacked layout */
  .about-team__row::before,
  .about-team__row::after {
    display: none;
    content: none;
  }

  .about-team__divider--vertical {
    display: none;
  }

  .about-team__divider--horizontal {
    display: none;
  }
}

@media (max-width: 768px) {
  .about-team {
    padding: 20px 0 20px;
  }

  .about-team__title {
    font-size: 42px;
    line-height: 52px;
    margin: 0 0 20px;
    /* reduce bottom margin on mobile */
  }

  .about-team__description {
    font-size: 16px;
    line-height: 26px;
  }

  .about-team__header {
    margin-bottom: 60px;
  }

  .about-team__row {
    gap: 80px;
    /* increased spacing between member cards on mobile */
  }

  /* Add extra top padding to the second row (the row after the horizontal divider) */
  .about-team__divider--horizontal+.about-team__row {
    padding-top: 80px;
  }

  /* Add top padding to the first row as well on mobile */
  .about-team__grid>.about-team__row:first-of-type {
    padding-top: 20px;
  }

  /* Scale underline under Mission on tablets */
  .about-team__title-highlight::after {
    /* Hide underline on mobile as requested */
    display: none !important;
    content: none !important;
  }

  /* Hide background blur decor on tablets */
  .about-team__blur {
    display: none !important;
  }
}

@media (max-width: 480px) {

  /* Ensure compact vertical padding on small phones */
  .about-team {
    padding: 20px 0 20px;
  }

  .about-team__title {
    font-size: 32px;
    line-height: 40px;
  }

  .about-team__member {
    padding: 64px 20px 24px;
  }

  /* Scale underline under Mission on small phones */
  .about-team__title-highlight::after {
    bottom: -12px;
    width: 150px;
    height: 8px;
  }

  /* Tighten header spacing */
  .about-team__header {
    margin-bottom: 10px;
    padding-bottom: 20px;
  }

  .about-team__grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 60px 0;
    align-items: stretch;
  }

  .about-team__grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Flatten rows so members become flex items */
  .about-team__row {
    display: contents !important;
  }

  /* Each member acts as a slide */
  .about-team__member {
    flex: 0 0 90%;
    max-width: 90%;
    scroll-snap-align: start;
    min-width: 0;
  }

  /* Hide decorative dividers/lines on slider */
  .about-team__row::before,
  .about-team__row::after,
  .about-team__divider {
    display: none !important;
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-team__blur {
    filter: none;
  }
}

/* Mobile slider for About Team (append at end to override earlier layouts) */
@media (max-width: 768px) {
  .about-team__grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding: 60px 0;
    align-items: stretch;
  }

  .about-team__grid::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Flatten rows so members become flex items */
  .about-team__row {
    display: contents !important;
  }

  /* Each member acts as a slide */
  .about-team__member {
    flex: 0 0 90%;
    max-width: 90%;
    scroll-snap-align: start;
    min-width: 0;
  }

  /* Hide decorative dividers/lines on slider */
  .about-team__row::before,
  .about-team__row::after,
  .about-team__divider {
    display: none !important;
    content: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-team__blur {
    filter: none;
  }
}