/* ════════════════════════════════════════════════════════════════
   FMF FORUM — bbPress standalone page dark theme
   Loaded only on bbPress topic/forum/reply URLs via is_bbpress().
   fmf-page body class (set by fmf_body_classes) handles the Kadence
   wrapper/background; this file styles bbPress-specific elements.
   ════════════════════════════════════════════════════════════════ */

/* Variables defined in fmf-global.css (:root) — loaded on every page. */

/* Kill Kadence content-area top padding on bbPress pages
   (mirrors the fix on fm_issue/fm_book pages). */
body.fmf-page.bbpress.content-vertical-padding-show #primary {
    padding-top: 0 !important;
}

/* ── Main container ──────────────────────────────────────────────── */
body.fmf-page #bbpress-forums {
    background: transparent !important;
    color: var(--fm-bone);
    font-family: inherit;
}

/* ── "Viewing X topics" count bar + pagination wrapper ───────────── */
body.fmf-page #bbpress-forums .bbp-topic-count,
body.fmf-page #bbpress-forums .bbp-forum-info,
body.fmf-page #bbpress-forums .bbp-body,
body.fmf-page #bbpress-forums .bbp-topics-header,
body.fmf-page #bbpress-forums .bbp-forums-header {
    background: transparent !important;
    color: var(--fm-muted);
}
body.fmf-page #bbpress-forums .bbp-paged-results {
    background: rgba(42, 32, 21, 0.5) !important;
    color: var(--fm-muted);
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--fm-border);
}

/* ── Breadcrumb ──────────────────────────────────────────────────── */
body.fmf-page .bbp-breadcrumb {
    color: var(--fm-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--fm-border);
    padding-bottom: 0.6rem;
    margin-bottom: 1.2rem;
}
body.fmf-page .bbp-breadcrumb a {
    color: var(--fm-amber);
    text-decoration: none;
}
body.fmf-page .bbp-breadcrumb a:hover {
    color: var(--fm-bone);
}

/* ── Section/page title + topic list title links ─────────────────── */
body.fmf-page #bbpress-forums h1,
body.fmf-page #bbpress-forums h2,
body.fmf-page #bbpress-forums .bbp-forum-title,
body.fmf-page #bbpress-forums .bbp-topic-title {
    color: var(--fm-amber) !important;
}
body.fmf-page #bbpress-forums .bbp-forum-title a,
body.fmf-page #bbpress-forums .bbp-topic-title a {
    color: var(--fm-amber) !important;
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-forum-title a:hover,
body.fmf-page #bbpress-forums .bbp-topic-title a:hover {
    color: var(--fm-bone) !important;
}
/* "Started by" and last-post info on topic list rows */
body.fmf-page #bbpress-forums .bbp-topic-started-by,
body.fmf-page #bbpress-forums .bbp-topic-started-in {
    color: var(--fm-muted) !important;
    font-size: 0.875rem;
}
body.fmf-page #bbpress-forums .bbp-topic-started-by a,
body.fmf-page #bbpress-forums .bbp-topic-started-in a {
    color: var(--fm-muted) !important;
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-topic-started-by a:hover,
body.fmf-page #bbpress-forums .bbp-topic-started-in a:hover {
    color: var(--fm-amber) !important;
}

/* ── Forum/topic list rows ───────────────────────────────────────── */
body.fmf-page #bbpress-forums ul.bbp-forums,
body.fmf-page #bbpress-forums ul.bbp-topics,
body.fmf-page #bbpress-forums ul.bbp-replies {
    background: transparent !important;
    border: 1px solid var(--fm-border);
}
body.fmf-page #bbpress-forums li.bbp-forum,
body.fmf-page #bbpress-forums li.bbp-topic,
body.fmf-page #bbpress-forums li.bbp-reply {
    background: var(--fm-dark) !important;
    border-bottom: 1px solid var(--fm-border);
    color: var(--fm-bone) !important;
}
body.fmf-page #bbpress-forums li.bbp-forum:last-child,
body.fmf-page #bbpress-forums li.bbp-topic:last-child,
body.fmf-page #bbpress-forums li.bbp-reply:last-child {
    border-bottom: none;
}
/* Alternate row tint */
body.fmf-page #bbpress-forums li.bbp-topic:nth-child(even),
body.fmf-page #bbpress-forums li.bbp-reply:nth-child(even) {
    background: rgba(42, 32, 21, 0.4) !important;
}

