/* Producer application =====================================================
 *
 * The producer application's own stylesheet: the Vue single-page app at /.
 * Everything it shares with the administrative area (tokens, Archivo, the
 * element defaults, buttons, forms, tables, tags, messages, page chrome, the
 * segmented control, the detail grid and the upload slots) is in base.css,
 * which this file imports first. What follows is the producer screens only.
 * admin.css imports the same base and neither file imports the other, so a
 * rule here cannot reach an admin page.
 *
 * The markup is plain semantic HTML and nearly everything hangs off element
 * selectors in base.css. A class here names a producer screen or a part of
 * one, never a colour or a size.
 */

@import url("/assets/base-cf1e4fea.css");

/* Shell ------------------------------------------------------------------- */

/* The producer application has no nav row. The organization name sits beside
 * the brand because it is the one fact a producer checks before doing
 * anything: that they are signed into the right organization. */
.site-header .organization {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-800);
}

/* Vue field wrappers. base.css styles form > div; the components wrap a
 * field in div.field wherever a form is not the direct parent. */
.field {
  max-width: 34rem;
  margin: 0 0 var(--space-4);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  max-width: 34rem;
}

.field-row > .field {
  flex: 1 1 10rem;
}

/* A field's own error sits under it as a line, in the attention colour. A
 * form-level message is a banner and uses .alert from base.css. */
.field .error,
.field-row .error,
form > p.error,
td .error {
  margin: 5px 0 0;
  max-width: none;
  font-size: 13px;
  color: var(--color-accent-700);
}

form > p.error {
  margin: calc(var(--space-4) * -1) 0 var(--space-4);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Header actions are inline-block rather than flex items. Selenium's visible
 * text, which the system tests read, breaks a line at every element that is
 * not inline-level, and inline-flex counts as not: "New property" and
 * "Create a season" have to read as one line of text. */
.page-actions {
  display: block;
  margin-left: auto;
}

.page-actions .button {
  display: inline-block;
  margin-left: var(--space-2);
  line-height: 18px;
  vertical-align: middle;
}

.page-actions .button .icon {
  display: inline-block;
  margin-right: 4px;
  vertical-align: -3px;
}

/* Red is reserved for the confirmed, typed, irreversible delete. Every other
 * destructive control on the producer side (Remove on a file row, the first
 * Delete property press) keeps its class, which is the tier the tests read,
 * and is drawn as a ghost action in the attention colour. */
button.destructive:not(.confirmed) {
  color: var(--color-accent-700);
  background: transparent;
  border-color: transparent;
}

button.destructive:not(.confirmed):hover {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

button.destructive:not(.confirmed):active {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
}

.hint {
  color: var(--color-neutral-800);
}

/* Property state ---------------------------------------------------------- */

/* The state word is always present. The fill is the tag doctrine: neutral at
 * rest, outline in between, accent where someone must act, ink when done.
 * Someone who cannot tell the four apart reads exactly the same information.
 *
 * A state with no rule of its own falls through to the neutral base, which is
 * why the base carries a full set of properties rather than only the shared
 * ones. MediaProperty::STATES can grow without this file being touched. */
.state-badge {
  display: inline-block;
  padding: 3px 10px;
  line-height: 1.5;
  vertical-align: middle;
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--color-neutral-800);
  background: var(--color-neutral-100);
  border: 1px solid transparent;
}

.state-badge.state-submitted {
  padding: 2px 9px;
  color: var(--color-accent-700);
  background: transparent;
  border-color: var(--color-accent);
}

.state-badge.state-needs_attention {
  color: var(--color-accent-800);
  background: var(--color-accent-100);
}

.state-badge.state-published {
  color: var(--color-bg);
  background: var(--color-text);
}

/* Sign in ----------------------------------------------------------------- */

/* The producer header is only rendered once signed in, so the sign-in sheet
 * owns the whole viewport. */
main.sign-in {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 100vh;
  padding: 0;
}

.sign-in > * {
  margin: 0;
  padding: 80px var(--gutter);
}

.sign-in-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 2px solid var(--color-divider);
}

.sign-in-form h1 { margin: 0; }
.sign-in-form form { max-width: 34rem; }
.sign-in-form .alert { margin: 0 0 20px; }
.sign-in-form form > div { margin-bottom: 20px; }

.sign-in-lede {
  margin: 0;
  font-size: 16px;
  color: var(--color-neutral-800);
}

.sign-in-note h2 {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-divider);
}

/* Two separate sign-in surfaces exist, and an account from one is not
 * recognised by the other. Someone who lands on the wrong one otherwise gets
 * told their password is incorrect, which sends them looking for the wrong
 * problem entirely. This is a static hint rather than a message triggered by
 * a failed attempt, so it discloses nothing about whether any particular
 * account exists. */
.other-portal {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  font-size: 14px;
  color: var(--color-neutral-800);
}

/* Dashboard --------------------------------------------------------------- */

