/* ============================================================
 * Climastery Forum — giao diện bbPress theo phong cách Climastery
 * Navy #002d62 / #00438b · Cam #E26D35 · Font Manrope
 * Selector theo CẤU TRÚC (không dựa vào class .bbp-forum/.bbp-topic
 * vì bbPress đặt class hàng là "forum"/"topic"). Thay layout float
 * mặc định bằng grid hiện đại, dạng "diễn đàn" thực thụ.
 * ============================================================ */

#bbpress-forums,
.climastery-profile-forum,
.bbp-pagination,
.bbp-breadcrumb {
	--cf-navy:    #002d62;
	--cf-navy-2:  #00438b;
	--cf-orange:  #e26d35;
	--cf-ink:     #1a1c1c;
	--cf-muted:   #737782;
	--cf-line:    #e7e9ef;
	--cf-line-2:  #c3c6d2;
	--cf-bg:      #ffffff;
	--cf-soft:    #f6f7fb;
	--cf-soft-2:  #eef1f7;
	--cf-radius:  12px;
	--cf-shadow:  0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.05);
	--cf-font:    var(--wp--preset--font-family--montserrat, "Montserrat", system-ui, sans-serif);
}

/* ---------- Khung tổng ---------- */
#bbpress-forums {
	font-family: var(--cf-font);
	color: var(--cf-ink);
	font-size: 15px;
	line-height: 1.55;
	max-width: 1340px;
	margin-inline: auto;
}
#bbpress-forums * { box-sizing: border-box; }
#bbpress-forums a { color: var(--cf-navy-2); text-decoration: none; }
#bbpress-forums a:hover { text-decoration: underline; }
.climastery-forum-main { min-height: 60vh; }

/* ---------- Breadcrumb ---------- */
.bbp-breadcrumb {
	font-family: var(--cf-font);
	font-size: 13.5px;
	color: var(--cf-muted);
	margin: 0 0 22px;
}
.bbp-breadcrumb p { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bbp-breadcrumb a { color: var(--cf-muted); }
.bbp-breadcrumb a:hover { color: var(--cf-navy); }
.bbp-breadcrumb .bbp-breadcrumb-current { color: var(--cf-navy); font-weight: 600; }
.climastery-bc-sep { color: var(--cf-line-2); }

/* ---------- Thông báo / notice ---------- */
.bbp-template-notice {
	font-family: var(--cf-font);
	background: var(--cf-soft);
	border: 1px solid var(--cf-line);
	border-left: 4px solid var(--cf-navy-2);
	border-radius: 10px;
	padding: 14px 18px;
	margin: 0 0 22px;
	font-size: 14px;
	color: var(--cf-ink);
}
.bbp-template-notice.error,
.bbp-template-notice.warning { border-left-color: var(--cf-orange); }
.bbp-template-notice ul, .bbp-template-notice p { margin: 0; }

/* ============================================================
 * BẢNG DANH SÁCH FORUM & CHỦ ĐỀ (card + grid)
 * Container: ul.bbp-forums / ul.bbp-topics
 * Hàng:      .bbp-body > ul   (class hàng là "forum"/"topic")
 * ============================================================ */
ul.bbp-forums,
ul.bbp-topics {
	list-style: none;
	margin: 0 0 30px;
	padding: 0;
	background: var(--cf-bg);
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	overflow: hidden;
	box-shadow: var(--cf-shadow);
}

/* Header bar (navy) */
ul.bbp-forums > li.bbp-header,
ul.bbp-topics > li.bbp-header {
	background: var(--cf-navy);
	color: #fff;
	padding: 0;
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}
ul.bbp-forums > li.bbp-header .forum-titles,
ul.bbp-topics > li.bbp-header .forum-titles { list-style: none; margin: 0; padding: 0; }

/* Grid chung cho header + từng hàng */
ul.bbp-forums > li.bbp-header .forum-titles,
ul.bbp-topics > li.bbp-header .forum-titles,
ul.bbp-forums > li.bbp-body > ul,
ul.bbp-topics > li.bbp-body > ul {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 84px 84px 220px;
	align-items: center;
	gap: 14px;
	padding: 18px 22px;
	margin: 0;
}

/* Reset list cho mọi ô con */
ul.bbp-forums > li.bbp-body > ul > li,
ul.bbp-topics > li.bbp-body > ul > li,
ul.bbp-forums > li.bbp-header .forum-titles > li,
ul.bbp-topics > li.bbp-header .forum-titles > li {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}

/* Body + hàng */
ul.bbp-forums > li.bbp-body,
ul.bbp-topics > li.bbp-body { list-style: none; margin: 0; padding: 0; }
ul.bbp-forums > li.bbp-body > ul,
ul.bbp-topics > li.bbp-body > ul {
	border-top: 1px solid var(--cf-line);
	transition: background .15s ease;
}
ul.bbp-forums > li.bbp-body > ul:hover,
ul.bbp-topics > li.bbp-body > ul:hover { background: var(--cf-soft); }

/* Căn phải/giữa các cột số liệu (cả header lẫn hàng) */
.forum-titles .bbp-forum-topic-count,
.forum-titles .bbp-forum-reply-count,
.forum-titles .bbp-topic-voice-count,
.forum-titles .bbp-topic-reply-count,
ul.bbp-forums > li.bbp-body > ul .bbp-forum-topic-count,
ul.bbp-forums > li.bbp-body > ul .bbp-forum-reply-count,
ul.bbp-topics > li.bbp-body > ul .bbp-topic-voice-count,
ul.bbp-topics > li.bbp-body > ul .bbp-topic-reply-count { text-align: center; }

/* Tiêu đề forum / chủ đề */
.bbp-forum-title,
.bbp-topic-permalink {
	display: inline-block;
	font-size: 16px;
	font-weight: 700;
	color: var(--cf-navy) !important;
	line-height: 1.35;
}
.bbp-forum-title:hover,
.bbp-topic-permalink:hover { color: var(--cf-orange) !important; text-decoration: none; }

.bbp-forum-content { font-size: 13.5px; color: var(--cf-muted); margin-top: 5px; line-height: 1.5; }

/* Meta dòng phụ */
.bbp-topic-meta {
	font-size: 12.5px;
	color: var(--cf-muted);
	margin: 6px 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	align-items: center;
}
.bbp-topic-meta a { color: var(--cf-navy-2); }
.bbp-topic-meta img.avatar { width: 16px; height: 16px; border-radius: 50%; vertical-align: middle; }

/* Sub-forum tags */
.bbp-forum-info .bbp-forums-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 12px;
}
.bbp-forum-info .bbp-forums-list li { margin: 0; padding: 2px 10px; background: var(--cf-soft-2); border-radius: 999px; color: var(--cf-navy-2); }

