/* ==========================================================================
   Our Team: /our-team/
   Builds on services.css (hero, breadcrumb, CTA band), about-pages.css
   (screen-reader-text) and the tokens in style.css.
   London = purple, Glasgow = orange, both offices = navy (same as Locations).
   ========================================================================== */

.usp-team-page,
.usp-team-hero,
.usp-team-lead-section,
.usp-team-directory,
.usp-team-offices {
  --london: var(--purple);
  --london-soft: var(--purple-light);
  --glasgow: var(--orange-dark);
  --glasgow-soft: var(--orange-light);
}

/* ---------- Avatars (photo or initials) ---------- */
.usp-avatar {
  --av: 56px;
  position: relative;
  flex-shrink: 0;
  width: var(--av);
  height: var(--av);
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: var(--white);
}
.usp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.usp-avatar.is-initials {
  background: linear-gradient(140deg, var(--navy-soft), var(--navy));
}
.usp-avatar--london.is-initials {
  background: linear-gradient(140deg, #7a4aa8, var(--purple-dark));
}
.usp-avatar--glasgow.is-initials {
  background: linear-gradient(140deg, var(--orange), var(--orange-dark));
}
.usp-avatar__initials {
  font-family: var(--usp-font-display);
  font-weight: 700;
  font-size: calc(var(--av) * 0.36);
  letter-spacing: 0.02em;
  line-height: 1;
}
.usp-avatar--xs {
  --av: 34px;
  border: 2px solid var(--white);
}
.usp-avatar--sm {
  --av: 42px;
}
.usp-avatar--lg {
  --av: 76px;
}
.usp-avatar--xl {
  --av: clamp(140px, 16vw, 200px);
  box-shadow:
    0 0 0 8px var(--white),
    0 0 0 9px var(--purple-light),
    var(--shadow-lg);
}

.usp-avatar-stack {
  display: inline-flex;
}
.usp-avatar-stack .usp-avatar + .usp-avatar {
  margin-left: -6px;
}

/* ---------- Office colour dot + tag ---------- */
.usp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  background: var(--navy);
}
.usp-dot--london {
  background: var(--london);
}
.usp-dot--glasgow {
  background: var(--orange);
}

.usp-office-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px 5px 8px;
  border-radius: var(--r-sm);
  color: var(--navy);
  background: var(--tint);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.usp-office-tag svg {
  width: 14px;
  height: 14px;
}
.usp-office-tag--london {
  color: var(--london);
  background: var(--purple-soft);
  border-color: var(--london-soft);
}
.usp-office-tag--glasgow {
  color: var(--glasgow);
  background: #fff7ed;
  border-color: var(--glasgow-soft);
}

.usp-team-dept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.usp-team-dept::before {
  content: "";
  width: 16px;
  height: 2px;
  background: var(--orange);
}

/* ---------- Hero: team at a glance ---------- */
.usp-team-glance {
  background: var(--white);
  border: 1px solid var(--purple-light);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 3vw, 34px);
  position: relative;
  overflow: hidden;
}
.usp-team-glance::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--purple) 0 50%,
    var(--orange) 50% 100%
  );
}
.usp-team-glance__head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--neutral);
}
.usp-team-glance__num {
  font-family: var(--usp-font-display);
  font-size: clamp(3rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--purple-dark);
}
.usp-team-glance__label {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--navy);
}
.usp-team-glance__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.usp-team-glance__row {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--neutral);
  text-decoration: none;
  color: var(--navy);
  transition: padding var(--dur-s) var(--ease);
}
.usp-team-glance__row > svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition:
    transform var(--dur-s) var(--ease),
    color var(--dur-s) var(--ease);
}
.usp-team-glance__row:hover > svg {
  transform: translateX(3px);
  color: var(--orange);
}
.usp-team-glance__city {
  display: flex;
  align-items: center;
  gap: 10px;
}
.usp-team-glance__city strong {
  font-size: 1.05rem;
}
.usp-team-glance__city small {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.usp-team-glance__note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.usp-team-glance__note svg {
  width: 16px;
  height: 16px;
  color: var(--orange);
  flex-shrink: 0;
}

/* ---------- Leadership profile ---------- */
.usp-team-lead-section .usp-section__head {
  margin-bottom: clamp(24px, 3vw, 36px);
}
.usp-team-lead {
  display: grid;
  grid-template-columns: auto 1fr 300px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: clamp(28px, 4vw, 48px);
  box-shadow: var(--shadow-md);
  position: relative;
}
.usp-team-lead::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--orange);
}
.usp-team-lead__media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.usp-team-lead__body h3 {
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  color: var(--purple-dark);
  margin: 4px 0 4px;
}
.usp-team-lead__role {
  margin: 0 0 18px;
  font-weight: 600;
  color: var(--orange-dark);
}
.usp-team-lead__body p:not(.usp-team-lead__role) {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.7;
}
.usp-team-lead__facts {
  list-style: none;
  margin: 0;
  padding: 22px;
  display: grid;
  gap: 14px;
  background: var(--purple-soft);
  border-radius: var(--r-sm);
  border: 1px solid var(--purple-light);
}
.usp-team-lead__facts li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--navy);
  font-weight: 500;
}
.usp-team-lead__facts svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
  margin-top: 1px;
}

/* ---------- Directory ---------- */
.usp-team-directory {
  background: var(--purple-soft);
  border-top: 1px solid var(--purple-light);
  border-bottom: 1px solid var(--purple-light);
}
.usp-team-directory__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.usp-team-directory__head h2 {
  color: var(--purple);
}

