/*
 * AtMyBoat.com — bbPress Forum Styles
 * AODA / WCAG 2.0 AA compliant — minimum 18px all text, no exceptions.
 * Requires: style.css (loads first — provides all CSS custom properties)
 * Version cache-bust: 0.5.3
 */

/* =========================================================================
   NUCLEAR FONT FLOOR — catches every element inside the forum wrapper.
   Specific rules below override UP from 18px; nothing goes below it.
   ========================================================================= */

#bbpress-forums,
#bbpress-forums * {
    font-size: 18px !important;
    line-height: 1.7 !important;
}

/* =========================================================================
   FULL-WIDTH OVERRIDE — remove Twenty Twenty's narrow page containers
   Targets every container Twenty Twenty uses to constrain width.
   ========================================================================= */

body.bbpress #page,
body.single-forum #page,
body.single-topic #page,
body.forum-archive #page {
    max-width: 100% !important;
    width: 100% !important;
}

body.bbpress .site-inner,
body.bbpress #primary,
body.bbpress .content-area,
body.bbpress .post-inner,
body.bbpress .section-inner,
body.bbpress .singular-content,
body.bbpress .site-content,
body.bbpress .entry-content,
body.bbpress .entry-header,
body.bbpress .post-content,
body.single-forum .site-inner,
body.single-forum #primary,
body.single-forum .content-area,
body.single-forum .post-inner,
body.single-forum .section-inner,
body.single-forum .singular-content,
body.single-forum .site-content,
body.single-forum .entry-content,
body.single-forum .entry-header,
body.single-topic .site-inner,
body.single-topic #primary,
body.single-topic .content-area,
body.single-topic .post-inner,
body.single-topic .section-inner,
body.single-topic .singular-content,
body.single-topic .site-content,
body.single-topic .entry-content,
body.single-topic .entry-header,
body.forum-archive .site-inner,
body.forum-archive #primary,
body.forum-archive .content-area,
body.forum-archive .post-inner,
body.forum-archive .section-inner,
body.forum-archive .singular-content,
body.forum-archive .site-content,
body.forum-archive .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    box-sizing: border-box !important;
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
}

/* Remove cap on direct children too */
body.bbpress .entry-content > *,
body.single-forum .entry-content > *,
body.single-topic .entry-content > *,
body.forum-archive .entry-content > * {
    max-width: 100% !important;
}

#bbpress-forums {
    max-width: 100% !important;
    width: 100% !important;
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
}

/* =========================================================================
   TOPIC & REPLY CONTAINER BACKGROUNDS
   These li/article elements sit directly inside the forum wrapper and must
   have explicit dark backgrounds — Twenty Twenty sets white on .entry-content
   which bleeds through any container that doesn't override it.
   ========================================================================= */

/* Topic list rows and reply rows — the li wrappers */
#bbpress-forums ul.bbp-topics li,
#bbpress-forums ul.bbp-replies li,
#bbpress-forums li.bbp-topic,
#bbpress-forums li.bbp-reply {
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
}

/* Author column in topic/reply — sibling to .bbp-reply-content, inherits parent */
#bbpress-forums .bbp-reply-author,
#bbpress-forums .bbp-topic-author {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
}

/* Topic header wrapper (title + meta above reply list) */
#bbpress-forums .bbp-topic-header,
#bbpress-forums .bbp-reply-header,
#bbpress-forums .bbp-topic-title-wrapper,
#bbpress-forums #topic-title {
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
}

/* Voice and reply count that appear outside card backgrounds */
.bbp-topic-voices,
.bbp-topic-reply-count,
#bbpress-forums .bbp-topic-voices,
#bbpress-forums .bbp-topic-reply-count {
    background-color: transparent !important;
    color: var(--text-secondary) !important;
}

/* Ensure the whole reply/topic article block is dark */
#bbpress-forums article,
#bbpress-forums .hentry {
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
}

/* =========================================================================
   RESET — remove bbPress default table layout
   ========================================================================= */

#bbpress-forums,
#bbpress-forums .bbp-forums-list,
#bbpress-forums ul.bbp-forums {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* =========================================================================
   COLUMN HEADER ROW — "Forum / Topics / Posts" row
   bbPress sets a lighter background on li.bbp-header by default — override it.
   ========================================================================= */

#bbpress-forums li.bbp-header,
#bbpress-forums ul.bbp-forums-header,
#bbpress-forums ul.bbp-forums-header li {
    background-color: var(--bg-deep) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-amber);
}

/* =========================================================================
   FORUM ARCHIVE — list of all forum categories
   ========================================================================= */

#bbpress-forums li.bbp-forum-info {
    background: var(--bg-card);
    border: 1px solid var(--border-amber);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

#bbpress-forums li.bbp-forum-info::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--amber-bright), var(--teal-bright));
    opacity: 0;
    transition: opacity 0.25s;
}

#bbpress-forums li.bbp-forum-info:hover {
    border-color: var(--amber-bright);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