/* Cột số (topics / replies / voices) */
ul.bbp-forums > li.bbp-body > ul .bbp-forum-topic-count,
ul.bbp-forums > li.bbp-body > ul .bbp-forum-reply-count,
ul.bbp-topics > li.bbp-body > ul .bbp-topic-voice-count,
ul.bbp-topics > li.bbp-body > ul .bbp-topic-reply-count {
	font-size: 17px;
	font-weight: 700;
	color: var(--cf-navy);
}

/* Cột Last Post / freshness */
.bbp-forum-freshness,
.bbp-topic-freshness { font-size: 13px; color: var(--cf-muted); line-height: 1.4; }
.bbp-forum-freshness a,
.bbp-topic-freshness a { color: var(--cf-navy-2); font-weight: 600; }
.bbp-forum-freshness .bbp-topic-meta,
.bbp-topic-freshness .bbp-topic-meta { margin-top: 2px; font-size: 12px; }

/* Footer của bảng */
ul.bbp-forums > li.bbp-footer,
ul.bbp-topics > li.bbp-footer { display: none; }

/* Sticky */
ul.bbp-topics > li.bbp-body > ul.sticky,
ul.bbp-topics > li.bbp-body > ul.super-sticky { background: var(--cf-soft); }
ul.bbp-topics > li.bbp-body > ul.sticky .bbp-topic-permalink::before,
ul.bbp-topics > li.bbp-body > ul.super-sticky .bbp-topic-permalink::before { content: "📌"; font-size: 12px; margin-right: 6px; }

/* ============================================================
 * CHỦ ĐỀ ĐƠN + DANH SÁCH TRẢ LỜI
 * ============================================================ */
ul.bbp-replies {
	list-style: none;
	margin: 0 0 30px;
	padding: 0;
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	overflow: hidden;
	background: var(--cf-bg);
	box-shadow: var(--cf-shadow);
}
ul.bbp-replies > li.bbp-header,
ul.bbp-replies > li.bbp-footer { display: none; }
ul.bbp-replies > li.bbp-body { list-style: none; margin: 0; padding: 0; }

