


.page-shell {
  width: 100%;
  padding: 25px 0 48px;
  overflow-x: hidden;
}

/*
  The screenshot uses this relationship:
  - red cards are about 49% of the chart width;
  - gray cards start at the center of a red card;
  - the center of every red card is the main connector spine.
*/
.org-chart {
  position: relative;
  width: min(86.5vw, 720px);
  margin-inline: auto;
  isolation: isolate;
}

/* Main vertical connector */
.org-chart::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 20px;
  bottom: 20px;
  left: 24.5%;
  width: 2px;
  background: #b9b9b9;
  transform: translateX(-1px);
}

.org-group {
  position: relative;
  z-index: 1;
  margin: 0 0 20px;
}

.org-group:last-child {
  margin-bottom: 0;
}

.direct-reports {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.person-card {
  position: relative;
  z-index: 2;
  display: grid;
  place-content: center;
  min-height: 40px;
  padding: 8px 10px;
  text-align: center;
  border-radius: 1px;
}

.person-card h2,

.person-card p {
  margin: 0;
  font-family: 'Montserrat', sans-serif !important;
}

.person-card h2 {
  font-size: clamp(8px, 1.2vw, 14px);
  font-weight: 700;
  line-height: 1.2;
}

.person-card p {
  margin-top: 4px;
  font-size: clamp(5.5px, 0.82vw, 10px);
  font-weight: 400;
  line-height: 1.25;
}

.person-card--executive h2{
  color: rgb(255 255 255 / 92%) !important;
}

.person-card--executive {
  width: 49%;
  color: rgb(255 255 255 / 92%);
  background: #e6251a;
  box-shadow: 0 2px 2px rgb(0 0 0 / 18%);
}

.person-card--executive p {
  color: rgb(255 255 255 / 92%);
}

.person-card--report {
  width: calc(49% - 10px);
  margin-left: calc(24.5% + 10px);
  color: #242424;
  background: #f5f5f5;
  border: 1px solid #f0f0f0;
  box-shadow: 0 2px 2px rgb(0 0 0 / 18%);
}

.person-card--report p {
  color: #555555;
}

/* Horizontal branch from the vertical spine to every gray card */
.person-card--report::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 10px;
  height: 2px;
  background: #b9b9b9;
  transform: translateY(-1px);
}

/* Small junction point makes each connection easier to see */
.person-card--report::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 10px - 3px);
  width: 6px;
  height: 6px;
  border: 2px solid #b9b9b9;
  border-radius: 50%;
  background: #ffffff;
  transform: translateY(-50%);
}

/* Slightly taller when an executive has a two-line title */
.org-group:nth-child(3) > .person-card--executive {
  min-height: 40px;
}

/* Keep the screenshot-like proportions on narrow screens. */
@media (max-width: 520px) {


  .page-shell {
    padding-top: 25px;
  }

  .org-chart {
    width: 86.5vw;
  }

  .person-card {
    min-height: 40px;
    padding: 7px 8px;
  }
}

/* A readable fallback for very small phones. */
@media (max-width: 335px) {
  .org-chart {
    width: calc(100vw - 24px);
  }

  .org-chart::before {
    left: 12px;
  }

  .person-card--executive,
  .person-card--report {
    width: calc(100% - 28px);
    margin-left: 28px;
  }

  .person-card--executive::before,
  .person-card--report::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: 16px;
    height: 2px;
    background: #b9b9b9;
    transform: translateY(-1px);
  }

  .person-card--report::after {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .person-card {
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .person-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgb(0 0 0 / 18%);
  }
}
