/* Ash Legion Boards. Three themes, chosen in Ash Boards > Theme.
   Each theme only sets colour tokens. Layout is shared by all three. */

/* Neutral (the mock-up palette): light, dark for night viewers */
.ash-boards.theme-neutral {
  --bg: #ebe7dc;
  --panel: #f7f5ef;
  --ink: #1c1e1b;
  --muted: #66655d;
  --rule: #d3cdbd;
  --accent: #8c5f0f;
  --accent-ink: #fbf8f0;
  --accent-soft: #eadfc6;
  --tag-bug: #9c3a27;
  --tag-req: #2b6656;
  --tag-chat: #44548a;
  --tag-off: #6b6a62;
  --ok: #2b6656;
  --lock: #77756c;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
}
@media (prefers-color-scheme: dark) {
  .ash-boards.theme-neutral:not([data-theme="light"]) {
    --bg: #131518;
    --panel: #1b1e22;
    --ink: #e8e5da;
    --muted: #9b9a90;
    --rule: #33373d;
    --accent: #d9ab52;
    --accent-ink: #15130c;
    --accent-soft: #3a2f18;
    --tag-bug: #e07a62;
    --tag-req: #6cbfa6;
    --tag-chat: #8fa3dd;
    --tag-off: #a7a59a;
    --ok: #6cbfa6;
    --lock: #7d7c74;
  }
}

/* Ash Legion: black and gold, as on the registration page */
.ash-boards.theme-ash {
  --bg: #0d0d0d;
  --panel: #161616;
  --ink: #f2f2f2;
  --muted: #a8a59a;
  --rule: #2c2a24;
  --accent: #c9a227;
  --accent-ink: #111111;
  --accent-soft: rgba(201, 162, 39, 0.14);
  --tag-bug: #d9694f;
  --tag-req: #7fb89a;
  --tag-chat: #9fb0d6;
  --tag-off: #b5b2a6;
  --ok: #7fb89a;
  --lock: #8c8a80;
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
}

/* Anonymous: greyscale only */
.ash-boards.theme-anon {
  --bg: #e4e4e4;
  --panel: #f7f7f7;
  --ink: #151515;
  --muted: #5e5e5e;
  --rule: #c8c8c8;
  --accent: #3a3a3a;
  --accent-ink: #f7f7f7;
  --accent-soft: #dcdcdc;
  --tag-bug: #151515;
  --tag-req: #3a3a3a;
  --tag-chat: #5e5e5e;
  --tag-off: #7a7a7a;
  --ok: #151515;
  --lock: #7a7a7a;
  --font-head: "IBM Plex Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  .ash-boards.theme-anon:not([data-theme="light"]) {
    --bg: #111111;
    --panel: #1a1a1a;
    --ink: #e6e6e6;
    --muted: #9a9a9a;
    --rule: #333333;
    --accent: #d0d0d0;
    --accent-ink: #111111;
    --accent-soft: #2a2a2a;
    --tag-bug: #e6e6e6;
    --tag-req: #cfcfcf;
    --tag-chat: #b5b5b5;
    --tag-off: #8a8a8a;
    --ok: #e6e6e6;
    --lock: #7a7a7a;
  }
}

/* ---------- Shared layout ---------- */

.ash-boards {
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  padding-block: 16px 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  max-width: 1410px;
  margin-inline: auto;
  box-sizing: border-box;
}
.ash-boards *, .ash-boards *::before, .ash-boards *::after { box-sizing: border-box; }
.ash-boards a { color: inherit; text-decoration: none; }
.ash-boards a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ash-boards a:focus-visible, .ash-boards button:focus-visible, .ash-boards input:focus-visible,
.ash-boards select:focus-visible, .ash-boards textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ash-boards h1, .ash-boards h2, .ash-boards h3 { margin: 0; }
.ash-boards p { margin: 0 0 10px; }

.ash-bd-msg {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--panel);
}
.ash-bd-msg--error { border-left-color: var(--tag-bug); }
.ash-bd-msg--ok { border-left-color: var(--ok); }

