/*
 * team styles.
 * Keep rule order intact: later rules refine earlier layouts and responsive states.
 */

.team-heading {
  padding: 60px 0 55px;
  max-width: 1000px;
}
.team-heading h1 {
  font-size: clamp(38px, 4.3vw, 64px);
  line-height: 1.15;
  margin: 0 0 28px;
}
.team-heading > p:last-child {
  font-size: 18px;
  line-height: 1.8;
  color: var(--body);
  max-width: 900px;
}
.team-section {
  padding-bottom: 65px;
}
.team-section .section-label {
  margin-bottom: 35px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 35px 28px;
  align-items: start;
}
.leadership-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 50px;
}
.team-card {
  background: #f0f0f0;
  color: #222;
  overflow: hidden;
}
.team-card:nth-child(3n + 2) {
  background: #e6e6e6;
}
.team-card:nth-child(3n) {
  background: #ddd;
}
.team-photo {
  overflow: hidden;
  aspect-ratio: 4/5;
  background: #e5e5e5;
}
.team-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.leadership-grid .team-photo {
  aspect-ratio: 1;
}
.team-card-copy {
  padding: 28px;
}
.team-card .team-role {
  font-size: 12px;
  color: #666;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.team-card h3 {
  font-family: var(--font-heading);
  font-size: clamp(25px, 2vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.team-email {
  font-size: 14px;
  overflow-wrap: anywhere;
  color: #555;
}
.team-email:hover {
  text-decoration: underline;
}
.team-card details {
  margin-top: 25px;
}
.team-card summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid #bbb;
  padding-top: 18px;
  font-size: 14px;
  cursor: pointer;
}
.team-card summary:focus-visible {
  outline: 2px solid #444;
  outline-offset: 5px;
}
.team-card summary span {
  font-size: 22px;
  line-height: 1;
}
.team-card details[open] summary span {
  transform: rotate(45deg);
}
.team-bio {
  padding-top: 20px;
}
.team-bio p {
  font-size: 15px;
  line-height: 1.8;
  color: #444;
  margin: 0 0 18px;
}
.team-bio p:last-child {
  margin-bottom: 0;
}
@media (hover: hover) {
  .team-card:hover .team-photo img {
    transform: scale(1.025);
  }
}
@media (max-width: 1000px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .leadership-grid {
    gap: 28px;
  }
}
@media (max-width: 650px) {
  .team-heading {
    padding: 40px 0 35px;
  }
  .team-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .team-card-copy {
    padding: 25px;
  }
  .team-section {
    padding-bottom: 40px;
  }
  .team-photo {
    aspect-ratio: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .team-photo img {
    transition: none;
  }
  .team-card:hover .team-photo img {
    transform: none;
  }
}

/* Main team categories follow the understated leadership navigation. */
.team-category-tabs {
  display: flex;
  gap: 36px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 36px;
  overflow-x: auto;
}
.team-category-tabs button {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--body);
  font-size: 15px;
  padding: 0 0 17px;
  font-weight: 400;
  white-space: nowrap;
}
.team-category-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.team-category-tabs button span {
  font-size: 11px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}
.team-category-panel {
  padding-bottom: 65px;
}
.team-category-panel[hidden] {
  display: none;
}
@media (max-width: 650px) {
  .team-category-tabs {
    gap: 25px;
    margin-bottom: 28px;
  }
  .team-category-tabs button {
    font-size: 14px;
  }
  .team-category-panel {
    padding-bottom: 35px;
  }
}

/* Profile links share the services link's underline and animated arrow. */
.team-card .team-profile-link {
  display: inline-flex;
  justify-content: flex-start;
  gap: 18px;
  border-top: 0;
  padding-top: 0;
  font-size: 16px;
  font-weight: 500;
  color: #555;
  list-style: none;
}
.team-profile-link::-webkit-details-marker {
  display: none;
}
.team-card .team-profile-link .link-label {
  font-size: inherit;
  line-height: 1.5;
  border-bottom: 1px solid currentColor;
  padding-bottom: 3px;
}
.team-card .team-profile-link .link-arrow {
  font-size: inherit;
  line-height: 1;
  transition: transform 0.4s ease;
}
.team-card details[open] .team-profile-link .link-label {
  transform: none;
}
.team-card details[open] .team-profile-link .link-arrow {
  transform: rotate(90deg);
}
.team-card .team-profile-link:focus-visible {
  outline-offset: 6px;
}

/* Emphasize the founder's role. */
.team-card .team-role-founder {
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* Consistent role, name, and full-width profile-action hierarchy. */
.team-card-copy {
  padding: 32px;
}
.team-card .team-role {
  line-height: 1.4;
  margin: 0 0 14px;
}
.team-card .team-role-founder {
  margin-bottom: 14px;
}
.team-card h3 {
  margin: 0;
  line-height: 1.25;
}
.team-card details {
  margin-top: 30px;
}
.team-card .team-profile-link {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0;
  min-height: 36px;
}
.team-card .team-profile-link .link-label {
  flex: 0 1 auto;
}
.team-card .team-profile-link .link-arrow {
  margin-inline-start: auto;
  flex-shrink: 0;
}
.team-card .team-bio {
  padding-top: 25px;
}
@media (max-width: 650px) {
  .team-card-copy {
    padding: 25px;
  }
  .team-card details {
    margin-top: 25px;
  }
}

/* Consistent designation styling for every team member. */
.team-card .team-role {
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 400;
  margin: 0 0 14px;
}

/* Profile actions now open full biographies. */
.team-card a.team-profile-link {
  margin-top: 30px;
}

/* Initials keep team cards consistent while a portrait is unavailable. */
.team-photo-initials {
  display: grid;
  place-items: center;
  color: #666;
}
.team-photo-initials span {
  font-family: var(--font-heading);
  font-size: clamp(64px, 8vw, 110px);
  line-height: 1;
  letter-spacing: 0.04em;
}
