/* ==========================================================================
   TeamTrek — four teams in one week, and one team across four weeks
   --------------------------------------------------------------------------
   The hero figure on the team performance analytics page: every team's week
   on one panel, with the hours, the activity beside them and the number of
   projects the hours were spread over.

   A comparison across teams rather than a record of one. The tracking pages
   draw what is happening, the capacity page draws a month ahead, and the
   utilization page divides one month into its parts; this page is about
   reading one team against another, so the panel is a column of teams and
   every figure in it is measured the same way.

   1056 by 482, like every other hero figure on the site.
   ========================================================================== */

.board {
  width: 100%; max-width: 66rem; margin-inline: auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-xl);
  background: #fff;
  /* Heavier than the shared shadow: the panel straddles the dark band and
     the dome, and a light shadow over the dark half disappears. */
  box-shadow: 0 30px 80px rgba(8, 40, 36, .28);
  text-align: left;
  display: flex; flex-direction: column;
}

/* ------------------------------------------------------------- the head */
.board__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--neutral-200);
}
.board__state {
  display: flex; align-items: center; gap: .5rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-700);
}
.board__what { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.board__who { font-size: .8125rem; color: var(--neutral-500); }
.board__total {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.board__total b { font-weight: 800; color: var(--neutral-900); }

/* The column headings. Three measures per team is two too many to leave
   unlabelled, and a figure whose name is only in the paragraph below is a
   figure the reader has to hold in their head. */
.board__cols {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 4.5rem 4.5rem 6rem;
  align-items: end; gap: 1rem;
  margin: 0; padding: .75rem 0 .375rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}
/* The bar and the hours figure are one measure in two cells, so the heading
   over them spans both. */
.board__col--wide { grid-column: span 2; }
.board__col--num { text-align: right; }

/* ------------------------------------------------------------- the rows */
.board__rows {
  flex: 1; min-height: 0;
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; justify-content: center; gap: .25rem;
}
.board__row {
  /* Five cells, five columns. The row carries a name, a bar, the hours, the
     activity and the project count, and a grid one column short would wrap
     the last of them onto a second line and push the panel past its height. */
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 4.5rem 4.5rem 6rem;
  align-items: center; gap: 1rem;
  padding: .625rem 0;
}
.board__row + .board__row { border-top: 1px solid var(--neutral-100); }

.board__name { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.board__name span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }

.board__bar {
  display: block; height: 1.5rem;
  border-radius: var(--r-sm); background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.board__bar i {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit; background: var(--primary-400);
  transition: width var(--dur-slow, 700ms) var(--ease-brand);
}

.board__hours,
.board__act,
.board__projects {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.board__hours { font-size: 1rem; font-weight: 800; color: var(--neutral-900); }
.board__act { font-size: .875rem; font-weight: 700; color: var(--primary-700); }
.board__projects { font-size: .8125rem; color: var(--neutral-600); }

/* Hours and activity share the third column on narrow screens, so they are
   written as one cell there; on wide screens they keep their own columns. */
.board__pair { display: none; }

/* ------------------------------------------------------------- the foot */
.board__foot {
  flex: none;
  margin: 0; padding-top: .875rem;
  border-top: 1px solid var(--neutral-200);
}
.board__note {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--neutral-500);
}
.board__note .icon { flex: none; color: var(--neutral-400); }

/* ------------------------------------------------------------------ sizes */
@media (min-width: 860px) {
  /* The figure every other hero on the site carries. */
  .board { height: 482px; }
}

@media (max-width: 859px) {
  .board { padding: 1.125rem 1.25rem; }
  .board__cols,
  .board__row { grid-template-columns: 6rem minmax(0, 1fr) 3.5rem 3.5rem 4.5rem; gap: .625rem; }
}

@media (max-width: 599px) {
  .board { padding: 1rem; }
  /* The name, the hours and the activity. A 90px bar cannot be compared
     with another 90px bar, and the project count is the measure a reader
     can most easily do without. */
  .board__cols { display: none; }
  .board__row { grid-template-columns: minmax(0, 1fr) 7rem; }
  .board__bar,
  .board__act,
  .board__projects { display: none; }
  .board__pair {
    display: block; text-align: right;
    font-size: .9375rem; font-weight: 800; color: var(--neutral-900);
    font-variant-numeric: tabular-nums;
  }
  .board__pair span { display: block; font-size: .75rem; font-weight: 400; color: var(--primary-700); }
}

/* --------------------------------------------------------------------------
   One team, four weeks
   --------------------------------------------------------------------------
   Section 04's figure: the question the hero raises -- is this team always
   like this -- answered for one of them. Four finished weeks, the hours and
   activity in each, and what each week did against the one before it.

   The change column is the point of the figure. A week of 264 hours means
   nothing on its own; 264 after 312 is the thing somebody would ask about.
   -------------------------------------------------------------------------- */
.weeks {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

.weeks__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--neutral-150);
}
.weeks__who { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.weeks__who span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }
.weeks__when { font-size: .8125rem; color: var(--neutral-500); }
.weeks__avg {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.weeks__avg b { font-weight: 700; color: var(--neutral-900); }

.weeks__rows { margin: .5rem 0 0; padding: 0; list-style: none; }
.weeks__row {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr) 5rem 7rem;
  align-items: center; gap: 1rem;
  padding: .875rem 0;
}
.weeks__row + .weeks__row { border-top: 1px solid var(--neutral-150); }

.weeks__label { font-size: .875rem; font-weight: 700; color: var(--neutral-900); }
.weeks__label span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }

.weeks__track {
  display: block; height: 2rem;
  border-radius: var(--r-sm);
  background: var(--neutral-100);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.weeks__fill {
  display: block; height: 100%; width: var(--w, 0%);
  background: var(--primary-500);
}

.weeks__hours {
  text-align: right;
  font-size: 1rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.weeks__hours span { display: block; font-size: .75rem; font-weight: 700; color: var(--primary-700); }

/* What the week did against the one before it. Up and down are named in
   words as well as drawn, because a coloured triangle on its own is a claim
   nobody can read out loud. */
.weeks__delta {
  display: flex; align-items: center; justify-content: flex-end; gap: .375rem;
  font-size: .8125rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.weeks__delta .icon { flex: none; }
.weeks__delta--up { color: var(--primary-700); }
.weeks__delta--down { color: #9a3412; }
.weeks__delta--flat { color: var(--neutral-500); font-weight: 400; }

/* The three figures the four weeks add up to. */
.weeks__sums {
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--neutral-200);
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.weeks__sum { margin: 0; }
.weeks__sum b {
  display: block;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.weeks__sum span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--neutral-500); }
.weeks__sum--key b { color: var(--primary-700); }

@media (max-width: 859px) {
  .weeks { padding: 1.25rem; }
  .weeks__row { grid-template-columns: 6rem minmax(0, 1fr) 4.5rem 5.5rem; gap: .75rem; }
  .weeks__sums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; }
  .weeks__sum b { font-size: 1.125rem; }
}

@media (max-width: 599px) {
  .weeks { padding: 1rem; }
  /* The week, its hours and what it did against the week before. The bar
     is the thing that stops being readable first. */
  .weeks__row { grid-template-columns: minmax(0, 1fr) 5rem 5rem; }
  .weeks__track { display: none; }
}
