/**
 * @file
 * Phase 10 Plan 03 — dark-mode legibility overrides for the diff contrib module.
 *
 * The contrib diff module ships colours tuned for white admin themes
 * (light pink #fdd / light green #dfd backgrounds with inherited foreground).
 * On the koallabs dark theme this becomes pale-on-pale — barely readable.
 *
 * Override strategy: keep the same semantic meaning (red = removed, green = added)
 * but use saturated backgrounds that hold contrast against #0A0A0F with explicit
 * dark foreground so the text stays legible.
 *
 * Scope: admin-only — only authenticated users with `view all revisions`
 * permission see these classes. Selectors are `.diff-*` prefixed so they
 * have zero impact on non-diff pages.
 */

/* Line-level backgrounds (block of removed/added text). */
td.diff-deletedline,
.diff-deleted {
  background-color: #4A1A1A;
  color: #FFD0D0;
}

td.diff-addedline,
.diff-added {
  background-color: #1A3A28;
  color: #C8F5D8;
}

/* Word-level inline highlights inside a diff line.  */
td.diff-deletedline span.diffchange,
.diff-deleted span.diffchange {
  background-color: #C04444;
  color: #1A0A0A;
  padding: 0 2px;
  border-radius: 2px;
}

td.diff-addedline span.diffchange,
.diff-added span.diffchange {
  background-color: #2DBC73;
  color: #0A1A12;
  padding: 0 2px;
  border-radius: 2px;
}

/* Section titles (e.g., "Body" field heading row). */
td.diff-section-title,
div.diff-section-title {
  background-color: #1A1A24;
  color: #F5F5F7;
  font-weight: 600;
}

/* Field name badge (left-rail label). */
td.field-name {
  background-color: #13131A;
  color: var(--color-accent, #00D4AA);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.85em;
  font-weight: 500;
}

/* Visual-inline layout: the diff renders inside the article template.
 * Drupal contrib `diff` wraps removed text in <del> and added in <ins>.
 * The diff module's diff.visual-inline.css targets bare `del`/`ins` and
 * loads after our theme global library at render time, so we use
 * !important here to guarantee the dark-mode colours win. Scope is still
 * admin-only — `del`/`ins` only appear in diff render output and rare
 * editorial body copy (where the same darker backgrounds remain readable). */
del,
.diff-context del,
del.diffmod {
  background-color: #C04444 !important;
  color: #1A0A0A !important;
  text-decoration: line-through;
  padding: 0 2px;
  border-radius: 2px;
}

ins,
.diff-context ins,
ins.diffmod {
  background-color: #2DBC73 !important;
  color: #0A1A12 !important;
  text-decoration: none;
  padding: 0 2px;
  border-radius: 2px;
}
