/*
Theme Name:   Trọng Hữu Child
Description:  Child theme của GeneratePress cho blog Marketing B2B × AI. Phong cách công nghệ tối, màu theo dụng thần Hoả – Thổ, tối ưu SEO/GEO và Core Web Vitals.
Author:       Ngô Trọng Hữu
Template:     generatepress
Version:      1.3.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain:  th
*/

/* ==========================================================================
   1. TOKENS — dark-first. Hoả (--fire, --ember) + Thổ (--bg ấm, --amber).
   Tránh xanh dương / bạc (Thuỷ, Kim — kỵ theo tứ trụ).
   ========================================================================== */
:root {
	--bg: #0C0907; --surface: #14100C; --raised: #1B1510; --line: #2B221A; --grid: rgba(255,176,32,.055);
	--ink: #F4EBDF; --body-ink: #E2D6C8; --muted: #A18F7E;
	--fire: #FF5A2E; --ember: #D0281D; --amber: #FFB224;
	--glow: rgba(255,90,46,.35);
	--display: "Chakra Petch", "Be Vietnam Pro", system-ui, sans-serif;
	--body: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--wrap: 1200px; --measure: 68ch; --r: 4px; --rc: 6px;
	--brand-orange: #FF5A2E; --brand-ink: #1A120D; /* Logo — không đổi theo theme */
	color-scheme: dark;
}
@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) {
		--bg: #FAF5EE; --surface: #FFFFFF; --raised: #F3EADF; --line: #E4D6C6; --grid: rgba(208,40,29,.05);
		--ink: #1A120D; --body-ink: #2E241D; --muted: #6F5E50;
		--fire: #D93A16; --ember: #B01E15; --amber: #9A6300; --glow: rgba(217,58,22,.18);
		color-scheme: light;
	}
}
:root[data-theme="light"] {
	--bg: #FAF5EE; --surface: #FFFFFF; --raised: #F3EADF; --line: #E4D6C6; --grid: rgba(208,40,29,.05);
	--ink: #1A120D; --body-ink: #2E241D; --muted: #6F5E50;
	--fire: #D93A16; --ember: #B01E15; --amber: #9A6300; --glow: rgba(217,58,22,.18);
	color-scheme: light;
}

/* ==========================================================================
   2. BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0; background-color: var(--bg); color: var(--ink);
	font: 400 17px/1.7 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
	background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
	background-size: 48px 48px; background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
a:hover, a:focus { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.2; text-wrap: balance; margin: 0; color: var(--ink); }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.label::before { content: "// "; color: var(--fire); }
.meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--fire); color: #160A05; padding: 10px 16px; border-radius: var(--r); font-weight: 600; }
.skip-link:focus { left: 16px; color: #160A05; }

/* ==========================================================================
   3. BUTTONS (ghi đè style button mặc định của GeneratePress)
   ========================================================================== */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: var(--r); font: 600 15px/1 var(--body); border: 0; cursor: pointer; transition: box-shadow .25s, transform .2s, color .2s; }
.btn-fire, a.btn-fire, button.btn-fire, button.btn-fire:hover, button.btn-fire:focus { background: var(--fire); color: #160A05; }
.btn-fire:hover { box-shadow: 0 0 0 1px var(--fire), 0 0 28px var(--glow); transform: translateY(-1px); color: #160A05; }
.btn-line, a.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1px var(--amber); color: var(--amber); }
button.icon-btn, button.icon-btn:hover, button.icon-btn:focus { width: 40px; height: 40px; padding: 0; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: 400 15px var(--mono); }
button.icon-btn:hover { border-color: var(--amber); }

/* ==========================================================================
   4. HEADER / FOOTER
   ========================================================================== */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--bg); }
