/*
Theme Name: mmo.vn
Theme URI: https://mmo.vn
Author: Kết Nối Số
Description: Theme blog review và case study công cụ số cho mmo.vn: thumbnail lớn, trải nghiệm thật, minh bạch.
Version: 2.0.4
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: mmovn
*/

:root {
	--ink: #13203A;
	--ink-2: #3B4862;
	--muted: #66728A;
	--paper: #F2F4F7;
	--line: #DCE1E8;
	--white: #FFFFFF;
	--green: #0B7A53;
	--green-dark: #075A3D;
	--green-soft: #E3F3EB;
	--mark: #FFE14D;
	--amber: #F2B01E;
	--display: "Be Vietnam Pro", system-ui, sans-serif;
	--font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
	--wrap: 1200px;
	--r: 14px;
	--cat: var(--green);
}

/* Màu theo chuyên mục: dùng cho chip, thumbnail dự phòng */
.cat-ai-sang-tao-noi-dung { --cat: #6D28D9; --cat-2: #C026D3; }
.cat-case-study { --cat: #0B7A53; --cat-2: #10B981; }
.cat-antidetect-browser { --cat: #1D4ED8; --cat-2: #0EA5E9; }
.cat-e-commerce-thanh-toan { --cat: #C2410C; --cat-2: #F59E0B; }
.cat-martech-ban-hang { --cat: #BE185D; --cat-2: #F43F5E; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.7; color: var(--ink); background: var(--white); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 820px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 10px 14px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.12; letter-spacing: -.025em; margin: 0 0 .45em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); }
h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 58ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 700 1rem/1 var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--ink); color: #fff; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* ---------- Header ---------- */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 70px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.04em; line-height: 1; }
.brand-name .tld { color: var(--green); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.site-nav li a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav li a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-parent > a { border-bottom-color: var(--green); color: var(--ink); }
.nav-toggle { display: none; min-height: 40px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font: 700 .95rem var(--font); color: var(--ink); }
@media (max-width: 920px) {
	.nav-toggle { display: inline-flex; align-items: center; }
	.site-nav { display: none; position: absolute; top: 70px; left: 0; right: 0; padding: 14px 24px 22px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px -20px rgba(19,32,58,.35); }
	.site-nav.open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; }
	.site-nav li a { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Chip chuyên mục ---------- */
.chip { text-decoration: none; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 700; line-height: 1; color: var(--cat); text-decoration: none; }
.chip::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--cat); }
a.chip:hover { color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .85rem; color: var(--muted); }
.meta .chip { font-size: .85rem; }

/* ---------- Thumbnail ---------- */
.thumb { position: relative; display: block; text-decoration: none; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--paper); isolation: isolate; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(19,32,58,.08); pointer-events: none; }
a.thumb:hover img { transform: scale(1.035); }
/* Thumbnail dự phòng khi bài chưa có ảnh */
.thumb-fallback { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 7% 7% 6%; color: #fff; background:
	radial-gradient(circle at 92% 8%, rgba(255,255,255,.18) 0 18%, transparent 18.5%),
	repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 14px, transparent 14px 34px),
	linear-gradient(135deg, var(--cat), var(--cat-2, var(--cat))); }
.thumb-fallback .fb-cat { align-self: flex-start; background: rgba(255,255,255,.95); color: var(--cat); font-weight: 800; font-size: .8rem; padding: 6px 12px; border-radius: 999px; }
.thumb-fallback .fb-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.2rem, 2.3vw, 1.75rem); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; text-shadow: 0 2px 0 rgba(0,0,0,.18); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb-fallback .fb-brand { font-family: var(--display); font-weight: 800; font-size: .9rem; opacity: .9; }

/* Con dấu "Case study thực tế" */
.thumb-wrap { position: relative; }
.stamp { position: absolute; z-index: 2; right: -18px; top: -24px; display: grid; place-content: center; text-align: center; width: 112px; height: 112px; border-radius: 50%; background: var(--green); color: #fff; border: 2px solid #fff; outline: 4px solid var(--green); box-shadow: 0 12px 26px -8px rgba(19,32,58,.55); transform: rotate(-10deg); font-family: var(--display); font-weight: 800; font-size: .92rem; line-height: 1.1; }
.stamp small { display: block; margin-top: 4px; font-weight: 600; font-size: .64rem; opacity: .9; }

/* ---------- Card ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 30px; }
.card { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-body { display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 1.28rem; line-height: 1.22; margin: 0; letter-spacing: -.015em; }
.card-title a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--mark), var(--mark)) 0 88% / 0 38% no-repeat; transition: background-size .35s ease; }
.card-title a:hover { background-size: 100% 38%; color: var(--ink); }
.card-excerpt { margin: 0; color: var(--ink-2); font-size: .97rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; gap: 36px; } }

/* ---------- Hero trang chủ ---------- */
.hero { padding: 56px 0 80px; background: var(--paper); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.hero-copy { padding-top: 28px; }
.hero-copy h1 { font-size: clamp(2.2rem, 3.9vw, 3.35rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: .4em; }
.hero-copy h1 mark { background: linear-gradient(transparent 58%, var(--mark) 58% 92%, transparent 92%); color: inherit; padding: 0 .04em; }
.hero-copy .lead { margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.proof { list-style: none; margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.proof li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: .97rem; color: var(--ink-2); line-height: 1.5; }
.proof li::before { content: ""; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12.5 4 4 8-9' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.proof b { color: var(--ink); }

.feature { display: flex; flex-direction: column; gap: 18px; }
.feature .thumb { border-radius: 20px; box-shadow: 0 30px 60px -30px rgba(19,32,58,.55); }
.feature-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.12; margin: 0; letter-spacing: -.02em; }
.feature-title a { color: var(--ink); text-decoration: none; }
.feature-title a:hover { text-decoration: underline; text-decoration-color: var(--green); text-decoration-thickness: 3px; }
.feature .card-excerpt { -webkit-line-clamp: 2; font-size: 1.02rem; }
.feature-tag { font-size: .85rem; font-weight: 700; color: var(--green-dark); }
@media (max-width: 960px) {
	.hero-grid { grid-template-columns: 1fr; gap: 40px; }
	.hero-copy { padding-top: 0; }
	.stamp { width: 86px; height: 86px; font-size: .74rem; right: -4px; top: -20px; }
	.stamp small { display: none; }
}

/* ---------- Section ---------- */
.section { padding: 76px 0; }
.section--paper { background: var(--paper); }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.row-head h2 { margin: 0; }
.row-head a { font-weight: 700; white-space: nowrap; }
.section-intro { color: var(--ink-2); max-width: 60ch; margin: -14px 0 30px; }

/* Chuyên mục */
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.topics a { position: relative; display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 22px 20px; border-radius: var(--r); background: #fff; color: var(--ink); text-decoration: none; border: 1px solid var(--line); overflow: hidden; }
.topics a::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--cat); }
.topics a:hover { border-color: var(--cat); }
.topic-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.topic-desc { font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.topic-count { margin-top: auto; padding-top: 8px; font-size: .85rem; font-weight: 700; color: var(--cat); }

/* Cách mmo.vn viết */
.promise { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.promise h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }
.promise-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px 32px; }
.promise-list li { padding-top: 16px; border-top: 3px solid var(--ink); }
.promise-list h3 { font-size: 1.15rem; margin-bottom: 6px; }
.promise-list p { margin: 0; color: var(--ink-2); font-size: .97rem; line-height: 1.6; }
@media (max-width: 900px) { .promise { grid-template-columns: 1fr; gap: 32px; } }
@media (max-width: 560px) { .promise-list { grid-template-columns: 1fr; } }

/* ---------- Trang bài viết ---------- */
.post-head { padding: 52px 0 0; background: linear-gradient(var(--paper), var(--paper)) 0 0 / 100% calc(100% - 180px) no-repeat; }
.post-head .meta { margin-bottom: 16px; }
.post-head h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.08; letter-spacing: -.03em; max-width: 22ch; }
.post-head .lead { font-size: 1.15rem; margin-bottom: 34px; }
.post-cover { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.post-cover .thumb { border-radius: 20px; box-shadow: 0 30px 60px -32px rgba(19,32,58,.5); }
.prose { max-width: 740px; margin: 0 auto; padding: 48px 24px 72px; }
.prose > p:first-of-type { font-size: 1.1rem; }
.prose h2 { font-size: 1.7rem; margin-top: 1.9em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--green); }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--green); color: var(--ink-2); }
.prose figure { margin: 1.8em 0; }
.prose .wp-block-table { overflow-x: auto; }
.prose .wp-block-table table { table-layout: auto; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; font-size: .95rem; line-height: 1.55; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.prose th, .prose td { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.prose th { white-space: nowrap; text-align: left; background: var(--ink); color: #fff; font-weight: 700; padding: 11px 14px; }
.prose .wp-block-table th, .prose .wp-block-table td { border: 0; }
.prose td { border-top: 1px solid var(--line) !important; padding: 11px 14px; vertical-align: top; }
.prose td + td, .prose th + th { border-left: 1px solid var(--line) !important; }
.prose th + th { border-left-color: rgba(255,255,255,.15) !important; }
.prose tr:first-child td { border-top: 0 !important; }
.prose tbody tr:nth-child(even) td { background: #FAFBFC; }
.prose table:not(:has(th)) td:first-child { width: 30%; font-weight: 700; color: var(--ink); background: var(--paper); }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--paper); padding: 2px 6px; border-radius: 5px; }
.prose pre { position: relative; margin: 1.4em 0 1.8em; padding: 44px 20px 20px; background: var(--ink); color: #E6ECF5; border-radius: 12px; font-family: var(--mono); font-size: .84rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.prose pre::before { content: "Prompt"; position: absolute; left: 20px; top: 13px; font-family: var(--font); font-size: .78rem; font-weight: 700; color: var(--mark); }
.prose pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.copy-btn { position: absolute; right: 12px; top: 9px; padding: 4px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: transparent; color: #fff; font: 600 .78rem var(--font); cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.12); }
.prose mark { background: var(--mark); color: inherit; padding: 0 2px; }
.prose img { border-radius: 10px; }
.prose .page-form { margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--ink); }
.disclosure { margin: 0 0 34px; padding: 14px 18px; background: #FFF7D6; border-radius: 10px; font-size: .92rem; line-height: 1.55; color: var(--ink-2); }
.disclosure p { margin: 0; }
.crosslink { margin-top: 44px; padding: 20px 22px; background: var(--green-soft); border-radius: 12px; }
.crosslink p { margin: 0; }
.post-foot { padding: 0 24px; max-width: 740px; margin: 0 auto 8px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 22px; border-top: 1px solid var(--line); }
.post-tags a { padding: 6px 14px; border-radius: 999px; background: var(--paper); color: var(--ink); font-size: .88rem; font-weight: 600; text-decoration: none; }
.post-tags a:hover { background: var(--ink); color: #fff; }

/* ---------- Danh sách / trang thường ---------- */
.page-head { padding: 56px 0 40px; background: var(--paper); }
.page-head h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.page-head .lead { margin-bottom: 0; }
.list-wrap { padding-top: 48px; padding-bottom: 88px; }
.empty { padding: 24px 0; color: var(--muted); }
.nav-links { display: flex; gap: 8px; margin-top: 56px; }
.nav-links .page-numbers { min-width: 44px; padding: 9px 14px; border: 2px solid var(--line); border-radius: 999px; text-align: center; text-decoration: none; color: var(--ink); font-weight: 700; }
.nav-links .current, .nav-links a.page-numbers:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.search-form { display: flex; gap: 8px; margin-bottom: 20px; }
.search-form input[type=search] { flex: 1; padding: 12px 16px; border: 2px solid var(--line); border-radius: 999px; font: inherit; }
.search-form input[type=submit] { padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font: 700 1rem var(--font); cursor: pointer; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .95rem; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: 1rem; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.notice { margin: 0 0 18px; padding: 12px 16px; font-weight: 600; border-radius: 10px; }
.notice.ok { background: var(--green-soft); color: var(--green-dark); }
.notice.err { background: #FDE8E8; color: #9B1C1C; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-foot { background: var(--ink); color: #A9B5C9; padding: 64px 0 28px; font-size: .95rem; }
.site-foot a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding-bottom: 36px; border-bottom: 1px solid #2A3A58; }
.foot-brand .brand { color: #fff; margin-bottom: 14px; }
.foot-brand p { max-width: 38ch; }
.foot-col h2 { font-size: 1rem; letter-spacing: 0; color: #fff; margin-bottom: 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 9px; }
.foot-col a { color: #D5DDEA; text-decoration: none; }
.foot-col a:hover { color: #fff; text-decoration: underline; }
.foot-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; font-size: .88rem; }
.foot-legal p { margin: 0; }
.foot-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 18px; margin: 0; padding: 0; }
.foot-menu a { color: #A9B5C9; }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr; gap: 28px; } }
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }

/* Hiện dần một lần khi tải trang (chỉ hero) */
@media (prefers-reduced-motion: no-preference) {
	.feature .thumb { animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
	.stamp { animation: stamp .45s .55s cubic-bezier(.3,1.6,.5,1) both; }
	@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
	@keyframes stamp { from { opacity: 0; transform: rotate(-10deg) scale(1.6); } }
}
.post-head:not(.has-cover) { background-size: 100% 100%; padding-bottom: 12px; }
.post-cover .thumb-fallback .fb-title { font-size: clamp(1.6rem, 4.4vw, 3.4rem); -webkit-line-clamp: 4; }
.post-cover .thumb-fallback .fb-cat { font-size: .95rem; padding: 8px 16px; }
.post-cover .thumb-fallback .fb-brand { font-size: 1.1rem; }
body { overflow-x: clip; }
@media (max-width: 1280px) { .stamp { right: -8px; } }
.prose pre.is-code::before { content: "Python"; }
.prose pre.is-script::before { content: "Kịch bản"; }
.prose pre.is-ssml::before { content: "SSML"; }
.prose pre.is-json::before { content: "JSON"; }
.prose pre.is-shell::before { content: "Lệnh"; }
