/* ============================================================
   FORUM — classic topic layout (not chat bubbles)
   ============================================================ */

.forum-thread-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}
.forum-thread-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--dh-text);
    line-height: 1.25;
}

.forum-thread-subline {
    font-size: 13px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dh-border);
    color: var(--dh-text-muted);
}
html.dark-mode .forum-thread-subline {
    border-color: var(--ark-bg-1);
    color: var(--ark-muted);
}

.forum-post-card {
    margin-bottom: 16px;
    border: 1px solid var(--dh-border);
    background: var(--dh-bg-card);
    color: var(--dh-text);
}
html.dark-mode .forum-post-card {
    background: var(--ark-bg-1);
    border-color: var(--ark-bg-1);
}

/* First post in thread — visually distinct from replies */
.forum-post-card--opening {
    border-width: 1px 1px 1px 4px;
    border-left-color: var(--dh-accent);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
html.dark-mode .forum-post-card--opening {
    background: linear-gradient(135deg, var(--ark-card-raise) 0%, var(--ark-bg-1) 55%);
    border-color: var(--ark-bg-1);
    border-left-color: var(--dh-accent);
    box-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}
.forum-post-card--opening .forum-post-user {
    background: rgba(217, 164, 65, 0.06);
}
html.dark-mode .forum-post-card--opening .forum-post-user {
    background: rgba(217, 164, 65, 0.08);
}
.forum-post-card--opening .forum-user-avatar {
    width: 80px;
    height: 80px;
    font-size: 24px;
    border-color: rgba(217, 164, 65, 0.45);
}
.forum-post-card--opening .forum-post-body {
    font-size: 15px;
}

.forum-post-meta-left {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.forum-post-opening-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 3px;
    color: var(--ark-bg-1);
    background: linear-gradient(180deg, var(--ark-gold), var(--dh-accent));
    border: 1px solid rgba(0, 0, 0, 0.12);
}
html.dark-mode .forum-post-opening-badge {
    color: var(--ark-bg-1);
    background: linear-gradient(180deg, var(--ark-gold-bright), var(--ark-gold));
}

.forum-post-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 120px;
}

.forum-post-user {
    flex: 0 0 200px;
    max-width: 200px;
    padding: 16px 14px;
    text-align: center;
    background: var(--dh-bg-secondary);
    border-right: 1px solid var(--dh-border);
}
html.dark-mode .forum-post-user {
    background: var(--ark-bg-1);
    border-right-color: var(--ark-bg-1);
}

.forum-user-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(145deg, var(--ark-faint), var(--ark-bg-1));
    border: 2px solid var(--dh-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.forum-user-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--dh-text);
    word-break: break-word;
    margin-bottom: 6px;
    text-decoration: none !important;
}
.forum-user-name:hover {
    color: var(--dh-accent);
}

.forum-user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    margin-bottom: 10px;
}

.forum-user-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 3px;
    line-height: 1.2;
}
.forum-user-badge--guest {
    background: var(--ark-faint);
    color: var(--ark-text);
}
.forum-user-badge--member {
    background: rgba(217, 164, 65, 0.2);
    color: var(--dh-accent);
    border: 1px solid rgba(217, 164, 65, 0.35);
}
.forum-user-badge--staff {
    background: var(--ark-blue);
    color: var(--ark-text);
}

.forum-user-stat {
    font-size: 12px;
    color: var(--dh-text-muted);
    line-height: 1.45;
}
html.dark-mode .forum-user-stat {
    color: var(--ark-muted);
}

.forum-post-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.forum-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--dh-text-muted);
    border-bottom: 1px solid var(--dh-border);
    background: rgba(0, 0, 0, 0.04);
}
html.dark-mode .forum-post-meta {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: var(--ark-bg-1);
    color: var(--ark-muted);
}

.forum-post-number {
    font-weight: 700;
    color: var(--dh-accent);
}

.forum-post-body {
    padding: 16px 18px 18px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--dh-text);
    flex: 1 1 auto;
}

.forum-post-mod {
    padding: 8px 16px 12px;
    border-top: 1px solid var(--dh-border);
    background: var(--dh-bg-secondary);
}
html.dark-mode .forum-post-mod {
    background: var(--ark-bg-1);
    border-top-color: var(--ark-bg-1);
}

.forum-post-mod .btn-link {
    padding: 0;
    font-size: 12px;
}

@media (max-width: 767px) {
    .forum-post-inner {
        flex-direction: column;
    }
    .forum-post-user {
        flex: 0 0 auto;
        max-width: none;
        border-right: none;
        border-bottom: 1px solid var(--dh-border);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 12px;
    }
    html.dark-mode .forum-post-user {
        border-bottom-color: var(--ark-bg-1);
    }
    .forum-user-avatar {
        width: 52px;
        height: 52px;
        font-size: 16px;
        margin: 0;
    }
    .forum-post-card--opening .forum-user-avatar {
        width: 58px;
        height: 58px;
        font-size: 18px;
    }
    .forum-user-badges,
    .forum-user-stat {
        justify-content: flex-start;
    }
    .forum-user-name {
        flex: 1 1 120px;
        margin-bottom: 0;
    }
}

.forum-reply-box {
    margin-top: 24px;
    padding: 18px;
    border: 1px solid var(--dh-border);
    background: var(--dh-bg-card);
}
html.dark-mode .forum-reply-box {
    background: var(--ark-bg-1);
    border-color: var(--ark-bg-1);
}
.forum-reply-box h4 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dh-text);
}

.forum-bbcode-quote {
    margin: 0.75em 0;
    padding: 10px 12px;
    border-left: 3px solid var(--dh-border);
    background: rgba(0, 0, 0, 0.04);
    font-size: 14px;
}
html.dark-mode .forum-bbcode-quote {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--ark-faint);
}
.forum-bbcode-quote-cite {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--dh-text-muted);
}

.forum-post-actions {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--dh-border);
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: flex-start;
}
.forum-inline-details {
    flex: 1 1 200px;
    max-width: 100%;
}
.forum-inline-details summary {
    cursor: pointer;
    color: var(--dh-text-muted);
}

.forum-toolbar {
    border-bottom: 1px solid var(--dh-border);
    padding-bottom: 10px;
}
