/* Trang bài viết blog (single.php) — 17/11/2026. Dùng biến --mh-* của .site-inner-page (tối/sáng) và --mx-* của site-motion.css.
   Chuyển động chậm, êm (chủ thích motion nhiều nhưng không nhanh): .6–1.1s, cubic-bezier(.2,.75,.2,1). */

.mh-article { max-width: 76rem; margin-inline: auto; padding: 36px 16px 64px; }
@media (min-width: 640px) { .mh-article { padding-inline: 24px; } }

/* ---------- Đầu bài ---------- */
.mh-art-head { max-width: 50rem; }
.mh-art-chip { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 14px; padding: 5px 12px; border: 1px solid #f5c26b40; border-radius: 999px; background: #f5c26b12; color: #f2c16d; font-size: 12px; font-weight: 700; letter-spacing: .04em; transition: background .4s, border-color .4s; }
.mh-art-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mx-gold); animation: mx-sub-ping 2.4s ease-out infinite; }
.mh-art-chip:hover { background: #f5c26b22; border-color: #f5c26b80; }
html:not(.dark) .mh-art-chip { color: #8a5a12; background: #b4822a14; border-color: #b4822a40; }
.mh-art-head .mh-page-title { font-size: clamp(1.75rem, 4vw, 2.6rem); line-height: 1.18; text-wrap: balance; }
.mh-art-lead { margin-top: 14px; color: var(--mh-muted); font-size: clamp(15px, 1.6vw, 17px); line-height: 1.75; text-wrap: pretty; }
.mh-art-meta { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.mh-art-meta img { flex: none; width: 36px; height: 36px; padding: 5px; border-radius: 50%; background: #0d1726; object-fit: contain; box-shadow: 0 0 0 1px #f5c26b40; }
.mh-art-meta span { display: flex; flex-direction: column; gap: 2px; }
.mh-art-meta a { color: var(--mh-text); font-weight: 700; text-decoration: none; }
.mh-art-meta a:hover { text-decoration: underline; }
.mh-art-meta small { color: var(--mh-faint); font-size: 12.5px; }
.mh-anim .mh-art-chip { animation: mx-sub-rise .8s var(--mx-ease) .02s both; }
.mh-anim .mh-art-lead { animation: mx-sub-rise .9s var(--mx-ease) .26s both; }
.mh-anim .mh-art-meta { animation-delay: .38s; animation-duration: .9s; }

/* ---------- Ảnh bìa ---------- */
.mh-art-cover { margin: 28px 0 0; overflow: hidden; border: 1px solid var(--mh-line); border-radius: 20px; box-shadow: 0 40px 80px -50px #000; }
.mh-art-cover img { display: block; width: 100%; max-height: 520px; object-fit: cover; border-radius: 0; }
.mh-anim .mh-art-cover { animation: mh-cover-in 1.1s var(--mx-ease) .3s both; }
.mh-anim .mh-art-cover img { animation: mh-cover-zoom 2.4s var(--mx-ease) .3s both; }
@keyframes mh-cover-in { from { opacity: 0; transform: translateY(24px); clip-path: inset(6% 4% 0 4% round 20px); } }
@keyframes mh-cover-zoom { from { transform: scale(1.08); } }

/* ---------- Thân bài + cột phải ---------- */
.mh-art-grid { display: grid; gap: 40px; margin-top: 36px; }
@media (min-width: 1024px) { .mh-art-grid:not(.no-toc) { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; } }
.mh-art-main { min-width: 0; max-width: 46rem; }
.mh-art-main .mh-prose { margin-top: 0; font-size: 16.5px; line-height: 1.95; }
.mh-art-main .mh-prose > * + * { margin-top: 22px; }
.mh-art-main .mh-prose h2 { margin-top: 48px; padding-top: 4px; font-size: clamp(1.3rem, 2.2vw, 1.55rem); scroll-margin-top: 96px; }
.mh-art-main .mh-prose h3 { margin-top: 32px; font-size: 1.12rem; }
.mh-art-main .mh-prose h2::before { content: ""; display: block; width: 36px; height: 3px; margin-bottom: 14px; border-radius: 3px; background: linear-gradient(90deg, var(--mx-gold), #ff9f5a); transform-origin: 0 50%; }
.mh-anim .mh-art-main .mh-prose h2[data-mx="in"]::before { animation: mh-bar-grow 1s var(--mx-ease) .25s both; }
@keyframes mh-bar-grow { from { transform: scaleX(0); } }

/* Khung "Trả lời nhanh" (đoạn đầu bài mở bằng <strong>Trả lời nhanh:</strong>) */
.mh-prose .mh-quick { position: relative; padding: 18px 20px 18px 22px; border: 1px solid #f5c26b38; border-radius: 16px; background: linear-gradient(135deg, #f5c26b14, transparent 60%), var(--mh-surface); line-height: 1.8; overflow: hidden; }
.mh-prose .mh-quick::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--mx-gold), #ff9f5a); }
.mh-prose .mh-quick > strong:first-child { display: block; margin-bottom: 6px; color: #f2c16d; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
html:not(.dark) .mh-prose .mh-quick > strong:first-child { color: #8a5a12; }
.mh-anim .mh-prose .mh-quick { animation: mx-sub-rise 1s var(--mx-ease) .5s both; }

/* Mục lục cho điện thoại / máy tính bảng */
.mh-toc-mobile { margin-bottom: 28px; border: 1px solid var(--mh-line); border-radius: 16px; background: var(--mh-surface); }
.mh-toc-mobile summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; color: var(--mh-text); font-weight: 700; cursor: pointer; list-style: none; }
.mh-toc-mobile summary::-webkit-details-marker { display: none; }
.mh-toc-mobile summary em { margin-left: auto; color: var(--mh-faint); font-size: 12px; font-style: normal; font-weight: 500; }
.mh-toc-mobile summary::after { content: "▾"; color: var(--mx-gold); transition: transform .5s var(--mx-ease); }
.mh-toc-mobile[open] summary::after { transform: rotate(180deg); }
.mh-toc-mobile nav { padding: 0 10px 12px; }
.mh-toc-mobile[open] nav { animation: mx-sub-rise .6s var(--mx-ease) both; }
@media (min-width: 1024px) { .mh-art-grid:not(.no-toc) .mh-toc-mobile { display: none; } }

/* Danh sách mục (dùng chung cho 2 mục lục) */
.mh-toc ol, .mh-toc-mobile ol { margin: 0; padding: 0; list-style: none; }
.mh-toc a, .mh-toc-mobile a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--mh-muted); font-size: 14px; line-height: 1.45; text-decoration: none; transition: color .45s, background .45s, transform .55s var(--mx-ease); }
.mh-toc a span, .mh-toc-mobile a span { flex: none; color: var(--mh-faint); font-family: var(--font-mono); font-size: 11.5px; padding-top: 2px; transition: color .45s; }
.mh-toc a:hover, .mh-toc-mobile a:hover { color: var(--mh-text); background: #f5c26b0d; }

/* Cột phải dính */
.mh-art-side { display: none; }
@media (min-width: 1024px) { .mh-art-side { display: block; } }
.mh-art-sticky { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
body.admin-bar .mh-art-sticky { top: 128px; }
.mh-toc { position: relative; padding: 18px 12px 14px 14px; border: 1px solid var(--mh-line); border-radius: 18px; background: color-mix(in srgb, var(--mh-surface) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-height: calc(100vh - 380px); overflow: auto; scrollbar-width: thin; }
.mh-toc > p { margin: 0 0 8px 10px; color: var(--mh-faint); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.mh-toc li { position: relative; }
.mh-toc li::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--mx-gold); box-shadow: 0 0 10px #f5c26b99; transform: scaleY(0); transition: transform .6s var(--mx-ease); }
.mh-toc li.is-on::before { transform: scaleY(1); }
.mh-toc li.is-on a { color: var(--mh-text); background: #f5c26b10; transform: translateX(3px); }
.mh-toc li.is-on a span, .mh-toc li.is-done a span { color: var(--mx-gold); }
.mh-anim .mh-art-sticky > * { animation: mx-sub-rise 1s var(--mx-ease) both; }
.mh-anim .mh-art-sticky > :nth-child(1) { animation-delay: .55s; }
.mh-anim .mh-art-sticky > :nth-child(2) { animation-delay: .75s; }

/* ---------- Thẻ mời dùng công cụ ---------- */
.mh-tool-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border: 1px solid #f5c26b33; border-radius: 18px; background-color: var(--mh-surface); overflow: hidden; }
.mh-tool-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(closest-side, #f5c26b2e, transparent); pointer-events: none; animation: mh-glow 7s ease-in-out infinite alternate; }
@keyframes mh-glow { to { transform: translate(-30px, 30px) scale(1.2); opacity: .6; } }
.mh-tool-card p { margin: 0; }
.mh-tool-card p.mh-tool-kicker { color: #f2c16d; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
html:not(.dark) .mh-tool-kicker { color: #8a5a12; }
.mh-tool-card p.mh-tool-title { color: var(--mh-text); font-size: 18px; font-weight: 800; line-height: 1.3; }
.mh-tool-card p.mh-tool-desc { color: var(--mh-muted); font-size: 14px; line-height: 1.6; }
.mh-tool-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; text-decoration: none !important; }
.mh-tool-btn svg { transition: transform .5s var(--mx-ease); }
.mh-tool-btn:hover svg { transform: translateX(4px); }
.mh-tool-card small { color: var(--mh-faint); font-size: 12px; text-align: center; }
.mh-prose .mh-tool-inline { margin-block: 40px; }
@media (min-width: 640px) {
  .mh-prose .mh-tool-inline { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "k btn" "t btn" "d s"; column-gap: 24px; row-gap: 4px; align-items: center; padding: 22px 26px; }
  .mh-tool-inline .mh-tool-kicker { grid-area: k; } .mh-tool-inline .mh-tool-title { grid-area: t; } .mh-tool-inline .mh-tool-desc { grid-area: d; }
  .mh-tool-inline .mh-tool-btn { grid-area: btn; margin-top: 0; white-space: nowrap; } .mh-tool-inline small { grid-area: s; }
}
.mh-prose .mh-tool-card a.mh-tool-btn { color: #1a1206; font-weight: 700; }

/* ---------- Chia sẻ ---------- */
.mh-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--mh-line); color: var(--mh-muted); font-size: 14px; }
.mh-share > span { flex-basis: 100%; margin-bottom: 4px; }
@media (min-width: 640px) { .mh-share > span { flex-basis: auto; margin: 0 6px 0 0; } }
.mh-share :is(a, button) { padding: 7px 14px; border: 1px solid var(--mh-line-strong); border-radius: 999px; background: transparent; color: var(--mh-text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .45s, background .45s, transform .5s var(--mx-ease); }
.mh-share :is(a, button):hover { border-color: #f5c26b88; background: #f5c26b12; transform: translateY(-2px); }
.mh-share button.is-done { border-color: #5eead488; color: #5eead4; }
html:not(.dark) .mh-share button.is-done { color: #0f766e; }

/* ---------- Bài liên quan + điều hướng ---------- */
.mh-related { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--mh-line); }
.mh-related h2 { color: var(--mh-text); font-size: clamp(1.4rem, 2.6vw, 1.8rem); font-weight: 800; }
.mh-related .mh-post-card-img img { height: 170px; }
.mh-article .mh-post-nav { margin-top: 40px; }
.mh-article .mh-post-nav .nav-links { display: grid; gap: 12px; }
@media (min-width: 640px) { .mh-article .mh-post-nav .nav-links { grid-template-columns: 1fr 1fr; } }
.mh-article .mh-post-nav a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 1px solid var(--mh-line); border-radius: 16px; color: var(--mh-text); font-weight: 700; line-height: 1.4; text-decoration: none; transition: border-color .45s, transform .55s var(--mx-ease); }
.mh-article .mh-post-nav a small { color: var(--mh-faint); font-size: 12px; font-weight: 500; }
.mh-article .mh-post-nav .nav-next a { text-align: right; }
.mh-article .mh-post-nav a:hover { border-color: #f5c26b88; transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  .mh-art-chip::before, .mh-tool-card::after { animation: none; }
  .mh-art-cover, .mh-art-cover img, .mh-art-sticky > *, .mh-prose .mh-quick { animation: none !important; }
}
