/* [team-grid title="..."] section headings (Company page sub-teams) */
.team-grid-title {
  margin: 0 0 var(--space-m);
  scroll-margin-top: 140px; /* anchor links (#property-management) land below the sticky header */
}

/* Team cards: narrow columns like the live site (4 across on desktop, 2 on phones) instead of
   .post-grid's 320px-minimum columns, which made each headshot very large. */
.team-grid.post-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 220px));
  gap: var(--space-l) var(--space-m);
}

@media (max-width: 575px) {
  .team-grid.post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Headshots keep their 2:3 portrait shape (600x900 sources), overriding .post-grid's 16:10;
   anchored to the top so faces stay in frame if a photo isn't exactly 2:3. */
.team-grid .team-member-photo img {
  aspect-ratio: 2 / 3;
  object-position: center top;
}

/* Space between one sub-team's cards and the next heading */
.team-grid + .team-grid-title {
  margin-top: var(--space-2xl);
}

/* Inside the child-page content column (dark-sidebar layout, e.g. Company) the column is narrower:
   3 across instead of the 220px-max columns, which only fit 2 */
@media (min-width: 576px) {
  .child-page-single .team-grid.post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
