/* ==========================================================================
   TeamTrek — last month tracked, next month planned
   --------------------------------------------------------------------------
   The hero figure on the capacity planning page: three teams, the hours
   each of them actually tracked last month, the hours planned for next
   month, and the capacity each team has.

   A comparison rather than a record. The pages in the tracking group draw
   what is happening -- a timer, a task, a client's month; this page is
   about what the finished months are good for, and that is a forecast. So
   every row carries two bars, the second measured against the first, and a
   capacity mark that neither of them is allowed to hide.

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

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

/* The key that says which bar is which. Without it the two bars in a row
   are only two bars. */
.forecast__key {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem;
  margin: 0; padding: .75rem 0 .25rem;
}
.forecast__k {
  display: flex; align-items: center; gap: .4375rem;
  font-size: .75rem; color: var(--neutral-600);
}
.forecast__k i {
  display: block; width: .75rem; height: .75rem; flex: none;
  border-radius: 3px; background: var(--neutral-200);
}
.forecast__k--plan i { background: var(--primary-500); }
.forecast__k--cap i {
  width: 0; height: .875rem; border-radius: 0;
  border-left: 2px dashed var(--neutral-500); background: none;
}

/* ------------------------------------------------------------- the rows */
.forecast__rows {
  flex: 1; min-height: 0;
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-direction: column; justify-content: center; gap: .25rem;
}
.forecast__row {
  display: grid; grid-template-columns: 10rem minmax(0, 1fr) 7.5rem;
  align-items: center; gap: 1rem;
  padding: .625rem 0;
}
.forecast__row + .forecast__row { border-top: 1px solid var(--neutral-100); }

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

/* The track carries both bars and the capacity mark, so the two months and
   the limit are all measured off the same left edge. */
.forecast__track { position: relative; display: block; }
.forecast__bar {
  display: block; height: .875rem;
  border-radius: var(--r-sm); background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.forecast__bar + .forecast__bar { margin-top: .375rem; }
.forecast__bar i {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: inherit; background: var(--neutral-300);
  transition: width var(--dur-slow, 700ms) var(--ease-brand);
}
.forecast__bar--plan i { background: var(--primary-500); }
/* A plan that runs past the team's capacity. Drawn in the warning colour,
   because the point of planning before the month is that this is visible
   while it can still be changed. */
.forecast__bar--over i { background: #c2410c; }

/* The capacity the team has. A line, not a bar: it is the limit the bars
   are read against, and it stays where it is whatever they do. */
.forecast__cap {
  position: absolute; top: -.125rem; bottom: -.125rem;
  left: var(--cap, 100%); width: 0;
  border-left: 2px dashed var(--neutral-500);
}

.forecast__out { text-align: right; }
.forecast__out b {
  display: block;
  font-size: 1rem; font-weight: 800; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.forecast__out span { display: block; font-size: .75rem; color: var(--neutral-500); font-variant-numeric: tabular-nums; }
.forecast__out span.is-over {
  display: flex; align-items: center; justify-content: flex-end; gap: .25rem;
  color: #9a3412; font-weight: 700;
}
.forecast__out .icon { flex: none; }

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

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

@media (max-width: 859px) {
  .forecast { padding: 1.125rem 1.25rem; }
  .forecast__row { grid-template-columns: 8rem minmax(0, 1fr) 6.5rem; gap: .75rem; }
}

@media (max-width: 599px) {
  .forecast { padding: 1rem; }
  /* The names and the figures. A 90px track cannot show one bar against
     another, and the figures beside it say the same thing exactly. */
  .forecast__row { grid-template-columns: minmax(0, 1fr) 7rem; }
  .forecast__track { display: none; }
  .forecast__key { display: none; }
}

/* --------------------------------------------------------------------------
   Where one team's plan came from
   --------------------------------------------------------------------------
   Section 04's figure: three finished months for one team, the average they
   make, and the month planned out of them with the leave already booked
   taken off.

   The three months are drawn in the same track as the plan, because the
   claim is that they are the same measurement: a plan here is an average of
   recorded hours, not a guess written beside them.
   -------------------------------------------------------------------------- */
.span {
  margin-top: 2.5rem; padding: 1.5rem;
  border: 1px solid var(--neutral-200); border-radius: var(--r-lg);
  background: #fff;
}

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

.span__rows { margin: .5rem 0 0; padding: 0; list-style: none; }
.span__row {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 10rem;
  align-items: center; gap: 1rem;
  padding: .75rem 0;
}
.span__row + .span__row { border-top: 1px solid var(--neutral-150); }
/* The planned month. Set apart from the three recorded ones above it,
   because it is the only line on the figure that has not happened yet. */
.span__row--plan { border-top: 1px solid var(--neutral-300); }

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

.span__track {
  position: relative; display: block; height: 1.75rem;
  border-radius: var(--r-sm);
  background: var(--neutral-100);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  overflow: hidden;
}
.span__fill {
  display: block; height: 100%; width: var(--w, 0%);
  background: var(--neutral-300);
}
.span__row--plan .span__fill { background: var(--primary-500); }

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

/* The three figures the four rows add up to. */
.span__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;
}
.span__sum { margin: 0; }
.span__sum b {
  display: block;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--neutral-900); font-variant-numeric: tabular-nums;
}
.span__sum span { display: block; margin-top: .125rem; font-size: .8125rem; color: var(--neutral-500); }
.span__sum--key b { color: var(--primary-700); }

@media (max-width: 859px) {
  .span { padding: 1.25rem; }
  .span__row { grid-template-columns: 7rem minmax(0, 1fr) 8.5rem; gap: .75rem; }
  .span__sums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .875rem 1rem; }
  .span__sum b { font-size: 1.125rem; }
}

@media (max-width: 599px) {
  .span { padding: 1rem; }
  /* The month and the two figures. The bar's share is stated in the row. */
  .span__row { grid-template-columns: minmax(0, 1fr) 8rem; }
  .span__track { display: none; }
}
