/* 11-scheduled-jobs.css: Beheer > Geplande taken (HEA-491): the job list and one job's page.
   Loaded by base.html, one <link> per file in number order; a later file wins on source
   order. */

/* Fixed columns, as the audit log's and Verzonden mail's: the tables keep their geometry
   whether a job has run or not, and while the runs table re-fetches itself. */
.data-table--jobs,
.data-table--runs {
  table-layout: fixed;
}

.data-table--jobs td,
.data-table--runs td {
  overflow-wrap: anywhere;
}

/* The result column is the widest after the name: it holds the reason of a failed run. The
   Koppeling column holds an integration's name ("Uitgaande mail (Microsoft Graph)") on two
   lines at most, the height the job's own name and description already give the row. */
.job-col--name { width: 24%; }
/* Without the Koppeling column (an integration's own page), the name takes its width too. */
.job-col--name-wide { width: 39%; }
.job-col--integration { width: 15%; }
.job-col--schedule { width: 12%; }
.job-col--moment { width: 11%; }
.job-col--state { width: 8%; }
.job-col--result { width: 20%; }
.job-col--action { width: 10%; }

/* The row's one action sits at the table's right edge, under no heading. */
.job-cell--action {
  text-align: right;
}

/* "Gestart door" holds "Herhaling (poging 2 van 3)" on one line (HEA-495), so a retry's row is
   as high as any other. In a window narrower than 1440 the cell cuts the text with an ellipsis
   instead of wrapping it. */
.run-cell--by {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-col--moment { width: 15%; }
.run-col--by { width: 22%; }
.run-col--state { width: 12%; }
.run-col--result { width: 36%; }

/* An outcome pill is one word on one line, whatever the column leaves it. */
.data-table--jobs .badge,
.data-table--runs .badge {
  white-space: nowrap;
}

/* A result too long for its line (jobs/_run_result.html). Closed, it is one line like every
   other row's, so the rows of a table keep one height. Opened, the full text takes the place
   of its cut start, and that row alone grows.

   The disclosure marker follows the text instead of leading it, so a text that opens and
   one that does not start on the same vertical line. A line the column cannot hold, in a
   window narrower than 1440, ends in an ellipsis instead of running into the next cell. */
.run-result-line,
.run-result > summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-result > summary {
  cursor: pointer;
  list-style: none;
}

.run-result > summary::-webkit-details-marker {
  display: none;
}

.run-result > summary::after {
  content: " \25B8";
  color: var(--muted);
}

.run-result[open] > summary::after {
  content: " \25BE";
}

.run-result[open] > summary {
  overflow: visible;
  white-space: normal;
}

.run-result__full,
.run-result[open] .run-result__start {
  display: none;
}

.run-result[open] .run-result__full {
  display: inline;
}

/* One job's page. Its sibling, Verzonden mail's detail, splits 5 + 7 for a mail preview beside
   its details. Here the left card holds two values and three fields and the right one a
   five-column table whose last column is a sentence and whose second names a retry and its
   attempt, so the split is 3 + 9: any narrower and either the result column drops under
   320px, where the standard failure reasons no longer fit one line, or a retry's row wraps
   and stands higher than the rows around it.

   The schedule form, or the note that stands in its place, starts one row below the card's
   two values. Those rows are ruled, the last one too, so no second rule is drawn here. */
.job-schedule {
  margin-top: 1.25rem;
}

/* The schedule form shows the fields of the chosen kind only. The wrappers take no box of
   their own, so the fields inside stay cells of the form's twelve-column grid.

   The form is found by its class and the select by its name's ending: an integration's page
   holds one such form per job, each with its own prefix and id. */
.schedule-kind {
  display: contents;
}

form.job-schedule:has(select[name$="kind"] option[value="daily"]:checked) .schedule-kind--interval,
form.job-schedule:has(select[name$="kind"] option[value="interval"]:checked) .schedule-kind--daily {
  display: none;
}
