/* ============================================
   Component: People
   Views: dashboards/people/show.html.erb, dashboards/people/person.html.erb
   Stimulus: none
   ============================================ */
/* People (#82): the tab's list of people, and a person's page beneath it (Deeper) */
.people {
  max-width: 40rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  list-style: none;
}

.person {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--spacing-xs) var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
}

.person + .person { border-top: 1px solid var(--color-border); }

.person-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-target);
  color: var(--color-link);
  font-weight: 600;
  text-decoration: none;
}

.person-link:hover { text-decoration: underline; }

.people .person-position { color: var(--color-muted); font-size: var(--font-size-sm); }

/* Who the person reports to (#614, PEOPLE-01), after their title: in the page's main text colour at the title's size,
   the title staying muted, so that on a phone its row reads apart from the title's; a row of its own in the person's
   line, which wraps as the line does, so a long name never scrolls a phone sideways. */
.people .person-reports-to {
  flex-basis: 100%;
  color: var(--color-text);
  font-size: var(--font-size-sm);
}

/* On exec's tab, where the list shows who each person reports to (#614, PEOPLE-01): below 600px every person's line
   stacks alike, the name, then the job title, then "Reports to", each on a row of its own, so a long job title never
   shares the row where the others show "Reports to". From 600px up, the line as it is (.person). */
.people.is-reporting-lines .person {
  display: grid;
  justify-items: start;
}

@media (min-width: 600px) {
  .people.is-reporting-lines .person { display: flex; }
}

/* The decision the tab serves where it shows who each person reports to, above its question (D-139), as SKU
   performance's decision line is drawn; then the question, its heading, above the list. */
.people-decision {
  margin: var(--spacing-lg) 0 0;
  color: var(--color-muted);
}

.people-decision + h3 { margin: var(--spacing-md) 0 var(--spacing-sm); }

/* The line of its own right under the question while no row of Kifaru's org chart is loaded: who each person
   reports to will show there once it is. */
.people-chart-pending {
  max-width: 40rem;
  margin-bottom: var(--spacing-sm);
}

/* The line under the list: that only people who hold a role in the app are listed, with where their job titles come
   from, and, once the chart is in, where who each reports to comes from, each with its date; or under a person's
   details, where who they report to comes from, with its date. */
.people-sources {
  max-width: 40rem;
  margin-top: var(--spacing-sm);
  color: var(--color-muted);
  font-size: var(--font-size-xs);
}

.person-left {
  display: inline-block;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  border: 1px solid var(--color-muted);
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-size: var(--font-size-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.person-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--spacing-sm) var(--spacing-lg);
  max-width: 40rem;
}

.person-details dt { grid-column: 1; color: var(--color-muted); }

.person-details dd { grid-column: 2; }