/* ── Topic/reply content ─────────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-topic-content,
body.fmf-page #bbpress-forums .bbp-reply-content {
    color: var(--fm-bone);
    background: transparent;
}
body.fmf-page #bbpress-forums .bbp-topic-content p,
body.fmf-page #bbpress-forums .bbp-reply-content p {
    color: var(--fm-bone);
}
body.fmf-page #bbpress-forums .bbp-topic-content a,
body.fmf-page #bbpress-forums .bbp-reply-content a {
    color: var(--fm-amber);
}

/* ── Author column ───────────────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-topic-author,
body.fmf-page #bbpress-forums .bbp-reply-author {
    background: rgba(10, 8, 4, 0.6);
    border-right: 1px solid var(--fm-border);
    color: var(--fm-muted);
}
body.fmf-page #bbpress-forums .bbp-author-name a {
    color: var(--fm-amber);
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-author-role {
    color: var(--fm-red);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
body.fmf-page #bbpress-forums .bbp-author-ip {
    color: var(--fm-muted);
    font-size: 0.875rem;
}

/* ── Meta / freshness ────────────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-topic-meta,
body.fmf-page #bbpress-forums .bbp-topic-freshness,
body.fmf-page #bbpress-forums .bbp-topic-voice-count,
body.fmf-page #bbpress-forums .bbp-topic-reply-count,
body.fmf-page #bbpress-forums .bbp-forum-topic-count,
body.fmf-page #bbpress-forums .bbp-forum-reply-count,
body.fmf-page #bbpress-forums .bbp-forum-freshness {
    color: var(--fm-muted);
    font-size: 0.875rem;
}
body.fmf-page #bbpress-forums .bbp-topic-meta a,
body.fmf-page #bbpress-forums .bbp-topic-freshness a {
    color: var(--fm-amber);
}

/* ── Header row (column labels) ──────────────────────────────────── */
body.fmf-page #bbpress-forums li.bbp-header {
    background: rgba(139, 0, 0, 0.15) !important;
    border-bottom: 1px solid var(--fm-red);
    color: var(--fm-muted) !important;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Pagination ──────────────────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-pagination {
    color: var(--fm-muted);
    font-size: 0.85rem;
}
body.fmf-page #bbpress-forums .bbp-pagination a,
body.fmf-page #bbpress-forums .bbp-pagination .current {
    color: var(--fm-amber);
    border: 1px solid var(--fm-border);
    padding: 2px 6px;
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-pagination .current {
    background: var(--fm-red);
    color: var(--fm-bone);
    border-color: var(--fm-red);
}

/* ── Notices ─────────────────────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-template-notice,
body.fmf-page #bbpress-forums .bbp-template-notice.info {
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid var(--fm-red);
    color: var(--fm-bone);
}

/* ── New topic / reply form ──────────────────────────────────────── */
body.fmf-page #new-post {
    background: var(--fm-dark);
    border: 1px solid var(--fm-border);
    padding: 1.5rem;
    margin-top: 1.5rem;
}
body.fmf-page #new-post label,
body.fmf-page #new-post .bbp-the-content-label {
    color: var(--fm-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
body.fmf-page #bbpress-forums input[type="text"],
body.fmf-page #bbpress-forums input[type="email"],
body.fmf-page #bbpress-forums input[type="url"],
body.fmf-page #bbpress-forums textarea,
body.fmf-page #bbpress-forums select {
    background: var(--fm-black);
    border: 1px solid var(--fm-border);
    color: var(--fm-bone);
    padding: 6px 10px;
}
body.fmf-page #bbpress-forums input[type="text"]:focus,
body.fmf-page #bbpress-forums textarea:focus {
    border-color: var(--fm-amber);
    outline: none;
    box-shadow: 0 0 6px rgba(201, 134, 10, 0.3);
}
body.fmf-page #bbpress-forums input[type="submit"],
body.fmf-page #bbpress-forums button[type="submit"] {
    background: var(--fm-red);
    color: var(--fm-bone);
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 200ms ease, box-shadow 200ms ease;
}
body.fmf-page #bbpress-forums input[type="submit"]:hover,
body.fmf-page #bbpress-forums button[type="submit"]:hover {
    background: var(--fm-red-hover);
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
}