.th-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.admin-bar .th-header { top: calc(env(safe-area-inset-top, 0px) + 32px); }
@media (max-width: 782px) { .admin-bar .th-header { top: env(safe-area-inset-top, 0px); } }
.th-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.th-brand { display: flex; align-items: center; gap: 12px; font-family: var(--body); font-size: 17px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
/* Logo: màu thương hiệu cố định (Cam Hoả + Đen Thổ), không đổi theo theme sáng/tối. */
.th-mark { width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: var(--brand-ink); background: var(--brand-orange); }
@media (max-width: 400px) { .th-brand { font-size: 15px; letter-spacing: .04em; } }
.th-menu { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.th-menu a { color: var(--muted); transition: color .2s; }
.th-menu a:hover, .th-menu .current-menu-item:not(.menu-item-type-custom) > a { color: var(--amber); }
.th-nav-r { display: flex; gap: 10px; align-items: center; }
.th-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: linear-gradient(90deg, var(--fire), var(--amber)); transform-origin: 0 50%; transform: scaleX(0); }
@media (max-width: 860px) { .th-menu { display: none; } .th-nav-r .btn { display: none; } }

.th-footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg); }
.th-foot { padding-block: 28px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.th-foot ul { display: flex; gap: 22px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.th-foot a:hover { color: var(--amber); }

/* ==========================================================================
   5. HOME — HERO + TERMINAL
   ========================================================================== */
.hero { padding-block: 80px 64px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fire); box-shadow: 0 0 10px var(--fire); animation: th-pulse 2.4s infinite; }
@keyframes th-pulse { 50% { opacity: .35; } }
.hero h1 { font-size: clamp(42px, 6.4vw, 82px); margin-top: 22px; text-transform: uppercase; line-height: 1.02; }
.grad { background: linear-gradient(92deg, var(--fire) 10%, var(--amber) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lede { font-size: 19px; color: var(--muted); max-width: 54ch; margin-top: 24px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

.term { border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); overflow: hidden; min-width: 0; }
.term-bar { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--raised); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.term-bar i:first-child { background: var(--ember); }
.term-bar i:nth-child(2) { background: var(--amber); }
.term-bar span { margin-left: auto; color: var(--muted); }
.term pre { margin: 0; padding: 18px 18px 8px; font: 400 13.5px/1.85 var(--mono); color: var(--muted); white-space: pre-wrap; background: none; border: 0; overflow-x: auto; }
.term pre b { color: var(--fire); font-weight: 500; }
.term pre em { color: var(--amber); font-style: normal; }
.term pre u { color: var(--ink); text-decoration: none; }
.caret { display: inline-block; width: 8px; height: 16px; background: var(--amber); vertical-align: -3px; animation: th-blink 1s steps(1) infinite; }
@keyframes th-blink { 50% { opacity: 0; } }
.topics { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.topics a { padding: 14px 18px; display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 500; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .2s, color .2s; }
.topics a:nth-child(2n) { border-right: 0; }
.topics a:nth-last-child(-n+2) { border-bottom: 0; }
.topics a b { font: 400 13px var(--mono); color: var(--amber); }
.topics a:hover { background: var(--raised); color: var(--fire); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; padding-block: 52px 40px; } }
@media (max-width: 420px) { .topics { grid-template-columns: 1fr; } .topics a { border-right: 0; } .topics a:nth-last-child(2) { border-bottom: 1px solid var(--line); } }

/* ==========================================================================
   6. SECTIONS + CARDS
   ========================================================================== */
.sec { padding-block: 56px; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.sec-head h2, .sec-head h1 { font-size: clamp(28px, 3.4vw, 40px); margin-top: 8px; text-transform: uppercase; }
.sec-head > a { font: 400 13px var(--mono); color: var(--amber); white-space: nowrap; letter-spacing: .04em; }
.sec-head > a:hover { color: var(--fire); }
.sec-desc { color: var(--muted); max-width: 64ch; margin-top: 10px; }

.card-item { display: flex; min-width: 0; }
.card { position: relative; display: flex; flex-direction: column; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); overflow: hidden; transition: border-color .25s, box-shadow .25s, transform .25s; min-width: 0; }
.card:hover { border-color: color-mix(in srgb, var(--fire) 60%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fire) 25%, transparent), 0 18px 40px -24px var(--glow); transform: translateY(-2px); }
.card h3 { transition: color .2s; }
.card:hover h3 { color: var(--amber); }
.card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card .ex { color: var(--muted); font-size: 15.5px; }
.card .meta { margin-top: auto; padding-top: 6px; }
.chip { display: inline-block; align-self: flex-start; font: 500 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fire); border: 1px solid color-mix(in srgb, var(--fire) 45%, transparent); padding: 3px 8px; border-radius: 3px; }

/* Covers: CSS thuần khi bài không có ảnh đại diện */
.cover { aspect-ratio: 16 / 9; max-width: 100%; position: relative; overflow: hidden; background: #100B08; border-bottom: 1px solid var(--line); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover:not(.has-img)::before, .cover:not(.has-img)::after { content: ""; position: absolute; }
.cover:not(.has-img)::before { inset: 0; background-image: linear-gradient(rgba(255,178,36,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,178,36,.08) 1px, transparent 1px); background-size: 24px 24px; }
.k1::after { width: 58%; aspect-ratio: 1; right: -8%; top: -30%; border-radius: 50%; background: radial-gradient(circle, #FF5A2E 0, #D0281D 40%, transparent 70%); filter: blur(4px); }
.k1 .lines { position: absolute; left: 8%; bottom: 16%; width: 44%; height: 40%; background: repeating-linear-gradient(0deg, #FFB224 0 2px, transparent 2px 14px); opacity: .7; }
.k2::after { inset: 22% 12%; border: 1px solid #FFB224; border-radius: 50%; box-shadow: 0 0 0 18px rgba(255,90,46,.12), 0 0 0 36px rgba(255,90,46,.06); }
.k2 .lines { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; background: #FF5A2E; border-radius: 50%; box-shadow: 0 0 24px #FF5A2E; }
.k3::after { left: 0; right: 0; bottom: 0; height: 62%; background: linear-gradient(90deg, #D0281D 0 8%, transparent 8% 12%, #FF5A2E 12% 22%, transparent 22% 26%, #FFB224 26% 40%, transparent 40% 44%, #FF5A2E 44% 62%, transparent 62% 66%, #FFB224 66% 88%, transparent 88%); clip-path: polygon(0 70%, 12% 60%, 26% 45%, 44% 38%, 66% 20%, 88% 8%, 100% 0, 100% 100%, 0 100%); opacity: .85; }
.k4::after { width: 70%; height: 70%; left: 15%; top: 15%; background: conic-gradient(from 0deg, #FF5A2E, #FFB224, #D0281D, #FF5A2E); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); opacity: .8; }
.k5::after { inset: 0; background: radial-gradient(circle at 20% 80%, #FFB224 0 6%, transparent 6.5%), radial-gradient(circle at 46% 46%, #FF5A2E 0 5%, transparent 5.5%), radial-gradient(circle at 74% 30%, #D0281D 0 7%, transparent 7.5%), linear-gradient(35deg, transparent 46%, rgba(255,178,36,.6) 46% 47%, transparent 47%); }
.k6::after { left: 10%; right: 10%; top: 30%; height: 40%; border: 1px solid #FFB224; background: repeating-linear-gradient(90deg, rgba(255,90,46,.5) 0 6px, transparent 6px 16px); }
.cover .code { position: absolute; left: 12px; bottom: 10px; font: 500 11px var(--mono); letter-spacing: .1em; color: #FFB224; z-index: 2; background: rgba(16, 11, 8, .82); padding: 3px 7px; border-radius: 3px; }

.featured { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 24px; }
.featured .is-big h3 { font-size: clamp(24px, 2.6vw, 32px); }
.featured .is-big .cover { aspect-ratio: 16 / 8; }
.feat-side { display: grid; gap: 24px; align-content: start; }
.feat-side h3 { font-size: 20px; }
.feat-side .cover { aspect-ratio: 16 / 6; }
@media (max-width: 900px) { .featured { grid-template-columns: 1fr; } .feat-side .cover { aspect-ratio: 16 / 8; } }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid4 h3, .grid3 h3 { font-size: 19px; line-height: 1.3; }
.grid4 .ex, .grid3 .ex { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; }
/* Ít bài hơn số cột → giảm số cột để không trống nửa hàng. */
.grid4.n-1, .grid3.n-1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.grid4.n-2, .grid3.n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid4.n-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1040px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid4, .grid3 { grid-template-columns: 1fr; } }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font: 500 13px var(--mono); color: var(--muted); }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { border-color: var(--fire); color: var(--ink); }

/* ==========================================================================
   7. ABOUT + NEWSLETTER
   ========================================================================== */
.about { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); overflow: hidden; }
.id-card { position: relative; background: #100B08; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; border-right: 1px solid var(--line); min-height: 380px; }
.id-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 60% at 50% 30%, rgba(255,90,46,.35), transparent 70%), linear-gradient(rgba(255,178,36,.07) 1px, transparent 1px) 0 0 / 100% 20px; }
.id-card > * { position: relative; }
.avatar { width: 132px; aspect-ratio: 1; border-radius: 0; margin: 20px auto 0; display: grid; place-items: center; overflow: hidden; font: 700 44px var(--display); color: #160A05; background: linear-gradient(135deg, #FF5A2E, #FFB224); box-shadow: 0 0 0 6px #100B08, 0 0 0 7px #FFB224, 0 0 50px rgba(255,90,46,.4); }
.avatar.is-mark, .av.is-mark { background: var(--brand-orange); color: var(--brand-ink); }
.avatar.is-mark svg { width: 66%; height: 66%; }
.av.is-mark svg { width: 70%; height: 70%; }
.avatar img, .av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.id-card dl { margin: 0; display: grid; gap: 8px; font: 400 12.5px var(--mono); color: #C9B8A6; }
.id-card dl div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #3A2C20; padding-bottom: 6px; }
.id-card dt { color: #8C7764; }
.id-card dd { margin: 0; color: #FFB224; text-align: right; }
.about-body { padding: 40px; min-width: 0; }
.about-body h2 { font-size: clamp(28px, 3.2vw, 40px); margin: 10px 0 18px; }
.about-body h2 span { color: var(--fire); }
.about-body p { color: var(--muted); max-width: 64ch; }
.about-body p + p { margin-top: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 32px; border: 1px solid var(--line); border-radius: var(--r); }
.stats div { padding: 16px 18px; border-right: 1px solid var(--line); display: grid; gap: 4px; }
.stats div:last-child { border-right: 0; }
.stats b { font: 700 32px/1 var(--display); color: var(--amber); font-variant-numeric: tabular-nums; }
.stats span { font-size: 13px; color: var(--muted); }
@media (max-width: 900px) {
	.about { grid-template-columns: 1fr; }
	.id-card { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
	.about-body { padding: 28px 22px; }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stats div:nth-child(2) { border-right: 0; }
	.stats div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

.news { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px 40px; border: 1px solid color-mix(in srgb, var(--fire) 40%, var(--line)); border-radius: var(--rc); background: linear-gradient(120deg, color-mix(in srgb, var(--fire) 10%, var(--surface)), var(--surface) 60%); }
.news h2 { font-size: clamp(24px, 2.8vw, 32px); margin: 10px 0; }
.news p { color: var(--muted); }
.news form { display: flex; gap: 10px; flex-wrap: wrap; }
.news input[type="email"] { flex: 1 1 220px; min-width: 0; padding: 13px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 400 15px var(--mono); }
.news input[type="email"]:focus { border-color: var(--amber); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 20%, transparent); background: var(--bg); color: var(--ink); }
.news .msg { margin-top: 10px; font: 500 13px var(--mono); color: var(--amber); }
@media (max-width: 900px) { .news { grid-template-columns: 1fr; padding: 28px 22px; } }

/* Contact */
.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 40px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); position: relative; overflow: hidden; }
.contact::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: var(--brand-orange); opacity: .08; transform: rotate(45deg); pointer-events: none; }
.contact h2 { font-size: clamp(26px, 3vw, 36px); margin: 10px 0 12px; }
.contact p { color: var(--muted); max-width: 58ch; }
.contact-actions { display: grid; gap: 14px; justify-items: start; position: relative; }
.contact-mail { font: 500 15px var(--mono); color: var(--ink); letter-spacing: .02em; word-break: break-all; }
.contact-mail span { color: var(--muted); margin-right: 8px; }
.contact-links { display: flex; gap: 18px; flex-wrap: wrap; font: 500 13px var(--mono); }
.contact-links a { color: var(--amber); }
.contact-links a:hover { color: var(--fire); }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; } }

/* ==========================================================================
   8. SINGLE POST
   ========================================================================== */
.post-head { padding-block: 48px 36px; max-width: 880px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }
.crumbs a:hover { color: var(--amber); }
.crumbs .sep { color: var(--fire); }
.post-head .chip { margin-top: 22px; }
.post-head h1 { font-size: clamp(34px, 5vw, 58px); margin-top: 16px; line-height: 1.1; }
.post-head .lede { font-size: 20px; color: var(--muted); margin-top: 18px; max-width: 62ch; line-height: 1.7; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: 12px; }
.av { width: 44px; height: 44px; border-radius: 0; overflow: hidden; flex: none; display: grid; place-items: center; font: 700 15px var(--display); color: #160A05; background: linear-gradient(135deg, var(--fire), var(--amber)); }
.who b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.who small { font-size: 13.5px; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.facts em { font-style: normal; color: var(--amber); }
.post-hero-img { margin: 0 0 40px; border-radius: var(--rc); overflow: hidden; border: 1px solid var(--line); }
.post-hero-img img { display: block; width: 100%; }

.layout { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 280px); gap: 72px; justify-content: space-between; padding-bottom: 40px; }
.layout.no-toc { grid-template-columns: minmax(0, var(--measure)); }
@media (max-width: 1060px) { .layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.prose { min-width: 0; color: var(--body-ink); font-size: 18px; line-height: 1.8; }
.prose > * + * { margin-top: 1.15em; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { font-size: 30px; margin-top: 2.2em; scroll-margin-top: 96px; display: flex; gap: 12px; align-items: baseline; }
.prose h2 .n { font: 500 14px var(--mono); color: var(--fire); flex: none; }
.prose h3 { font-size: 22px; margin-top: 1.8em; scroll-margin-top: 96px; }
.prose a { color: var(--amber); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--amber) 40%, transparent); text-underline-offset: 4px; }
.prose a:hover { color: var(--amber); text-decoration-color: var(--amber); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; margin-left: 0; margin-bottom: 0; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--fire); }
.prose blockquote, .prose .wp-block-quote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--fire); font-size: 21px; line-height: 1.6; color: var(--ink); font-style: italic; background: none; }
.prose blockquote p { margin: 0; }
.prose code { font: 400 .86em var(--mono); background: var(--raised); border: 1px solid var(--line); padding: 1px 6px; border-radius: 3px; color: var(--amber); }
.prose pre, .prose .wp-block-code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); padding: 18px 20px; overflow-x: auto; font: 400 13.5px/1.75 var(--mono); color: var(--muted); }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose figure { margin: 1.6em 0; }
.prose figure img { border-radius: var(--rc); }
.prose figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose .wp-block-table, .tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--rc); margin-left: 0; margin-right: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 520px; margin: 0; border: 0; }
.prose th, .prose td { text-align: left; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--raised); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--ink); font-weight: 600; }

.tldr { background: var(--surface); border: 1px solid color-mix(in srgb, var(--fire) 40%, var(--line)); border-radius: var(--rc); padding: 22px 24px; margin-bottom: 1.6em; }
.tldr h2 { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin: 0 0 10px; }
.tldr ul { margin: 0; padding-left: 1.2em; }
.tldr li { font-size: 16.5px; color: var(--body-ink); }
.tldr li + li { margin-top: .4em; }
.tldr li::marker { color: var(--fire); }

/* Block patterns: .th-check, .th-callout (chèn từ Trình soạn thảo → Patterns → Trọng Hữu) */
.prose .th-check { list-style: none; padding: 0; display: grid; gap: 10px; counter-reset: c; }
.prose .th-check li { counter-increment: c; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rc); padding: 14px 16px; margin: 0; }
.prose .th-check li::before { content: counter(c, decimal-leading-zero); font: 500 14px/1.9 var(--mono); color: var(--fire); }
.prose .th-callout { padding: 18px 20px; border-radius: var(--rc); background: color-mix(in srgb, var(--amber) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line)); font-size: 16.5px; }
.prose .th-callout > :first-child { margin-top: 0; }
.prose .th-callout strong:first-child { font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--amber); margin-right: 8px; }

.faq details { border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; padding: 16px 20px; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--fire); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding: 0 20px 18px; color: var(--muted); font-size: 16.5px; }