#bbpress-forums li.bbp-forum-info:hover::before {
    opacity: 1;
}

/* Forum title */
#bbpress-forums .bbp-forum-title {
    font-family: var(--font-display);
    font-size: 20px !important;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.3 !important;
}

#bbpress-forums .bbp-forum-title:hover {
    color: var(--amber-bright);
}

/* Forum description */
#bbpress-forums .bbp-forum-content p {
    font-size: 18px !important;
    color: var(--text-secondary);
    margin: 0.4rem 0 0;
    line-height: 1.7 !important;
}

/* Forum meta — topic/reply counts */
#bbpress-forums li.bbp-forum-counts,
#bbpress-forums .bbp-forum-topic-count,
#bbpress-forums .bbp-forum-reply-count {
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1.5 !important;
}

/* Last active info */
#bbpress-forums .bbp-forum-lastpost {
    font-size: 18px !important;
    color: var(--text-secondary);
    line-height: 1.5 !important;
}

#bbpress-forums .bbp-forum-lastpost a {
    color: var(--teal-bright);
    font-size: 18px !important;
    text-decoration: none;
}

/* =========================================================================
   TOPIC LIST — list of threads within a forum
   ========================================================================= */

#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-topics li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each topic row */
#bbpress-forums li.bbp-topic-title {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.2s, background 0.2s;
}

#bbpress-forums li.bbp-topic-title:hover {
    border-color: var(--border-amber);
    background: var(--bg-raised);
}

/* Topic title link */
#bbpress-forums .bbp-topic-permalink {
    font-family: var(--font-display);
    font-size: 20px !important;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.3 !important;
    display: block;
}

#bbpress-forums .bbp-topic-permalink:hover {
    color: var(--amber-bright);
}

/* Topic meta — reply count, last active */
#bbpress-forums .bbp-topic-meta,
#bbpress-forums .bbp-topic-reply-count,
#bbpress-forums .bbp-topic-voice-count {
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    line-height: 1.5 !important;
}

#bbpress-forums .bbp-topic-freshness a,
#bbpress-forums .bbp-topic-author a {
    color: var(--teal-bright);
    font-size: 18px !important;
    text-decoration: none;
    line-height: 1.5 !important;
}

/* =========================================================================
   SINGLE TOPIC — thread view with replies
   ========================================================================= */

/* Original post and each reply */
#bbpress-forums .bbp-reply-content,
#bbpress-forums .bbp-topic-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    font-size: 18px !important;
    line-height: 1.85 !important;
    color: var(--text-primary);
}

#bbpress-forums .bbp-reply-content p,
#bbpress-forums .bbp-topic-content p {
    font-size: 18px !important;
    line-height: 1.85 !important;
    color: var(--text-primary);
}

/* Post author row */
#bbpress-forums .bbp-reply-author,
#bbpress-forums .bbp-topic-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

#bbpress-forums .bbp-author-name a {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--amber-bright);
    text-decoration: none;
    font-size: 18px !important;
    line-height: 1.4 !important;
}

#bbpress-forums .bbp-author-role {
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1.4 !important;
}

/* Avatar */
#bbpress-forums .bbp-author-avatar img {
    border-radius: 50%;
    border: 2px solid var(--border-amber);
    width: 48px;
    height: 48px;
}

/* Reply number badge */
#bbpress-forums .bbp-reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.4 !important;
}

/* =========================================================================
   NEW TOPIC & REPLY FORMS
   ========================================================================= */

#bbpress-forums #new-topic,
#bbpress-forums #new-reply,
#bbpress-forums .bbp-topic-form,
#bbpress-forums .bbp-reply-form {
    background: var(--bg-card);
    border: 1px solid var(--border-teal);
    border-radius: 8px;
    padding: 1.75rem;
    margin: 2rem 0;
    position: relative;
}

#bbpress-forums .bbp-topic-form::before {
    content: 'NEW TOPIC';
    position: absolute;
    top: -12px;
    left: 1.5rem;
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.1em;
    background: var(--amber-bright);
    color: #0A2342;
    padding: 3px 12px;
    border-radius: 2px;
    font-weight: 700;
    line-height: 1.4 !important;
}

#bbpress-forums .bbp-reply-form::before {
    content: 'POST A REPLY';
    position: absolute;
    top: -12px;
    left: 1.5rem;
    font-family: var(--font-mono);
    font-size: 18px !important;
    letter-spacing: 0.1em;
    background: var(--teal-bright);
    color: #0A2342;
    padding: 3px 12px;
    border-radius: 2px;
    font-weight: 700;
    line-height: 1.4 !important;
}

/* Form field labels */
#bbpress-forums label {
    display: block;
    font-family: var(--font-body);
    font-size: 18px !important;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    line-height: 1.4 !important;
}

/* Text inputs and textareas */
#bbpress-forums input[type="text"],
#bbpress-forums textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 18px !important;
    padding: 0.85rem 1rem;
    min-height: 56px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    line-height: 1.5 !important;
}

