/* Team grid (library block, T20). Tokens only; written for phones first.
   Prototype (How we work "Our team", Design support "The design team"): 4:5 portraits with a 20 px radius,
   name 18 px medium, role 14 px in slate, gaps 40 px (rows) and 24 px (columns).
   Phones: 2 per row. From 600 px: 3 per row. From 1024 px: 3 per row for 3, 6 and 9 people, otherwise
   4 per row (last row left-aligned); 1 or 2 people keep the 4-column card width and don't stretch.
   Phone and email are 44 px tap rows on phones (B6). */

.team-grid__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.team-grid__heading { margin: 0; max-width: 100%; overflow-wrap: break-word; }
.team-grid__intro {
  margin: 0;
  max-width: 560px;
  font-size: var(--fs-body-md);
  line-height: var(--lh-body);
  color: var(--color-text);
  overflow-wrap: break-word;
}

.team-grid__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-10) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}
.team-grid__person {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.team-grid__portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--color-surface-quiet);
}
.team-grid__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* S2-TG1 fallback: the portrait's media item is missing. Neutral tile with the person's initials. */
.team-grid__initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-display);
  color: var(--color-muted);
}

.team-grid__name {
  margin: var(--space-2) 0 0;
  font-family: var(--font-body);
  font-size: var(--fs-h4);
  font-weight: var(--fw-medium);
  line-height: var(--lh-label);
  letter-spacing: 0;
  color: var(--color-heading);
  overflow-wrap: anywhere;
}
.team-grid__role {
  margin: 0;
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body-tight);
  color: var(--color-text);
  overflow-wrap: break-word;
}

.team-grid__contact {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.team-grid__link {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-label);
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.team-grid__link:hover { color: var(--color-link-hover); }

@media (min-width: 600px) {
  .team-grid__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--gutter);
  }
}

@media (min-width: 1024px) {
  .team-grid__list--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .team-grid__list--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* With a mouse on a wide screen the rows can be compact; touch screens keep 44 px tap rows. */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .team-grid__link { min-height: 0; padding-block: var(--space-1); }
}
