/* ==========================================================================
   TeamTrek — the task list, and the sittings one task was worked in
   --------------------------------------------------------------------------
   The hero figure on the task time tracking page: four of a project's
   twelve tasks, each with the time tracked on it and the estimate it was
   given, and one of them running.

   A list rather than a clock. The project page draws the moment an hour is
   attached; a task only means anything beside the other tasks of the same
   project and the estimate each was given, so the figure here is the
   comparison, with one row moving inside it.

   1056 by 482, like every other hero figure on the site. Four rows, not
   twelve: the panel's argument is what a single row says -- tracked,
   estimated, and the distance between them -- and four rows say it at a
   size a reader can read. The foot carries what the other eight add up to.
   ========================================================================== */

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

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

/* The mark in the gutter. A ring on every row, filled on the one being
   tracked: a task either is or is not what somebody is doing right now,
   and that is the only state the list needs to show. */
.tasklist__mark {
  width: .625rem; height: .625rem; margin-inline: auto;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--neutral-300);
}
.tasklist__row--on .tasklist__mark { background: var(--primary-500); box-shadow: none; }

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

.tasklist__track {
  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;
}
.tasklist__track i {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit; background: var(--neutral-200);
}
/* The task being tracked, and the task that has passed what it was given.
   Over is marked, not scolded: a warmer neutral rather than a red, because
   a task over its estimate is a fact about the estimate as often as it is
   a fact about the task. */
.tasklist__row--on .tasklist__track i { background: var(--primary-400); }
.tasklist__row--over .tasklist__track i { background: var(--neutral-400); }

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

/* ------------------------------------------------------------- the foot */
.tasklist__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.5rem;
}
.tasklist__sum b {
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.tasklist__sum span { margin-left: .5rem; font-size: .8125rem; color: var(--neutral-500); }

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

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

@media (max-width: 859px) {
  .tasklist { padding: 1.125rem 1.25rem; }
  .tasklist__row { grid-template-columns: 1rem 10rem minmax(0, 1fr) 8rem; gap: .75rem; }
  .tasklist__note { margin-left: 0; }
}

@media (max-width: 599px) {
  .tasklist { padding: 1rem; }
  /* The name and the figures. A bar 80px wide reads as a smudge, and the
     two figures beside it say the same thing exactly. */
  .tasklist__row { grid-template-columns: 1rem minmax(0, 1fr) 7rem; }
  .tasklist__track { display: none; }
}

/* --------------------------------------------------------------------------
   One task, in the sittings it was worked in
   --------------------------------------------------------------------------
   Section 04's figure: the same task the hero is tracking, drawn across one
   day as the four sessions it was actually worked in.

   The gaps are the point. A task total of three hours five is four pieces
   with lunch and two interruptions between them, and no single number can
   say that.
   -------------------------------------------------------------------------- */
.sessions {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

.sessions__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--neutral-150);
}
.sessions__what { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.sessions__where { font-size: .8125rem; color: var(--neutral-500); }
.sessions__total {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.sessions__total b { font-weight: 700; color: var(--neutral-900); }

/* The clock along the top, so the blocks underneath have hours to sit in. */
.sessions__axis {
  position: relative; height: 1.0625rem;
  margin-top: 1.25rem;
  font-size: .75rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.sessions__axis b {
  position: absolute; top: 0;
  left: calc(var(--at) * 1%); transform: translateX(-50%);
  font-weight: inherit; white-space: nowrap;
}
.sessions__axis b:first-child { transform: none; }
.sessions__axis b:last-child { transform: translateX(-100%); }

.sessions__track {
  position: relative; height: 3.25rem;
  margin-top: .375rem;
  border-radius: var(--r-sm);
  background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
}
.sessions__block {
  position: absolute; top: 5px; bottom: 5px;
  left: calc(var(--from) * 1%); right: calc(100% - var(--to) * 1%);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-xs);
  background: var(--primary-500);
}
.sessions__block b {
  font-size: .75rem; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden;
}

/* The four sittings read down, so the arithmetic is never measured off the
   picture. */
.sessions__rows {
  margin: 1.25rem 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.sessions__row span {
  display: block;
  font-size: .8125rem; color: var(--neutral-500); font-variant-numeric: tabular-nums;
}
.sessions__row b {
  display: block; margin-top: .125rem;
  font-size: 1.125rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}

@media (max-width: 859px) {
  .sessions { padding: 1.25rem; }
  .sessions__track { height: 2.75rem; }
  /* The two shortest sittings are 25 and 35 minutes, which is 35px and 50px
     of a 700px day: no room for a label inside them. */
  .sessions__block b { display: none; }
  .sessions__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; }
}

@media (max-width: 599px) {
  .sessions { padding: 1rem; }
  .sessions__row b { font-size: 1rem; }
}
