/* =========================================================
   Blog, bài viết & poster video
   ========================================================= */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Poster video */
.video-thumb img, .video-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb video { opacity: 0; transition: opacity 0.4s; }
.video-card.previewing .video-thumb video { opacity: 1; }
.video-card.previewing .play-btn { opacity: 0; transform: scale(0.6); }

/* Danh sách bài */
.blog-card { display: flex; flex-direction: column; transition: transform 0.45s var(--spring), box-shadow 0.3s; }
.blog-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.blog-card .blog-img { display: block; }
.blog-card .blog-img img { filter: none; transition: transform 1s var(--ease-out); }
.blog-card:hover .blog-img img { transform: scale(1.06); }
.blog-card .blog-body { flex: 1; align-content: start; }
.blog-card h3 { font-size: 1.1rem; line-height: 1.35; }
.blog-card h3 a:hover { color: var(--tint); }
.blog-card p { color: var(--label-2); font-size: 0.93rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--label-2); }
.blog-play { position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, 0.5); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.blog-play .ic { width: 16px; height: 16px; margin-left: 2px; }
.post-featured { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; align-items: center; margin-bottom: 48px; padding: 18px; border-radius: var(--r-xl); background: var(--card); box-shadow: var(--shadow); }
.pf-img { display: block; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; }
.pf-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.post-featured:hover .pf-img img { transform: scale(1.04); }
.pf-body { display: grid; gap: 14px; justify-items: start; padding-right: 18px; }
.pf-body h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 800; }
.pf-body h2 a:hover { color: var(--tint); }
.pf-body p { color: var(--label-2); margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; }
.pager-num { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; display: grid; place-items: center; background: var(--card); font-weight: 600; box-shadow: var(--shadow-sm); transition: transform 0.3s var(--spring); }
.pager-num:hover { transform: translateY(-2px); }
.pager-num.active { background: var(--grad); color: #fff; }
.service-grid.four { grid-template-columns: repeat(4, 1fr); }
.service-grid.four .service-card h3 { flex: 1; }

/* Bài viết */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 80; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; }
.post-head { position: relative; overflow: hidden; padding: 40px 0 8px; }
.post-head .container { position: relative; z-index: 1; }
.narrow-wide { max-width: 980px; }
.post-title { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.12; margin-bottom: 16px; }
.post-lead { font-size: 1.15rem; color: var(--label-2); max-width: 760px; }
.post-meta { display: flex; align-items: center; gap: 12px; margin: 8px 0 28px; }
.post-meta img { border-radius: 50%; box-shadow: var(--shadow-sm); }
.post-meta strong { display: block; font-size: 0.95rem; }
.post-meta span { color: var(--label-2); font-size: 0.86rem; }
.post-cover { margin: 0; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; padding-top: 48px; padding-bottom: 24px; }
.post-side { position: sticky; top: calc(var(--nav-h) + 20px); display: grid; gap: 18px; }
.toc { background: var(--card); border-radius: var(--r); padding: 18px 18px 14px; box-shadow: var(--shadow-sm); max-height: 60vh; overflow: auto; }
.toc-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin: 0 0 8px; }
.toc ol { counter-reset: toc; display: grid; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; padding: 7px 10px; border-radius: 10px; font-size: 0.88rem; color: var(--label-2); line-height: 1.4; transition: background 0.2s, color 0.2s; }
.toc a::before { content: counter(toc); font-weight: 700; color: var(--label-3); min-width: 14px; }
.toc a:hover { background: var(--fill); color: var(--label); }
.toc a.active { background: color-mix(in srgb, var(--tint) 12%, transparent); color: var(--tint); font-weight: 600; }
.toc a.active::before { color: var(--tint); }

.prose-article { font-size: 1.07rem; line-height: 1.8; color: var(--label); }
.prose-article > * { margin-top: 0; margin-bottom: 0; }
.prose-article > * + * { margin-top: 1.15em; }
.prose-article h2 { position: relative; font-size: clamp(1.45rem, 2.6vw, 1.85rem); font-weight: 800; margin-top: 2.2em; padding-left: 18px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose-article h2::before { content: ""; position: absolute; left: 0; top: 0.15em; bottom: 0.15em; width: 5px; border-radius: 3px; background: var(--grad); }
.prose-article h3 { font-size: 1.22rem; font-weight: 700; margin-top: 1.6em; scroll-margin-top: calc(var(--nav-h) + 24px); }
.prose-article a { color: var(--tint); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--tint) 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color 0.2s; }
.prose-article a:hover { text-decoration-color: var(--tint); }
.prose-article ul, .prose-article ol { display: grid; gap: 8px; padding-left: 0; }
.prose-article ul li { position: relative; padding-left: 30px; }
.prose-article ul li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 14px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 18%, transparent); box-shadow: inset 0 0 0 4px var(--tint); }
.prose-article ol { counter-reset: li; }
.prose-article ol li { position: relative; padding-left: 40px; counter-increment: li; }
.prose-article ol li::before { content: counter(li); position: absolute; left: 0; top: 0.15em; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 0.85rem; font-weight: 700; }
.prose-article strong { font-weight: 700; }
.prose-article blockquote { margin: 1.6em 0; padding: 18px 22px; border-radius: var(--r); background: color-mix(in srgb, var(--tint) 8%, var(--card)); border-left: 4px solid var(--tint); font-style: italic; color: var(--label-2); }
.prose-article table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem; background: var(--card); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); display: table; overflow: hidden; }
@media (max-width: 760px) { .prose-article table { display: block; overflow-x: auto; } }
.prose-article thead th { background: var(--grad); color: #fff; text-align: left; font-weight: 600; }
.prose-article th, .prose-article td { padding: 12px 16px; border-bottom: 0.5px solid var(--sep); vertical-align: top; min-width: 120px; }
.prose-article tbody tr:nth-child(even) td { background: var(--card-2); }
.prose-article tbody tr:last-child td { border-bottom: 0; }
.post-video { margin: 2em 0; }
.post-video video { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--r-lg); background: #000; box-shadow: var(--shadow-lg); }
.post-video figcaption { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 0.9rem; color: var(--label-2); }
.post-video figcaption .ic { color: var(--red); }
.see-also { padding: 16px 20px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-sm); border-left: 4px solid var(--brand-blue); }
.see-also strong { color: var(--brand-blue); }
.post-faq { margin-top: 48px; }
.post-faq h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 18px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 40px 0 28px; padding: 26px 28px; border-radius: var(--r-lg); background: var(--grad); color: #fff; box-shadow: 0 18px 40px rgba(31, 138, 76, 0.3); }
.post-cta strong { display: block; font-size: 1.25rem; }
.post-cta span { opacity: 0.88; font-size: 0.95rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.share-bar { display: flex; align-items: center; gap: 10px; padding-top: 20px; border-top: 0.5px solid var(--sep); color: var(--label-2); font-weight: 600; font-size: 0.92rem; }
.social-btn.light { background: var(--fill); color: var(--label); border: 0; }
.social-btn.light:hover { color: #fff; }

@media (max-width: 1024px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-side { position: static; }
  .post-featured { grid-template-columns: 1fr; }
  .pf-body { padding: 0 6px 10px; }
  .service-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .service-grid.four { grid-template-columns: 1fr; }
  .prose-article { font-size: 1.02rem; }
  .post-cta { padding: 22px; }
  .post-cover { border-radius: var(--r-lg); }
}