/* Header meta của mỗi bài */
.bbp-reply-header {
	background: var(--cf-soft);
	border-top: 1px solid var(--cf-line);
	padding: 11px 24px;
	font-size: 12.5px;
	color: var(--cf-muted);
}
ul.bbp-replies > li.bbp-body > .bbp-reply-header:first-child { border-top: 0; }
.bbp-reply-header .bbp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bbp-reply-permalink { margin-left: auto; color: var(--cf-line-2) !important; font-weight: 600; }
.bbp-reply-post-date { font-weight: 600; color: var(--cf-ink); }

/* Thân bài: 2 cột (chọn theo cấu trúc — div chứa .bbp-reply-author) */
#bbpress-forums div:has(> .bbp-reply-author) {
	display: grid;
	grid-template-columns: 190px minmax(0, 1fr);
	border-top: 1px solid var(--cf-line);
}
.bbp-reply-author {
	padding: 22px 18px;
	background: var(--cf-soft);
	border-right: 1px solid var(--cf-line);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}
.bbp-reply-author a { color: var(--cf-navy) !important; }
.bbp-reply-author .bbp-author-avatar img,
.bbp-reply-author img.avatar {
	width: 68px; height: 68px; border-radius: 50%; display: block; margin: 0 auto;
	border: 2px solid #fff; box-shadow: 0 0 0 1px var(--cf-line-2);
}
.bbp-reply-author .bbp-author-name { display: block; font-weight: 700; color: var(--cf-navy) !important; font-size: 14px; }
.bbp-reply-author .bbp-author-role {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	color: var(--cf-orange);
	background: rgba(226, 109, 53, .1);
	padding: 2px 10px;
	border-radius: 999px;
}
.bbp-reply-content {
	padding: 24px 26px;
	font-size: 15px;
	line-height: 1.65;
	color: var(--cf-ink);
	min-height: 110px;
}
.bbp-reply-content p:first-child { margin-top: 0; }
.bbp-reply-content p:last-child { margin-bottom: 0; }
.bbp-reply-ip { font-size: 11px; color: var(--cf-line-2); }

/* Admin / row actions */
.bbp-admin-links, .bbp-row-actions { font-size: 12px; }
.bbp-admin-links a { color: var(--cf-muted) !important; margin-left: 8px; }
.bbp-admin-links a:hover { color: var(--cf-orange) !important; }

/* ============================================================
 * NÚT BẤM
 * ============================================================ */
#bbpress-forums div.bbp-topic-buttons,
#bbpress-forums div.bbp-reply-buttons { margin: 16px 0; }
#bbpress-forums a.button,
.bbp-topic-buttons a,
.bbp-reply-buttons a,
a.bbp-manage-user-link {
	display: inline-block;
	font-family: var(--cf-font);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	padding: 10px 18px;
	border-radius: 8px;
	border: 1px solid var(--cf-line-2);
	background: #fff;
	color: var(--cf-navy) !important;
	text-decoration: none !important;
	margin-right: 8px;
	transition: all .15s ease;
}
#bbpress-forums a.button:hover,
.bbp-topic-buttons a:hover,
.bbp-reply-buttons a:hover { border-color: var(--cf-navy); background: var(--cf-navy); color: #fff !important; }

/* ============================================================
 * FORM (tạo chủ đề / trả lời / đăng nhập / tìm kiếm)
 * ============================================================ */
#bbpress-forums fieldset.bbp-form {
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	background: var(--cf-bg);
	padding: 26px 26px 10px;
	margin: 0 0 30px;
	box-shadow: var(--cf-shadow);
}
#bbpress-forums fieldset.bbp-form legend { font-size: 18px; font-weight: 800; color: var(--cf-navy); padding: 0 0 4px; }
#bbpress-forums fieldset.bbp-form label { display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--cf-ink); margin-bottom: 6px; }
#bbpress-forums fieldset.bbp-form p { margin: 0 0 18px; }

