/* People grid and the single person (front end and editor) */
.sg-people {
  --cols: 4;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 40px 28px;

  &.has-cols-2 { --cols: 2; }
  &.has-cols-3 { --cols: 3; }
}

@media (max-width: 1023px) {
  .sg-people.has-cols-4 { --cols: 3; }
}
@media (max-width: 760px) {
  .sg-people { --cols: 2 !important; gap: 32px 20px; }
}
/* phones: two portraits per row (one full-width portrait filled the whole screen) */
@media (max-width: 420px) {
  .sg-people { gap: 28px 16px; }
  .sg-person__name { font-size: 15px; }
}

.sg-person {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.sg-person__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--wp--preset--color--mint);

  & img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  & .sg-media-empty { position: absolute; inset: 0; min-height: 0; }
}

.sg-person__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;

  & > * { margin: 0; }
  & p:empty { display: none; }
}

.sg-person__name {
  font-size: 17px;
  line-height: 1.3;
}

.sg-person__role {
  color: var(--wp--preset--color--teal);
  font-weight: 600;
}

.sg-person__text > * { margin: 0 !important; }
.sg-person__text > * + * { margin-top: 8px !important; }

.sg-person__links {
  display: flex;
  gap: 8px;
  margin-top: 6px !important;

  & a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--wp--custom--line);
    color: var(--wp--preset--color--teal);
    transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
  }
  & a:hover,
  & a:focus-visible {
    background: var(--wp--preset--color--teal);
    border-color: var(--wp--preset--color--teal);
    color: #fff;
  }
  & svg { width: 16px; height: 16px; fill: currentColor; }
}

/* ---------- link of a person: the whole person is clickable ---------- */
.sg-person { position: relative; }
.sg-person__link {
  position: static;
  text-decoration: none;

  &::after { content: ""; position: absolute; inset: 0; z-index: 1; }
  &:focus-visible { outline: none; }
  &:focus-visible::after { outline: 2px solid var(--wp--preset--color--teal); outline-offset: 3px; }
}
.sg-person__links a { position: relative; z-index: 2; }
/* outside the large look only the overlay counts: the link text stays for screen readers */
.sg-people:not(.is-v-board) .sg-person__link,
.sg-people.is-v-board .sg-people__grid .sg-person__link { font-size: 0; }
.sg-person__kicker { margin-bottom: 0; }

/* ---------- look "cards": white cards with photo, name and role (profile pages, Top Management Team) ---------- */
.sg-people.is-v-cards { gap: 20px; }
.is-v-cards .sg-person {
  gap: 4px;
  padding: 16px;
  background: var(--wp--preset--color--white);
  transition: transform 220ms var(--wp--custom--ease-out), box-shadow 220ms ease;

  & .sg-person__photo { aspect-ratio: 211 / 224; margin-bottom: 10px; }
  & .sg-person__photo img { filter: grayscale(.15); }
  & .sg-person__body { gap: 4px; }
  & .sg-person__name { font-size: 15px; color: var(--wp--preset--color--ink); }
  & .sg-person__role { font-size: 12.5px; }
}
@media (hover: hover) and (pointer: fine) {
  .is-v-cards .sg-person.has-link:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -18px rgba(14, 110, 100, .5); }
}

/* ---------- look "portraits": black-and-white portraits 4:5, teal name (board of directors) ---------- */
.sg-people.is-v-portraits { grid-template-columns: repeat(var(--cols), minmax(0, 220px)); gap: 32px; }
.sg-people.is-v-portraits.has-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.is-v-portraits .sg-person {
  gap: 4px;
  transition: transform 220ms var(--wp--custom--ease-out);

  & .sg-person__photo img { filter: grayscale(1) contrast(1.05); object-position: center 20%; }
  & .sg-person__body { gap: 4px; }
  & .sg-person__name { font-size: 15px; color: var(--wp--preset--color--teal); margin-top: 10px; }
  & .sg-person__role { font-size: 12.5px; font-weight: 400; color: var(--wp--custom--body); }
}
@media (hover: hover) and (pointer: fine) {
  .is-v-portraits .sg-person.has-link:hover { transform: translateY(-3px); }
}