/* One tile per state between two 2px rules, the figure at display size. The
 * whole tile is the link, so the count and its name are one target. */
.state-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 var(--space-8);
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--color-divider);
  border-bottom: 2px solid var(--color-divider);
}

.state-counts .count {
  display: flex;
  border-right: 1px solid var(--color-divider);
}

.state-counts .count:last-child { border-right: 0; }

.state-counts a {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 18px var(--space-6) 22px;
  color: var(--color-text);
  text-decoration: none;
}

.state-counts .count:first-child a { padding-left: 0; }

.state-counts a:hover .count-value,
.state-counts a:focus-visible .count-value {
  color: var(--color-accent-700);
}

.count-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-neutral-800);
}

.count-value {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 40px;
}

/* With nothing uploading there is no second column, and the lists take the
 * sheet rather than ending against a blank third of it. */
.overview-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.overview-grid > div {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.list-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-divider);
}

.list-heading h2 { margin: 0; }

.not-ready ul,
.needs-attention ul,
.uploading-now ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.not-ready li,
.needs-attention li,
.uploading-now li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: 14px;
}

.not-ready li a,
.needs-attention li a {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.not-ready li a:hover,
.needs-attention li a:hover {
  color: var(--color-accent-700);
  text-decoration: underline;
}

.not-ready .readiness-note {
  flex-basis: 100%;
  font-size: 13px;
}

.uploading-now .filename {
  flex-basis: 100%;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: var(--space-6) 0 48px;
  border-top: 2px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.empty-state p { margin: 0; }

.empty-title {
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 800;
}

/* Media property list ----------------------------------------------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-6);
  padding: 14px 0;
  border-top: 2px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

/* Seven columns do not fit a phone; the table keeps its width and scrolls
 * inside .table-wrap rather than crushing every cell to a word per line. */
table.properties {
  min-width: 56rem;
}

table.properties .title-cell {
  min-width: 18rem;
}

/* What is left on a draft, in the attention colour: it is something to do. */
.readiness-note { color: var(--color-accent-700); }

.season-row td {
  background: var(--color-surface);
}

.season-row .title-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
}

.season-label { font-weight: 600; }

.season-state {
  display: inline-block;
  margin-right: var(--space-4);
}

.season-state .state-badge { vertical-align: middle; }

.season-episode td:first-child {
  padding-left: var(--space-8);
}

/* Media property detail --------------------------------------------------- */

.detail-main {
  min-width: 0;
}

/* The readiness panel. A sunk panel under the title with a 4px rule along
 * its top that is the one animated thing on the page: Track Grey while items
 * are unmet, Signal Blue the moment the last one resolves. */
.readiness {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-6) 40px;
  margin: 0 0 var(--space-8);
  padding: 18px 20px 20px;
  background: var(--color-surface);
  border-top: 4px solid var(--color-neutral-300);
  transition: border-top-color 300ms ease-out;
}

.readiness.is-ready {
  border-top-color: var(--color-accent);
}

.readiness-body {
  flex: 1 1 24rem;
  min-width: 0;
}

.readiness-body h2 {
  margin: 0 0 var(--space-3);
}

.readiness-body .alert {
  margin: 0 0 var(--space-3);
}

.readiness-summary {
  margin: 0;
  font-weight: 600;
}

.readiness-list > * {
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-divider);
  font-size: 14px;
}

.readiness-ready {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-weight: 600;
}

.readiness-ready .icon { color: var(--color-accent); }

.readiness-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  gap: var(--space-2);
  margin-left: auto;
}

.readiness-actions button {
  min-width: 220px;
  justify-content: space-between;
  padding: 13px 14px;
  font-size: 15px;
}

.readiness-actions .readiness-note {
  max-width: 240px;
  margin: 0;
  font-size: 13px;
  color: var(--color-neutral-800);
  text-align: right;
}

/* Slots. base.css draws the slot; these are the parts only the producer page
 * has: the expected list wrapper, the list-that-is-still-a-list of rows, and
 * the attach form. */