/* ── Reply form quicktags toolbar (B, I, LINK, B-QUOTE…) ────────── */
body.fmf-page #bbpress-forums .quicktags-toolbar,
body.fmf-page #bbpress-forums div.bbp-the-content-wrapper .quicktags-toolbar {
    background: #111 !important;
    border: 1px solid var(--fm-border) !important;
    border-bottom: none !important;
    padding: 4px 6px;
}
body.fmf-page #bbpress-forums .quicktags-toolbar input.ed_button {
    background: var(--fm-dark) !important;
    border: 1px solid var(--fm-border) !important;
    color: var(--fm-muted) !important;
    font-size: 0.82rem;
    padding: 2px 6px;
    cursor: pointer;
    margin: 1px;
    transition: color 150ms ease, border-color 150ms ease;
}
body.fmf-page #bbpress-forums .quicktags-toolbar input.ed_button:hover {
    color: var(--fm-amber) !important;
    border-color: var(--fm-amber) !important;
}

/* ── Submit wrapper — kill the HR dividers bbPress injects ───────── */
body.fmf-page #bbpress-forums hr,
body.fmf-page #new-post hr {
    display: none !important;
}
body.fmf-page #bbpress-forums .bbp-submit-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* ── Subscriptions / admin links ─────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-admin-links a,
body.fmf-page #bbpress-forums .bbp-topic-subscribe a,
body.fmf-page #bbpress-forums .bbp-reply-to a {
    color: var(--fm-muted);
    font-size: 0.875rem;
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-admin-links a:hover,
body.fmf-page #bbpress-forums .bbp-topic-subscribe a:hover,
body.fmf-page #bbpress-forums .bbp-reply-to a:hover {
    color: var(--fm-amber);
}

/* ── Issue Chatter — hide new topic form ────────────────────────── */
/* Issue Chatter is curated: one admin-created topic per FM issue.
   Registered users reply within threads; they don't create new topics.
   body.fmf-issue-chatter is added by functions.php when post_name = 'issue-chatter' */
body.fmf-issue-chatter #new-post { display: none !important; }

/* ── Login required notice ───────────────────────────────────────── */
body.fmf-page #bbpress-forums .bbp-logged-out {
    color: var(--fm-muted);
}
body.fmf-page #bbpress-forums .bbp-logged-out a {
    color: var(--fm-amber);
}

/* ── Kadence single-post article wrappers on bbPress topic pages ─────
   On /forum/topic/... Kadence wraps the content in article.type-topic,
   .entry-content-wrap, and .entry-header — all may carry white bg or
   light text color from the Kadence palette. Force transparent + bone. */
body.fmf-page article.type-topic,
body.fmf-page article.type-forum,
body.fmf-page article.type-reply,
body.fmf-page .entry-content-wrap,
body.fmf-page .entry-header {
    background: transparent !important;
    color: var(--fm-bone);
}

/* ── Single topic title + reply threading ───────────────────────────
   BuddyBoss wraps the topic title in .bbp-topic-title-wrap; on single
   topic pages the reply list can have nested .bbp-threaded-replies.
   Force dark backgrounds and bone text throughout.                     */
body.fmf-page #bbpress-forums .bbp-topic-title-wrap {
    color: var(--fm-bone);
}
body.fmf-page #bbpress-forums .bbp-threaded-replies {
    border-left: 2px solid var(--fm-border);
    margin-left: 1rem;
    padding-left: 0.75rem;
}

