/* =========================================================
   RCCF BBPress — Modern Topic List
   ========================================================= */

#bbpress-forums .bbp-topics {
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0;
}

/* Hide the old table-style header and footer */
#bbpress-forums .bbp-topics > .bbp-header,
#bbpress-forums .bbp-topics > .bbp-footer {
    display: none;
}

/* Topic container */
#bbpress-forums .bbp-topics > .bbp-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

/* Individual topic card */
#bbpress-forums .bbp-topics > .bbp-body > ul.bbp-topic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 90px 190px;
    align-items: center;
    gap: 20px;

    width: 100%;
    margin: 0;
    padding: 22px 24px;

    background: #fff;
    border: 1px solid var(--rccf-line);
    border-radius: 12px;
    box-sizing: border-box;

    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

/* Subtle interaction */
#bbpress-forums .bbp-topics > .bbp-body > ul.bbp-topic:hover {
    border-color: rgba(63, 140, 201, 0.45);
    box-shadow: 0 5px 18px rgba(5, 77, 111, 0.08);
    transform: translateY(-1px);
}

/* Main topic information */
#bbpress-forums .bbp-topics .bbp-topic-title {
    min-width: 0;
    margin: 0;
    padding: 0;
}

/* Topic title */
#bbpress-forums .bbp-topics .bbp-topic-permalink {
    display: inline-block;

    color: var(--rccf-navy) !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none !important;

    overflow-wrap: anywhere;
}

#bbpress-forums .bbp-topics .bbp-topic-permalink:hover {
    color: var(--rccf-blue) !important;
}

/* Started by */
#bbpress-forums .rccf-topic-started {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-top: 8px;

    color: var(--rccf-ink-soft);
    font-size: 13px;
    line-height: 1.4;
}

#bbpress-forums .rccf-topic-label {
    color: var(--rccf-ink-soft);
}

/* Author link */
#bbpress-forums .rccf-topic-started .bbp-author-link,
#bbpress-forums .rccf-topic-last-author .bbp-author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    color: var(--rccf-ink) !important;
    font-weight: 600;
    text-decoration: none;
}

#bbpress-forums .rccf-topic-started .bbp-author-link:hover,
#bbpress-forums .rccf-topic-last-author .bbp-author-link:hover {
    color: var(--rccf-blue) !important;
}

/* Avatar */
#bbpress-forums .rccf-topic-started .bbp-author-avatar img,
#bbpress-forums .rccf-topic-last-author .bbp-author-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

/* Hide duplicate/legacy meta formatting */
#bbpress-forums .rccf-topic-started .bbp-topic-meta {
    margin: 0;
}

/* Statistics */
#bbpress-forums .bbp-topic-voice-count,
#bbpress-forums .bbp-topic-reply-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    margin: 0;
    padding: 0;

    text-align: center;
}

/* Large statistic number */
#bbpress-forums .rccf-topic-stat-value {
    display: block;

    color: var(--rccf-navy);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
}

/* Statistic label */
#bbpress-forums .rccf-topic-stat-label {
    display: block;

    margin-top: 4px;

    color: var(--rccf-ink-soft);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

/* Last activity */
#bbpress-forums .bbp-topic-freshness {
    min-width: 0;
    margin: 0;
    padding: 0;
}

#bbpress-forums .rccf-topic-last-activity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#bbpress-forums .rccf-topic-last-activity > .rccf-topic-stat-label {
    margin: 0 0 4px;
}

#bbpress-forums .rccf-topic-last-activity > a {
    color: var(--rccf-ink) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

#bbpress-forums .rccf-topic-last-activity > a:hover {
    color: var(--rccf-blue) !important;
}

/* Last activity author */
#bbpress-forums .rccf-topic-last-author {
    margin-top: 7px;
}

#bbpress-forums .rccf-topic-last-author .bbp-author-name {
    font-size: 12px;
}

/* Pagination count */
#bbpress-forums .bbp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin: 0 0 16px;
}

#bbpress-forums .bbp-pagination-count {
    color: var(--rccf-ink-soft);
    font-size: 13px;
}

