/* ================================================================
   HLX TEAM SECTION
================================================================ */
.hlx-team-section {
  padding-block: 56px;
  background: var(--clr-bg);
}

/* ── Tabs ── */
.hlx-team-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 40px;
}
.hlx-team-tab {
  padding: 12px 0px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font);
  font-size: calc(15px * var(--a11y-font-scale, 1));
  font-weight: 500;
  color: var(--clr-text);
  cursor: pointer;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color var(--tr), border-color var(--tr);
}
.hlx-team-tab:hover {
  color: #e77727;
}
.hlx-team-tab[aria-selected="true"] {
  color: #e77727;
  border-bottom-color: #e77727;
  font-weight: 600;
}
.hlx-team-tab:focus-visible {
  outline: 2px solid #e77727;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Panel ── */
.hlx-team-panel          { display: none; }
.hlx-team-panel--active  { display: block; }
.hlx-team-panel[hidden]  { display: none !important; }

/* ── Card ── */
.hlx-team-card {
  max-width: 256px;
  width: 100%;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .125);
  padding: 10px;
  border-radius: .25rem;
  background-color: #fff;
  position: relative;
  font-family: var(--font);
  text-align: center;
  transition: box-shadow .2s ease-in-out;
  display: block;
  overflow: hidden;
}
.hlx-team-card:focus-visible {
  outline: 2px solid #e77727;
  outline-offset: 2px;
}

/* Active card */
.hlx-team-card--active {
  border-color: #e77727;
  border-width: 2px;
}

/* Bottom border slide-in on hover */
.hlx-team-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 5px;
  width: 0;
  background: #e77727;
  transition: width .2s ease-in-out;
}
.hlx-team-card:hover::after,
.hlx-team-card--active::after {
  width: 100%;
}

/* ── Image wrap ── */
.hlx-team-card__img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: .15rem;
  background: #f0f0f0;
  aspect-ratio: 3 / 3.5;
}
.hlx-team-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .2s ease-in-out;
}
.hlx-team-card:hover .hlx-team-card__img {
  transform: scale(1.02);
}

/* Orange overlay */
.hlx-team-card__overlay {
  position: absolute;
  inset: 0;
  background: #e77727;
  opacity: 0;
  transition: opacity .2s ease-in-out;
  mix-blend-mode: multiply;
}
.hlx-team-card:hover .hlx-team-card__overlay,
.hlx-team-card--active .hlx-team-card__overlay {
  opacity: 0.55;
}

/* ── Card body ── */
.hlx-team-card__body {
  padding: 12px 4px 8px;
}

/* ── Name ── */
.hlx-team-card__name {
  color: #273b25;
  font-family: Poppins, sans-serif;
  font-size: calc(18px * var(--a11y-font-scale, 1));
  font-weight: 700;
  line-height: 27px;
  margin: 0 0 2px;
}

/* ── Designation ── */
.hlx-team-card__role {
  color: #e77727;
  font-family: Poppins, sans-serif;
  font-size: calc(14px * var(--a11y-font-scale, 1));
  font-weight: 400;
  line-height: 21px;
  margin-bottom: 0;
  margin-top: 0;
}

/* ── Popup ── */
.hlx-team-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.hlx-team-popup.is-open {
  display: flex;
}
.hlx-team-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.hlx-team-popup__box {
  position: relative;
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 960px;
  max-height: 100vh;
  overflow-y: auto;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  animation: popupIn 0.22s ease;
}
@keyframes popupIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
body.pause-animations .hlx-team-popup__box { animation: none; }

/* Close button */
.hlx-team-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--clr-text-muted);
  transition: background var(--tr), color var(--tr), border-color var(--tr);
  z-index: 2;
}
.hlx-team-popup__close:hover {
  background: #e77727;
  color: #fff;
  border-color: #e77727;
}
.hlx-team-popup__close:focus-visible {
  outline: 2px solid #e77727;
  outline-offset: 2px;
}

/* Popup inner */
.hlx-team-popup__inner {
  display: flex;
  gap: 28px;
  padding: 32px;
  align-items: flex-start;
}
.hlx-team-popup__img-col {
  flex-shrink: 0;
}
.hlx-team-popup__img {
  width: 225px;
  height: 225px;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-md);
  display: block;
  background: #f0f0f0;
  border-radius: 1rem;
  border: 2px solid #eee;
}
.hlx-team-popup__content {
  flex: 1;
  min-width: 0;
}
.hlx-team-popup__name {
  color: #273b25;
  font-family: Poppins, sans-serif;
  margin: 0 0 4px;
  line-height: 1.3;
}
.hlx-team-popup__role {
  color: var(--clr-text);
  margin: 0 0 2px;
}
.hlx-team-popup__location {
  color: var(--clr-text-muted);
  margin: 0 0 20px;
}
.hlx-team-popup__bio {
  color: var(--clr-text);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  max-height: 250px; /* adjust as needed */
  padding-right: 8px; /* prevents scrollbar overlapping text */
}
.hlx-team-popup__bio p {
  margin: 0;
}

/* ── Dark Mode ── */
body.dark-mode .hlx-team-section       { background: var(--clr-bg); }
body.dark-mode .hlx-team-tabs          { border-color: var(--clr-border); }
body.dark-mode .hlx-team-tab           { color: var(--clr-text); }
body.dark-mode .hlx-team-card          { background: var(--clr-surface); border-color: rgba(255,255,255,0.125); }
body.dark-mode .hlx-team-card__name    { color: var(--clr-text); }
body.dark-mode .hlx-team-popup__box    { background: var(--clr-surface); }
body.dark-mode .hlx-team-popup__name   { color: var(--clr-text); }
body.dark-mode .hlx-team-popup__role   { color: var(--clr-text); }
body.dark-mode .hlx-team-popup__bio    { color: var(--clr-text); }

/* ── High Contrast ── */
body.high-contrast .hlx-team-card           { background: #000; border: 2px solid #fff; }
body.high-contrast .hlx-team-card__name     { color: #fff; }
body.high-contrast .hlx-team-card__role     { color: #ffcc00; }
body.high-contrast .hlx-team-card::after    { background: #ffcc00; }
body.high-contrast .hlx-team-tab[aria-selected="true"] { color: #ffcc00; border-color: #ffcc00; }
body.high-contrast .hlx-team-popup__box     { background: #000; border: 2px solid #fff; }
body.high-contrast .hlx-team-popup__name    { color: #fff; }
body.high-contrast .hlx-team-popup__role    { color: #ffcc00; }
body.high-contrast .hlx-team-popup__bio     { color: #fff; }

/* ── Responsive ── */
@media (max-width: 767px) {
  .hlx-team-section          { padding-block: 36px; }
  .hlx-team-card             { max-width: 100%; }
  .hlx-team-popup__inner     { flex-direction: column; padding: 24px 16px; gap: 16px; }
  .hlx-team-popup__img       { width: 100%; height: 220px; }
  .hlx-team-tabs             { flex-wrap: nowrap; }
  .hlx-team-popup__box { max-width: 860px; max-height: 96vh; }