.ash-bd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  background: var(--panel);
  border: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .ash-bd-layout { grid-template-columns: 230px minmax(0, 1fr) 230px; }
}

/* ---------- Navigation (left, about 20%) ---------- */

.ash-bd-nav {
  padding: 16px 14px 18px;
  border-bottom: 1px solid var(--rule);
  min-width: 0;
}
@media (min-width: 720px) {
  .ash-bd-nav { border-bottom: 0; border-right: 1px solid var(--rule); }
}
.ash-bd-btn-new,
.ash-bd-btn {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font: 600 14px/1.2 "IBM Plex Sans", system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
}
.ash-bd-btn-new:hover, .ash-bd-btn:hover { text-decoration: none; filter: brightness(1.05); }
.ash-bd-btn { width: auto; display: inline-block; }
.ash-bd-shortcuts, .ash-bd-boards { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ash-bd-shortcuts { margin-top: 12px; }
.ash-bd-shortcuts a, .ash-bd-boards a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: var(--ink);
  font-size: 14px;
}
.ash-bd-shortcuts a:hover, .ash-bd-boards a:hover { background: var(--accent-soft); text-decoration: none; }
.ash-bd-shortcuts a[aria-current="page"], .ash-bd-boards a[aria-current="page"] {
  background: var(--accent-soft);
  font-weight: 600;
}
.ash-bd-nav-h {
  margin: 20px 8px 6px;
  font: 500 11px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.ash-bd-count {
  font: 400 12px/1 "IBM Plex Mono", ui-monospace, monospace;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ash-bd-nav-note { margin: 22px 8px 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- Main (right, about 80%) ---------- */

.ash-bd-main { min-width: 0; }
.ash-bd-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 12px;
}
@media (min-width: 620px) {
  .ash-bd-head { grid-template-columns: minmax(0, 1fr) minmax(0, 240px); align-items: end; }
}
.ash-bd-head h1 {
  font: 700 30px/1.05 var(--font-head);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.ash-bd-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.ash-bd-search { display: block; min-width: 0; }
.ash-bd-search input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.2 "IBM Plex Sans", system-ui, sans-serif;
}
.ash-bd-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ash-bd-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}

/* Cards on the index */
.ash-bd-cards { list-style: none; margin: 0; padding: 0; }
.ash-bd-card { padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.ash-bd-card:last-child { border-bottom: 0; }
.ash-bd-card strong { font: 600 18px/1.2 var(--font-head); text-transform: uppercase; letter-spacing: 0.02em; }
.ash-bd-card p { margin: 4px 0; color: var(--muted); font-size: 14px; }
.ash-bd-card small { color: var(--muted); font-size: 12px; }

/* Thread rows */
.ash-bd-threads { list-style: none; margin: 0; padding: 0; }
.ash-bd-thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.ash-bd-thread:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.ash-bd-thread.is-pinned { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.ash-bd-thread[hidden] { display: none; }
@media (min-width: 620px) {
  .ash-bd-thread { grid-template-columns: minmax(0, 1fr) 70px 150px; }
}
.ash-bd-thread-main, .ash-bd-thread-title { min-width: 0; }
.ash-bd-thread-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.ash-bd-meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.ash-bd-user { color: var(--ink); font-weight: 500; }
.ash-bd-user { display: inline-flex; align-items: center; gap: 6px; }
.ash-bd-user .bc-avatar { flex: 0 0 auto; border-radius: 0; display: inline-block; }
.ash-bd-num, .ash-bd-last { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ash-bd-num b { display: block; font: 600 18px/1.1 "IBM Plex Mono", ui-monospace, monospace; color: var(--ink); }
.ash-bd-last .ash-bd-user { display: block; }
@media (min-width: 620px) {
  .ash-bd-num { text-align: right; }
}

.ash-bd-tag {
  font: 500 10.5px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 5px 2px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.ash-bd-tag--bug { color: var(--tag-bug); }
.ash-bd-tag--request { color: var(--tag-req); }
.ash-bd-tag--question { color: var(--tag-chat); }
.ash-bd-tag--discussion { color: var(--tag-off); }

.ash-bd-pill {
  font: 600 10.5px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 6px 2px;
  color: var(--muted);
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.ash-bd-pill--accent { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.ash-bd-pill--ok { color: var(--ok); border-color: var(--ok); }

.ash-bd-empty { padding: 24px 18px; color: var(--muted); font-size: 14px; }
.ash-bd-empty[hidden] { display: none; }

/* Compose boxes */
.ash-bd-compose { padding: 18px; border-top: 1px solid var(--rule); }
.ash-bd-compose h2, .ash-bd-h2 {
  font: 600 20px/1.1 var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.ash-bd-form { display: grid; gap: 10px; max-width: 720px; }
.ash-bd-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ash-bd-form input[type="text"], .ash-bd-form select, .ash-bd-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.4 "IBM Plex Sans", system-ui, sans-serif;
  min-width: 0;
}
.ash-bd-form textarea { resize: vertical; }
.ash-bd-form .ash-bd-btn { justify-self: start; }

/* ---------- Thread view ---------- */

.ash-bd-back { padding: 14px 18px 0; font-size: 13px; }
.ash-bd-thread-view { padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.ash-bd-thread-view h1 {
  font: 700 26px/1.1 var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 8px 0 6px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.ash-bd-thread-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ash-bd-body { margin-top: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.ash-bd-body p { margin: 0 0 10px; }
.ash-bd-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ash-bd-inline { display: inline-flex; margin: 0; }

/* +1 (1.0.6): dark orange square, bold white, centred. White on #B03608 is 6.2:1 contrast. */
.ash-bd-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.6ch;
  padding: 7px 10px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #B03608;
  color: #ffffff;
  font: 700 13px/1 "IBM Plex Sans", system-ui, sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.ash-bd-plus:not(.ash-bd-plus--static):not(:disabled):hover { background: #8f2b05; }
.ash-bd-plus:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.ash-bd-plus:disabled,
.ash-bd-plus--static { cursor: default; opacity: 1; background: #B03608; color: #ffffff; }

.ash-bd-mod {
  font: 500 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  padding: 6px 9px;
  border: 1px dashed var(--muted);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.ash-bd-mod:hover { color: var(--ink); border-color: var(--ink); }
.ash-bd-mod.is-danger:hover { color: var(--tag-bug); border-color: var(--tag-bug); }
.ash-bd-fixed {
  font: 400 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  padding: 6px 8px;
  width: 150px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--ink);
}

.ash-bd-replies { list-style: none; margin: 0; padding: 0; }
.ash-bd-reply {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 4px;
}
.ash-bd-reply:last-child { border-bottom: 0; }
.ash-bd-reply.is-answer { background: color-mix(in srgb, var(--ok) 8%, var(--panel)); }
.ash-bd-reply .ash-bd-body { margin-top: 2px; }
.ash-bd-h2 { padding: 14px 18px 0; font-size: 18px; }

.ash-bd-chart-note { color: var(--muted); }

/* Phone: the two columns stack, with navigation first. */
@media (max-width: 719px) {
  .ash-bd-nav { padding-bottom: 14px; }
  .ash-bd-boards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ash-boards * { transition: none !important; }
}

/* Full width on pages with the Boards shortcode (1.0.1): the content column is not narrowed. */
/* 1.0.13: the frame wraps the Boards panel (1180px), with no padding, so the two edges meet. */
.ash-boards-page .ash-main > * { max-width: none; width: min(1410px, 100%); }
.ash-boards-page .ash-main .entry-content { padding: 0; }
.ash-boards-page .ash-bd { max-width: none; }

/* +1 message (1.0.2): shown only if a vote is refused. */
.ash-bd-plus-note { font-size: 13px; color: #b5b5b5; margin-left: 8px; }
/* While a +1 is being saved (1.0.3), the button is slightly faded. */
.ash-bd-plus-form[data-busy] .ash-bd-plus { opacity: 0.7; }

/* 1.0.9: links inside messages look like the text, with a thin dotted underline. The underline gets bolder on hover. */
.ash-boards .ash-bd-body a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.ash-boards .ash-bd-body a:hover {
  text-decoration-style: solid;
  text-decoration-thickness: 2px;
}

/* Member card (1.0.10) */
.ash-boards .ash-bd-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border-radius: 4px;
}
.ash-boards .ash-bd-who:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ash-boards .ash-bd-pop {
  position: fixed;
  z-index: 1000;
  width: 260px;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  padding: 14px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
  font-size: 14px;
  line-height: 1.4;
}
.ash-boards .ash-bd-pop[hidden] {
  display: none;
}
.ash-boards .ash-bd-pop-top {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.ash-boards .ash-bd-pop-face {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
}
.ash-boards .ash-bd-pop-face img {
  width: 72px;
  height: 72px;
  max-width: 100%;
  display: block;
}
.ash-boards .ash-bd-pop-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ash-boards .ash-bd-pop-name {
  font-weight: 700;
}
.ash-boards .ash-bd-pop-role {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.ash-boards .ash-bd-pop-stats {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--accent-soft);
}
.ash-boards .ash-bd-pop-stats > div {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ash-boards .ash-bd-pop-stats strong {
  font-size: 18px;
}
.ash-boards .ash-bd-pop-stats span {
  color: var(--muted);
  font-size: 12px;
}

/* Thread flags on line 1 (1.0.12) */
.ash-boards .ash-bd-thread-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ash-boards .ash-bd-thread-title > a { min-width: 0; overflow-wrap: anywhere; }
.ash-boards .ash-bd-pill--open { color: var(--muted); border-color: var(--rule, var(--muted)); }
.ash-boards .ash-bd-pill--closed { color: var(--muted); border-color: var(--muted); }
.ash-boards .ash-bd-last-label { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.ash-boards .ash-bd-pill--pin { color: var(--accent); border-color: var(--accent); }

/* Version strip under the panel (1.0.14): thin, right-aligned, quiet. */
.ash-boards .ash-bd-foot { display: flex; justify-content: flex-end; align-items: center; padding: 8px 16px 14px; border-top: 1px solid var(--rule); font: 500 10.5px/1.2 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.05em; color: var(--muted); }

/* Recently Active column (1.0.16): right-hand, same 230px as the left, everything right-aligned */
.ash-bd-side { padding: 18px 14px; text-align: right; min-width: 0; }
@media (min-width: 720px) { .ash-bd-side { border-left: 1px solid var(--rule); } }
.ash-bd-side-title { font: 500 18px/1.1 Oswald, sans-serif; letter-spacing: 0.03em; margin: 0 0 14px; color: var(--ink); }
.ash-bd-side-sub { font: 600 10.5px/1.2 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 14px 0 8px; }
.ash-bd-side-sub:first-of-type { margin-top: 0; }
.ash-bd-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ash-bd-side li { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
.ash-bd-side .ash-bd-who { flex-direction: row-reverse; }
.ash-bd-side .ash-bd-ago { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ash-bd-side-empty, .ash-bd-guests { font: 12px/1.4 "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); margin: 10px 0 0; }
.ash-bd-guests { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--rule); }

/* 720px to 1199px: no room for a third column beside the main area, so Recently Active sits below it, full width. */
@media (min-width: 720px) and (max-width: 1199px) {
  .ash-bd-layout { grid-template-columns: 230px minmax(0, 1fr); }
  .ash-bd-side { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--rule); }
  .ash-bd-side ul { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* 1.0.17: the theme aligns headings and paragraphs by element (left, justified). Keep the panel's text right-aligned. */
.ash-boards .ash-bd-side h2, .ash-boards .ash-bd-side h3, .ash-boards .ash-bd-side p { text-align: right; hyphens: manual; }
