/* Management profile page. The sidebar and content share the existing ICS design tokens. */

.team-detail-page {
  --team-rail-blue: #084A91;
  --team-rail-orange: var(--heading-accent, #EF7303);
  --team-rail-heading: var(--heading-ink, #373737);
  --team-rail-muted: #5F7183;
  --team-rail-line: #DDE4EA;
  --team-rail-surface: #F5F7F9;
  background: #FFFFFF;
  overflow-anchor: none;
}

.team-detail-main {
  min-height: 78vh;
  padding: 0;
}

.team-detail-hero .detail-hero-video {
  object-position: center 52%;
}

.team-detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 286px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(42px, 5vw, 76px);
  width: min(calc(100% - (var(--site-inline-gutter) * 2)), 1440px);
  margin: 0 auto;
  padding: clamp(64px, 5.5vw, 88px) 0 clamp(72px, 7vw, 112px);
  scroll-margin-top: 96px;
}

.team-profile-sidebar {
  position: sticky;
  top: 96px;
  overflow: hidden;
  background: var(--team-rail-surface);
  border: 1px solid var(--team-rail-line);
}

.team-profile-back {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  margin: 0;
  padding: 16px 18px;
  color: var(--team-rail-heading);
  background: #FFFFFF;
  border-bottom: 1px solid var(--team-rail-line);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.team-profile-back:hover,
.team-profile-back:focus-visible {
  color: var(--team-rail-blue);
}

.team-profile-back i {
  color: var(--team-rail-orange);
  font-size: 18px;
}

.team-profile-nav {
  height: 535px;
  overflow: hidden;
}

.team-profile-nav details[open] {
  position: relative;
  height: 100%;
}

.team-profile-nav-title {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  margin: 0;
  padding: 14px 18px;
  color: var(--team-rail-blue);
  background: var(--team-rail-surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  list-style: none;
}

.team-profile-nav-title::-webkit-details-marker {
  display: none;
}

.team-profile-nav-title::after {
  content: "+";
  color: var(--team-rail-blue);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.team-profile-nav details[open] > .team-profile-nav-title::after {
  content: "−";
}

.team-profile-nav-groups {
  position: absolute;
  inset: 0;
  min-height: 0;
  padding: 10px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-color: rgba(8, 74, 145, 0.28) transparent;
  scrollbar-width: thin;
}

.team-profile-nav-groups::-webkit-scrollbar {
  width: 8px;
}

.team-profile-nav-groups::-webkit-scrollbar-thumb {
  background: rgba(8, 74, 145, 0.28);
  border: 2px solid var(--team-rail-surface);
  border-radius: 999px;
}

.team-profile-nav-group {
  padding: 0;
}

.team-profile-nav-group + .team-profile-nav-group {
  padding-top: 3px;
}

.team-profile-nav-group ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.team-profile-nav-group a {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 9px 12px 9px 9px;
  color: var(--team-rail-heading);
  border-left: 3px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.team-profile-nav-group a:hover,
.team-profile-nav-group a:focus-visible {
  color: var(--team-rail-blue);
  background: #FFFFFF;
}

.team-profile-nav-group a[aria-current="page"] {
  color: var(--team-rail-blue);
  background: #FFFFFF;
  border-left-color: var(--team-rail-orange);
}

.team-profile-nav-group strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.team-profile-nav-group span {
  color: var(--team-rail-muted);
  font-size: 12px;
  line-height: 1.45;
}

.team-profile-content {
  min-width: 0;
}

.team-profile-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 240px);
  align-items: start;
  gap: clamp(36px, 4.5vw, 70px);
  padding-bottom: clamp(38px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
}

.team-profile-heading {
  align-self: center;
}

.team-profile-heading h2 {
  display: grid;
  gap: 6px;
  margin: 0;
  color: var(--heading-ink);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.team-profile-name-zh,
.team-profile-name-en {
  display: block;
}

.team-profile-name-zh {
  font-size: clamp(32px, 3vw, 46px);
}

.team-profile-name-en {
  font-size: clamp(28px, 2.4vw, 37px);
  letter-spacing: -0.035em;
}

.team-profile-name-en:only-child {
  font-size: clamp(32px, 3.2vw, 48px);
  letter-spacing: -0.045em;
}

.team-profile-role {
  margin: 16px 0 0;
  color: var(--primary-blue);
  font-size: clamp(17px, 1.3vw, 22px);
  font-weight: 600;
  line-height: 1.4;
}

.team-profile-portrait {
  justify-self: end;
  width: min(100%, 240px);
  margin: 42px 0 0;
  overflow: hidden;
  aspect-ratio: 1 / 1.08;
  background: var(--profile-card-background, #EEF3F8);
  border: 1px solid rgba(8, 74, 145, 0.2);
  box-shadow: 0 18px 44px rgba(8, 42, 78, 0.11);
}

.team-profile-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: var(--profile-object-fit, cover);
  object-position: var(--profile-object-position, center top);
  transform: translateY(var(--profile-image-shift-y, 0%)) scale(var(--profile-image-scale, 1));
}

.team-profile-biography {
  width: min(100%, 920px);
  padding-top: clamp(34px, 3.8vw, 54px);
}

.team-profile-biography p {
  margin: 0;
  color: var(--slate);
  font-size: clamp(16px, 1.12vw, 18px);
  font-weight: 400;
  line-height: 1.9;
  letter-spacing: 0.005em;
}

@media (max-width: 1180px) {
  .team-detail-layout {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .team-profile-sidebar {
    position: static;
  }

  .team-profile-nav {
    height: auto;
  }

  .team-profile-nav details[open] {
    position: static;
    height: auto;
  }

  .team-profile-nav-groups {
    position: static;
    padding: 10px;
    overflow-y: visible;
  }

  .team-profile-portrait {
    margin-top: 0;
  }

  .team-profile-nav-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-profile-nav-group + .team-profile-nav-group {
    padding-top: 0;
  }
}

@media (max-width: 680px) {
  .team-detail-hero {
    min-height: 400px;
  }

  .team-detail-layout {
    width: calc(100% - 40px);
    gap: 38px;
    padding: 56px 0 72px;
  }

  .team-profile-nav-groups {
    grid-template-columns: 1fr;
  }

  .team-profile-nav-group + .team-profile-nav-group {
    padding-top: 3px;
  }

  .team-profile-nav-title {
    display: flex;
    border-bottom: 1px solid var(--team-rail-line);
  }

  .team-profile-nav details:not([open]) .team-profile-nav-title {
    border-bottom: 0;
  }

  .team-profile-header {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .team-profile-heading h2 {
    gap: 6px;
  }

  .team-profile-name-zh {
    font-size: clamp(28px, 8.5vw, 36px);
  }

  .team-profile-name-en {
    font-size: clamp(24px, 7vw, 30px);
  }

  .team-profile-name-en:only-child {
    font-size: clamp(28px, 8.5vw, 36px);
  }

  .team-profile-role {
    margin-top: 12px;
    font-size: 17px;
  }

  .team-profile-portrait {
    justify-self: start;
    width: min(100%, 280px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .team-profile-nav-group a {
    transition: none;
  }
}