#bbpress-forums input[type="text"],
#bbpress-forums input[type="password"],
#bbpress-forums input[type="email"],
#bbpress-forums input[type="url"],
#bbpress-forums input[type="number"],
#bbpress-forums input[type="search"],
#bbpress-forums select,
#bbpress-forums textarea,
#bbpress-forums .wp-editor-container {
	width: 100%;
	font-family: var(--cf-font);
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--cf-ink);
	background: #fff;
	border: 1px solid var(--cf-line-2);
	border-radius: 8px;
	padding: 11px 14px;
}
#bbpress-forums input[type="search"] { height: 46px; }
#bbpress-forums .wp-editor-container { padding: 0; overflow: hidden; }
#bbpress-forums textarea { min-height: 160px; line-height: 1.6; resize: vertical; }
#bbpress-forums input:focus,
#bbpress-forums select:focus,
#bbpress-forums textarea:focus { outline: none; border-color: var(--cf-navy-2); box-shadow: 0 0 0 3px rgba(0, 67, 139, .12); }

/* Form tìm kiếm — gọn, ô + nút nằm ngang (thay vì ô khổng lồ full-width) */
#bbpress-forums .bbp-search-form,
#bbpress-forums form[role="search"] {
	max-width: 560px;
	margin: 0 0 24px;
}
#bbpress-forums .bbp-search-form > div,
#bbpress-forums form[role="search"] > div {
	display: flex;
	gap: 10px;
	align-items: stretch;
	flex-wrap: wrap;
}
#bbpress-forums .bbp-search-form label,
#bbpress-forums form[role="search"] label {
	position: absolute;
	width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
#bbpress-forums .bbp-search-form input[type="search"],
#bbpress-forums .bbp-search-form input[type="text"],
#bbpress-forums form[role="search"] input[type="search"],
#bbpress-forums form[role="search"] input[type="text"] {
	flex: 1 1 200px;
	height: 46px;
}
#bbpress-forums .bbp-search-form input[type="submit"],
#bbpress-forums .bbp-search-form button,
#bbpress-forums form[role="search"] input[type="submit"],
#bbpress-forums form[role="search"] button {
	flex: 0 0 auto;
	width: auto;
}

#bbpress-forums button,
#bbpress-forums input[type="submit"],
#bbpress-forums button[type="submit"],
#bbp_topic_submit,
#bbp_reply_submit {
	font-family: var(--cf-font);
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	background: var(--cf-navy);
	border: 1px solid var(--cf-navy);
	border-radius: 8px;
	padding: 12px 26px;
	cursor: pointer;
	transition: background .15s ease;
	width: auto;
}
#bbpress-forums button:hover,
#bbpress-forums input[type="submit"]:hover,
#bbp_topic_submit:hover,
#bbp_reply_submit:hover { background: var(--cf-orange); border-color: var(--cf-orange); }

#bbpress-forums input[type="checkbox"],
#bbpress-forums input[type="radio"] { width: auto; margin-right: 6px; }

/* ============================================================
 * PHÂN TRANG
 * ============================================================ */
.bbp-pagination {
	font-family: var(--cf-font);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 26px;
}
.bbp-pagination-count { font-size: 13px; color: var(--cf-muted); }
.bbp-pagination-links { display: flex; gap: 6px; flex-wrap: wrap; }
.bbp-pagination-links a,
.bbp-pagination-links span.current,
.bbp-pagination-links span.dots {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid var(--cf-line-2);
	background: #fff;
	color: var(--cf-navy) !important;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none !important;
}
.bbp-pagination-links a:hover { border-color: var(--cf-navy); background: var(--cf-soft); }
.bbp-pagination-links span.current { background: var(--cf-navy); border-color: var(--cf-navy); color: #fff !important; }
.bbp-pagination-links span.dots { border: 0; background: transparent; }

/* ============================================================
 * TRANG HỒ SƠ NGƯỜI DÙNG bbPress (/forums/users/...)
 * ============================================================ */
#bbp-user-wrapper {
	font-family: var(--cf-font);
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}
#bbp-single-user-details {
	background: var(--cf-bg);
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	padding: 26px 24px;
	text-align: center;
	box-shadow: var(--cf-shadow);
	position: sticky;
	top: 24px;
}
#bbp-user-avatar img.avatar {
	width: 130px; height: 130px; border-radius: 50%;
	border: 3px solid #fff; box-shadow: 0 0 0 1px var(--cf-line-2);
	margin: 0 auto 10px;
}
#bbp-single-user-details .bbp-user-display-name,
#bbp-single-user-details h2 { color: var(--cf-navy); font-size: 19px; font-weight: 800; margin: 4px 0 0; }
#bbp-user-navigation { margin-top: 18px; }
#bbp-user-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#bbp-user-navigation li { margin: 0; }
#bbp-user-navigation li a,
#bbp-user-navigation li span > a {
	display: block;
	padding: 11px 16px;
	border-radius: 9px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cf-ink) !important;
	text-decoration: none !important;
}
#bbp-user-navigation li a:hover { background: var(--cf-soft); }
#bbp-user-navigation li.current a,
#bbp-user-navigation li.current span > a { background: var(--cf-navy); color: #fff !important; }

