/* Full reskin of bbPress to match the site's black/red/white system.
   bbPress lays these out as CSS tables by default (ul/li acting as
   table/row/cell) — since we killed bbp-default.css, we rebuild that
   structure ourselves with flexbox instead of guessing at classes. */

#bbpress-forums {
  font-family: var(--body);
  color: var(--text);
  font-size: 1rem;
}
#bbpress-forums a { color: var(--red); }
#bbpress-forums a:hover { color: #ff3b3b; }
#bbpress-forums ul, #bbpress-forums li { list-style: none; margin: 0; padding: 0; }

/* outer wrapper */
.bbpress-wrapper { margin-top: 10px; }

.bbp-breadcrumb {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.bbp-breadcrumb-sep { margin: 0 4px; }

/* search box */
.bbp-search-form { margin-bottom: 20px; }
#bbp_search {
  background: var(--bg); color: var(--text); border: 2px solid var(--ink);
  padding: 8px 10px; font-family: var(--body);
}
.bbp-search-form .button {
  background: var(--red); color: #fff; border: 2px solid var(--ink);
  font-family: var(--mono); text-transform: uppercase; padding: 8px 14px; cursor: pointer;
}

/* ===== forums list (archive) + topics list (single forum) =====
   Cards, matching .nu-grid/.nu-card elsewhere on the site — not a cramped
   spreadsheet-style table. Meta info stacks under the title instead of
   fighting for column space. */

.bbp-forums, .bbp-topics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  margin-bottom: 24px;
}

/* header row: just a label bar, not a fake table header anymore */
.bbp-forums > li.bbp-header,
.bbp-topics > li.bbp-header {
  grid-column: 1 / -1;
  background: var(--red);
  padding: 8px 14px;
}
.bbp-forums > li.bbp-header::before { content: "Forums"; }
.bbp-topics > li.bbp-header::before { content: "Topics"; }
.bbp-forums > li.bbp-header,
.bbp-topics > li.bbp-header {
  color: #fff;
  font-family: var(--pixel);
  font-size: 0.7rem;
  text-transform: uppercase;
}
.bbp-forums > li.bbp-header .forum-titles,
.bbp-topics > li.bbp-header .topic-titles { display: none; }

.bbp-forums > li.bbp-footer,
.bbp-topics > li.bbp-footer { display: none; }

/* bbp-body wraps all the row <ul>s as a contents-passthrough so our grid
   applies to the actual card elements, not the wrapper */
.bbp-forums > li.bbp-body,
.bbp-topics > li.bbp-body {
  display: contents;
}

/* each row/card */
.bbp-forums > li.bbp-body > ul,
.bbp-topics > li.bbp-body > ul {
  background: var(--bg-raised);
  padding: 16px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bbp-forums > li.bbp-body > ul:hover,
.bbp-topics > li.bbp-body > ul:hover { background: #1f1f1f; }
.bbp-forums > li.bbp-body > ul > li,
.bbp-topics > li.bbp-body > ul > li { padding: 0; }

.bbp-forum-title, .bbp-topic-permalink {
  font-family: var(--pixel);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1.5;
}
.bbp-forum-title:hover, .bbp-topic-permalink:hover { color: var(--red); }
.bbp-forum-content { font-family: var(--body); font-size: 0.85rem; color: var(--text-dim); margin-top: 3px; }

.bbp-topic-meta, .bbp-topic-freshness-author {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--text-dim);
}
.bbp-forum-topic-count, .bbp-forum-reply-count, .bbp-topic-voice-count, .bbp-topic-reply-count {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--red);
}
.bbp-forum-topic-count::after { content: " topics"; }
.bbp-forum-reply-count::after { content: " posts"; }
.bbp-topic-voice-count::after { content: " voices"; }
.bbp-topic-reply-count::after { content: " replies"; }

.bbp-forum-freshness, .bbp-topic-freshness {
  border-top: 2px dashed #333;
  margin-top: 6px;
  padding-top: 6px;
}

