/*
 * Red, amber, green moderation status, on every select named *moderationstatus: the queue's
 * list (form-N-moderationstatus), Rejected Items, and the item's own page.
 *
 * :has(option:checked) follows the selected option, so the colour changes the moment a
 * moderator picks a status, before saving, with no script. Every value in
 * CoreLocariaItem.MODERATION_STATUS must appear below; test_static_files checks it.
 *
 *   red    needs a person now, or has been turned down: Requires Human Check, Rejected
 *   amber  waiting on a moderator: Requires Moderation, Flagged for Review, Updates to Approve
 *   green  Published, offered in the queue as "OK to Publish"
 */
:root {
  --status-red-bg: #fee2e2;
  --status-red-text: #991b1b;
  --status-red-edge: #dc2626;
  --status-amber-bg: #fef3c7;
  --status-amber-text: #92400e;
  --status-amber-edge: #d97706;
  --status-green-bg: #dcfce7;
  --status-green-text: #166534;
  --status-green-edge: #16a34a;
}

.dark {
  --status-red-bg: rgba(220, 38, 38, 0.3);
  --status-red-text: #fecaca;
  --status-amber-bg: rgba(217, 119, 6, 0.3);
  --status-amber-text: #fde68a;
  --status-green-bg: rgba(22, 163, 74, 0.3);
  --status-green-text: #bbf7d0;
}

select[name$="moderationstatus"]:has(option[value="requires_human_check"]:checked),
select[name$="moderationstatus"]:has(option[value="moderation_not_ok"]:checked) {
  background-color: var(--status-red-bg);
  color: var(--status-red-text);
  border-color: var(--status-red-edge);
  border-left: 6px solid var(--status-red-edge);
  font-weight: 600;
}

select[name$="moderationstatus"]:has(option[value="requires_moderation"]:checked),
select[name$="moderationstatus"]:has(option[value="moderation_flagged_for_review"]:checked),
select[name$="moderationstatus"]:has(option[value="moderation_updates_to_approved"]:checked) {
  background-color: var(--status-amber-bg);
  color: var(--status-amber-text);
  border-color: var(--status-amber-edge);
  border-left: 6px solid var(--status-amber-edge);
  font-weight: 600;
}

select[name$="moderationstatus"]:has(option[value="moderation_ok"]:checked) {
  background-color: var(--status-green-bg);
  color: var(--status-green-text);
  border-color: var(--status-green-edge);
  border-left: 6px solid var(--status-green-edge);
  font-weight: 600;
}

/* The open list takes the browser's own colours, so the options stay readable in either theme. */
select[name$="moderationstatus"] option {
  font-weight: normal;
}