@media (max-width: 900px) {
  .sg-people.is-v-cards,
  .sg-people.is-v-portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- look "board": President large on the background image, the committee next to it ---------- */
.is-layout-constrained > .sg-people.is-v-board,
.is-layout-flow > .sg-people.is-v-board { margin-block: 0; }

.sg-people.is-v-board {
  display: grid;
  grid-template-columns: 57fr 43fr;
  align-items: stretch;
  gap: 0;
  padding-bottom: 96px;
}

.sg-people__lead {
  position: relative;
  overflow: hidden;
  min-height: clamp(560px, 48vw, 720px);
  background: #eef0ee;

  & .sg-people__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

  & .sg-person { position: static; display: block; height: 100%; }
  & .sg-person__photo {
    position: absolute;
    bottom: 0;
    right: 4%;
    height: 93%;
    aspect-ratio: auto;
    background: none;
    overflow: visible;
    z-index: 1;

    & img { position: static; width: auto; height: 100%; max-width: none; object-fit: contain; }
  }

  & .sg-person__body {
    position: relative;
    z-index: 2;
    box-sizing: content-box;
    width: min(44%, 330px);
    min-height: calc(100% - 108px);
    /* lines up with the header logo (theme page width), not the narrower content width */
    padding: 52px 0 56px max(var(--wp--custom--gutter, 24px), calc((var(--sg-viewport, 100vw) - var(--sg-page-width, 1360px)) / 2 + var(--sg-gutter, 24px)));
    gap: 18px;
    font-size: 15.5px;
    line-height: 1.5;
    color: var(--wp--preset--color--ink);
  }

  & .sg-person__kicker { margin-bottom: 16px; }
  & .sg-person__name { font-size: clamp(36px, 3.4vw, 50px); font-weight: 400; line-height: 1.02; letter-spacing: -.01em; }
  & .sg-person__role { font-size: clamp(17px, 1.45vw, 21px); font-weight: 600; line-height: 1.3; color: var(--wp--preset--color--ink); margin-top: -12px; }
  & .sg-person__body p:not([class]) { max-width: 24ch; }

  & .sg-person__link {
    width: fit-content;
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.6;
    text-transform: uppercase;
    color: var(--wp--preset--color--ink);

    & .arr { display: inline-block; transition: transform 220ms var(--wp--custom--ease-out); }
  }
}

@media (hover: hover) and (pointer: fine) {
  .sg-people__lead .sg-person__link:hover { color: var(--wp--preset--color--teal); }
  .sg-people__lead .sg-person__link:hover .arr { transform: translateX(4px); }
}

.sg-people__team {
  padding: 52px max(var(--wp--custom--gutter, 24px), calc((var(--sg-viewport, 100vw) - var(--wp--style--global--wide-size, 1312px)) / 2)) 0 36px;

  & > .is-style-eyebrow { margin: 0 0 58px; }
}

.sg-people__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 200px));
  gap: 30px 22px;

  & .sg-person { gap: 0; }
  & .sg-person__photo { aspect-ratio: 1; }
  & .sg-person__photo img { object-position: center 20%; }
  & .sg-person__body { gap: 2px; }
  & .sg-person__name { margin-top: 12px; font-size: 14.5px; color: var(--wp--preset--color--ink); }
  & .sg-person__role { font-size: 11.5px; font-weight: 400; color: var(--wp--preset--color--ink); }
}

@media (max-width: 1023px) {
  .sg-people.is-v-board { grid-template-columns: 1fr; padding-bottom: 64px; }
  .sg-people__lead { min-height: 640px; }
  .sg-people__lead .sg-person__body { width: auto; max-width: 52%; min-height: 0; padding: 40px 0 40px var(--wp--custom--gutter, 24px); }
  .sg-people__lead .sg-person__photo { right: -6%; height: 80%; }
  .sg-people__team { padding: 48px var(--wp--custom--gutter, 24px) 0; }
  .sg-people__team > .is-style-eyebrow { margin-bottom: 28px; }
}

@media (max-width: 560px) {
  .sg-people__lead { min-height: 0; display: flex; flex-direction: column; }
  .sg-people__lead .sg-person { display: flex; flex-direction: column; }
  .sg-people__lead .sg-person__body { max-width: none; padding-right: var(--wp--custom--gutter, 24px); }
  .sg-people__lead .sg-person__body p:not([class]) { max-width: none; }
  .sg-people__lead .sg-person__photo { position: relative; right: auto; height: auto; width: 78%; margin: 0 auto; order: 2; }
  .sg-people__lead .sg-person__photo img { width: 100%; height: auto; }
}