/* ── Reply author meta (date, role badge) on single topic ──────────── */
body.fmf-page #bbpress-forums .bbp-reply-header {
    background: rgba(42, 32, 21, 0.4) !important;
    border-bottom: 1px solid var(--fm-border);
    color: var(--fm-muted);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}
body.fmf-page #bbpress-forums .bbp-reply-header a {
    color: var(--fm-amber);
    text-decoration: none;
}
body.fmf-page #bbpress-forums .bbp-reply-header a:hover {
    color: var(--fm-bone);
}

/* ── Reply head-area on single topics — username + meta layout ──────
   BB renders <div class="bbp-head-area"> with .reply-author-displayname
   on the left and .bbp-meta (date + permalink) on the right. Long
   usernames like "famousmonststg" used to break mid-character on phone.
   We force the whole username to stay intact AND relocate .bbp-meta
   from the top header into the empty bottom-left of the bone-paper
   card by absolute-positioning it relative to li.bbp-reply.          */
body.fmf-page #bbpress-forums li.bbp-reply,
body.fmf-page #bbpress-forums li.bbp-topic {
    position: relative;
}
body.fmf-page #bbpress-forums .bbp-head-area {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.75rem;
}
body.fmf-page #bbpress-forums .reply-author-displayname,
body.fmf-page #bbpress-forums .reply-author-displayname .bbp-author-link,
body.fmf-page #bbpress-forums .reply-author-displayname .bbp-author-name {
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
}
/* Pull meta out of the top header and float it to bottom-left of the
   bone-paper card. .bbp-reply-content gains extra padding-bottom so the
   meta visually sits inside the paper, in the empty lower-left zone. */
body.fmf-page #bbpress-forums .bbp-head-area .bbp-meta {
    position: absolute;
    left: 1rem;
    bottom: 0.55rem;
    margin: 0;
    font-size: 0.78rem;
    color: var(--fm-muted);
    z-index: 2;
    line-height: 1.2;
}
body.fmf-page.bbpress #bbpress-forums .bbp-reply-content,
body.fmf-page.bbpress #bbpress-forums .bbp-topic-content {
    padding-bottom: 2rem !important;
}

/* Phone — widen the card by tightening outer column padding and the
   bone-paper internal horizontal padding. Plenty of play here. */
@media (max-width: 768px) {
    body.fmf-page.bbpress #bbpress-forums {
        padding: 1rem 0.5rem !important;
    }
    body.fmf-page.bbpress #bbpress-forums .bbp-reply-content,
    body.fmf-page.bbpress #bbpress-forums .bbp-topic-content {
        padding: 0.85rem 0.85rem 1.9rem !important;
    }
    body.fmf-page #bbpress-forums .bbp-head-area .bbp-meta {
        left: 0.85rem;
        bottom: 0.5rem;
        font-size: 0.75rem;
    }
}

/* ── Topic/reply body text — force readable contrast ───────────────── */
body.fmf-page #bbpress-forums .bbp-topic-content *,
body.fmf-page #bbpress-forums .bbp-reply-content * {
    color: inherit;
}

/* ── Single topic description under title ──────────────────────────── */
body.fmf-page #bbpress-forums .bbp-topic-description,
body.fmf-page #bbpress-forums .bbp-forum-description {
    color: var(--fm-muted);
    font-size: 0.85rem;
}

/* ── bbPress login form (shown to logged-out users on topic pages) ───
   bbPress renders a .bbp-login-form wrapper with WP's standard login
   fields when a visitor isn't logged in. Override the default light bg. */
