/* ==========================================================================
   TeamTrek — a team's week against capacity, and the same week by day
   --------------------------------------------------------------------------
   The hero figure on the project and task allocation page: five people,
   one week, each row read against the same forty hours.

   People rather than projects. The project page draws where an hour went
   and the task page what a task took; allocation is the only one of the
   three about people, and the question it answers -- who has room for the
   next piece of work -- cannot be drawn without putting the whole team on
   one scale.

   The track is 48 hours wide with the 40-hour mark as a line across it,
   rather than each bar ending at its own capacity. Four hours over and
   four hours spare are then the same distance on the page, read in
   opposite directions, which is the comparison the panel exists to make.

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

.crewload {
  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 */
.crewload__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--neutral-200);
}
.crewload__state {
  display: flex; align-items: center; gap: .5rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-700);
}
.crewload__team { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.crewload__who { font-size: .8125rem; color: var(--neutral-500); }
.crewload__cap {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.crewload__cap b { font-weight: 700; color: var(--neutral-900); }

/* ------------------------------------------------------------- the rows */
.crewload__rows {
  flex: 1; min-height: 0;
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; justify-content: center;
}
.crewload__row {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 7rem;
  align-items: center; gap: 1rem;
  padding: .8125rem 0;
}
.crewload__row + .crewload__row { border-top: 1px solid var(--neutral-150); }

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

/* Forty-eight hours wide, whoever is standing in it. */
.crewload__track {
  position: relative; display: block; height: 1.75rem;
  border-radius: var(--r-sm); background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.crewload__track i {
  display: block; height: 100%; width: var(--w, 0%);
  background: var(--primary-400);
  transition: width var(--dur-slow, 700ms) var(--ease-brand);
}
/* Full is the same hours as spare, drawn without the invitation. */
.crewload__row--full .crewload__track i { background: var(--primary-500); }
.crewload__row--over .crewload__track i { background: var(--primary-600); }

/* The 40-hour mark: 40 of 48, which is 83.333 per cent across. A line
   rather than an edge, so the bar can pass it. */
.crewload__line {
  position: absolute; top: 0; bottom: 0; left: 83.333%;
  width: 1px; margin-left: -.5px;
  background: var(--neutral-400);
}

.crewload__out { text-align: right; }
.crewload__out b {
  display: block;
  font-size: .9375rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.crewload__out span { display: block; font-size: .75rem; color: var(--neutral-500); }
.crewload__row--over .crewload__out span { color: var(--neutral-700); font-weight: 700; }

/* ------------------------------------------------------------- the foot */
.crewload__foot {
  flex: none;
  margin: 0; padding-top: .875rem;
  border-top: 1px solid var(--neutral-200);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.75rem;
}
.crewload__sum b,
.crewload__spare b {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.crewload__spare b { color: var(--primary-700); }
.crewload__sum span,
.crewload__spare span { margin-left: .5rem; font-size: .8125rem; color: var(--neutral-500); }

.crewload__note {
  margin-left: auto;
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--neutral-500);
}
.crewload__note .icon { flex: none; color: var(--neutral-400); }

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

@media (max-width: 859px) {
  .crewload { padding: 1.125rem 1.25rem; }
  .crewload__row { grid-template-columns: 7rem minmax(0, 1fr) 6rem; gap: .75rem; }
  .crewload__note { margin-left: 0; }
}

@media (max-width: 599px) {
  .crewload { padding: 1rem; }
  /* The name and the two figures. A 90px bar reads as a smudge, and "4h
     over" says the same thing exactly. */
  .crewload__row { grid-template-columns: minmax(0, 1fr) 6rem; }
  .crewload__track { display: none; }
}

/* --------------------------------------------------------------------------
   One person, one day
   --------------------------------------------------------------------------
   Section 04's figure: the eight hours the copy beside it divides, drawn as
   one bar and then read down as rows.

   Two projects and then the time that is recorded but is not a project --
   the manual entries and the idle stretch the person kept -- because a
   manager reading somebody's load has to see all four before deciding
   whether there is room for a fifth thing.
   -------------------------------------------------------------------------- */
.oneday {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

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

/* The day itself. One track, four segments, no gaps. */
.oneday__bar {
  display: flex;
  margin-top: 1.25rem; height: 3.25rem;
  border-radius: var(--r-sm); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--neutral-150);
}
.oneday__seg {
  display: flex; align-items: center;
  width: var(--w, 0%); min-width: 0;
  padding: 0 .75rem;
}
.oneday__seg b {
  font-size: .75rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Two steps of the brand hue for the two projects, then two neutrals for
   the time that is recorded without being project work. The split in the
   palette is the same split the rows below describe. */
.oneday__seg--a { background: var(--primary-600); }
.oneday__seg--b { background: var(--primary-500); }
.oneday__seg--c { background: var(--neutral-400); }
.oneday__seg--d { background: var(--neutral-300); }
.oneday__seg--d b { color: var(--neutral-800); }

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

.oneday__key { width: .75rem; height: .75rem; border-radius: 3px; }
.oneday__key--a { background: var(--primary-600); }
.oneday__key--b { background: var(--primary-500); }
.oneday__key--c { background: var(--neutral-400); }
.oneday__key--d { background: var(--neutral-300); }

.oneday__name { font-size: .875rem; font-weight: 700; color: var(--neutral-900); }
.oneday__name span { display: block; font-size: .75rem; font-weight: 400; color: var(--neutral-500); }
.oneday__hours {
  text-align: right;
  font-size: .9375rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 859px) {
  .oneday { padding: 1.25rem; }
  .oneday__bar { height: 2.75rem; }
  /* The two 45-minute segments are 9.4 per cent of the day, which is 66px
     of a 700px bar: no room for a word inside them. */
  .oneday__seg--c b,
  .oneday__seg--d b { display: none; }
}

@media (max-width: 599px) {
  .oneday { padding: 1rem; }
  .oneday__seg b { display: none; }
  .oneday__row { grid-template-columns: .75rem minmax(0, 1fr) 5rem; }
}
