/* A record's page header (an agency's, an advisor's: `wi-record-header` on PageHeader's card): one identity line. Its
   tile or face (64px), its name with its facts under it, the advisors' faces, and its action at the right end, centred.
   The title row dissolves into the grid, so the lead, the name and the facts are the card's own cells. Facts are quiet
   chips on the navy; the status badge keeps its colours. A phone stacks them: the lead with the name, the facts, the
   faces, then the action across the card, under them. */
.wi-record-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas:
    "lead name faces actions"
    "lead meta faces actions";
  column-gap: var(--space-5);
  row-gap: var(--space-2);
  align-items: center;
}

.wi-record-header > .wi-page-header__title-row {
  display: contents;
}

.wi-record-header .wi-page-header__lead {
  grid-area: lead;
}

.wi-record-header .wi-page-header__title-block {
  grid-area: name;
  align-self: end;
}

.wi-record-header > .wi-page-header__meta {
  grid-area: meta;
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.wi-record-header .wi-page-header__meta > span::after {
  content: none;
}

.wi-record-header .wi-page-header__meta > span:not(:has(.wi-badge)) {
  padding: var(--space-0-5) var(--space-3);
  border-radius: var(--radius-full);
  background-color: var(--blue-gray-800);
  color: var(--gray-200);
  font-size: var(--font-size-xs);
}

.wi-record-header > .wi-page-header__byline {
  grid-area: faces;
  flex: none;
}

.wi-record-header > .wi-page-header__actions {
  grid-area: actions;
  margin: 0;
}

/* Its action, Edit, is lifted by a small shadow. */
.wi-record-header .wi-page-header__actions .wi-btn--tertiary-light:not(:focus-visible) {
  box-shadow: var(--shadow-sm);
}

@media (max-width: 767.98px) {
  .wi-record-header {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "lead name"
      "meta meta"
      "faces faces"
      "actions actions";
    column-gap: var(--space-4);
    row-gap: var(--space-3);
  }

  .wi-record-header > .wi-page-header__actions {
    align-items: stretch;
  }

  .wi-record-header > .wi-page-header__actions > .wi-btn {
    width: 100%;
  }
}
