/* The producer's page for a delivery made as Files: the files already in
   it as rows (js/delivery-file-rows.js), and the Release notes above them
   (js/delivery-release-notes.js). Loaded after files.css, which has the
   checksum line, and after uploads.css, file-meta.css and upload-tiles.css,
   whose cell, Details button and remove button a row reuses.

   A row (the lead is the icon, or the file's thumbnail where the server
   has one, or the check while choosing):

     +------+-----------------------------------------------+------+------+
     | icon | setup-2.4.1.msi                               |  #3  |  x   |
     |      | 48.2 MB  SHA-256 9f2c…e1a0 [Copy]  Download   |      |      |
     +------+-----------------------------------------------+------+------+

   Rows share one frame with a hairline between them, as the client's list
   does (recipient-list.css). Files still being uploaded stay tiles above
   (upload-tiles.css). */

/* --- the list ----------------------------------------------------------- */

.wgrid.up-grid.up-rows {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  overflow: hidden;
}

.up-row {
  display: grid;
  grid-template-columns: var(--control-l) minmax(0, 1fr) var(--control-l) var(--control-l);
  align-items: center;
  column-gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  contain-intrinsic-block-size: auto 76px;
}
.up-row + .up-row { border-top: 1px solid var(--line2); }
.up-row.is-selected { background: var(--accent-tint); }

/* --- the parts of a row ------------------------------------------------- */

.up-row-lead {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--control-l);
  height: var(--control-l);
  overflow: hidden; /* a thumbnail is cut to the square's corners */
  border-radius: var(--radius-control);
  background: var(--sunken);
  color: var(--mute);
}
.up-row-icon { display: grid; place-items: center; }
/* An icon that took a thumbnail's place inside the button that opens the
   viewer fills the square as the thumbnail did. */
.up-view > .up-row-icon { width: 100%; height: 100%; }
.up-row-icon svg { width: var(--icon-l); height: var(--icon-l); }
/* The thumbnail fills the icon's square, and so does the button round it
   that opens the viewer (.up-view, upload-tiles.css). */
.up-row-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* While choosing, the check takes the icon's or the thumbnail's place. */
.up-row-lead:has(.up-toggle) :is(.up-row-icon, .up-row-thumb) { visibility: hidden; }
.up-row .up-check { top: 11px; left: 11px; }
.up-row.is-selected .up-row-lead { background: none; }

.up-row-main { min-width: 0; }
.up-row .up-name { display: flex; color: var(--ink); }
.up-row-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}

/* Details sits in the corner of a 44 px square, as on a tile; the square is
   this cell. */
.up-row-tools { position: relative; width: var(--control-l); height: var(--control-l); }
.up-row .btn.up-remove { width: var(--control-l); height: var(--control-l); grid-column: auto; grid-row: auto; }

/* Download, the last of a row's facts, is a text button: a finger gets 44 px
   on any touch screen, whatever its width, and so does a phone's width with
   any pointer. */
@media (pointer: coarse), (max-width: 820px) {
  .up-row-facts > .btn.link.sm { min-height: var(--control-l); }
}

/* The line above the rows: what the checksums are. */
.up-note { margin: 0 0 var(--space-3); }

/* --- release notes ------------------------------------------------------ */

.release-notes .panel-head { margin-bottom: var(--space-3); }
.release-notes textarea { min-height: 128px; }
.release-notes .actions { justify-content: flex-end; margin-top: var(--space-3); }
@media (max-width: 820px) {
  .release-notes .btn { min-height: var(--control-l); }
}