.expected-assets {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* On this page the slots are ruled sections, not boxes: a 2px rule above
 * each heading, hairlines between rows, no fill. Newsprint Sunk is reserved
 * for the readiness panel and the drop target, so the one sunk panel stays
 * the one thing on the page that is sunk. */
.detail-main .slot {
  padding: var(--space-3) 0 var(--space-4);
  background: transparent;
  border-top: 2px solid var(--color-divider);
}

.detail-main .slots { gap: var(--space-2); }

/* The Assets heading already rules the top of the stack. */
.detail-main .slots > .slot:first-child { border-top: 0; }

.detail-main .expected-assets { gap: var(--space-2); }

.detail-main .slot-asset { padding-inline: 0; }

.detail-main .slot-asset.is-failed { padding-inline: var(--space-3); }

.slot-heading :is(h2, h3) { font-size: 18px; }

ul.assets {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.assets .filename {
  flex: 1 1 12rem;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.slot-asset .subline {
  flex-basis: 100%;
}

.slot-asset form .filename { margin: 0 0 var(--space-3); }

.slot-status.muted { margin: 0; }

.slot.attach form { margin-top: var(--space-2); }

.slot .field,
.slot .field-row {
  max-width: none;
}

/* The drop zone. The native input sits inside it, visible and focusable. The
 * zone is a second way to do the same thing, never the only way -- a drop
 * target that replaced the input would be unreachable by keyboard and
 * invisible to a screen reader, which on this product is not a trade worth
 * making. :focus-within rather than :focus, so tabbing to the input lights
 * the whole zone and the focus ring lands somewhere a sighted keyboard user
 * can see. */
.drop-zone {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 2px dashed var(--color-divider);
}

.drop-zone.is-active {
  background: var(--color-accent-100);
  border-color: var(--color-accent);
  border-style: solid;
}

.drop-zone:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.drop-zone input[type="file"] {
  display: block;
  max-width: 100%;
  font: inherit;
  font-size: 14px;
}

.drop-zone-prompt {
  margin: 0 0 var(--space-3);
  max-width: none;
  font-weight: 600;
}

.drop-zone-hint {
  margin: var(--space-2) 0 0;
  max-width: none;
  font-size: 13px;
  color: var(--color-neutral-800);
}

.drop-zone-chosen {
  margin: var(--space-3) 0 0;
  max-width: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* Upload progress. A 6px square bar in the system's track and fill; the
 * native element keeps its semantics and loses its chrome. */
.upload-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-2) 0 0;
  font-size: 14px;
}

.upload-progress p {
  margin: 0;
  max-width: none;
}

progress {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  max-width: 18rem;
  height: 6px;
  border: 0;
  background: var(--color-neutral-300);
  accent-color: var(--color-accent);
}

progress::-webkit-progress-bar { background: var(--color-neutral-300); }
progress::-webkit-progress-value { background: var(--color-accent); }
progress::-moz-progress-bar { background: var(--color-accent); }

/* A failed upload is something to act on, so it is set in the attention
 * colour, not a red. */
.upload-error {
  font-weight: 600;
  color: var(--color-accent-700);
}

.playback { margin-top: var(--space-2); }

/* A 4K or 8K master would otherwise play at its native pixel size and run off
 * the page. Width and height stay auto so both caps scale it down with its
 * aspect ratio intact, and the height cap keeps a portrait clip on screen. */
.playback .player {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  margin: 0 0 var(--space-3);
}

.playback .properties {
  font-size: 13px;
  color: var(--color-neutral-800);
}

/* Deletion is last and set apart. The red rule belongs to the warning panel
 * that appears after the first press, not to the section at rest. */
.deletion {
  padding-top: var(--space-4);
  border-top: 2px solid var(--color-divider);
}

.deletion h2 { margin-bottom: var(--space-3); }

.deletion .warning p { margin: 0 0 var(--space-3); }
.deletion .warning p:last-child { margin: 0; }

.deletion .field { max-width: none; }

/* Forms ------------------------------------------------------------------- */

/* The expected-asset choices and the producer/series scope toggle are
 * fieldsets inside a form; base.css styles fieldset.choices, and these keep
 * the class names the tests read. */
.series-scope {
  max-width: 34rem;
  margin: 0 0 var(--space-4);
  padding: 0;
  border: 0;
}

.series-scope legend {
  margin: 0 0 5px;
  padding: 0;
  font-size: 12px;
  color: var(--color-neutral-800);
}

.series-scope label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: 0;
  font-size: 14px;
  color: var(--color-text);
}

.series-scope input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
}

/* Season grid ------------------------------------------------------------- */

.season-grid-fields {
  min-width: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
  border: 0;
}

.season-grid {
  min-width: 56rem;
}

.season-grid td {
  vertical-align: top;
}

.season-grid input,
.season-grid textarea {
  min-height: 36px;
  max-width: none;
}

.season-grid-number { width: 6rem; }
.season-grid-date { width: 11rem; }
.season-grid-textarea { width: 30%; }

/* Narrow screens ---------------------------------------------------------- */

@media (max-width: 48rem) {
  main.sign-in {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .sign-in > * {
    padding: var(--space-8) var(--gutter);
    border-right: 0;
  }

  .sign-in-form { border-bottom: 2px solid var(--color-divider); }

  .state-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .state-counts a { padding-left: 0; }
  .state-counts .count { border-right: 0; }
  .count-value { font-size: 48px; }

  .overview-grid,
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* The segments stay on one line and the bar scrolls; a control that wraps
   * inside its own border reads as two controls. */
  .filter-bar { overflow-x: auto; }
  .seg { flex-wrap: nowrap; }
  .seg a { white-space: nowrap; }

  .metadata { grid-template-columns: minmax(0, 1fr); }

  .readiness-actions {
    align-items: stretch;
    width: 100%;
    margin-left: 0;
  }

  .readiness-actions .readiness-note {
    max-width: none;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .readiness { transition: none; }
}
