/* Watched: two views behind a switch, films (the default) and shows. Each has the film or episode
   on now (or the last one) as the page's .feature, a sortable table, and the year in films or
   episodes. */

.view-switch { width: fit-content; }

/* What's on now, or the last thing watched */

.watch-slot { margin-top: 20px; }
.watch-rating { margin-top: 12px; line-height: 1; }

/* Films and shows: tables sorted by whichever column header was clicked (.sortable, in
   system.css). Like the books page's table, they adapt to their own width rather than the
   viewport's. A show's row has its last episode under the title and how far through it is in
   place of a film's year and length. */

.table-wrap { container-type: inline-size; }

/* Column widths come from the header row (table-layout: fixed) */
th.col-poster { width: 62px; }
th.col-year { width: 72px; }
th.col-rating { width: 110px; }
th.col-runtime { width: 84px; }
th.col-progress { width: 168px; }
th.col-watched { width: 140px; }

.watch-table .col-title { padding-right: 20px; }
td.col-title > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.col-title > .row-byline { color: var(--muted); font-size: 13px; }
td.col-title > .row-byline--narrow { display: none; }

.watch-table .col-runtime, .watch-table .col-watched { text-align: right; }
td.col-year, td.col-runtime, td.col-watched, .row-count { color: var(--meta); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-plays { margin-left: 6px; color: var(--ch-ink); }
.watch-table .none { color: var(--faint); font-size: 13px; }

.row-progress { display: flex; align-items: center; gap: 10px; padding-right: 16px; }
.row-progress .progress { flex: none; width: 70px; }

/* Narrower: a film's year moves under the title and the rating column shrinks to its dots; a
   show's rating drops out (progress and the date need the room). Narrower still: a film's
   length drops out, and progress is just counts. */
@container (max-width: 640px) {
  th.col-year, td.col-year { display: none; }
  th.col-rating { width: 76px; }
  th.col-progress { width: 132px; }
  .watch-table--shows .col-rating { display: none; }
  .watch-table--shows th.col-watched { width: 106px; }
  td.col-title > .row-byline--narrow { display: block; }
  .row-progress .progress { width: 46px; }
}

@container (max-width: 480px) {
  th.col-runtime, td.col-runtime { display: none; }
  .watch-table { font-size: 14px; }
  .watch-table .col-title { padding-right: 12px; }
  th.col-poster { width: 48px; }
  th.col-rating { width: 58px; }
  th.col-progress { width: 84px; }
  th.col-watched { width: 106px; }
  .row-progress { padding-right: 8px; }
  .row-progress .progress { display: none; }
  .watch-table .thumb-poster { width: 28px; height: 42px; }
  .watch-table .rating { gap: 2px; }
  .row-plays { display: none; }
}