#bbpress-forums textarea {
    min-height: 140px;
    resize: vertical;
}

#bbpress-forums input[type="text"]:focus,
#bbpress-forums textarea:focus {
    border-color: var(--teal-bright);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34,160,144,0.2);
}

/* Submit button */
#bbpress-forums input[type="submit"],
#bbpress-forums button[type="submit"],
#bbpress-forums .bbp-submit-wrapper input[type="submit"] {
    background: var(--amber-bright);
    color: #0A2342;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 18px !important;
    padding: 0.85rem 2rem;
    border-radius: 4px;
    border: none;
    min-height: 48px;
    min-width: 48px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
    transition: background 0.2s, transform 0.2s;
    line-height: 1.3 !important;
}

#bbpress-forums input[type="submit"]:hover,
#bbpress-forums button[type="submit"]:hover {
    background: #E5A820;
    color: #0A2342;
    transform: translateY(-1px);
}

#bbpress-forums input[type="submit"]:focus,
#bbpress-forums button[type="submit"]:focus {
    outline: 3px solid var(--teal-bright);
    outline-offset: 3px;
}

/* =========================================================================
   BREADCRUMBS
   ========================================================================= */

#bbpress-forums .bbp-breadcrumb {
    font-family: var(--font-body);
    font-size: 18px !important;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border-radius: 4px;
    border: 1px solid var(--border);
    line-height: 1.5 !important;
}

#bbpress-forums .bbp-breadcrumb a {
    color: var(--teal-bright);
    text-decoration: none;
    font-size: 18px !important;
}

#bbpress-forums .bbp-breadcrumb a:hover {
    color: var(--amber-bright);
}

#bbpress-forums .bbp-breadcrumb .bbp-breadcrumb-sep {
    margin: 0 0.4em;
    color: var(--text-secondary);
}

/* =========================================================================
   PAGINATION
   ========================================================================= */

.bbp-pagination,
#bbpress-forums .bbp-pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.bbp-pagination a,
.bbp-pagination span {
    font-family: var(--font-body);
    font-size: 18px !important;
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    line-height: 1.3 !important;
}

.bbp-pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.bbp-pagination a:hover {
    background: var(--bg-raised);
    border-color: var(--border-amber);
    color: var(--amber-bright);
}

.bbp-pagination .current,
.bbp-pagination span.current {
    background: var(--amber-bright);
    color: #0A2342;
    font-weight: 700;
    border: none;
}

/* =========================================================================
   FORUM STATS BAR
   ========================================================================= */

.bbp-statistics {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    font-family: var(--font-body);
    font-size: 18px !important;
    color: var(--text-secondary);
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    line-height: 1.5 !important;
}

.bbp-statistics span strong {
    color: var(--amber-bright);
    font-weight: 700;
}

/* =========================================================================
   LOGIN / MUST LOG IN NOTICES
   ========================================================================= */

#bbpress-forums .bbp-logged-in,
#bbpress-forums .bbp-login-form,
#bbpress-forums .bbp-must-be-logged-in {
    background: var(--bg-card);
    border: 1px solid var(--border-teal);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-size: 18px !important;
    color: var(--text-secondary);
    line-height: 1.7 !important;
}

#bbpress-forums .bbp-must-be-logged-in a,
#bbpress-forums .bbp-login-form a {
    color: var(--amber-bright);
    font-size: 18px !important;
}

/* =========================================================================
   TOPIC PAGE HEADER
   ========================================================================= */

.bbp-topic-title-wrapper h1,
#bbpress-forums .entry-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 36px) !important;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3 !important;
    margin-bottom: 0.5rem;
}

.bbp-topic-voices,
.bbp-topic-reply-count {
    font-family: var(--font-body);
    font-size: 18px !important;
    color: var(--text-secondary);
    line-height: 1.5 !important;
}

/* =========================================================================
   NOTICES
   ========================================================================= */

.bbp-template-notice,
#bbpress-forums .bbp-template-notice {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    font-size: 18px !important;
    line-height: 1.7 !important;
    margin: 1rem 0;
    border-left: 4px solid var(--teal-bright);
    background: var(--teal-glow);
    color: var(--text-primary);
}

.bbp-template-notice.info {
    border-left-color: var(--amber-bright);
    background: var(--amber-glow);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

@media (max-width: 768px) {
    #bbpress-forums li.bbp-forum-info,
    #bbpress-forums li.bbp-topic-title {
        padding: 1rem;
    }

    #bbpress-forums .bbp-reply-content,
    #bbpress-forums .bbp-topic-content {
        padding: 1rem;
    }

    #bbpress-forums .bbp-topic-form,
    #bbpress-forums .bbp-reply-form {
        padding: 1.25rem 1rem;
    }

    .bbp-statistics {
        flex-direction: column;
        gap: 0.5rem;
    }
}
