/*
 * .seq-jobs — the jobs of a run in execution order, under the dominant figure of the run
 * page (docs/plans/seq-redesign.md § 3): step (linked to the job's page), the .seq-state
 * mark, started, duration, the issue linked when the job has one. A plain gem .admin-table
 * in the body face, as the approved composition (showcase/src/80-pages/12-run-show.html)
 * draws it; this file adds only what keeps the seven columns readable. In viewer mode the
 * step is its label and is not linked.
 *
 *   <table class="admin-table seq-jobs">
 *     <tr class="seq-jobs__row" data-state="running">
 *       <td class="seq-jobs__step"><a data-ref="jobs:9001" href="…">bwa_mem2.mem</a></td>
 *       <td class="seq-jobs__state"><span class="seq-state body-sm" data-state="running">Running</span></td>
 *       <td class="seq-jobs__started-at"><time>08:15:10</time></td>
 *       <td>24 min</td>
 *       <td></td>
 *     </tr>
 *   </table>
 *
 * The row's data-state repeats the mark's so a Turbo Stream can replace the row and
 * .is-changed (09-utilities/_changed.css) can wash it.
 *
 * One row per step (RunStepList): a scattered step's row sums its shards, and the row after
 * it holds .seq-jobs__shards, a <details> with the gem's .disclosure-summary and
 * .disclosure-chevron, closed, whose table lists the shards that have begun by start and
 * counts the rest on one line. No JavaScript: the disclosure is the browser's.
 *
 *   <tr><td colspan="6"><details class="seq-jobs__shards">
 *     <summary class="disclosure-summary body-sm">The 625 shards of gatk.haplotype_caller, by start <svg class="disclosure-chevron">…</svg></summary>
 *     <table class="admin-table o-rows">…</table>
 *   </details></td></tr> In the --viewer variant the step is
 * the step's label, a description ("DeepVariant whole-genome calling over the run's
 * small-variant domain"), and from 768px the cell truncates it with an ellipsis, the full
 * text in the cell's title; below 768px, as a labelled row, it wraps.
 */

.seq-jobs th,
.seq-jobs td {
  white-space: nowrap;
}

/* The step column takes the width the other columns leave; a long step name wraps at a dot. */
.seq-jobs__step {
  white-space: normal;
  overflow-wrap: anywhere;
}

.seq-jobs__state {
  white-space: normal;
}

@media (min-width: 768px) {
  .seq-jobs--viewer .seq-jobs__step {
    max-width: 24rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.seq-jobs__started-at,
.seq-jobs td:empty {
  color: var(--text-secondary);
}

.seq-jobs td:empty::before {
  content: "—";
  color: var(--text-tertiary);
}

/* The shards' disclosure spans the table; its summary and the count of shards not begun wrap. */
.seq-jobs__shards,
.seq-jobs__shards td[colspan] {
  white-space: normal;
}

.seq-jobs__shards > summary {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
}

/* Touch: the summary is one line of text; on a coarse pointer it is at least 44px tall
   (WCAG 2.5.5, README.md § Touch targets), as the notes form's summary is. */
@media (pointer: coarse) {
  .seq-jobs__shards > summary {
    min-block-size: 44px;
  }
}
