/* Homelab tweaks for Forgejo's issue / pull request lists.
 *
 * Goal: when scanning many PRs, the eye should find repo, number and author without
 * reading the sentence. homelab.js adds the hl-* classes and the --hl-hue values;
 * without it only the row padding/hover, number and time rules apply.
 *
 * light-dark() follows the color-scheme each Forgejo theme sets on :root, so the same
 * rules work for the light, dark and auto themes.
 */

/* ---- Row: a thin stripe in the repo's colour down the left edge ---------------- */
#issue-list .flex-item {
  padding-inline: 10px;
}
#issue-list .flex-item.hl-has-repo {
  box-shadow: inset 3px 0 0 hsl(var(--hl-repo-hue) 65% 55% / 0.85);
}
#issue-list .flex-item:hover {
  background: var(--color-hover);
}

/* ---- Meta line --------------------------------------------------------------- *
 * Light-mode text lightness is kept at <= 28% so every hue, yellow included, stays
 * above WCAG AA (4.5:1) on white and on its own chip tint. */
/* Repo chip: owner dimmed, repo name bold, both in the repo's own hue. */
#issue-list .issue-meta a.index.hl-repo-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  padding: 0 6px;
  border-radius: var(--border-radius);
  background: light-dark(hsl(var(--hl-hue) 70% 94%), hsl(var(--hl-hue) 45% 22% / 0.7));
  color: light-dark(hsl(var(--hl-hue) 60% 26%), hsl(var(--hl-hue) 75% 75%));
  text-decoration: none;
}
#issue-list .issue-meta a.index .hl-owner {
  opacity: 0.65;
}
#issue-list .issue-meta a.index .hl-repo {
  font-weight: 600;
}

/* PR / issue number: monospace so numbers line up and read as an ID. */
#issue-list .issue-meta a.index .hl-num,
#issue-list .issue-meta a.index:not(.hl-repo-chip) {
  font-family: var(--fonts-monospace);
  font-size: 0.95em;
  color: var(--color-text);
}
#issue-list .issue-meta a.index.hl-repo-chip .hl-num {
  margin-inline-start: 4px;
}

/* Author: small avatar + name in the person's own hue. */
#issue-list .issue-meta a.hl-author {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: light-dark(hsl(var(--hl-hue) 55% 28%), hsl(var(--hl-hue) 70% 72%));
}
#issue-list .issue-meta .hl-author-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: middle;
}

/* Target branch: the usual ones fade, anything unusual gets a warning tint. */
#issue-list .issue-meta .branch.hl-branch-default {
  opacity: 0.6;
}
#issue-list .issue-meta .branch.hl-branch-other {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  font-weight: 600;
}

/* "updated 8 minutes ago" is context, not signal. */
#issue-list .issue-meta relative-time {
  opacity: 0.75;
}

/* Signals worth catching at a glance: approvals, change requests, conflicts. */
#issue-list .issue-meta .approvals { font-weight: 600; }
#issue-list .issue-meta .rejects,
#issue-list .issue-meta .conflicting {
  color: var(--color-red);
  font-weight: 600;
}