#bbp-user-body {
	background: var(--cf-bg);
	border: 1px solid var(--cf-line);
	border-radius: var(--cf-radius);
	padding: 28px;
	min-height: 360px;
	box-shadow: var(--cf-shadow);
}
#bbp-user-body h2.entry-title,
#bbp-user-body > h2,
.bbp-user-section h2 { font-size: 20px; font-weight: 800; color: var(--cf-navy); margin: 0 0 18px; }
.bbp-user-section { margin-bottom: 26px; }
#bbp-user-body p.bbp-topic-meta { margin-top: 4px; }

/* Trong trang hồ sơ: bảng chủ đề/trả lời rộng full cột phải */
#bbp-user-body ul.bbp-topics,
#bbp-user-body ul.bbp-replies { box-shadow: none; }

/* ============================================================
 * SECTION "HOẠT ĐỘNG DIỄN ĐÀN" trong trang /profile/
 * ============================================================ */
.climastery-profile-forum { font-family: var(--cf-font); }
.climastery-pf-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }

.climastery-pf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.climastery-pf-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; background: var(--cf-soft); border: 1px solid var(--cf-line); border-radius: 12px; padding: 18px 20px; }
.climastery-pf-stat-icon { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 10px; background: #fff; color: var(--cf-navy); border: 1px solid var(--cf-line); }
.climastery-pf-stat-value { font-size: 26px; font-weight: 800; color: var(--cf-navy); line-height: 1; }
.climastery-pf-stat-label { font-size: 13px; color: var(--cf-muted); }

.climastery-pf-subtitle { font-size: 15px; font-weight: 700; color: var(--cf-ink); margin: 0 0 12px; }
.climastery-pf-topics { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.climastery-pf-topic { padding: 14px 16px; border: 1px solid var(--cf-line); border-radius: 10px; transition: border-color .15s ease, background .15s ease; }
.climastery-pf-topic:hover { border-color: var(--cf-line-2); background: var(--cf-soft); }
.climastery-pf-topic-title { display: block; font-size: 15px; font-weight: 700; color: var(--cf-navy) !important; text-decoration: none !important; margin-bottom: 4px; }
.climastery-pf-topic-title:hover { color: var(--cf-orange) !important; }
.climastery-pf-topic-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--cf-muted); }
.climastery-pf-topic-forum { color: var(--cf-navy-2); font-weight: 600; }

.climastery-pf-empty { background: var(--cf-soft); border: 1px dashed var(--cf-line-2); border-radius: 12px; padding: 24px; text-align: center; }
.climastery-pf-empty p { margin: 0 0 14px; color: var(--cf-muted); font-size: 14px; }

/* ============================================================
 * RESPONSIVE
 * ============================================================ */
@media (max-width: 880px) {
	#bbp-user-wrapper { grid-template-columns: 1fr; }
	#bbp-single-user-details { position: static; }
	#bbp-user-navigation ul { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 720px) {
	ul.bbp-forums > li.bbp-header,
	ul.bbp-topics > li.bbp-header { display: none; }

	ul.bbp-forums > li.bbp-body > ul,
	ul.bbp-topics > li.bbp-body > ul { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 16px; }
	.bbp-forum-info, .bbp-topic-title { grid-column: 1 / -1; }
	ul.bbp-forums > li.bbp-body > ul .bbp-forum-topic-count::after { content: " chủ đề"; font-weight: 500; color: var(--cf-muted); font-size: 12px; }
	ul.bbp-forums > li.bbp-body > ul .bbp-forum-reply-count::after,
	ul.bbp-topics > li.bbp-body > ul .bbp-topic-reply-count::after { content: " bài"; font-weight: 500; color: var(--cf-muted); font-size: 12px; }
	.bbp-forum-freshness, .bbp-topic-freshness { grid-column: 1 / -1; border-top: 1px dashed var(--cf-line); padding-top: 8px; }

	#bbpress-forums div:has(> .bbp-reply-author) { grid-template-columns: 1fr; }
	.bbp-reply-author { flex-direction: row; justify-content: flex-start; text-align: left; border-right: 0; border-bottom: 1px solid var(--cf-line); padding: 14px 18px; }
	.bbp-reply-author .bbp-author-avatar img,
	.bbp-reply-author img.avatar { width: 40px; height: 40px; }

	.climastery-pf-stats { grid-template-columns: 1fr; }
}