/* sticky/closed icons etc that bbpress may inject */
.bbp-topic-title .bbp-topic-status, .bbp-topic-title .bbp-topic-visibility {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ===== single topic: replies list (author | content, 2 col) ===== */

ul.bbp-replies, ul.forums.bbp-replies {
  border: 3px solid var(--ink);
  background: var(--bg-raised);
  margin-bottom: 20px;
}

ul.bbp-replies > li.bbp-header,
ul.bbp-replies > li.bbp-footer {
  display: flex;
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.9rem;
}
ul.bbp-replies > li.bbp-header { border-bottom: 3px solid var(--ink); }
ul.bbp-replies > li.bbp-footer { border-top: 3px solid var(--ink); }
ul.bbp-replies > li.bbp-header > div, ul.bbp-replies > li.bbp-footer > div { padding: 8px 14px; }
ul.bbp-replies > li.bbp-header .bbp-reply-author,
ul.bbp-replies > li.bbp-footer .bbp-reply-author { flex: 0 0 160px; }
ul.bbp-replies > li.bbp-header .bbp-reply-content,
ul.bbp-replies > li.bbp-footer .bbp-reply-content { flex: 1; }

.bbp-reply-header {
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-bottom: 2px solid var(--ink);
  border-top: 2px solid var(--ink);
}
.bbp-reply-header:first-child { border-top: none; }
.bbp-reply-header a { color: #fff; text-decoration: underline; }
.bbp-reply-header .bbp-admin-links a {
  border: 1px solid #fff; padding: 1px 6px; margin-left: 8px; text-decoration: none;
}

ul.bbp-replies li.bbp-body > div.topic,
ul.bbp-replies li.bbp-body > div[class*="type-topic"],
ul.bbp-replies li.bbp-body > div[class*="reply"][class*="hentry"] {
  display: flex;
  padding: 16px 14px;
  border-bottom: 2px dashed #333;
  gap: 14px;
}

.bbp-reply-author {
  flex: 0 0 160px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.bbp-reply-author img.avatar {
  margin: 0 auto 8px;
  border: 2px solid var(--ink);
}
.bbp-author-name { color: var(--red); font-weight: bold; display: block; }
.bbp-author-role { color: var(--text-dim); font-size: 0.8rem; text-transform: uppercase; }

.bbp-reply-content { flex: 1; min-width: 0; line-height: 1.7; }
.bbp-reply-content p:first-child { margin-top: 0; }

/* ===== forms (new topic / reply / login) ===== */

fieldset.bbp-form {
  border: 3px solid var(--ink);
  background: var(--bg-raised);
  padding: 18px;
  margin-bottom: 24px;
}
fieldset.bbp-form legend {
  font-family: var(--pixel);
  font-size: 0.7rem;
  color: var(--red);
  text-transform: uppercase;
  padding: 0 8px;
  background: var(--bg);
}
#bbpress-forums label {
  font-family: var(--mono);
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
  margin-top: 12px;
}
#bbpress-forums input[type="text"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums input[type="password"],
#bbpress-forums textarea {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--ink);
  font-family: var(--body);
  padding: 8px 10px;
  width: 100%;
  max-width: 500px;
}
#bbpress-forums textarea { max-width: 100%; min-height: 140px; }

#bbpress-forums button,
#bbpress-forums input[type="submit"] {
  background: var(--red);
  color: #fff;
  border: 2px solid var(--ink);
  font-family: var(--pixel);
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 12px 20px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  margin-top: 16px;
  transition: transform 0.05s ease;
}
#bbpress-forums button:hover, #bbpress-forums input[type="submit"]:hover {
  background: #ff3b3b;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

/* the "Create New Topic" trigger, when forum has no topics yet */
#bbpress-forums a.button,
a#new-topic-button {
  display: inline-block;
  background: var(--red);
  color: #fff !important;
  border: 2px solid var(--ink);
  font-family: var(--pixel);
  text-transform: uppercase;
  font-size: 0.7rem;
  padding: 10px 16px;
  box-shadow: 4px 4px 0 var(--ink);
  margin: 12px 0;
}
#bbpress-forums a.button:hover { background: #ff3b3b; text-decoration: none !important; }

/* pagination */
.bbp-pagination { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); color: var(--text-dim); font-size: 0.9rem; margin-bottom: 16px; }
.bbp-pagination-links a { border: 2px solid var(--ink); padding: 2px 8px; margin-right: 4px; background: var(--bg-raised); }

/* notices */
.bbp-template-notice, div.bbp-info {
  border: 2px solid var(--red);
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--mono);
  padding: 12px 14px;
  margin-bottom: 16px;
}
.bbp-template-notice ul, div.bbp-info ul { padding-left: 20px; list-style: disc; }
.bbp-template-notice li, div.bbp-info li { display: list-item; }

@media (max-width: 700px) {
  .bbp-forum-freshness, .bbp-topic-freshness,
  .bbp-forums .forum-titles li.bbp-forum-freshness,
  .bbp-topics .topic-titles li.bbp-topic-freshness { display: none; }
  ul.bbp-replies li.bbp-body > div { flex-direction: column; }
  .bbp-reply-author { flex: none; text-align: left; display: flex; align-items: center; gap: 8px; }
}
