/* A person's page, and the admin lists and forms that wear the same cards.
   White cards on the page's own background, one column, the brand colour
   only for what can be clicked. */
.profile-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
  color: var(--color-ink);

  & [id] { scroll-margin-top: calc(var(--navbar-height) + 1rem); }
  @media (max-width: 640px) { padding: 1rem 1rem 2.5rem; }
}
.profile-page--narrow { max-width: 44rem; }

/* Back link, header and jump links. */
.profile-page__back {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-primary);

  & svg { width: 1.125rem; height: 1.125rem; }
  &:hover { color: var(--color-primary-dark); }
}
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1.125rem; }
.profile-header__who { display: flex; flex: 1; flex-direction: column; gap: 0.25rem; min-width: 12rem; }
.profile-header__name { font-size: 2rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.profile-header__about { color: var(--color-text); }
.profile-header__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.profile-more { position: relative; }
.profile-more > summary {
  list-style: none;

  &::-webkit-details-marker { display: none; }
}
.profile-more__list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 20;
  min-width: 15rem;
  padding: 0.375rem;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  background: var(--color-surface);
  box-shadow: var(--shadow-pop);
}
.profile-more__item {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: left;

  &:hover { background: var(--color-raised); }
}
.profile-more__item--danger { color: var(--color-red); }

.profile-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-bottom: -0.25rem;

  & a {
    padding: 0.25rem 0;
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 500;

    &:hover { color: var(--color-primary); }
  }
}

/* Cards. */
.profile-card {
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  background: var(--color-surface);

  @media (max-width: 640px) { padding: 1.25rem 1rem; }
}
.profile-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
}
.profile-card__title { font-size: 1.375rem; font-weight: 700; line-height: 1.3; }
.profile-card__title--spaced { padding-bottom: 0.75rem; }
.profile-card__title--with-count {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.625rem;
  padding-bottom: 0.25rem;
}
.profile-card__count { color: var(--color-text); font-size: 0.9375rem; font-weight: 400; }
.profile-card-action {
  color: var(--color-primary);
  font-size: 0.9375rem;
  font-weight: 600;

  &:hover { color: var(--color-primary-dark); }
}
.profile-card__danger { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--color-hairline); }

/* Rows in a card. The first row after a title has no line above it. */
.profile-list { display: flex; flex-direction: column; }
.profile-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--color-hairline);
}
.profile-list > .profile-row:first-child { border-top: 0; }
.profile-row--link {
  margin-inline: -0.75rem;
  padding-inline: 0.75rem;

  &:hover { background: var(--color-raised); }
}
/* A row that opens something: the whole row lights up, and everything but
   the actions at its end is the link. */
.profile-row--open {
  margin-inline: -0.75rem;
  padding-inline: 0.75rem;
  border-radius: 0.5rem;

  &:hover { background: var(--color-raised); }
  &:hover .profile-row__name { color: var(--color-primary-dark); }
}
.profile-row__open { display: flex; flex: 1; align-items: center; gap: 1rem; min-width: 0; }
.profile-row__body { display: flex; flex: 1; flex-direction: column; gap: 0.125rem; min-width: 0; }
.profile-row__name { font-size: 1.0625rem; font-weight: 600; overflow-wrap: anywhere; }
.profile-row__detail {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-text);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}
.profile-row__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 1rem; }
.profile-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.625rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);

  & svg { width: 1.25rem; height: 1.25rem; }
}

/* The underlined actions at the end of a row. */
.profile-action {
  color: var(--color-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;

  &:hover { color: var(--color-primary-dark); }
}
.profile-action--danger { color: var(--color-red); }

.profile-empty,
.profile-quiet { color: var(--color-text); }
.profile-quiet { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--color-muted); }
.profile-dot {
  display: inline-block;
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background: var(--color-muted);
}
.profile-dot--small { width: 0.5rem; height: 0.5rem; }
.profile-dot--green { background: var(--color-primary); }
.profile-dot--red { background: var(--color-red-dot); }
.profile-dot--amber { background: var(--color-amber-dot); }
.profile-chip {
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background: var(--color-raised);
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Needs your attention. */
.profile-attention { display: flex; flex-direction: column; gap: 0.75rem; padding-top: 0.75rem; }
.profile-attention__row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  line-height: 1.5;

  & .profile-dot { transform: translateY(-1px); }
}
.profile-attention__title { font-weight: 600; }
.profile-attention__text { margin-left: 0.5rem; color: var(--color-text); }

/* A person's information: the label in a grey column, then the value. */
.profile-info__group {
  margin: 1.25rem 0 0.25rem;
  color: var(--color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.profile-info__row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.625rem 0;
  border-top: 1px solid var(--color-hairline);

  @media (max-width: 640px) { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; }
}
.profile-info__group + .profile-info__row { border-top: 0; }
.profile-info__label { color: var(--color-text); }
.profile-info__value { overflow-wrap: anywhere; }

.profile-figure {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.625rem;
  color: var(--color-text);
  font-size: 1.125rem;

  & strong { color: var(--color-ink); font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; }
}

/* Two fields side by side on a computer, stacked on a phone. */
.form__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;

  @media (max-width: 640px) { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
}

@media (max-width: 640px) {
  .profile-header__name { font-size: 1.625rem; }
  .profile-header__actions { width: 100%; }
}

/* A place to drop a file on the Add a document form. The real file field
   is hidden; the label is the drop zone and the "Choose a file" button. */
.drop-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 2.25rem 1.5rem;
  border: 1px dashed var(--color-border-strong);
  border-radius: 0.75rem;
  background: var(--color-raised);
  text-align: center;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;

  &:hover, &.is-over { border-color: var(--color-primary); background: var(--color-primary-soft); }
}
.drop-zone__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);

  & svg { width: 1.375rem; height: 1.375rem; }
}
.drop-zone__text { font-size: 1rem; font-weight: 600; }
.drop-zone__types { max-width: 32.5rem; font-size: 0.875rem; line-height: 1.5; color: var(--color-muted); }
.drop-zone__chosen {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  background: var(--color-primary-soft);
  font-size: 0.9375rem;

  & svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--color-primary-dark); }
}
.drop-zone__chosen-name { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