body.fmf-page .bbp-login-form,
body.fmf-page #bbpress-forums .bbp-login-form {
    background: var(--fm-dark) !important;
    border: 1px solid var(--fm-border);
    padding: 1.5rem;
    color: var(--fm-bone);
}
body.fmf-page .bbp-login-form label,
body.fmf-page .bbp-login-form p {
    color: var(--fm-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
body.fmf-page .bbp-login-form a {
    color: var(--fm-amber);
    text-decoration: none;
}
body.fmf-page .bbp-login-form a:hover {
    color: var(--fm-bone);
}
/* WP login fields inside bbPress login form */
body.fmf-page .bbp-login-form input[type="text"],
body.fmf-page .bbp-login-form input[type="password"] {
    background: var(--fm-black) !important;
    border: 1px solid var(--fm-border) !important;
    color: var(--fm-bone) !important;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
}
body.fmf-page .bbp-login-form input[type="text"]:focus,
body.fmf-page .bbp-login-form input[type="password"]:focus {
    border-color: var(--fm-amber) !important;
    outline: none;
    box-shadow: 0 0 6px rgba(201, 134, 10, 0.3);
}
body.fmf-page .bbp-login-form input[type="submit"] {
    background: var(--fm-red) !important;
    color: var(--fm-bone) !important;
    border: none !important;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 200ms ease, box-shadow 200ms ease;
}
body.fmf-page .bbp-login-form input[type="submit"]:hover {
    background: var(--fm-red-hover) !important;
    box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
}

/* ── Issue Chatter: cover thumbnails in topic title rows ─────────────────── */
/* Small thumbnail on forum list view, inline before the topic title link.
   Larger block image on single topic page, displayed above the title.      */
.fmf-ic-thumb {
    width: 46px;
    height: auto;
    vertical-align: middle;
    margin-right: 10px;
    border: 1px solid var(--fm-border);
    display: inline-block;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}
.fmf-ic-thumb:hover {
    border-color: var(--fm-amber);
}

.fmf-ic-thumb--single {
    width: 110px;
    display: block;
    margin: 0 0 1rem;
    border: 2px solid var(--fm-border);
}
/* "Remember me" checkbox label */
body.fmf-page .bbp-login-form .bbp-remember-me label,
body.fmf-page .bbp-login-form .forgetmenot label {
    color: var(--fm-muted);
    font-size: 0.875rem;
    text-transform: none;
    letter-spacing: 0;
}
/* ── Register prompt — styled divider + link below the login form ────
   bbPress outputs a register link in .bbp-register-wrapper when
   registration is open. We also target the generic lost-password /
   nav-links area bbPress appends after the form. */
body.fmf-page .bbp-login-form .bbp-register-wrapper,
body.fmf-page .bbp-login-form .bbp-lost-pass-wrapper,
body.fmf-page .bbp-login-form .nav {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fm-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--fm-muted);
    text-transform: none;
    letter-spacing: 0;
}
body.fmf-page .bbp-login-form .bbp-register-wrapper a,
body.fmf-page .bbp-login-form .bbp-lost-pass-wrapper a,
body.fmf-page .bbp-login-form .nav a {
    color: var(--fm-amber);
    text-decoration: none;
    font-weight: 600;
}
body.fmf-page .bbp-login-form .bbp-register-wrapper a:hover,
body.fmf-page .bbp-login-form .bbp-lost-pass-wrapper a:hover,
body.fmf-page .bbp-login-form .nav a:hover {
    color: var(--fm-bone);
}

/* ── Issue Chatter: encyclopedia framing — suppress poster identity ───
   Issue Chatter is about the issue, not the poster. Hide avatar columns
   and "by [user]" metadata so the bone-paper card reads as a dossier
   entry, not a forum post. Kills the 2-col squish on phone (B9) and the
   metadata/title text-bleed on Desk Index cards (B5/B11).
   ─────────────────────────────────────────────────────────────────── */
body.fmf-issue-chatter #bbpress-forums .bbp-topic-author,
body.fmf-issue-chatter #bbpress-forums .bbp-reply-author {
    display: none !important;
}
body.fmf-issue-chatter #bbpress-forums .bbp-topic-content,
body.fmf-issue-chatter #bbpress-forums .bbp-reply-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
body.fmf-issue-chatter #bbpress-forums .bbp-topic-started-by,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-meta .bbp-topic-started-by,
body.fmf-issue-chatter #bbpress-forums li.bbp-body > ul.topic .bbp-topic-started-by,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-by,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-freshness p,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-freshness .bbp-author-name,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-freshness .bbp-author-link,
body.fmf-issue-chatter #bbpress-forums .bbp-topic-freshness .bbp-author-avatar {
    display: none !important;
}
