/* ==========================================================================
   TeamTrek — the week grid
   --------------------------------------------------------------------------
   The hybrid instrument, inside the shared panel frame.

   A hybrid team's question is not where somebody is. It is whether the
   record follows them: the same hours, against the same projects, whether
   Tuesday was at a desk in the office and Thursday was at a desk at home.
   So this is a week per person, five marks each, with the split stated
   beside it -- and the hours in the same row, because the point of the
   figure is that the hours do not change with the room.

   The frame around it lives in panel.css. Everything here is the
   instrument.
   ========================================================================== */
.week {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: .875rem .875rem .5rem;
}

/* The days, above the rows. The name column matches the rows' own, so a
   day label sits over its own column. */
.week__days,
.week__row {
  display: grid;
  grid-template-columns: 9.5rem repeat(5, minmax(0, 1fr)) 7rem 4rem;
  gap: .375rem;
  align-items: center;
}
.week__days {
  margin: 0 0 .5rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}
.week__days span { text-align: center; }
.week__days span:first-child,
.week__days span:nth-last-child(2),
.week__days span:last-child { text-align: left; }
.week__days span:last-child { text-align: right; }

/* ------------------------------------------------------------- the rows */
.week__rows { display: grid; grid-auto-rows: minmax(0, 1fr); gap: .375rem; min-height: 0; }

.week__who { min-width: 0; font-size: .75rem; color: var(--neutral-500); }
.week__who b {
  display: block;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* One day. On site is filled, at home is outlined, and a day with no hours
   is neither -- a hybrid week has days that are simply not worked, and
   drawing them as "at home" would be inventing attendance. */
.week__day {
  position: relative;
  height: 100%; min-height: 28px;
  border-radius: var(--r-xs);
  background: var(--neutral-100);
  transition: background-color var(--dur-ui) var(--ease-ui);
}
.week__day--site { background: var(--primary-500); }
.week__day--home {
  background: var(--primary-50);
  box-shadow: inset 0 0 0 1.5px var(--primary-300);
}
/* The day being read, from the rail. */
.week__day.is-now { box-shadow: inset 0 0 0 2px var(--primary-800); }
.week__day--home.is-now { box-shadow: inset 0 0 0 2px var(--primary-700); }
.week__days span.is-now { color: var(--primary-700); }

/* The split, in words, where a reader lands after the marks. */
.week__split { font-size: .75rem; color: var(--neutral-600); white-space: nowrap; }
.week__split b { color: var(--neutral-900); font-variant-numeric: tabular-nums; }

.week__hours {
  text-align: right;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- the key */
.week__foot {
  display: flex; align-items: center; gap: 1rem;
  margin: .75rem 0 0; padding-top: .625rem;
  border-top: 1px solid var(--neutral-150);
  font-size: .625rem; color: var(--neutral-500);
}
.week__key { display: inline-flex; align-items: center; gap: .375rem; }
.week__key i {
  width: 11px; height: 11px; border-radius: 3px;
  background: var(--primary-500);
}
.week__key--home i {
  background: var(--primary-50);
  box-shadow: inset 0 0 0 1.5px var(--primary-300);
}
.week__key--off i { background: var(--neutral-100); }

@media (prefers-reduced-motion: reduce) {
  .week__day { transition: none; }
}

/* ------------------------------------------------------------- narrower */
@media (max-width: 959px) {
  .week { padding: .75rem .75rem .5rem; }
  .week__days,
  .week__row { grid-template-columns: 7.5rem repeat(5, minmax(0, 1fr)) 3.5rem; }
  /* The split moves into the words under the panel: at this width the five
     marks already say three and two. */
  .week__split { display: none; }
}

/* --------------------------------------------------------------- phones */
@media (max-width: 599px) {
  .week { padding: .625rem .5rem .5rem; }
  .week__days,
  .week__row { grid-template-columns: 6rem repeat(5, minmax(0, 1fr)) 3.25rem; gap: .25rem; }
  .week__days { font-size: .75rem; letter-spacing: .04em; }
  .week__who b { font-size: .75rem; }
  .week__who { font-size: 0; }
  .week__hours { font-size: .75rem; }
  .week__foot { flex-wrap: wrap; gap: .25rem .75rem; font-size: .75rem; }
}