/* ============================================================
 * TRANG "DIỄN ĐÀN" — FEED 3 CỘT (shortcode [climastery_forum_feed])
 * ============================================================ */
.cf-feed {
	--cf-navy:   #002d62;
	--cf-navy-2: #00438b;
	--cf-orange: #e26d35;
	--cf-ink:    #1a1c1c;
	--cf-muted:  #737782;
	--cf-line:   #c3c6d2;
	--cf-soft:   #f4f3f2;
	--cf-font:   var(--wp--preset--font-family--montserrat, "Montserrat", system-ui, sans-serif);

	font-family: var(--cf-font);
	color: var(--cf-ink);
	width: 100%;
}
.cf-feed * { box-sizing: border-box; }
.cf-feed a { text-decoration: none; }

.cf-feed-grid {
	display: grid;
	grid-template-columns: 240px 1fr 320px;
	gap: 32px;
	align-items: start;
	max-width: 1340px;
	margin-inline: auto;
	padding: 40px 24px 64px;
}

/* ---------- Sidebar trái ---------- */
.cf-side-left { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }
.cf-nav { display: flex; flex-direction: column; gap: 4px; }
.cf-nav-head {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--cf-muted);
	margin: 0 0 10px;
	padding: 0 12px;
}
.cf-nav-item,
.cf-topic-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 12px;
	border-radius: 8px;
	color: var(--cf-ink);
	font-size: 14px;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease;
}
.cf-nav-item svg { color: currentColor; flex-shrink: 0; }
.cf-nav-item:not(.is-active),
.cf-topic-link { color: #434751; }
.cf-nav-item:hover,
.cf-topic-link:hover { background: #efeeed; }
.cf-nav-item.is-active { background: #1a1c1c; color: #fff; }
.cf-topic-link {
	border-left: 4px solid transparent;
	border-radius: 0 8px 8px 0;
	padding-left: 12px;
}
.cf-topic-link:hover { border-left-color: var(--cf-navy); background: var(--cf-soft); }

/* ---------- Feed chính ---------- */
.cf-feed-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cf-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cf-feed-title { font-size: 24px; font-weight: 700; color: var(--cf-ink); margin: 0; }
.cf-feed-tools { display: flex; align-items: center; gap: 16px; }
.cf-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.cf-sort-opt { color: var(--cf-muted); font-weight: 600; }
.cf-sort-opt.is-active { color: var(--cf-navy); }
.cf-sort-opt:hover { color: var(--cf-navy); }
.cf-sort-sep { color: var(--cf-line); }
.cf-new-btn {
	display: inline-flex;
	align-items: center;
	background: var(--cf-navy);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 9px 22px;
	border-radius: 8px;
	transition: background 0.2s ease;
}
.cf-new-btn:hover { background: var(--cf-navy-2); color: #fff; }

/* Composer */
.cf-composer {
	display: flex;
	align-items: center;
	gap: 16px;
	background: #fff;
	border: 1px solid var(--cf-line);
	border-radius: 10px;
	padding: 14px 18px;
	color: var(--cf-muted);
}
.cf-composer:hover { border-color: var(--cf-navy); }
.cf-composer-ph { flex: 1 1 auto; font-size: 15px; }
.cf-composer > svg { color: var(--cf-muted); }
.cf-composer:hover > svg { color: var(--cf-navy); }

/* Avatar */
.cf-avatar { display: inline-flex; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #d7e3ff; }
.cf-avatar svg,
.cf-avatar img { width: 100% !important; height: 100% !important; border-radius: 8px !important; object-fit: cover; }

/* Post card */
.cf-posts { display: flex; flex-direction: column; gap: 16px; }
.cf-post {
	background: #fff;
	border: 1px solid var(--cf-line);
	border-radius: 10px;
	padding: 22px 24px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cf-post:hover { border-color: rgba(0, 45, 98, 0.4); box-shadow: 0 6px 18px rgba(16, 24, 40, 0.05); }
.cf-post-top { margin-bottom: 14px; }
.cf-post-author { display: flex; align-items: center; gap: 12px; }
.cf-post-author-text { min-width: 0; }
.cf-post-author-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-post-name { font-size: 14px; font-weight: 700; color: var(--cf-ink); }
.cf-badge {
	background: var(--cf-navy);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 2px 7px;
	border-radius: 6px;
}
.cf-badge--sm { font-size: 9px; padding: 1px 6px; }
.cf-post-time { font-size: 12px; color: var(--cf-muted); cursor: help; }

/* Bảng tin bám đúng bề rộng nội dung của site (dóng thẳng với Footer). */
.cf-feed { width: 100%; }

/* ---- Chuyên mục: Thảo luận -> danh sách chủ đề khóa học ---- */
.cf-subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 14px; padding-left: 10px; border-left: 1px solid var(--cf-line); }
.cf-subnav .cf-topic-link { font-size: 13.5px; padding: 7px 10px; }
.cf-subnav .cf-topic-link.is-active { background: var(--cf-soft); border-left-color: var(--cf-navy); color: var(--cf-navy); font-weight: 700; }

/* ---- Thanh ngôn ngữ của bảng tin ---- */
.cf-lang-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 9px 14px;
	border: 1px solid var(--cf-line);
	border-radius: 10px;
	background: var(--cf-soft);
	font-size: 13px;
	color: var(--cf-muted);
}
.cf-lang-bar svg { flex-shrink: 0; color: var(--cf-navy-2); }
.cf-lang-note { flex: 1 1 auto; }
.cf-lang-toggle { font-weight: 700; color: var(--cf-navy-2) !important; white-space: nowrap; }
.cf-lang-toggle:hover { color: var(--cf-orange) !important; }

/* ---- Ô chọn ngôn ngữ trong form tạo chủ đề ---- */
.cf-lang-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 18px; }
.cf-lang-field label { font-weight: 700; color: var(--cf-navy); font-size: 14px; }
.cf-lang-field select { max-width: 260px; padding: 10px 12px; border: 1px solid var(--cf-line-2); border-radius: 8px; background: #fff; font: inherit; }
.cf-field-hint { font-size: 12.5px; color: var(--cf-muted); }

/* ---- Mention @ ---- */
.cf-mention {
	font-weight: 700;
	color: var(--cf-navy-2) !important;
	background: rgba(0, 67, 139, .08);
	border-radius: 4px;
	padding: 0 4px;
	text-decoration: none !important;
}
.cf-mention:hover { background: rgba(226, 109, 53, .14); color: var(--cf-orange) !important; }
.cf-mention-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--cf-muted); }
.cf-mention-box {
	position: absolute;
	z-index: 9999;
	margin: 0;
	padding: 6px;
	list-style: none;
	max-height: 250px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--cf-line-2);
	border-radius: 10px;
	box-shadow: 0 12px 34px rgba(16, 24, 40, .14);
	font-family: var(--cf-font);
}
.cf-mention-opt { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.cf-mention-opt strong { color: var(--cf-navy); }
.cf-mention-opt span { color: var(--cf-muted); font-size: 12.5px; }
.cf-mention-opt.is-active, .cf-mention-opt:hover { background: var(--cf-soft); }
.cf-post-in { font-size: 12px; color: var(--cf-muted); margin: 2px 0 0; }
.cf-post-in a { color: var(--cf-navy-2); font-weight: 700; }
.cf-post-in a:hover { text-decoration: underline; }
.cf-post-title { font-size: 20px; font-weight: 600; line-height: 1.35; margin: 0 0 10px; }
.cf-post-title a { color: var(--cf-ink); }
.cf-post-title a:hover { color: var(--cf-navy); }
.cf-post-excerpt {
	font-size: 15px;
	line-height: 1.6;
	color: #434751;
	margin: 0 0 18px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cf-post-foot {
	display: flex;
	align-items: center;
	gap: 24px;
	padding-top: 16px;
	border-top: 1px solid #e7e9ef;
}
.cf-post-stat {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	font-weight: 600;
	color: var(--cf-muted);
}
a.cf-post-stat:hover { color: var(--cf-navy); }

/* Pagination */
.cf-pagination { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cf-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--cf-line);
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--cf-ink);
}
.cf-pagination .page-numbers:hover { border-color: var(--cf-navy); color: var(--cf-navy); }
.cf-pagination .page-numbers.current { background: var(--cf-navy); border-color: var(--cf-navy); color: #fff; }

.cf-empty {
	background: #fff;
	border: 1px dashed var(--cf-line);
	border-radius: 10px;
	padding: 40px;
	text-align: center;
}
.cf-empty p { color: var(--cf-muted); margin: 0 0 16px; }

/* ---------- Sidebar phải ---------- */
.cf-side-right { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }
.cf-widget {
	background: #fff;
	border: 1px solid var(--cf-line);
	border-radius: 10px;
	padding: 22px;
}
.cf-widget--boxed { padding: 0; overflow: hidden; }
.cf-widget-cap { padding: 14px 18px; border-bottom: 1px solid var(--cf-line); background: var(--cf-soft); }
.cf-widget-title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 16px;
	font-weight: 700;
	color: var(--cf-ink);
	margin: 0 0 20px;
}
.cf-widget-title svg { color: var(--cf-navy); }
.cf-widget-title--sm {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	margin: 0;
}

.cf-trend-list { display: flex; flex-direction: column; gap: 18px; }
.cf-trend-item { display: flex; gap: 12px; align-items: flex-start; }
.cf-trend-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cf-trend-title { font-size: 13px; font-weight: 600; color: var(--cf-ink); line-height: 1.4; }
.cf-trend-item:hover .cf-trend-title { color: var(--cf-navy); }
.cf-trend-author { font-size: 11px; color: var(--cf-muted); }

.cf-member-list { display: flex; flex-direction: column; }
.cf-member {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--cf-line);
}
.cf-member:last-child { border-bottom: none; }
.cf-member:hover { background: var(--cf-soft); }
.cf-member-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cf-member-name { font-size: 13px; font-weight: 700; color: var(--cf-ink); display: inline-flex; align-items: center; gap: 6px; }
.cf-member:hover .cf-member-name { color: var(--cf-navy); }
.cf-member-meta { font-size: 11px; color: var(--cf-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.cf-feed-grid { grid-template-columns: 220px 1fr; }
	.cf-side-right { display: none; }
}
@media (max-width: 860px) {
	.cf-feed-grid { grid-template-columns: 1fr; }
	.cf-side-left { position: static; flex-direction: row; flex-wrap: wrap; gap: 16px 32px; }
	.cf-side-left .cf-nav-group { flex: 1 1 200px; }
}

/* === [Climastery] Diễn đàn — cập nhật feedback === */
.cf-feed { max-width: 1300px; margin-left: auto; margin-right: auto; }
.cf-widget-title--sm { text-transform: none !important; font-size: 14px !important; letter-spacing: 0.01em !important; }
.cf-widget--boxed .cf-trend-list { padding: 14px 18px; }

/* --- Cổng truy cập Diễn đàn --- */
.cf-gate { max-width: 720px; margin: 24px auto; font-family: var(--cf-font); }
.cf-gate-steps { display: flex; align-items: flex-start; justify-content: center; list-style: none; padding: 0; margin: 0 0 28px; }
.cf-gate-step { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; position: relative; color: #98a1ad; font-size: 13px; font-weight: 600; text-align: center; }
.cf-gate-step:not(:last-child)::after { content: ""; position: absolute; top: 16px; left: 50%; width: 100%; height: 2px; background: #e2eaf3; z-index: 0; }
.cf-gate-step-num { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e2eaf3; color: #98a1ad; font-weight: 700; position: relative; z-index: 1; }
.cf-gate-step.is-current { color: #002d62; }
.cf-gate-step.is-current .cf-gate-step-num { background: #002d62; color: #fff; }
.cf-gate-step.is-done { color: #1f7a4d; }
.cf-gate-step.is-done .cf-gate-step-num { background: #1f7a4d; color: #fff; }
.cf-gate-card { background: #fff; border: 1px solid #e2eaf3; border-radius: 20px; padding: 40px; text-align: center; box-shadow: 0 10px 40px rgba(0,45,98,.06); }
.cf-gate-card h2 { font-size: 22px; font-weight: 700; color: #002d62; margin: 0 0 12px; }
.cf-gate-card p { color: #4b5563; font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.cf-gate-rules { text-align: left; max-width: 520px; margin: 0 auto 28px; padding-left: 20px; color: #374151; line-height: 1.9; }
.cf-gate-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 0; }
.cf-gate-btn { display: inline-block; padding: 14px 28px; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none; border: 1.5px solid #002d62; color: #002d62; background: #fff; cursor: pointer; transition: all .2s ease; }
.cf-gate-btn:hover { background: #f4f7fb; }
.cf-gate-btn.is-primary { background: #e26d35; border-color: #e26d35; color: #fff; }
.cf-gate-btn.is-primary:hover { background: #c85a26; }
