.com-team {
  /* Variables */
  --vert-padding: 3rem;
  --member-gap: 16px;
  --member-min-width: 280px;
  --member-radius: 12px;
  --member-padding: 1.5rem;
  --member-background: hsl(0 0% 96% / 1);
  --contact-spacing: 0.5rem;
  @media (width < 768px) {
    --vert-padding: 2.5rem;
    --member-gap: 12px;
    --member-padding: 0.85rem;
    --photo-strip-width: 33%;
  }
}

.intro {
  --margin-if-last-child: 1.5rem;
  /* Inherit the site's global heading styles (size + --color-heading) so these
     section titles match the rest of the website. */
  h2 { margin-top: 0; }
  h1, h2, h3 {
    &:last-child { margin-bottom: var(--margin-if-last-child); }
  }
  p {
    max-width: 1100px;
    &:last-child { margin-bottom: var(--margin-if-last-child); }
  }
}

.com-team {
  padding: var(--vert-padding) 0;
  & ~ & { border-top: 1px solid hsl(0 0% 80% / 1); }
}

.com-team-inner {
  max-width: var(--mobile-content-max-width);
  margin-inline: auto;
}

.team-members {
  display: grid;
  /* min() prevents the 280px track from overflowing viewports narrower than the
     member-min-width (e.g. small phones) — it collapses to a single column instead. */
  grid-template-columns: repeat(auto-fill, minmax(min(var(--member-min-width), 100%), 1fr));
  gap: var(--member-gap);
}

.team-member {
  background: var(--member-background);
  border-radius: var(--member-radius);
  padding: var(--member-padding);
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.08);
  @media (width < 768px) { margin-bottom: 0; }
}

.team-member-inner {}
.team-member-image-frame {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.team-member-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.team-member-image--placeholder {
  background: hsl(0 0% 88%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23bbb'%3E%3Cpath d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 55%;
  background-size: 55%;
}
.team-member-info {}
.team-member-name {
  margin-top: 0;
  @media (width < 768px) { font-size: 1.1rem; }
}
.team-member-title {}
.team-member-department {}
.team-member-bio-link {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.3rem 0.75rem;
  background: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--color-link, currentColor);
  font: inherit;
  font-size: 0.8em;
  text-decoration: none;
  cursor: pointer;
  &:hover { opacity: 0.7; }
}


.team-member-contact {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(0 0% 0% / 0.1);
}
.team-member-contact-heading {
  margin: 0 0 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(0 0% 50%);
}
.team-member-more-info {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid hsl(0 0% 0% / 0.1);
  font-size: 0.9em;
}

.team-member-email, .team-member-phone {
  a { text-decoration: none; }
}
.team-member-email {}
.team-member-phone {}
.team-member-contact a {}
.team-member-contact a:hover {}

/* Mobile: compact horizontal "list row" layout — a full-height photo strip on
   the left (~33% width) with the text beside it — so a long team list scrolls
   far less. Email/phone stay visible inline (basic contact info shouldn't
   require opening the modal); the contact block is just slimmed down. */
@media (width < 768px) {
  .team-member {
    padding: 0;            /* photo bleeds to the card edges; padding moves to .team-member-info */
    overflow: hidden;      /* clip the photo to the card's rounded corners */
  }
  .team-member-inner {
    position: relative;    /* anchor for the "Read more" overlay on the photo */
    display: flex;
    align-items: stretch;  /* photo strip fills the card top to bottom */
    gap: 0;
  }
  .team-member-image-frame {
    flex: none;
    width: var(--photo-strip-width);
    aspect-ratio: auto;    /* fill the card height instead of forcing a square */
    border-radius: 0;      /* card's overflow:hidden gives the left corners their radius */
    margin-bottom: 0;
  }
  .team-member-info {
    flex: 1;
    min-width: 0;          /* let long names/titles wrap instead of overflowing the row */
    padding: var(--member-padding);
  }
  .team-member-title,
  .team-member-department {
    font-size: 0.9rem;
  }
  /* "Read more" overlays the bottom of the photo strip, centered within it.
     Solid pill background keeps it legible over any photo. */
  .team-member-bio-link {
    position: absolute;
    bottom: 8px;
    left: calc(var(--photo-strip-width) / 2);
    transform: translateX(-50%);
    margin: 0;
    background: hsl(0 0% 100% / 0.92);
    border-color: hsl(0 0% 100% / 0.6);
    box-shadow: 0 1px 4px hsl(0 0% 0% / 0.35);
    white-space: nowrap;
  }
  /* Keep email/phone/office visible inline, but slim: drop the "Contact Info"
     label and the divider/large margin so the row stays compact. */
  .team-member-contact {
    margin-top: 0.5rem;
    padding-top: 0;
    border-top: none;
    font-size: 0.9rem;
  }
  .team-member-contact-heading {
    display: none;
  }
}