/* Remove legacy list/table styling */
#bbpress-forums .bbp-topics ul,
#bbpress-forums .bbp-topics li {
    box-sizing: border-box;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {

    #bbpress-forums .bbp-topics > .bbp-body > ul.bbp-topic {
        grid-template-columns: minmax(0, 1fr) 80px 80px;
        gap: 16px;
    }

    #bbpress-forums .bbp-topic-freshness {
        grid-column: 1 / -1;

        padding-top: 14px;
        border-top: 1px solid var(--rccf-line);
    }

    #bbpress-forums .rccf-topic-last-activity {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    #bbpress-forums .rccf-topic-last-activity > .rccf-topic-stat-label {
        margin: 0;
    }

    #bbpress-forums .rccf-topic-last-author {
        margin-top: 5px;
    }
}

@media (max-width: 600px) {

    #bbpress-forums .bbp-pagination {
        display: block;
        margin-bottom: 14px;
    }

    #bbpress-forums .bbp-topics > .bbp-body {
        gap: 10px;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul.bbp-topic {
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 18px;
    }

    #bbpress-forums .bbp-topic-title {
        grid-column: 1 / -1;
        padding-bottom: 15px !important;
    }

    #bbpress-forums .bbp-topic-voice-count,
    #bbpress-forums .bbp-topic-reply-count {
        align-items: flex-start;
        justify-content: flex-start;

        padding-top: 13px;
        border-top: 1px solid var(--rccf-line);

        text-align: left;
    }

    #bbpress-forums .bbp-topic-voice-count {
        grid-column: 1;
    }

    #bbpress-forums .bbp-topic-reply-count {
        grid-column: 2;
    }

    #bbpress-forums .bbp-topic-freshness {
        grid-column: 1 / -1;
        margin-top: 13px;
    }

    #bbpress-forums .rccf-topic-last-activity {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    #bbpress-forums .rccf-topic-last-author {
        margin-top: 7px;
    }

    #bbpress-forums .bbp-topics .bbp-topic-permalink {
        font-size: 17px;
    }
}/* RCCF: override bbPress table-style topic cells */
.bbp-topics .bbp-body > ul.bbp-topic {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 90px 90px 190px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.bbp-topics .bbp-body > ul.bbp-topic > li {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
    vertical-align: initial !important;
}

.bbp-topics .bbp-body > ul.bbp-topic .bbp-topic-title {
    width: auto !important;
}

.bbp-topics .bbp-body > ul.bbp-topic .bbp-topic-title .bbp-topic-permalink {
    display: block !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

@media (max-width: 900px) {
    .bbp-topics .bbp-body > ul.bbp-topic {
        grid-template-columns: minmax(0, 1fr) 90px 90px !important;
    }

    .bbp-topics .bbp-body > ul.bbp-topic > .bbp-topic-freshness {
        grid-column: 1 / -1;
    }
}

@media (max-width: 600px) {
    .bbp-topics .bbp-body > ul.bbp-topic {
        grid-template-columns: minmax(0, 1fr) minmax(70px, 90px) !important;
    }

    .bbp-topics .bbp-body > ul.bbp-topic > .bbp-topic-voice-count,
    .bbp-topics .bbp-body > ul.bbp-topic > .bbp-topic-reply-count {
        grid-column: auto;
    }

    .bbp-topics .bbp-body > ul.bbp-topic > .bbp-topic-freshness {
        grid-column: 1 / -1;
    }
}/* RCCF: actual bbPress topic rows */
#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 90px 90px 190px !important;
    align-items: center !important;
    gap: 20px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 22px 24px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border: 1px solid var(--rccf-line) !important;
    border-radius: 12px !important;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > li {
    display: block !important;
    float: none !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-title {
    grid-column: 1;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-voice-count {
    grid-column: 2;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-reply-count {
    grid-column: 3;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-freshness {
    grid-column: 4;
}

@media (max-width: 900px) {
    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
        grid-template-columns: minmax(0, 1fr) 80px 80px !important;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-freshness {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 600px) {
    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 0 !important;
        padding: 18px !important;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-title {
        grid-column: 1 / -1 !important;
        padding-bottom: 15px !important;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-voice-count {
        grid-column: 1 !important;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-reply-count {
        grid-column: 2 !important;
    }

    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > .bbp-topic-freshness {
        grid-column: 1 / -1 !important;
        margin-top: 13px !important;
    }
}
/* RCCF: prevent Astra/legacy layout rules from collapsing bbPress topic body */
#bbpress-forums .bbp-topics {
    display: block !important;
    width: 100% !important;
}

#bbpress-forums .bbp-topics > .bbp-body {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
}

/* ==========================================================
   RCCF — Single Forum Header (icon + description + stats card)
   Scoped to body.single-forum only — never leaks into the
   archive tile grid or topic list, learning from the earlier
   ID-collision bug tonight.
   ========================================================= */

body.single-forum .entry-title {
    color: var(--rccf-navy);
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 700;
}

body.single-forum .bbp-breadcrumb {
    margin-bottom: 18px;
    color: var(--rccf-ink-soft);
}

body.single-forum .rccf-forum-header-card {
    background: #fff;
    border: 1px solid var(--rccf-line);
    border-radius: 12px;
    padding: 24px 26px;
    margin: 0 0 24px;
}

body.single-forum .rccf-forum-header-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

body.single-forum .rccf-forum-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

body.single-forum .rccf-forum-header-desc {
    margin: 6px 0 0;
    color: var(--rccf-ink);
    font-size: 15px;
    line-height: 1.5;
}

body.single-forum .rccf-forum-header-stats {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--rccf-line);
    color: var(--rccf-ink-soft);
    font-size: 13px;
}

body.single-forum .rccf-forum-header-stats a {
    color: var(--rccf-blue);
    text-decoration: none;
    font-weight: 600;
}

body.single-forum .rccf-forum-header-stats a:hover {
    color: var(--rccf-navy);
}

@media (max-width: 600px) {
    body.single-forum .rccf-forum-header-card {
        padding: 18px;
    }
    body.single-forum .rccf-forum-header-top {
        gap: 12px;
    }
    body.single-forum .rccf-forum-header-desc {
        font-size: 14px;
    }
}

/* =========================================================
   RCCF — Single Forum Hero Title Bar
   Scoped to body.single-forum only.
   ========================================================= */

body.single-forum header.entry-header {
    background: var(--rccf-navy);
    color: #fff;
    padding: 28px 26px;
    border-radius: 12px;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

body.single-forum header.entry-header .entry-title {
    color: #fff;
    margin: 0;
}

/* The "By [author]" byline renders empty on forum pages — hide it here */
body.single-forum header.entry-header .entry-meta {
    display: none;
}

body.single-forum .rccf-new-topic-btn {
    background: var(--rccf-gold);
    color: var(--rccf-ink);
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

body.single-forum .rccf-new-topic-btn:hover {
    background: #B37F1F;
    color: var(--rccf-ink);
}

@media (max-width: 600px) {
    body.single-forum header.entry-header {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    body.single-forum .rccf-new-topic-btn {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================
   RCCF — Single Forum Hero Bar v2: title+button row, then
   description, then stats — all inside the navy bar. No icon.
   ========================================================= */

body.single-forum header.entry-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.single-forum .rccf-header-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

body.single-forum header.entry-header .rccf-forum-header-desc {
    margin: 0;
    color: rgba(255,255,255,0.92);
    font-size: 15px;
    line-height: 1.5;
}

body.single-forum header.entry-header .rccf-forum-header-stats {
    margin: 8px 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.72);
    font-size: 13px;
}

body.single-forum header.entry-header .rccf-forum-header-stats a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

body.single-forum header.entry-header .rccf-forum-header-stats a:hover {
    color: var(--rccf-gold);
}

/* RCCF: force left alignment — Astra's default centered "hero" text was showing through */
body.single-forum header.entry-header {
    text-align: left;
    align-items: flex-start;
}

body.single-forum header.entry-header .rccf-forum-header-desc,
body.single-forum header.entry-header .rccf-forum-header-stats {
    text-align: left;
    width: 100%;
    display: block;
}

/* RCCF: breadcrumb — boxed card, home icon instead of "Home" text, bold current page */
body.single-forum .bbp-breadcrumb {
    border: 1px solid var(--rccf-line);
    border-radius: 8px;
    padding: 12px 18px;
    background: #fff;
    margin: 0 0 20px;
}

body.single-forum .bbp-breadcrumb p {
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

body.single-forum .bbp-breadcrumb-home {
    font-size: 0;
    display: inline-flex;
    align-items: center;
}

body.single-forum .bbp-breadcrumb-home::before {
    font-family: dashicons;
    content: "\f102";
    font-size: 18px;
    color: var(--rccf-blue);
}

body.single-forum .bbp-breadcrumb-sep {
    color: var(--rccf-ink-soft);
}

body.single-forum .bbp-breadcrumb-current {
    font-weight: 700;
    color: var(--rccf-navy);
}

/* =========================================================
   RCCF — Topic cards v2: compact byline + single stats line
   Overrides the earlier 4-column grid layout.
   ========================================================= */

/* Breadcrumb links — remove underline (single-forum header work) */
body.single-forum .bbp-breadcrumb a {
    text-decoration: none;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
    display: block !important;
    grid-template-columns: none !important;
    padding: 18px 22px;
}

#bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] > li.bbp-topic-title {
    display: block !important;
    width: 100% !important;
    grid-column: auto !important;
}

.rccf-topic-byline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.rccf-topic-byline .rccf-topic-author-link .bbp-author-avatar img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    vertical-align: middle;
}

.rccf-topic-byline .rccf-topic-author-link .bbp-author-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--rccf-ink-soft);
}

.rccf-topic-sep {
    color: var(--rccf-line);
}

#bbpress-forums .bbp-topic-permalink {
    color: var(--rccf-navy) !important;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none !important;
}

#bbpress-forums .bbp-topic-permalink:hover {
    color: var(--rccf-blue) !important;
}

.rccf-topic-compact-stats {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--rccf-ink-soft);
}

.rccf-topic-compact-stats a {
    color: var(--rccf-blue);
    text-decoration: none;
    font-weight: 600;
}

.rccf-topic-compact-stats a:hover {
    color: var(--rccf-navy);
}

@media (max-width: 600px) {
    #bbpress-forums .bbp-topics > .bbp-body > ul[id^="bbp-topic-"] {
        padding: 16px;
    }
    #bbpress-forums .bbp-topic-permalink {
        font-size: 16px;
    }
}

/* RCCF: topic-card fixes — visible separator, correctly-sized freshness link */
.rccf-topic-sep {
    color: var(--rccf-ink-soft);
}

.rccf-topic-compact-stats a {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--rccf-blue) !important;
}

/* =========================================================
   RCCF — Single Topic Hero Bar: same navy-bar treatment as
   the single-forum header, extended to thread pages.
   ========================================================= */

body.single-topic header.entry-header {
    background: var(--rccf-navy);
    color: #fff;
    padding: 28px 26px;
    border-radius: 12px;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    align-items: flex-start;
}

body.single-topic header.entry-header .entry-title {
    color: #fff;
    margin: 0;
}

body.single-topic header.entry-header .entry-meta {
    display: none;
}

body.single-topic header.entry-header .rccf-forum-header-stats {
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.72);
    font-size: 13px;
    width: 100%;
}

body.single-topic header.entry-header .rccf-forum-header-stats a {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
}

body.single-topic header.entry-header .rccf-forum-header-stats a:hover {
    color: var(--rccf-gold);
}

/* Breadcrumb — boxed card, matching the single-forum treatment */
body.single-topic .bbp-breadcrumb {
    border: 1px solid var(--rccf-line);
    border-radius: 8px;
    padding: 12px 18px;
    background: #fff;
    margin: 0 0 20px;
}

body.single-topic .bbp-breadcrumb a {
    text-decoration: none;
}

@media (max-width: 600px) {
    body.single-topic header.entry-header {
        padding: 20px;
    }
}
