/* Trang blog, đọc bài và trang nội dung: nền xám nhạt, thẻ trắng, một màu nhấn xanh. */

/* ── Trang danh sách ── */
.bl-page { padding: 24px 0 48px; background: #EDF0F4; color: #111827; }
.bl-page .container { max-width: 1240px; }
.bl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.bl-card { background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 12px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06); }
.bl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.bl-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: #111827; }
.bl-head span, .bl-head a { font-size: 13px; color: #667085; }
.bl-head a { font-weight: 500; color: #0A5FDB; text-decoration: none; }
.bl-head a:hover { text-decoration: underline; }
.bl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.bl-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 8px; font-size: 13px; font-weight: 500; color: #1F2937; text-decoration: none; }
.bl-chip:hover { background: #F3F6FA; border-color: #9FB0C5; color: #1F2937; }
.bl-chip.on { background: #E8F1FF; border-color: #096EFF; color: #096EFF; font-weight: 600; }
.bl-feat { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); overflow: hidden; margin-bottom: 16px; }
.bl-feat .bl-thumb { aspect-ratio: auto; height: 100%; min-height: 260px; }
.bl-feat .bl-body { justify-content: center; padding: 24px; }
.bl-feat h3 { font-size: 22px; line-height: 1.35; }
.bl-feat p { -webkit-line-clamp: 4; }
.bl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bl-post { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s; }
.bl-post:hover { border-color: #9FB0C5; }
.bl-thumb { display: block; aspect-ratio: 1024 / 687; overflow: hidden; background: #F2F4F7; }
.bl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bl-thumb-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 32px; color: #98A2B3; }
.bl-body { display: flex; flex: 1; flex-direction: column; gap: 8px; padding: 16px; }
.bl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; color: #667085; }
.bl-meta a { position: relative; z-index: 2; font-weight: 500; color: #0A5FDB; text-decoration: none; }
.bl-meta a:hover { text-decoration: underline; }
.bl-post h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.bl-post h3 a { color: #111827; text-decoration: none; }
.bl-post h3 a::after { content: ""; position: absolute; inset: 0; }
.bl-post:hover h3 a { color: #0A5FDB; }
.bl-post p { display: -webkit-box; overflow: hidden; margin: 0; font-size: 14px; line-height: 1.55; color: #475467; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.bl-side { position: sticky; top: 116px; display: flex; flex-direction: column; gap: 16px; }
.bl-widget { padding: 16px; }
.bl-widget h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; color: #111827; }
.bl-search { display: flex; gap: 8px; }
.bl-search input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; background: #FFFFFF; border: 1px solid #868e9c; border-radius: 8px; font-size: 14px; color: #111827; outline: none; }
.bl-search input:focus { border-color: #1e3a5f; box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12); }
.bl-search button { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 42px; height: 42px; background: #096EFF; border: 0; border-radius: 8px; font-size: 18px; color: #FFFFFF; cursor: pointer; }
.bl-search button:hover { background: #0A5FDB; }
.bl-cats { margin: 0; padding: 0; list-style: none; }
.bl-cats a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; margin: 0 -8px; padding: 6px 8px; border-radius: 8px; font-size: 14px; color: #1D2939; text-decoration: none; }
.bl-cats a:hover { background: #F5F7FA; color: #111827; }
.bl-cats a.on { background: #E8F1FF; color: #096EFF; font-weight: 600; }
.bl-cats small { font-size: 12px; color: #667085; font-variant-numeric: tabular-nums; }
.bl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bl-tags a { padding: 3px 9px; background: #F2F4F7; border-radius: 6px; font-size: 13px; color: #344054; text-decoration: none; }
.bl-tags a:hover { background: #E4E7EC; color: #111827; }
.bl-buy { padding: 16px; background: #084FB8; border: 0; }
.bl-buy h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: #FFFFFF; }
.bl-buy p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: #E8F1FF; }
.bl-buy a { display: flex; align-items: center; justify-content: center; min-height: 42px; background: #FFFFFF; border-radius: 8px; font-size: 14px; font-weight: 600; color: #084FB8; text-decoration: none; }
.bl-buy a:hover { background: #E8F1FF; color: #084FB8; }
.bl-empty { padding: 48px 16px; font-size: 14px; color: #667085; text-align: center; }
.bl-empty h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: #111827; }
.bl-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.bl-pager a, .bl-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 4px 10px; background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 8px; font-size: 14px; color: #1F2937; text-decoration: none; }
.bl-pager a:hover { background: #F3F6FA; border-color: #9FB0C5; color: #1F2937; }
.bl-pager .on { background: #E8F1FF; border-color: #096EFF; color: #096EFF; font-weight: 600; }
.bl-pager .gap { background: none; border: 0; color: #667085; }
.bl-pager .off { color: #98A2B3; }

/* ── Trang đọc bài ── */
.post-3col-wrap { padding: 24px 0 40px !important; background: #EDF0F4 !important; }
.post-3col-wrap .container { max-width: 1320px !important; }
.post-3col { display: grid !important; grid-template-columns: 250px minmax(0, 1fr) 280px !important; gap: 20px !important; align-items: start; }
.post-toc-col, .post-sidebar-col, .post-main-col { width: auto !important; max-width: none !important; min-width: 0 !important; flex: none !important; }
.toc-sticky { position: sticky; top: 116px; }
.toc-box, .sb-card, .post-main-inner { background: #FFFFFF !important; border: 1px solid #D9DEE5 !important; border-radius: 12px !important; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06) !important; }
.toc-box { overflow: hidden; }
.toc-box-header, .sb-card-header { display: flex; align-items: center; gap: 8px; padding: 12px 16px !important; background: #FFFFFF !important; border-bottom: 1px solid #EEF1F5 !important; font-size: 14px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; color: #111827 !important; }
.toc-box-header i, .sb-card-header i { color: #475467 !important; }
.toc-nav { max-height: calc(100vh - 200px); overflow-y: auto; padding: 6px 8px !important; }
.toc-link { display: block; padding: 6px 8px !important; border: 0 !important; border-radius: 6px; font-size: 13px !important; line-height: 1.45; text-transform: none !important; letter-spacing: 0 !important; color: #475467 !important; text-decoration: none; }
.toc-link:hover { background: #F5F7FA !important; color: #111827 !important; }
.toc-link.active { background: #E8F1FF !important; color: #096EFF !important; font-weight: 600; }
.toc-link.toc-h3 { padding-left: 18px !important; }
.toc-link.toc-h4 { padding-left: 28px !important; }
.post-main-inner { overflow: hidden; }
.post-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 14px 32px; border-bottom: 1px solid #EEF1F5; font-size: 13px; color: #475467; }
.post-article-meta a { font-weight: 500; color: #0A5FDB; text-decoration: none; }
.post-article-meta a:hover { text-decoration: underline; }
.post-article-meta strong { font-weight: 600; color: #111827; }
.post-thumbnail-wrap { margin: 0 !important; border-radius: 0 !important; }
.post-thumbnail-wrap img { display: block; width: 100%; height: auto !important; border-radius: 0 !important; }
.post-body-pad { padding: 28px 32px !important; }
.post-body { max-width: 74ch; margin: 0 auto; font-size: 16px !important; line-height: 1.75 !important; color: #1D2939 !important; }
.post-body p, .post-body li { color: #1D2939 !important; }
.post-body h2 { margin: 32px 0 12px !important; padding: 0 !important; border: 0 !important; font-size: 23px !important; font-weight: 700 !important; line-height: 1.3 !important; text-transform: none !important; color: #111827 !important; }
.post-body h3 { margin: 24px 0 10px !important; font-size: 18px !important; font-weight: 600 !important; line-height: 1.35 !important; color: #111827 !important; }
.post-body h4 { margin: 20px 0 8px !important; font-size: 16px !important; font-weight: 600 !important; color: #111827 !important; }
.post-body a { color: #0A5FDB !important; text-decoration: underline; text-underline-offset: 2px; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.post-body code { padding: 1px 5px !important; background: #F2F4F7 !important; border: 0 !important; border-radius: 4px; font-size: .9em; color: #1D2939 !important; }
.post-body pre { overflow-x: auto; padding: 14px 16px !important; background: #111827 !important; border: 0 !important; border-radius: 8px !important; font-size: 14px; line-height: 1.6; color: #F2F4F7 !important; }
.post-body pre code { padding: 0 !important; background: none !important; color: inherit !important; }
.post-body blockquote { margin: 16px 0; padding: 10px 16px; background: #F7F9FB !important; border-left: 3px solid #096EFF !important; border-radius: 0 8px 8px 0; color: #344054 !important; }
.post-body table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: 14px; }
.post-body th, .post-body td { padding: 8px 10px; border: 1px solid #E4E7EC; }
.post-body th { background: #F7F9FB; font-weight: 600; }
.post-section-divider { height: 1px; margin: 28px 0 20px; background: #EEF1F5 !important; }
.tag-lbl { font-size: 13px; color: #475467; }
.post-tag, .sb-topic-pill { padding: 3px 9px !important; background: #F2F4F7 !important; border: 0 !important; border-radius: 6px !important; font-size: 13px !important; color: #344054 !important; }
.post-tag:hover { background: #E4E7EC !important; }
.post-share-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 0 !important; background: none !important; border: 0 !important; }
.btn-back-blog { font-size: 13px !important; font-weight: 500; color: #0A5FDB !important; background: none !important; border: 0 !important; padding: 0 !important; }
.share-label { font-size: 13px; color: #475467; }
.share-btn, .share-btn-copy { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #F2F4F7 !important; border: 0 !important; border-radius: 8px !important; color: #1D2939 !important; box-shadow: none !important; }
.share-btn:hover, .share-btn-copy:hover { background: #E4E7EC !important; transform: none !important; }
.post-update-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; font-size: 13px; color: #475467; }
.post-update-row button { padding: 4px 10px; background: #F2F4F7; border: 0; border-radius: 6px; font-size: 13px; color: #1D2939; cursor: pointer; }
.post-update-row button:hover { background: #E4E7EC; }
.post-author-bio { display: flex; gap: 12px; padding: 16px !important; background: #F7F9FB !important; border: 0 !important; border-radius: 8px !important; }
.ab-avatar { background: #F2F4F7 !important; }
.ab-name { font-size: 15px !important; font-weight: 600 !important; color: #111827 !important; }
.ab-role { font-size: 13px !important; color: #667085 !important; }
.ab-desc { margin: 4px 0 0 !important; font-size: 14px !important; color: #475467 !important; }
.post-sidebar-col > div { top: 116px !important; display: flex; flex-direction: column; gap: 16px; }
.sb-card { margin: 0 !important; overflow: hidden; }
.sb-card-body { padding: 12px 16px !important; }
.sb-search-form { display: flex; gap: 8px; }
.sb-search-form input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #868e9c !important; border-radius: 8px !important; font-size: 14px; }
.sb-search-form button { width: 40px; height: 40px; background: #096EFF !important; border: 0; border-radius: 8px !important; color: #FFFFFF !important; }
.sb-cat-list { margin: 0; padding: 0; list-style: none; }
.sb-cat-item { border: 0 !important; }
.sb-cat-item a { display: flex; align-items: center; justify-content: space-between; min-height: 36px; margin: 0 -8px; padding: 6px 8px !important; border-radius: 8px; font-size: 14px !important; color: #1D2939 !important; text-decoration: none; }
.sb-cat-item a:hover { background: #F5F7FA; }
.sb-cat-active a { background: #E8F1FF; color: #096EFF !important; font-weight: 600; }
.cat-count { background: none !important; font-size: 12px !important; color: #667085 !important; }
.sb-cat-item .cat-name i { display: none; }
.sb-cta { padding: 16px !important; background: #084FB8 !important; border: 0 !important; border-radius: 12px !important; box-shadow: none !important; }
.sb-cta .cta-label { display: none; }
.sb-cta .cta-title { margin-bottom: 2px; font-size: 16px !important; font-weight: 600 !important; color: #FFFFFF !important; }
.sb-cta .cta-sub { margin-bottom: 12px; font-size: 13px !important; color: #E8F1FF !important; }
.sb-cta .cta-btn { display: flex; align-items: center; justify-content: center; min-height: 42px; background: #FFFFFF !important; border-radius: 8px !important; font-size: 14px !important; font-weight: 600 !important; color: #084FB8 !important; box-shadow: none !important; }
.toc-mobile { margin-bottom: 20px; background: #F7F9FB !important; border: 0 !important; border-radius: 8px !important; }
.toc-mobile-toggle { background: transparent !important; color: #111827 !important; }

/* Bài liên quan và dải kêu gọi cuối bài */
.post-related-section { padding: 0 0 40px !important; background: #EDF0F4 !important; }
.post-related-section .container, .post-cta-banner .container { max-width: 1320px; }
.section-tag-sm { display: none !important; }
.blog-section-title { margin: 0 !important; font-size: 20px !important; font-weight: 700 !important; color: #111827 !important; }
.post-card { height: 100%; overflow: hidden; background: #FFFFFF !important; border: 1px solid #D9DEE5 !important; border-radius: 12px !important; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06) !important; transform: none !important; }
.post-card:hover { border-color: #9FB0C5 !important; transform: none !important; }
.post-card-thumb { display: block; aspect-ratio: 1024 / 687; height: auto !important; }
.post-card-thumb img { width: 100%; height: 100% !important; object-fit: cover; transform: none !important; }
.post-card-title, .post-card-title a { font-size: 16px !important; font-weight: 600 !important; line-height: 1.4 !important; color: #111827 !important; }
.post-card-date { font-size: 13px !important; color: #667085 !important; }
.post-card-footer { padding: 0 16px 14px !important; background: none !important; border: 0 !important; }
.btn-read-more { font-size: 13px !important; font-weight: 500 !important; color: #0A5FDB !important; }
.post-cta-banner { padding: 0 0 48px !important; background: #EDF0F4 !important; }
.post-cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 24px !important; background: #084FB8 !important; border: 0 !important; border-radius: 12px !important; box-shadow: none !important; }
.post-cta-inner h3 { margin: 0 0 4px; font-size: 18px !important; font-weight: 600; color: #FFFFFF !important; }
.post-cta-inner p { margin: 0; font-size: 14px !important; color: #E8F1FF !important; }
.post-cta-btn { display: inline-flex !important; align-items: center; gap: 6px; min-height: 44px; padding: 8px 18px !important; background: #FFFFFF !important; border-radius: 8px !important; font-size: 14px !important; font-weight: 600 !important; color: #084FB8 !important; box-shadow: none !important; transform: none !important; }

/* ── Trang nội dung do admin tạo ── */
.pg-page { padding: 24px 0 48px; background: #EDF0F4; }
.pg-card { max-width: 860px; margin: 0 auto; padding: 32px; background: #FFFFFF; border: 1px solid #D9DEE5; border-radius: 12px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06); }
.pg-card .post-body { max-width: none; }
.pg-card .post-body > *:first-child { margin-top: 0 !important; }
.pg-card .post-body > *:last-child { margin-bottom: 0; }

@media (max-width: 1199.98px) {
  .post-3col { grid-template-columns: minmax(0, 1fr) 280px !important; }
  .post-toc-col { display: none !important; }
}
@media (max-width: 991.98px) {
  .bl-layout { grid-template-columns: minmax(0, 1fr); }
  .bl-side { position: static; }
  .post-3col { grid-template-columns: minmax(0, 1fr) !important; }
  .post-sidebar-col { display: block !important; }
  .post-sidebar-col > div { position: static !important; }
  .bl-feat { grid-template-columns: minmax(0, 1fr); }
  .bl-feat .bl-thumb { height: auto; min-height: 0; aspect-ratio: 1024 / 687; }
}
@media (max-width: 575.98px) {
  .bl-grid { grid-template-columns: minmax(0, 1fr); }
  .bl-feat h3 { font-size: 19px; }
  .bl-feat .bl-body { padding: 16px; }
  .post-body-pad { padding: 20px 16px !important; }
  .post-article-meta { padding: 12px 16px; }
  .pg-card { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) { .bl-post { transition: none; } }
.bl-post.bl-feat { display: grid; }
.sb-card-header span { letter-spacing: 0 !important; text-transform: none !important; color: #111827 !important; font-size: 14px !important; font-weight: 600 !important; }
@media (max-width: 991.98px) { .bl-post.bl-feat { display: flex; } }

/* Thẻ lẻ cuối lưới (trang cuối danh sách): trải hết hàng để không dư ô trống */
@media (min-width: 576px) {
  .bl-grid > .bl-post:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 992px) {
  .bl-grid > .bl-post:last-child:nth-child(odd) { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .bl-grid > .bl-post:last-child:nth-child(odd) .bl-thumb { aspect-ratio: auto; height: 100%; min-height: 220px; }
  .bl-grid > .bl-post:last-child:nth-child(odd) .bl-body { justify-content: center; padding: 24px; }
}