.usp-team-filter {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--purple-light);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}
.usp-team-filter__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 6px 0 8px;
}
.usp-team-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition:
    background var(--dur-s) var(--ease),
    color var(--dur-s) var(--ease);
}
.usp-team-filter__btn:hover {
  background: var(--purple-soft);
}
.usp-team-filter__btn[aria-pressed="true"] {
  background: var(--purple);
  color: var(--white);
}
.usp-team-filter__btn[aria-pressed="true"] .usp-dot {
  box-shadow: 0 0 0 2px var(--white);
}
.usp-team-filter__count {
  font-size: 0.76rem;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 20px;
  background: var(--neutral);
  color: var(--navy);
  text-align: center;
}
.usp-team-filter__btn[aria-pressed="true"] .usp-team-filter__count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}
.usp-team-filter__btn:focus-visible,
.usp-person__toggle:focus-visible,
.usp-team-glance__row:focus-visible,
.usp-office-card__link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.usp-team-people {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.usp-person[hidden] {
  display: none;
}
.usp-person article {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--purple-light);
  border-radius: var(--r-sm);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition:
    transform var(--dur-s) var(--ease),
    box-shadow var(--dur-s) var(--ease);
}
.usp-person article::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 3px;
  background: var(--navy);
}
.usp-person[data-office="london"] article::before {
  background: var(--london);
}
.usp-person[data-office="glasgow"] article::before {
  background: var(--orange);
}
.usp-person article:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.usp-person__top {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.usp-person h3 {
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--navy);
  margin: 8px 0 4px;
}
.usp-person__role {
  margin: 0 0 14px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--orange-dark);
}
.usp-person__summary,
.usp-person__bio p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.usp-person__bio {
  margin-top: 10px;
}
.usp-person.is-open .usp-person__summary {
  display: none;
}
.usp-person.is-open .usp-person__bio {
  margin-top: 0;
}
.usp-person__toggle {
  margin-top: auto;
  padding: 16px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--purple);
  cursor: pointer;
}
.usp-person__toggle:hover {
  color: var(--orange-dark);
}
.usp-person__toggle .chevron {
  width: 12px;
  height: 8px;
  transition: transform var(--dur-s) var(--ease);
}
.usp-person__toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* ---------- Offices ---------- */
.usp-team-offices__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.usp-office-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.usp-office-card__head {
  padding: 26px 28px 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
}
.usp-office-card--glasgow .usp-office-card__head {
  background: linear-gradient(135deg, var(--navy-soft), var(--navy));
  box-shadow: inset 0 -4px 0 var(--orange);
}
.usp-office-card--london .usp-office-card__head {
  box-shadow: inset 0 -4px 0 var(--orange);
}
.usp-office-card__nation {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}
.usp-office-card__head h3 {
  margin: 4px 0 12px;
  font-size: 1.45rem;
  color: var(--white);
}
.usp-office-card__reg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.88);
}
.usp-office-card__reg svg {
  width: 16px;
  height: 16px;
  color: var(--orange);
}
.usp-office-card__people {
  list-style: none;
  margin: 0;
  padding: 10px 28px;
}
.usp-office-card__people li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--neutral);
}
.usp-office-card__people li:last-child {
  border-bottom: 0;
}
.usp-office-card__people strong {
  display: block;
  font-size: 0.95rem;
  color: var(--navy);
}
.usp-office-card__people small {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.usp-office-card__contact {
  display: grid;
  gap: 10px;
  margin: 0 28px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--navy);
}
.usp-office-card__contact a,
.usp-office-card__contact span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
  text-decoration: none;
}
.usp-office-card__contact a {
  font-weight: 700;
}
.usp-office-card__contact a:hover {
  color: var(--purple);
}
.usp-office-card__contact svg {
  width: 17px;
  height: 17px;
  color: var(--orange);
  flex-shrink: 0;
}
.usp-office-card__link {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: var(--tint);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple);
  text-decoration: none;
}
.usp-office-card__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--dur-s) var(--ease);
}
.usp-office-card__link:hover {
  color: var(--orange-dark);
}
.usp-office-card__link:hover svg {
  transform: translateX(3px);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .usp-team-lead {
    grid-template-columns: auto 1fr;
  }
  .usp-team-lead__facts {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .usp-team-lead {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .usp-team-lead__media {
    flex-direction: row;
    justify-content: flex-start;
    gap: 18px;
  }
  .usp-avatar--xl {
    --av: 104px;
    box-shadow:
      0 0 0 5px var(--white),
      0 0 0 6px var(--purple-light),
      var(--shadow-md);
  }
  .usp-team-lead__facts {
    grid-template-columns: 1fr;
  }
  .usp-team-offices__grid {
    grid-template-columns: 1fr;
  }
  .usp-team-filter {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .usp-team-filter__label {
    grid-column: 1 / -1;
    padding: 4px 6px 2px;
  }
  .usp-team-filter__btn {
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    font-size: 0.86rem;
  }
}

@media (max-width: 420px) {
  .usp-office-card__head,
  .usp-office-card__people,
  .usp-office-card__link {
    padding-left: 20px;
    padding-right: 20px;
  }
  .usp-office-card__contact {
    margin: 0 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .usp-person article,
  .usp-team-glance__row > svg,
  .usp-office-card__link svg,
  .usp-person__toggle .chevron {
    transition: none;
  }
  .usp-person article:hover {
    transform: none;
  }
}
