/* ==========================================================================
   TeamTrek — the merge panel
   --------------------------------------------------------------------------
   The hero figure on the remote monitoring page: three people in three
   places, and the one record their work arrives in.

   The page's argument is that distance changes where work happens and not
   what is recorded about it, and that a lost connection delays the record
   rather than losing it. Neither of those is a number, so neither belongs in
   a dashboard: they are a shape. Three lanes feeding one list, with one lane
   holding its work until it can hand it over.

   1056 by 482, like every other hero figure on the site. The lanes take the
   width and the record takes a fixed column beside them, so a lane's blocks
   stay wide enough to read as stretches of a day rather than as ticks.

   Drawn in CSS. Nothing here is an image, and nothing claims to be a
   screenshot of the product.
   ========================================================================== */

.merge {
  width: 100%; max-width: 66rem; margin-inline: auto;
  padding: 1.25rem;
  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 */
.merge__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid var(--neutral-200);
}
.merge__team { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }
.merge__where { font-size: .8125rem; color: var(--neutral-500); }
.merge__state {
  display: flex; align-items: center; gap: .5rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--primary-700);
}
.merge__day {
  margin-left: auto;
  font-size: .8125rem; color: var(--neutral-600); font-variant-numeric: tabular-nums;
}
.merge__day b { font-weight: 700; color: var(--neutral-900); }

/* ------------------------------------------------------------ the split */
.merge__split {
  flex: 1; min-height: 0;
  margin-top: .875rem;
  display: grid; grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: 1.5rem;
}

/* ------------------------------------------------------------- the lanes */
.merge__lanes {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: .75rem;
}
.merge__lane { min-height: 0; display: flex; flex-direction: column; justify-content: center; }

.merge__who {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; color: var(--neutral-500);
}
.merge__who b { font-weight: 700; color: var(--neutral-900); }
/* The local clock, which is the only thing on the lane that says these three
   are not in the same room. */
.merge__local { margin-left: auto; font-variant-numeric: tabular-nums; }

.merge__track {
  position: relative;
  margin-top: .4375rem; height: 1.625rem;
  display: flex; gap: 3px;
  border-radius: var(--r-sm);
  background: var(--neutral-50);
  box-shadow: inset 0 0 0 1px var(--neutral-150);
  padding: 3px;
  overflow: hidden;
}
.merge__block {
  flex: 0 0 auto; width: var(--w, 8%);
  border-radius: 2px;
  background: var(--primary-400);
}
/* Work that happened with no connection to send it over. Hatched rather
   than absent: the hours exist, the server has not been told yet. */
.merge__block--queued {
  background: repeating-linear-gradient(135deg,
    var(--neutral-200) 0 4px, var(--neutral-100) 4px 8px);
  box-shadow: inset 0 0 0 1px var(--neutral-200);
}
/* The moment a queue is handed over. One pass, then it is just work. */
.merge__block--sending { background: var(--primary-200); }

.merge__flag {
  margin-top: .375rem;
  display: flex; align-items: center; gap: .375rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--neutral-500);
}
.merge__flag .icon { flex: none; width: 13px; height: 13px; }
.merge__lane[data-offline="true"] .merge__flag { color: var(--warning-text); }

/* ------------------------------------------------------------ the record */
/* What the three lanes come to. A list, because that is what a record is,
   and the newest entry at the top because that is the one that just arrived. */
.merge__record {
  min-height: 0;
  display: flex; flex-direction: column;
  padding-left: 1.5rem;
  border-left: 1px solid var(--neutral-150);
}
.merge__rechead {
  display: flex; align-items: baseline; gap: .5rem;
  font-size: .8125rem; color: var(--neutral-500);
}
.merge__rechead b { font-size: .9375rem; font-weight: 700; color: var(--neutral-900); }

.merge__rows {
  margin: .75rem 0 0; padding: 0; list-style: none;
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: .5rem;
  overflow: hidden;
}
/* Two lines, not three columns. An entry is a name, a project and a task --
   "Maya R. - Atlas redesign - Components" -- and the record is a 280px
   column, so on one line the middle of every entry was cut to 175px and the
   thing a reader wants, the task, was the part that went. */
.merge__row {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline; gap: .125rem .5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--neutral-150);
  font-size: .75rem; color: var(--neutral-600);
}
.merge__row:last-child { border-bottom: 0; }
.merge__time { font-weight: 700; color: var(--neutral-900); font-variant-numeric: tabular-nums; }
.merge__what {
  grid-column: 1 / -1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Where the entry came from. A word, not a flag: the point is that the
   record knows, not that the reader should care which. */
.merge__from {
  justify-self: end;
  padding: .0625rem .375rem;
  border-radius: var(--r-pill);
  background: var(--neutral-100);
  /* .75rem rather than the .625 a micro-tag usually takes here: it is the
     word that says whether an entry arrived live or came out of a queue,
     which is the panel's whole subject. */
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  color: var(--neutral-500);
}
.merge__row.is-new .merge__from { background: var(--primary-50); color: var(--primary-700); }

.merge__synced {
  flex: none;
  margin-top: .75rem; padding-top: .75rem;
  border-top: 1px solid var(--neutral-200);
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--neutral-500);
}
.merge__synced .icon { flex: none; color: var(--neutral-400); }
.merge__synced b { font-weight: 700; color: var(--neutral-900); font-variant-numeric: tabular-nums; }

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

@media (max-width: 859px) {
  /* The record goes under the lanes. Beside them at this width it is a
     280px column against three tracks of 300, and neither reads. */
  .merge { padding: 1.125rem; }
  .merge__split { grid-template-columns: minmax(0, 1fr); gap: 1.125rem; }
  .merge__lanes { grid-template-rows: auto; gap: 1rem; }
  .merge__record {
    padding-left: 0; padding-top: 1.125rem;
    border-left: 0; border-top: 1px solid var(--neutral-150);
  }
  .merge__rows { gap: .4375rem; }
  /* Three entries, not five. Under the lanes rather than beside them, and
     with each entry on two lines, five put the card at 867px on a tablet --
     a hero figure nearly twice the height of the one every other page
     carries. Three still show that the lanes land in one place. */
  .merge__row:nth-child(n + 4) { display: none; }
}

@media (max-width: 599px) {
  .merge { padding: 1rem; }
  .merge__who { font-size: .75rem; }
  .merge__track { height: 1.375rem; }
}
