/* =========================================================================
   PubArx Pitch: the submitter's page (/dashboard/pitches/{paper}). The cards,
   the uploader driven by js/pitch-upload.js, the captions block and the
   unfinished-upload notice. Every selector starts with .pitch-; colours come
   only from the tokens in pubarx.css, so dark mode follows them. The player
   is styled in pitch.css.
   ========================================================================= */

/* ------------------------------------------------------------------ cards */

.pitch-manage-card .card-body > p:first-child { margin-top: 0; }
.pitch-manage-card .pitch-player { margin: 16px 0; }
.pitch-manage-badges { gap: 6px; }
.pitch-manage-actions { margin-top: 16px; gap: 8px; }
.pitch-manage-actions form { margin: 0; }
.pitch-manage-subhead { margin: 18px 0 4px; font-size: 1rem; }
.pitch-manage-card .card-body > .pitch-manage-subhead:first-child { margin-top: 0; }
.pitch-rules { margin-bottom: 20px; }

/* Everything the script reveals, in the uploader and in the unfinished-upload block (.btn's display would otherwise
   show a hidden "Try again"). */
.pitch-upload [hidden], .pitch-resume [hidden] { display: none; }

/* ------------------------------------------------------------------ the uploader */

.pitch-needs-js { margin: 0 0 12px; color: var(--text-2); }
/* Every error and refusal of the script, like .field .error; the neutral variant reports a cancelled upload. */
.pitch-message { margin: 0 0 14px; font-size: 0.86rem; font-weight: 500; color: var(--danger); }
.pitch-message.is-info { font-weight: 400; color: var(--text-2); }
.pitch-message:focus { outline: none; }
.pitch-message:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pitch-drop { margin-bottom: 18px; }
.pitch-drop.is-dragging { border-color: var(--brand); background: var(--brand-soft); }
.pitch-drop .file-name { overflow-wrap: anywhere; }
.pitch-drop .file-name.is-error { color: var(--danger); }
.pitch-declarations { padding-bottom: 16px; }
.pitch-declarations > h3 { margin: 0 0 4px; font-size: 1rem; }
.pitch-declarations .error { margin-top: 8px; font-weight: 500; color: var(--danger); }

/* Progress: the upload's and the processing meter (both .pitch-meter); the script sets the fill's width. */
.pitch-progress { padding-top: 4px; }
.pitch-progress .pitch-meter { margin-bottom: 10px; }
.pitch-progress .pitch-meter > span { width: 0; }
.pitch-meter > span { transition: width 0.3s ease; }
.pitch-progress-text { margin: 0 0 4px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.pitch-progress .row { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .pitch-meter > span { transition: none; }
}
/* Windows high contrast drops the token colours of the bar and its fill. */
@media (forced-colors: active) {
  .pitch-meter { border: 1px solid CanvasText; }
  .pitch-meter span { background: Highlight; }
}

/* ------------------------------------------------------------------ captions */

.pitch-captions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pitch-captions > h3 { margin: 0 0 4px; font-size: 1rem; }
.pitch-captions-list { list-style: none; margin: 12px 0 0; padding: 0; }
.pitch-caption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pitch-caption-language { font-weight: 600; }
.pitch-caption-remove { margin: 0 0 0 auto; }
.pitch-caption-message { flex-basis: 100%; margin: 0; color: var(--text-2); }
.pitch-captions-form { margin-top: 14px; }

/* ------------------------------------------------------------------ history */

.pitch-history { list-style: none; margin: 8px 0 0; padding: 0; }
.pitch-history li { padding: 4px 0; overflow-wrap: anywhere; }
.pitch-history-message { display: block; margin-top: 2px; color: var(--text-2); }

/* ------------------------------------------------------------------ the unfinished upload */

.pitch-resume { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.pitch-resume:focus { outline: none; }
.pitch-resume:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pitch-resume-text { margin: 0 0 8px; }
.pitch-resume form { margin: 0; }
