/*
 * solidres.com: the forum (Kunena 7, Aurelia), on the template's tokens.
 * Loaded on forum pages by partials/kunena.php, which repairs Kunena's markup;
 * this file sets the colours where Aurelia's fall short (its menu links at
 * 4.2:1, its user-type names from 2.8:1, colours fixed for a light page).
 *
 * Kunena's own stylesheet loads after this one, with rules like
 * "#kunena.layout .kwho-user": the rules here start with "body" (or "html
 * body", against its "input[type=…]:focus") to come first.
 */

#kunena {
  --sr-kwho-admin: #b42318;
}

[data-bs-theme="dark"] #kunena {
  --sr-kwho-admin: #ff8a80;
}

/* The menu bar: Bootstrap's navbar links are the emphasis colour at 65%. */
body #kunena.layout .navbar {
  --bs-navbar-color: var(--sr-text);
  --bs-navbar-hover-color: var(--sr-link-hover);
  --bs-navbar-active-color: var(--sr-ink);
  font-family: var(--sr-font-heading);
  letter-spacing: 0.02em;
}

/* User names by type: each readable on the page in both schemes. */
body #kunena.layout .kwho-guest {
  color: var(--sr-muted);
}

body #kunena.layout .kwho-user {
  color: var(--sr-link);
}

body #kunena.layout .kwho-moderator {
  color: var(--sr-green-text);
}

body #kunena.layout :is(.kwho-globalmod, .kwho-globalmoderator) {
  color: var(--sr-accent-text);
}

body #kunena.layout .kwho-admin {
  color: var(--sr-kwho-admin);
}

body #kunena.layout :is(.kwho-blocked, .kwho-banned) {
  color: var(--sr-muted);
  text-decoration: line-through;
}

body #kunena.layout .topic-starter {
  color: var(--sr-link);
}

/* A message's header: Kunena's translucent light grey turned mid-grey on the
 * dark page, under light text. */
body #kunena.layout .mykmsg-header {
  background: var(--sr-tint);
}

/* "(1 NEW)" beside a category or topic: Kunena prints it in the Aurelia
 * option's green (#48a348, 3.2:1 as text), with !important. */
body .layout#kunena sup.knewchar,
body .layout#kunena [class*="category"] .knewchar {
  color: var(--sr-green-text) !important;
}

/* Bootstrap's info badge keeps white text on its light cyan (the attachment
 * limits on the new topic form). */
body #kunena.layout .badge.bg-info {
  color: #000000;
}

/* Kunena takes the focus outline off its links and fields ("outline: none
 * !important"); the template's ring is back on every control, so a keyboard
 * user can see where they are. */
html body #kunena.layout :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--sr-focus) !important;
  outline-offset: 2px;
}

/* A pinned topic's row: Kunena darkens it twice over (5% black on the row,
 * the table's stripe on its cells), which takes its links under 4.5:1. */
body #kunena.layout tr.category-stickymsg,
body #kunena.layout tr.category-stickymsg > td {
  background-color: var(--sr-tint) !important;
  box-shadow: none;
}

/* Each category's icon cell after the first carries a numbered id
 * (partials/kunena.php: an id is unique), out of reach of Kunena's
 * "#kcat-icon svg" size. */
#kunena.layout [id^="kcat-icon-"] svg {
  width: 34px;
  height: 34px;
}
