/* ==========================================================================
   THR — trang Blog (/blog) và chi tiết bài (/blog/{slug}). Tiền tố .bl-
   Mockup: mockup/Blog.dc.html (máy tính); di động tự dựng theo phong cách các mockup Mobile.
   ========================================================================== */

/* ---------- Hero ---------- */
.bl-hero-body { max-width: 1280px; padding-bottom: 56px; }
.bl-h1 { margin-top: 12px; font-size: clamp(38px, 6vw, 56px); }
.bl-lead { max-width: 560px; line-height: 1.65; }
.bl-search { position: relative; max-width: 520px; margin: 24px 0 0; }
.bl-search svg { position: absolute; z-index: 1; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.bl-search input { width: 100%; box-sizing: border-box; min-height: 52px; padding: 0 18px 0 46px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: #fff; font-size: 15px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); outline: none; -webkit-appearance: none; appearance: none; }
.bl-search input::placeholder { color: #b9cbd8; }
.bl-search input:focus { border-color: rgba(78, 227, 154, .7); background: rgba(255, 255, 255, .14); }

/* ---------- Khung nội dung ---------- */
.bl-main { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px) 80px; display: flex; flex-direction: column; gap: 40px; box-sizing: content-box; }
.bl-sec { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 124px; }
body.thr .t-page .bl-h2 { margin: 0; font-family: var(--t-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--t-navy); }

/* ---------- Cấp độ ---------- */
.bl-levels { margin-top: -28px; position: relative; z-index: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 14px; }
body.thr .t-page a.bl-lv { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; border: 1.5px solid transparent; background: #fff; box-shadow: 0 10px 28px rgba(19, 48, 90, .09); color: var(--t-navy); transition: box-shadow .2s, border-color .2s, transform .2s; }
body.thr .t-page a.bl-lv:hover { box-shadow: 0 14px 34px rgba(19, 48, 90, .14); color: var(--t-navy); transform: translateY(-2px); }
.bl-lv.on { border-color: var(--lv-ink) !important; }
.bl-lv-top { display: flex; align-items: center; justify-content: space-between; }
.bl-lv-n { width: 40px; height: 40px; border-radius: 12px; background: var(--lv-tint); color: var(--lv-ink); display: flex; align-items: center; justify-content: center; font-family: var(--t-display); font-weight: 700; font-size: 20px; }
.bl-lv-cnt { font-size: 12px; font-weight: 600; color: var(--t-navy); }
.bl-lv-cnt.soon { color: var(--t-muted-2); }
.bl-lv-t { font-family: var(--t-display); font-weight: 700; font-size: 24px; line-height: 1; }
.bl-lv-who { font-size: 12px; font-weight: 600; color: var(--lv-ink); margin-top: 4px; }
.bl-lv-d { font-size: 13px; line-height: 1.55; color: var(--t-text-2); }

/* ---------- Nổi bật ---------- */
.bl-feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; }
body.thr .t-page a.bl-big { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; border-radius: 24px; overflow: hidden; background: var(--t-dark); color: #fff; box-shadow: 0 14px 36px rgba(19, 48, 90, .14); }
body.thr .t-page a.bl-big:hover { color: #fff; }
.bl-big > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.bl-big:hover > img { transform: scale(1.04); }
.bl-big-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 42, 60, 0) 30%, rgba(14, 42, 60, .92) 100%); }
.bl-big-body { position: relative; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.bl-big-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.bl-big-tags span { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.bl-big-tags span.hot { font-weight: 700; background: var(--t-gold); }
body.thr .t-page .bl-big h3 { margin: 0; font-family: var(--t-display); font-weight: 700; font-size: clamp(26px, 4vw, 34px); line-height: 1.02; color: #fff; }
.bl-big-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--t-hero-text); }
.bl-av { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--t-grad-btn); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: #fff; object-fit: cover; }
.bl-av.sm { width: 24px; height: 24px; font-size: 9px; }
.bl-side { display: flex; flex-direction: column; gap: 12px; }
body.thr .t-page a.bl-sp { display: flex; gap: 14px; padding: 12px; border-radius: 18px; background: #fff; box-shadow: 0 6px 20px rgba(19, 48, 90, .07); color: var(--t-navy); transition: box-shadow .2s; flex: 1; }
body.thr .t-page a.bl-sp:hover { box-shadow: 0 12px 28px rgba(19, 48, 90, .13); color: var(--t-navy); }
.bl-sp > img { width: 132px; flex: none; aspect-ratio: 4/3; height: auto; align-self: center; border-radius: 12px; object-fit: cover; background: #dfe9ec; }
.bl-sp > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.bl-sp .c { font-size: 11px; font-weight: 700; color: var(--t-teal); }
.bl-sp .t { font-family: var(--t-display); font-weight: 700; font-size: 20px; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bl-sp .m { font-size: 12px; color: var(--t-muted); }

/* ---------- Chủ đề ---------- */
.bl-topics { padding: 22px; border-radius: 22px; background: var(--t-dark); color: #fff; display: flex; flex-direction: column; gap: 14px; }
.bl-topics-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
body.thr .t-page .bl-topics-hd h2 { margin: 0; font-family: var(--t-display); font-weight: 700; font-size: 26px; color: #fff; }
.bl-topics-hd span { font-size: 13px; color: var(--t-hero-muted); }
.bl-tp-list { display: flex; flex-wrap: wrap; gap: 8px; }
body.thr .t-page a.bl-tp { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff; font-size: 14px; font-weight: 600; box-sizing: border-box; }
body.thr .t-page a.bl-tp:hover { background: rgba(255, 255, 255, .16); color: #fff; }
body.thr .t-page a.bl-tp.on { background: #fff; color: var(--t-navy); }
.bl-tp i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bl-tp small { font-size: 11px; opacity: .65; }

/* ---------- Tất cả bài viết ---------- */
.bl-all-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bl-count { font-size: 13px; color: var(--t-muted); margin-top: 4px; }
.bl-cats { display: flex; gap: 6px; flex-wrap: wrap; }
body.thr .t-page a.bl-cat { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid #d3e0e6; background: #fff; color: var(--t-navy); font-size: 13px; font-weight: 600; white-space: nowrap; box-sizing: border-box; }
body.thr .t-page a.bl-cat:hover { border-color: var(--t-teal); color: var(--t-navy); }
body.thr .t-page a.bl-cat.on { background: var(--t-navy); border-color: var(--t-navy); color: #fff; }
.bl-cat span { font-size: 11px; opacity: .65; }

.bl-ctx { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; padding: 16px 18px; border-radius: 18px; background: #fff; border-left: 4px solid var(--lv-ink); box-shadow: var(--t-shadow); }
.bl-ctx-txt { flex: 1; min-width: 220px; }
.bl-ctx-txt b { font-size: 15px; font-weight: 700; color: var(--lv-ink); }
.bl-ctx-txt p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: var(--t-text-2); }
body.thr .t-page a.bl-ctx-x { flex: none; font-size: 13px; font-weight: 600; color: var(--t-muted); padding: 6px 12px; border-radius: 999px; background: var(--t-soft); }
body.thr .t-page a.bl-ctx-x:hover { color: var(--t-red); }
.bl-steps { flex-basis: 100%; padding: 14px 16px; border-radius: 14px; background: var(--lv-tint); }
.bl-steps-t { font-weight: 700; font-size: 14px; color: #0f5e4b; margin-bottom: 10px; }
.bl-steps-g { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.bl-steps-g div { display: flex; flex-direction: column; gap: 2px; }
.bl-steps-g em { font-style: normal; font-family: var(--t-display); font-weight: 700; font-size: 26px; line-height: 1; color: var(--lv-ink); opacity: .55; }
.bl-steps-g strong { font-size: 14px; color: var(--t-navy); }
.bl-steps-g span { font-size: 12.5px; line-height: 1.5; color: var(--t-text-2); }

.bl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 18px; }
body.thr .t-page a.bl-card { display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 6px 22px rgba(19, 48, 90, .07); color: var(--t-navy); transition: box-shadow .2s; }
body.thr .t-page a.bl-card:hover { box-shadow: 0 14px 32px rgba(19, 48, 90, .14); color: var(--t-navy); }
.bl-card[hidden] { display: none !important; }
.bl-card-img { position: relative; aspect-ratio: 16/9; background: #dfe9ec; overflow: hidden; }
.bl-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.bl-card:hover .bl-card-img img { transform: scale(1.04); }
.bl-card-img .cat { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px); font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--t-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.bl-card-img .min { position: absolute; right: 12px; bottom: 12px; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: rgba(14, 42, 60, .8); color: #fff; }
.bl-card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.bl-card-body .lv { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t-teal); }
body.thr .t-page .bl-card-body h3 { margin: 0; font-family: var(--t-display); font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--t-navy); }
.bl-card-body p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--t-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bl-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--t-line); font-size: 12px; color: var(--t-muted); }
.bl-none[hidden] { display: none; }
.bl-empty-t { font-weight: 700; font-size: 17px; color: var(--t-navy); margin-bottom: 6px; }
.bl-empty-b { margin-top: 18px; min-height: 42px; font-size: 14px; }

/* ---------- Chi tiết bài ---------- */
.bl-d-hero .t-hero-bg > div.img { background-size: cover; background-position: center; opacity: .25; }
.bl-d-body { max-width: 920px; text-align: left; padding-bottom: 72px; }
.bl-d-tag { display: inline-flex; margin-top: 16px; font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--t-teal); color: #fff; }
body.thr .t-page .bl-d-h1 { margin-top: 12px; font-size: clamp(34px, 5vw, 52px); line-height: 1; }
.bl-d-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 16px; font-size: 13px; color: var(--t-hero-text); }
.bl-d-meta > span { display: inline-flex; align-items: center; gap: 8px; }
.bl-d-wrap { max-width: 920px; margin: -40px auto 0; padding: 0 clamp(20px, 4vw, 48px) 56px; position: relative; z-index: 2; box-sizing: border-box; }
.bl-d-card { padding: clamp(22px, 4vw, 48px); border-radius: 24px; }
.bl-d-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--t-line); }
.bl-d-au { display: flex; align-items: center; gap: 10px; }
.bl-d-au .bl-av { width: 40px; height: 40px; font-size: 14px; }
.bl-d-au b { display: block; font-size: 14px; }
.bl-d-au small { font-size: 12px; color: var(--t-muted); }
.bl-share { display: flex; gap: 8px; }
.bl-share a, .bl-share button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #d3e0e6; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--t-navy); padding: 0; }
.bl-share a:hover, .bl-share button:hover { background: var(--t-mint-bg); border-color: var(--t-teal); }
.bl-share svg { width: 17px; height: 17px; }
.bl-related { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px) 80px; }
.bl-related .bl-h2 { margin-bottom: 16px !important; }
.bl-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--t-teal) !important; margin-bottom: 18px; }

/* Chữ bài viết (giữ như bản cũ; dự phòng khi plugin typography không nạp) */
.bl-prose { color: #475569; font-family: var(--t-font); }
body.thr .t-page .bl-prose h1, body.thr .t-page .bl-prose h2, body.thr .t-page .bl-prose h3 { font-family: var(--t-font); }
.bl-prose .bl-lead-q { font-size: 1.15em; color: #475569; font-weight: 500; font-style: italic; border-left: 4px solid var(--t-teal); padding-left: 16px; margin: 0 0 2em; }
.bl-prose h1 { font-size: 2.25em; font-weight: 800; margin-top: 0; margin-bottom: .9em; line-height: 1.1; color: #0f172a; }
.bl-prose h2 { font-size: 1.5em; font-weight: 700; margin-top: 2em; margin-bottom: 1em; line-height: 1.3; color: #0f172a; padding-bottom: .3em; border-bottom: 1px solid #e2e8f0; }
.bl-prose h3 { font-size: 1.25em; font-weight: 600; margin-top: 1.6em; margin-bottom: .6em; line-height: 1.4; color: #0f172a; }
.bl-prose h4 { font-size: 1.1em; font-weight: 600; margin-top: 1.5em; margin-bottom: .5em; color: #1e293b; }
.bl-prose h5, .bl-prose h6 { font-size: 1em; font-weight: 600; margin-top: 1.5em; margin-bottom: .5em; color: #334155; }
.bl-prose p { margin-top: 1.25em; margin-bottom: 1.25em; line-height: 1.8; color: #475569; }
.bl-prose hr { border: 0; border-top: 1px solid #e2e8f0; margin: 3em 0; }
.bl-prose blockquote { border-left: 4px solid #0d9488; padding-left: 1em; margin: 1.6em 0; color: #64748b; font-style: italic; }
.bl-prose ul, .bl-prose ol { margin: 1.25em 0; padding-left: 1.6em; color: #475569; }
.bl-prose li { margin: .5em 0; line-height: 1.75; }
.bl-prose ul { list-style-type: disc; }
.bl-prose ol { list-style-type: decimal; }
.bl-prose img { max-width: 100%; height: auto; border-radius: .5rem; margin: 2em auto; display: block; }
.bl-prose a { color: #0f766e; text-decoration: underline; }
.bl-prose a:hover { color: #115e59; }
.bl-prose strong { color: #0f172a; font-weight: 700; }
.bl-prose table { width: 100%; border-collapse: collapse; margin: 2em 0; display: block; overflow-x: auto; }
.bl-prose th, .bl-prose td { border: 1px solid #e2e8f0; padding: .75em 1em; text-align: left; }
.bl-prose th { background: #f8fafc; font-weight: 600; color: #0f172a; }
.bl-prose pre { background: #1e293b; color: #e2e8f0; padding: 1em; border-radius: .5rem; overflow-x: auto; margin: 1.5em 0; }
.bl-prose code { font-size: .875em; }
.bl-prose figure { margin: 2em 0; text-align: center; }
.bl-prose figure img { margin: 0 auto .75em; }
.bl-prose figcaption { font-size: .85em; color: #94a3b8; font-style: italic; line-height: 1.5; max-width: 90%; margin: 0 auto; }
.bl-prose iframe, .bl-prose video { max-width: 100%; }
.bl-prose > :first-child { margin-top: 0; }

/* ---------- Di động (≤860px) ---------- */
@media (max-width: 860px) {
    .bl-hero-body { padding: 76px 16px 44px; }
    .bl-h1 { font-size: 40px; margin-top: 10px; }
    .bl-lead { font-size: 13px; line-height: 1.55; margin-top: 8px; }
    .bl-search { margin-top: 16px; }
    .bl-search input { min-height: 48px; font-size: 16px; }

    .bl-main { padding: 0 16px 40px; gap: 28px; }
    .bl-sec { scroll-margin-top: 72px; }
    body.thr .t-page .bl-h2 { font-size: 24px; }

    .bl-levels { margin-top: -24px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.thr .t-page a.bl-lv { padding: 14px; gap: 8px; border-radius: 18px; }
    .bl-lv-n { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
    .bl-lv-cnt { font-size: 11px; }
    .bl-lv-t { font-size: 21px; }
    .bl-lv-who { font-size: 11px; }
    .bl-lv-d { font-size: 12px; line-height: 1.5; }

    .bl-feat { gap: 10px; }
    body.thr .t-page a.bl-big { min-height: 300px; border-radius: 20px; }
    .bl-big-body { padding: 16px; gap: 8px; }
    body.thr .t-page .bl-big h3 { font-size: 25px; }
    .bl-big-meta { font-size: 12px; }
    .bl-side { gap: 10px; }
    body.thr .t-page a.bl-sp { padding: 10px; gap: 12px; border-radius: 16px; }
    .bl-sp > img { width: 96px; border-radius: 10px; }
    .bl-sp .t { font-size: 17px; }

    .bl-topics { padding: 16px; border-radius: 20px; gap: 12px; }
    body.thr .t-page .bl-topics-hd h2 { font-size: 22px; }
    .bl-topics-hd span { font-size: 12px; }
    .bl-tp-list { gap: 6px; }
    body.thr .t-page a.bl-tp { min-height: 38px; padding: 0 12px; font-size: 13px; }

    .bl-all-hd { flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px; }
    .bl-all-hd > div { min-width: 0; }
    .bl-cats { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .bl-cats::-webkit-scrollbar { display: none; }
    body.thr .t-page a.bl-cat { flex: none; min-height: 40px; }
    .bl-ctx { padding: 14px; }
    .bl-steps-g { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    /* «Tất cả bài viết»: thẻ ngang gọn (ảnh trái, chữ phải) — trước mỗi thẻ ~430px, 12 bài ~5.000px */
    .bl-grid { gap: 10px; }
    body.thr .t-page a.bl-card { flex-direction: row; align-items: stretch; border-radius: 16px; }
    .bl-card-img { flex: none; width: 112px; aspect-ratio: auto; min-height: 112px; }
    .bl-card-img .cat { display: none; }
    .bl-card-img .min { right: 6px; bottom: 6px; font-size: 10px; padding: 2px 7px; }
    .bl-card-body { padding: 10px 12px; gap: 4px; min-width: 0; }
    .bl-card-body .lv { font-size: 10px; }
    body.thr .t-page .bl-card-body h3 { font-size: 17px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .bl-card-body p { display: none; }
    .bl-card-foot { margin-top: auto; padding-top: 4px !important; border-top: none !important; font-size: 11px; }

    .bl-d-body { padding: 76px 16px 60px; }
    body.thr .t-page .bl-d-h1 { font-size: 32px; }
    .bl-d-meta { font-size: 12px; gap: 6px 14px; }
    .bl-d-wrap { padding: 0 12px 36px; margin-top: -32px; }
    .bl-d-card { padding: 20px 16px; border-radius: 20px; }
    /* Nội dung bài: thắng lớp prose-lg (18px, h2 27px) của Tailwind còn trong view */
    .bl-d-card .bl-prose.prose { font-size: 16px; line-height: 1.75; color: #334155; }
    .bl-d-card .bl-prose.prose p, .bl-d-card .bl-prose.prose li { font-size: 16px; line-height: 1.75; color: #334155; }
    .bl-d-card .bl-prose.prose p { margin: 0 0 14px; }
    .bl-d-card .bl-prose.prose h2 { font-size: 22px; line-height: 1.3; margin: 28px 0 10px; color: var(--t-navy); }
    .bl-d-card .bl-prose.prose h3 { font-size: 19px; line-height: 1.35; margin: 22px 0 8px; color: var(--t-navy); }
    .bl-d-card .bl-prose.prose figcaption, .bl-d-card .bl-prose.prose em { font-size: 13px; }
    .bl-d-card .bl-prose.prose table { font-size: 13px; }
    .bl-related { padding: 0 16px 40px; }
}