.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 22px; border-block: 1px solid var(--line); margin-top: 2.4em; }
.share .mono { color: var(--muted); margin-right: 6px; }
.share a, .share button, .share button:hover, .share button:focus { background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r); padding: 8px 14px; font: 500 13px var(--mono); cursor: pointer; text-decoration: none; }
.share a:hover, .share button:hover { border-color: var(--amber); color: var(--amber); }

.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 20px; padding: 24px; border: 1px solid var(--line); border-radius: var(--rc); background: var(--surface); margin-top: 2em; }
.author-box .av { width: 72px; height: 72px; font-size: 24px; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--amber); }
.author-box h2 { font-size: 21px; margin: 4px 0 8px; }
.author-box p { font-size: 15.5px; color: var(--muted); }
.author-box .links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font: 500 13px var(--mono); }
.author-box .links a { color: var(--amber); }
@media (max-width: 520px) { .author-box { grid-template-columns: 1fr; } }

.toc { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 92px); align-self: start; display: grid; gap: 24px; }
.toc nav { border-left: 1px solid var(--line); padding-left: 18px; }
.toc h2 { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; line-height: 1.45; }
.toc nav a { color: var(--muted); display: block; position: relative; transition: color .2s; }
.toc nav a:hover, .toc nav a.on { color: var(--ink); }
.toc nav a.on::before { content: ""; position: absolute; left: -19px; top: 2px; bottom: 2px; width: 2px; background: var(--fire); box-shadow: 0 0 8px var(--fire); }
.mini { border: 1px solid var(--line); border-radius: var(--rc); padding: 18px; background: var(--surface); display: grid; gap: 10px; }
.mini p { font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.mini b { font: 600 16px var(--display); color: var(--ink); }
.mini .btn { justify-content: center; }

.related { padding-block: 40px 24px; border-top: 1px solid var(--line); }
.related > h2 { font-size: 28px; text-transform: uppercase; margin-bottom: 22px; }

.page-404 { padding-block: 96px; max-width: 720px; }
.page-404 h1 { font-size: clamp(40px, 6vw, 72px); text-transform: uppercase; margin: 14px 0 16px; }
.page-404 p { color: var(--muted); }
.search-form-th { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.search-form-th input[type="search"] { flex: 1 1 240px; min-width: 0; padding: 13px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 15px var(--body); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
