/* =========================================================
   TEAM GRID FINAL FIX
   Load this file last. It repairs Doctors / Medical Team cards.
   ========================================================= */

body .doctors-section .team-grid,
body .management-section .team-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 28px 0 0 !important;
  padding: 0 !important;
  align-items: stretch !important;
}

body .doctors-section .team-card,
body .management-section .team-card {
  position: relative !important;
  isolation: isolate !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 290px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 30px !important;
  border: 1px solid rgba(8, 120, 164, 0.10) !important;
  border-radius: 30px !important;
  overflow: hidden !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(241,250,253,.92)) !important;
  box-shadow:
    0 24px 70px rgba(13, 86, 117, 0.11),
    inset 0 1px 0 rgba(255,255,255,.96) !important;
  transform:
    perspective(900px)
    rotateX(var(--tilt-x, 0deg))
    rotateY(var(--tilt-y, 0deg)) !important;
  transition:
    transform .24s ease,
    box-shadow .28s ease,
    border-color .28s ease,
    background .28s ease !important;
}

body .doctors-section .team-card::before,
body .management-section .team-card::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  right: -80px !important;
  top: -80px !important;
  width: 210px !important;
  height: 210px !important;
  border-radius: 50% !important;
  background:
    radial-gradient(circle, rgba(19,183,165,.20), rgba(8,120,164,.06) 55%, transparent 72%) !important;
  pointer-events: none !important;
}

body .doctors-section .team-card::after,
body .management-section .team-card::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: 5px !important;
  background: linear-gradient(90deg, #0878a4, #13b7a5) !important;
  transform: scaleX(0) !important;
  transform-origin: left !important;
  transition: transform .32s ease !important;
}

body .doctors-section .team-card:hover,
body .management-section .team-card:hover {
  border-color: rgba(8, 120, 164, 0.18) !important;
  box-shadow:
    0 34px 100px rgba(13, 86, 117, 0.18),
    inset 0 1px 0 rgba(255,255,255,.96) !important;
}

body .doctors-section .team-card:hover::after,
body .management-section .team-card:hover::after {
  transform: scaleX(1) !important;
}

body .doctors-section .team-card .avatar,
body .management-section .team-card .avatar {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 auto !important;
  width: 68px !important;
  height: 68px !important;
  margin: 0 0 24px !important;
  padding: 0 !important;
  border-radius: 24px !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #0878a4, #13b7a5) !important;
  box-shadow: 0 16px 38px rgba(8,120,164,.24) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 16px !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body .doctors-section .team-card h3,
body .management-section .team-card h3 {
  display: block !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #16323f !important;
  font-size: 23px !important;
  line-height: 1.14 !important;
  letter-spacing: -0.035em !important;
  font-weight: 900 !important;
}

body .doctors-section .team-card p,
body .management-section .team-card p {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #637986 !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  font-weight: 500 !important;
}

body .doctors-section .team-card.visible,
body .management-section .team-card.visible {
  opacity: 1 !important;
  filter: blur(0) !important;
}

/* Add optional small role label for visual completion */
body .doctors-section .team-card .avatar::after,
body .management-section .team-card .avatar::after {
  content: "" !important;
}

/* Make sure the section below has enough spacing after team cards */
body .doctors-section {
  padding-bottom: 108px !important;
}

@media (max-width: 980px) {
  body .doctors-section .team-grid,
  body .management-section .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 700px) {
  body .doctors-section .team-grid,
  body .management-section .team-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body .doctors-section .team-card,
  body .management-section .team-card {
    min-height: auto !important;
    padding: 26px !important;
    border-radius: 26px !important;
  }

  body .doctors-section .team-card .avatar,
  body .management-section .team-card .avatar {
    width: 58px !important;
    height: 58px !important;
    border-radius: 20px !important;
    font-size: 14px !important;
  }
}


/* =========================================================
   V16 Team Card Icon Balance Fix
   Make the team icon and title feel balanced in the same row.
   ========================================================= */

body .doctors-section .team-card,
body .management-section .team-card {
  display: grid !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
  grid-template-rows: auto 1fr !important;
  column-gap: 18px !important;
  row-gap: 18px !important;
  align-items: start !important;
  min-height: 260px !important;
  padding: 32px !important;
}

body .doctors-section .team-card .avatar,
body .management-section .team-card .avatar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  justify-self: start !important;
  width: 64px !important;
  height: 64px !important;
  min-width: 64px !important;
  min-height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

body .doctors-section .team-card h3,
body .management-section .team-card h3 {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 22px !important;
  line-height: 1.18 !important;
  letter-spacing: -0.035em !important;
}

body .doctors-section .team-card p,
body .management-section .team-card p {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  margin: 0 !important;
  padding-top: 6px !important;
  max-width: 94% !important;
  font-size: 15px !important;
  line-height: 1.72 !important;
}

/* Add a soft divider between card header and description */
body .doctors-section .team-card p::before,
body .management-section .team-card p::before {
  content: "" !important;
  display: block !important;
  width: 72px !important;
  height: 3px !important;
  margin: 0 0 18px !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, #0878a4, #13b7a5) !important;
}

/* More balanced hover scale without making the icon jump */
body .doctors-section .team-card:hover .avatar,
body .management-section .team-card:hover .avatar {
  transform: translateY(-2px) !important;
  box-shadow:
    0 20px 48px rgba(8,120,164,.28),
    inset 0 1px 0 rgba(255,255,255,.18) !important;
}

/* Tablet: keep row layout but reduce spacing */
@media (max-width: 980px) {
  body .doctors-section .team-card,
  body .management-section .team-card {
    grid-template-columns: 66px minmax(0, 1fr) !important;
    column-gap: 16px !important;
    padding: 28px !important;
  }

  body .doctors-section .team-card .avatar,
  body .management-section .team-card .avatar {
    width: 58px !important;
    height: 58px !important;
    min-width: 58px !important;
    min-height: 58px !important;
    max-width: 58px !important;
    max-height: 58px !important;
    border-radius: 20px !important;
  }
}

/* Mobile: center the icon and content for a cleaner stacked card */
@media (max-width: 700px) {
  body .doctors-section .team-card,
  body .management-section .team-card {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    text-align: center !important;
    justify-items: center !important;
    row-gap: 14px !important;
  }

  body .doctors-section .team-card .avatar,
  body .management-section .team-card .avatar {
    grid-column: 1 !important;
    grid-row: 1 !important;
    justify-self: center !important;
  }

  body .doctors-section .team-card h3,
  body .management-section .team-card h3 {
    grid-column: 1 !important;
    grid-row: 2 !important;
    text-align: center !important;
  }

  body .doctors-section .team-card p,
  body .management-section .team-card p {
    grid-column: 1 !important;
    grid-row: 3 !important;
    max-width: 100% !important;
    text-align: center !important;
  }

  body .doctors-section .team-card p::before,
  body .management-section .team-card p::before {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
