/* ==========================================================
   DIỄN ĐÀN TLBB - bổ sung nhỏ trên nền portal.css (Tin Tức)
   Dùng lại bảng màu giấy dó: nền #fcf6ee, viền #d7cda9, nâu đỏ #661e0a, cam #ed7c2b, vàng #b88628
   ========================================================== */
.forum-wrapper { max-width: 1080px; }

.forum-cat-desc { text-align: center; color: #7a6a54; font-size: 14px; margin: -5px 0 18px; }
.forum-muted { color: #8d7b62; font-size: 13px; }
.forum-toolbar-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Nhóm chuyên mục */
.forum-group { margin-bottom: 26px; }
.forum-group-title { margin-bottom: 0; }

/* Dòng chủ đề / chuyên mục: tlbb-news-row + cột số liệu */
.forum-topic-row, .forum-cat-row { align-items: center; padding: 14px 0; gap: 16px; }
.forum-topic-row .tlbb-news-title, .forum-cat-row .tlbb-news-title { font-size: 16px; margin: 2px 0 2px; }
.forum-cat-row .tlbb-news-summary { margin: 0; font-size: 13px; }
.forum-topic-icon {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #efe6d5; border: 1px solid #d7cda9; color: #8c7864; font-size: 17px;
}
.forum-topic-icon.is-new { background: #661e0a; border-color: #661e0a; color: #fff; }
.forum-topic-icon.is-pinned { background: #ffecb3; border-color: #e8c46a; color: #995c00; }
.forum-topic-icon.is-locked { background: #e4dac7; color: #6b5d4d; }
.forum-topic-stats {
    flex: 0 0 110px; display: flex; flex-direction: column; gap: 3px;
    font-size: 12px; color: #7a6a54; border-left: 1px dotted #d7cda9; padding-left: 14px;
}
.forum-topic-last {
    flex: 0 0 190px; display: flex; flex-direction: column; gap: 2px;
    font-size: 12px; color: #8d7b62; border-left: 1px dotted #d7cda9; padding-left: 14px; min-width: 0;
}
.forum-topic-last a { color: #a93e16; font-weight: 600; text-decoration: none; }
.forum-topic-last .forum-last-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forum-member-link { color: #661e0a; font-weight: 600; text-decoration: none; }
.forum-member-link:hover { color: #ed7c2b; }
.forum-lock-tag, .forum-new-tag {
    font-size: 11px; padding: 2px 6px; border-radius: 3px; font-weight: 700; vertical-align: middle;
}
.forum-lock-tag { background: #e4dac7; color: #55443a; }
.forum-new-tag { background: #d32f2f; color: #fff; }
.forum-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #7a6a54; }
.forum-legend .is-pinned { color: #995c00; } .forum-legend .is-locked { color: #6b5d4d; } .forum-legend .is-new { color: #661e0a; }
.tlbb-pagination li.forum-page-gap span { display: flex; align-items: center; min-width: 20px; height: 34px; color: #8c7864; }

/* Nút: dùng tlbb-back-btn, thêm biến thể */
.forum-btn-sm { padding: 4px 12px; font-size: 12px; cursor: pointer; }
.forum-btn-primary { background: #661e0a; color: #fff !important; border-color: #661e0a; cursor: pointer; }
.forum-btn-primary:hover { background: #8b2b10; }
.forum-btn-danger { color: #b3261e; }
.forum-btn-danger:hover { background: #b3261e; border-color: #b3261e; }
.forum-mod-bar { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; }

/* Bài viết trong chủ đề */
.forum-post {
    display: flex; gap: 22px; padding: 22px 0; border-bottom: 1px dotted #d7cda9;
}
.forum-post:last-child { border-bottom: none; }
.forum-post-author {
    flex: 0 0 150px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
    background: #f4ecdc; border: 1px solid #e2d9be; border-radius: 6px; padding: 14px 8px; align-self: flex-start;
}
.forum-post-name { font-size: 14px; word-break: break-word; }
.forum-post-facts { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: #7a6a54; }
.forum-post-main { flex: 1; min-width: 0; }
.forum-post-meta { justify-content: space-between; border-bottom: 1px dashed #e2d9be; padding-bottom: 6px; margin-bottom: 12px; }
.forum-post-number { color: #b88628; font-weight: 700; text-decoration: none; }
.forum-post-body { font-size: 15px; line-height: 1.8; }
.forum-post-first .forum-post-body { font-size: 16px; }
.forum-post-edited { font-size: 12px; color: #8d7b62; font-style: italic; margin-top: 10px; }
.forum-signature {
    margin-top: 14px; padding-top: 8px; border-top: 1px solid #e2d9be; font-size: 13px; color: #6b5d4d;
    max-height: 120px; overflow: hidden;
}
.forum-signature img { max-height: 90px !important; margin: 4px 0 !important; }
.forum-signature-profile { border-top: none; padding-top: 0; max-height: none; }
.forum-post-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* Avatar + cấp bậc */
.forum-avatar { border-radius: 50%; object-fit: cover; border: 2px solid #d7cda9; background: #efe6d5; }
.forum-avatar-md { width: 40px; height: 40px; }
.forum-avatar-lg { width: 76px; height: 76px; }
.forum-avatar-xl { width: 120px; height: 120px; border-width: 3px; }
.forum-avatar-letter {
    display: inline-flex; align-items: center; justify-content: center;
    background: #661e0a; color: #fff; font-weight: 800; font-family: "Noto Serif", Georgia, serif;
}
.forum-avatar-lg.forum-avatar-letter { font-size: 32px; }
.forum-avatar-xl.forum-avatar-letter { font-size: 52px; }
.forum-rank {
    display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 20px;
    background: #eedec3; color: #661e0a; border: 1px solid #d7cda9;
}
.forum-rank-admin { background: #661e0a; color: #ffd78a; border-color: #661e0a; }
.forum-rank-1000, .forum-rank-400 { background: #b88628; color: #fff; border-color: #a0731f; }
.forum-rank-150 { background: #ed7c2b; color: #fff; border-color: #de640d; }

/* Trích dẫn + mã */
.forum-quote {
    background: #f4ecdc; border-left: 4px solid #b88628; margin: 10px 0 14px; padding: 10px 14px;
    font-size: 14px; color: #55443a; border-radius: 0 4px 4px 0;
}
.forum-quote-head { font-weight: 700; color: #661e0a; font-size: 12px; margin-bottom: 4px; }
.forum-code {
    background: #2e2825; color: #f4ecdc; padding: 10px 14px; border-radius: 4px; font-size: 13px;
    white-space: pre-wrap; word-break: break-word;
}

/* Soạn bài */
.forum-label { font-weight: 700; color: #661e0a; font-size: 14px; }
.forum-form .form-control, .forum-textarea {
    background: #fffdf8; border: 1px solid #d7cda9; color: #2e2825; font-size: 15px;
}
.forum-form .form-control:focus, .forum-textarea:focus { border-color: #ed7c2b; box-shadow: 0 0 0 2px rgba(237, 124, 43, 0.15); }
.forum-editor-tools {
    display: flex; gap: 4px; flex-wrap: wrap; background: #efe6d5; border: 1px solid #d7cda9; border-bottom: none;
    border-radius: 4px 4px 0 0; padding: 5px;
}
.forum-editor-tools button {
    border: 1px solid transparent; background: transparent; color: #661e0a; width: 32px; height: 30px; border-radius: 3px; cursor: pointer;
}
.forum-editor-tools button:hover { background: #fff; border-color: #d7cda9; }
.forum-editor .forum-textarea { border-radius: 0 0 4px 4px; }
.forum-editor-hint { display: block; color: #8d7b62; margin-top: 4px; }
.forum-reply-box .forum-editor { margin-top: 8px; }

/* Thông báo */
.forum-alert { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.forum-alert-error { background: #fdecea; border-color: #f5c2bd; color: #8a1c13; }
.forum-alert-ok { background: #eef7e8; border-color: #c7e2b6; color: #2f5d1a; }

/* Hồ sơ thành viên */
.forum-profile { display: flex; gap: 28px; align-items: flex-start; }
.forum-profile-card {
    flex: 0 0 220px; text-align: center; background: #f4ecdc; border: 1px solid #e2d9be; border-radius: 6px;
    padding: 20px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.forum-profile-name { font-size: 22px; font-weight: 800; color: #661e0a; margin: 4px 0 0; word-break: break-word; }
.forum-profile-info { flex: 1; min-width: 0; }
.forum-profile-meta { justify-content: flex-start; margin-top: 0; }

/* Điện thoại */
@media (max-width: 767px) {
    .forum-topic-row, .forum-cat-row { flex-wrap: wrap; }
    .forum-topic-row .tlbb-news-info, .forum-cat-row .tlbb-news-info { flex: 1 1 calc(100% - 60px); }
    .forum-topic-stats { flex: 1 1 auto; flex-direction: row; gap: 14px; border-left: none; padding-left: 58px; }
    .forum-topic-last { flex: 1 1 100%; border-left: none; padding-left: 58px; }
    .forum-post { flex-direction: column; gap: 10px; }
    .forum-post-author { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; width: 100%; padding: 8px 10px; gap: 10px; height: auto; }
    .forum-avatar-lg { width: 44px; height: 44px; }
    .forum-avatar-lg.forum-avatar-letter { font-size: 20px; }
    .forum-post-facts { flex-direction: row; gap: 10px; }
    .forum-profile { flex-direction: column; }
    .forum-profile-card { flex: 1 1 auto; width: 100%; }
}

/* Khung mực tối (tlbb-related-box của trang con) chứa form / đoạn văn */
.portal-sub .forum-reply-box { background: #f4ecdc; }
.portal-sub .forum-reply-box form, .portal-sub .forum-reply-box > p,
.portal-sub .tlbb-related-box > p.forum-muted { padding: 12px 16px; margin: 0; }
.portal-sub .tlbb-related-box > p.forum-muted { color: #c9b896; }
.portal-sub .forum-reply-box > p { color: #6b5d4d; }
