/* ============================================
   phamvankien.com — Theme 2026 (PHONG THỦY 100%)
   Nam Giáp Tý 1984 · Hải Trung Kim · Cung Đoài
   Tương sinh:  THỔ → KIM  (vàng đất, nâu đất)
   Bản mệnh:    KIM        (trắng, bạc, ghi)
   Tránh:       HỎA (đỏ, cam tươi) · THỦY (xanh dương — KIM sinh THỦY = hao mệnh)
   ============================================ */

:root{
  /* Primary: VÀNG ĐẤT (Thổ sinh Kim) — hợp mệnh nhất */
  --primary:#b8860b;
  --primary-hover:#8b6914;
  --primary-soft:#fdf6e3;
  /* Accent: NÂU ĐẤT đậm (Thổ) — thay xanh dương vốn hao Kim */
  --accent:#8b6914;
  --accent-hover:#6b4e16;
  /* Bản mệnh Kim: trắng/bạc/ghi */
  --bg:#f7f5ef;
  --surface:#ffffff;
  --surface-2:#faf8f1;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e7e2d6;
  --border-soft:#f0ece2;
  --shadow-sm:0 1px 2px rgba(31,41,55,.04), 0 1px 3px rgba(31,41,55,.06);
  --shadow-md:0 4px 12px rgba(31,41,55,.06);
  --shadow-lg:0 10px 30px rgba(31,41,55,.1);
  --radius:12px;
  --radius-sm:8px;
  --radius-lg:18px;
  --header-h:60px;
  --maxw:1600px;
  --sticky-top:72px;
  --toc-fab:52px;
  --toc-drawer-w:380px;
  --side-safe:16px;
  /* legacy tokens — giữ tương thích */
  --primary-color:var(--primary);
  --secondary-color:var(--accent);
  --accent-color:var(--accent);
  --text-color:var(--text);
  --border-color:var(--border);
  --bg-soft:var(--surface-2);
  --hover-bg:var(--primary-soft);
}

html[data-theme="dark"]{
  /* Dark mode vẫn giữ tone Thổ-Kim cho phong thủy nhất quán */
  --primary:#d4a017;
  --primary-hover:#f5b94a;
  --primary-soft:#2a1f0a;
  --accent:#c9a55a;
  --accent-hover:#e0bf78;
  --bg:#13110c;
  --surface:#1a1810;
  --surface-2:#221f15;
  --text:#e6e3d8;
  --muted:#9ca3af;
  --border:#2e2920;
  --border-soft:#231f18;
  --shadow-sm:0 1px 2px rgba(0,0,0,.4);
  --shadow-md:0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:0 10px 30px rgba(0,0,0,.6);
  --hover-bg:#2a1f0a;
}

*{ box-sizing:border-box; }
html{ text-size-adjust:100%; -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  /* System font stack — nhẹ, sắc nét, render native trên Win/Mac/Android/iOS, không tải Google Fonts */
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Apple Color Emoji","Segoe UI Emoji",sans-serif;
  font-weight:400;
  background:var(--bg); margin:0; color:var(--text); line-height:1.65;
  font-size:16px;
  letter-spacing:0;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  transition:background-color .2s ease, color .2s ease;
}
h1,h2,h3,h4,h5,h6{
  font-family:inherit;
  font-weight:600;
  letter-spacing:-0.01em;
  line-height:1.3;
  color:var(--text);
}
h1{ font-size:26px; font-weight:600; letter-spacing:-0.012em; }
h2{ font-size:21px; font-weight:600; }
h3{ font-size:18px; font-weight:600; }
h4{ font-size:16px; font-weight:600; }
strong,b{ font-weight:600; }
.post-content,.entry-content,.cat-long-body{
  font-size:16px; line-height:1.75; color:#1f2937; font-weight:400;
}
.post-content p,.entry-content p{ margin:0 0 1em; }
.post-content h2,.entry-content h2{ font-size:20px; font-weight:600; margin:1.6em 0 .5em; padding-left:12px; border-left:3px solid var(--primary); line-height:1.35; }
.post-content h3,.entry-content h3{ font-size:17px; font-weight:600; margin:1.3em 0 .45em; color:#1f2937; line-height:1.4; }
.post-content h4,.entry-content h4{ font-size:15.5px; font-weight:600; margin:1.1em 0 .4em; }
.post-content strong,.entry-content strong{ font-weight:600; color:#0f172a; }
.post-content a,.entry-content a{ color:var(--primary); font-weight:600; text-decoration:none; border-bottom:1px dashed transparent; transition:color .15s ease, border-color .15s ease; }
.post-content a:hover,.entry-content a:hover{ color:var(--primary-hover); border-bottom-color:var(--primary-hover); }
.post-content ul,.entry-content ul,.post-content ol,.entry-content ol{ margin:0 0 1.2em; padding-left:1.4em; }
.post-content li,.entry-content li{ margin:.3em 0; }
/* ✅ Ảnh trong post: FULL container width, căn giữa — theo yêu cầu user "không thu nhỏ" */
.post-content img,.entry-content img,.cat-long-body img{
  display:block !important;
  margin:1.2em auto !important;           /* căn giữa ngang */
  width:100% !important;                  /* fill full container — không hiển thị nhỏ */
  max-width:100% !important;
  height:auto !important;                  /* giữ tỉ lệ */
  border-radius:8px;
  box-shadow:0 1px 3px rgba(0,0,0,.06);
  object-fit:contain;
}
/* Trường hợp ảnh được wrap trong <a> (link cloaking) — link cũng block-level + center */
.post-content a:has(> img),.entry-content a:has(> img){
  display:block;
  text-align:center;
  margin:1.2em 0;
}
/* Ảnh trong figure (caption) — figure full-width, image trong nó căn giữa */
.post-content figure,.entry-content figure{
  margin:1.4em auto;
  text-align:center;
}
.post-content figure img,.entry-content figure img{ margin:0 auto .4em; }
.post-content figcaption,.entry-content figcaption{
  font-size:14px;color:var(--muted);text-align:center;font-style:italic;
}
.post-content blockquote,.entry-content blockquote{ margin:1.2em 0; padding:14px 18px; background:var(--surface-2); border-left:3px solid var(--primary); border-radius:6px; color:#374151; font-style:italic; }
.post-content table,.entry-content table{ width:100%; border-collapse:collapse; margin:1.2em 0; font-size:15.5px; }
.post-content th,.entry-content th,.post-content td,.entry-content td{ padding:10px 12px; border:1px solid var(--border); text-align:left; }
.post-content th,.entry-content th{ background:var(--surface-2); font-weight:600; }
img{ max-width:100%; height:auto; }
a{ text-decoration:none; color:inherit; transition:color .15s ease; }
a:hover{ color:var(--primary); }
a:focus-visible{ outline:3px solid rgba(184,134,11,.45); outline-offset:2px; border-radius:6px; }
.sr-only{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.skip-link{ position:absolute; left:-9999px; top:10px; padding:10px 14px; background:var(--surface); color:var(--text); border:2px solid var(--primary); border-radius:10px; z-index:10000; }
.skip-link:focus{ left:12px; }

.container{ width:100%; max-width:1380px; margin:0 auto; padding:0 24px; box-sizing:border-box; }
@media (max-width:768px){ .container{ padding:0 12px; } }

/* ==================== HEADER ==================== */
.topbar{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:9999;
  backdrop-filter:saturate(180%) blur(8px);
}
.topbar-inner{ display:flex; align-items:center; gap:16px; padding:10px 0; min-height:var(--header-h); }
.brand{ display:flex; align-items:center; min-width:180px; }
.brand img{ display:block; height:40px; width:auto; max-width:180px; object-fit:contain; }
.search-wrap{ flex:1; display:flex; justify-content:center; }
.search-form{ width:100%; max-width:520px; display:flex; border:1px solid var(--border); border-radius:999px; overflow:hidden; background:var(--surface-2); height:40px; }
.search-input{ flex:1; border:0; padding:0 16px; font-size:14px; outline:none; background:transparent; color:var(--text); height:100%; }
.search-input::placeholder{ color:var(--muted); }
.search-btn{ border:0; background:var(--primary); color:#fff; padding:0 16px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background-color .15s ease; }
.search-btn:hover{ background:var(--primary-hover); }

.nav-actions{ display:flex; gap:4px; align-items:center; flex-wrap:nowrap; }
.nav-link{ display:inline-block; padding:8px 12px; border-radius:8px; font-size:13px; font-weight:600; color:var(--text); white-space:nowrap; transition:background-color .15s ease, color .15s ease; }
.nav-link:hover{ background:var(--primary-soft); color:var(--primary); }

.theme-toggle{ border:1px solid var(--border); background:var(--surface-2); border-radius:999px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text); flex-shrink:0; transition:background-color .15s ease, border-color .15s ease, color .15s ease; }
.theme-toggle:hover{ background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
.theme-toggle svg{ width:18px; height:18px; }
.theme-toggle .icon-sun{ display:none; }
.theme-toggle .icon-moon{ display:block; }
html[data-theme="dark"] .theme-toggle .icon-sun{ display:block; }
html[data-theme="dark"] .theme-toggle .icon-moon{ display:none; }

.menu-toggle{ display:none; border:1px solid var(--border); background:var(--surface-2); border-radius:10px; width:40px; height:40px; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }
.menu-toggle:hover{ background:var(--primary-soft); color:var(--primary); }

/* Drawer */
.drawer-backdrop{ position:fixed; inset:0; background:rgba(31,41,55,.55); z-index:10000; opacity:0; pointer-events:none; transition:opacity .2s ease; }
.drawer-backdrop.open{ opacity:1; pointer-events:auto; }
.mobile-drawer{ position:fixed; top:0; right:-340px; width:340px; max-width:86vw; height:100vh; background:var(--surface); z-index:10001; box-shadow:-14px 0 30px rgba(0,0,0,.2); transition:right .22s ease; display:flex; flex-direction:column; padding:14px; }
.mobile-drawer.open{ right:0; }
.drawer-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 4px 12px; border-bottom:1px solid var(--border-soft); }
.drawer-title{ font-weight:700; font-size:16px; color:var(--text); }
.drawer-close{ border:1px solid var(--border); background:var(--surface-2); border-radius:10px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }
.drawer-close:hover{ background:var(--primary-soft); }
.mnav{ padding:10px 2px 0; display:grid; gap:8px; }
.mnav-item{ display:block; padding:12px; border:1px solid var(--border-soft); border-radius:10px; font-weight:600; color:var(--text); }
.mnav-item:hover{ background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
.no-scroll{ overflow:hidden; }

/* ==================== MAIN ==================== */
main.container{ margin-top:18px; }

/* ==================== STORIES / REEL ROW ==================== */
.story-section{ margin:14px 0 22px; }
.story-section-head{
  display:flex; align-items:center; justify-content:space-between;
  margin:0 0 12px;
}
.story-section-head h2{
  margin:0; font-size:16px; font-weight:800; color:var(--text);
  text-transform:uppercase; letter-spacing:.4px;
  display:inline-flex; align-items:center; gap:10px;
}
.story-section-head h2::before{
  content:""; width:4px; height:18px; background:var(--primary); border-radius:2px;
}
.story-section-head .more{
  font-size:13px; color:var(--primary); font-weight:700;
  display:inline-flex; align-items:center; gap:4px;
}
.story-section-head .more::after{ content:"›"; font-size:18px; line-height:1; }

.story-row{
  display:flex; gap:12px; margin:0;
  overflow-x:auto; scroll-snap-type:x mandatory;
  scrollbar-width:none; padding-bottom:6px;
  -webkit-overflow-scrolling:touch;
}
.story-row::-webkit-scrollbar{ display:none; }
.story-card{
  flex:0 0 150px; aspect-ratio:3/4;
  position:relative; border-radius:14px;
  overflow:hidden; scroll-snap-align:start;
  background:var(--surface-2); display:block;
  box-shadow:var(--shadow-sm);
  transition:transform .2s ease, box-shadow .2s ease;
}
.story-card:hover{ transform:translateY(-2px); box-shadow:var(--shadow-md); }
.story-card img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  transition:transform .3s ease;
}
.story-card:hover img{ transform:scale(1.04); }
.story-card .story-cap{
  position:absolute; left:0; right:0; bottom:0;
  padding:24px 10px 10px;
  background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,.92) 100%);
  color:#fff; font-size:12px; font-weight:700; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
@media(max-width:640px){ .story-card{ flex:0 0 120px; } }

/* ==================== HERO BOX (static, không auto-play) ==================== */
.hero-box{
  display:grid; grid-template-columns:2fr 1fr; gap:18px;
  margin:14px 0 28px;
}
.hero-main{
  position:relative; border-radius:var(--radius-lg);
  overflow:hidden; background:var(--surface);
  box-shadow:var(--shadow-md); display:block;
}
.hero-main img{ width:100%; aspect-ratio:16/10; object-fit:cover; display:block; transition:transform .4s ease; }
.hero-main:hover img{ transform:scale(1.02); }
.hero-main-cap{
  position:absolute; left:0; right:0; bottom:0;
  padding:50px 24px 22px;
  background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,.6) 50%, rgba(0,0,0,.92) 100%);
  color:#fff;
}
.hero-main-cat{
  display:inline-block; padding:4px 10px; margin-bottom:10px;
  background:var(--primary); color:#fff;
  border-radius:4px; font-size:11px; font-weight:800;
  text-transform:uppercase; letter-spacing:.5px;
}
.hero-main-title{
  font-size:24px; font-weight:800; line-height:1.25; margin:0;
  color:#fff;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.hero-main-excerpt{
  font-size:14px; margin:8px 0 0; opacity:.88; color:#fff;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

.hero-side{
  background:var(--surface); border-radius:var(--radius-lg);
  padding:8px 14px; box-shadow:var(--shadow-md);
  display:flex; flex-direction:column;
  border:1px solid var(--border-soft);
}
.hero-side-head{
  padding:10px 4px 8px; font-size:14px; font-weight:800;
  color:var(--text); text-transform:uppercase; letter-spacing:.4px;
  display:flex; align-items:center; justify-content:space-between;
  border-bottom:1px solid var(--border-soft);
}
.hero-side-head .more{ font-size:12px; color:var(--primary); font-weight:700; }
.hero-side-item{
  display:flex; gap:12px; padding:12px 4px; align-items:flex-start;
  border-bottom:1px dashed var(--border-soft);
}
.hero-side-item:last-child{ border-bottom:0; }
.hero-side-thumb{
  flex:0 0 92px; aspect-ratio:4/3; border-radius:var(--radius-sm);
  overflow:hidden; background:var(--surface-2);
}
.hero-side-thumb img{ width:100%; height:100%; object-fit:cover; }
.hero-side-body{ flex:1; min-width:0; }
.hero-side-cat{
  display:inline-block; font-size:10px; font-weight:800;
  color:var(--primary); text-transform:uppercase; letter-spacing:.4px;
  margin-bottom:4px;
}
.hero-side-title{
  font-size:13px; font-weight:700; line-height:1.4; color:var(--text); margin:0;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.hero-side-item:hover .hero-side-title{ color:var(--primary); }

@media(max-width:1024px){
  .hero-box{ grid-template-columns:1fr; }
}
@media(max-width:640px){
  .hero-main-title{ font-size:18px; }
  .hero-main-excerpt{ display:none; }
  .hero-side-thumb{ flex:0 0 80px; }
}

/* ==================== HERO SLIDER ==================== */
.hero-slider{
  position:relative; margin:14px 0 28px;
  border-radius:var(--radius-lg); overflow:hidden;
  background:var(--surface); box-shadow:var(--shadow-md);
}
.hero-slider .slides{
  display:flex; overflow-x:auto; scroll-snap-type:x mandatory;
  scroll-behavior:smooth; -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
}
.hero-slider .slides::-webkit-scrollbar{ display:none; }
.hero-slider .slide{
  flex:0 0 100%; scroll-snap-align:start;
  position:relative; display:block; aspect-ratio:21/9;
  min-height:380px; background:var(--surface-2);
}
.hero-slider .slide img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover; display:block;
}
.hero-slider .slide-caption{
  position:absolute; left:0; right:0; bottom:0;
  padding:60px 32px 28px;
  background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,.55) 45%, rgba(0,0,0,.92) 100%);
  color:#fff;
}
.hero-slider .slide-cat{
  display:inline-block; padding:4px 10px; margin-bottom:10px;
  background:var(--primary); color:#fff;
  border-radius:4px; font-size:11px; font-weight:800;
  text-transform:uppercase; letter-spacing:.5px;
}
.hero-slider .slide-title{
  font-size:26px; font-weight:800; line-height:1.25; margin:0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  color:#fff;
}
.hero-slider .slide-excerpt{
  font-size:14px; margin:8px 0 0; opacity:.85;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.hero-slider .nav{
  position:absolute; top:50%; transform:translateY(-50%);
  width:44px; height:44px; border-radius:999px;
  background:rgba(255,255,255,.92); border:0; cursor:pointer;
  color:var(--text); display:flex; align-items:center; justify-content:center;
  box-shadow:var(--shadow-md); z-index:2;
  transition:background-color .15s ease;
}
.hero-slider .nav:hover{ background:#fff; }
.hero-slider .nav.prev{ left:14px; }
.hero-slider .nav.next{ right:14px; }
.hero-slider .nav svg{ width:22px; height:22px; }
.hero-slider .dots{
  position:absolute; left:0; right:0; bottom:14px;
  display:flex; justify-content:center; gap:8px; z-index:2;
}
.hero-slider .dot{
  width:8px; height:8px; border-radius:999px;
  background:rgba(255,255,255,.5); border:0; cursor:pointer; padding:0;
  transition:all .2s ease;
}
.hero-slider .dot.active{ background:#fff; width:24px; }
@media(max-width:768px){
  .hero-slider .slide{ aspect-ratio:16/10; min-height:240px; }
  .hero-slider .slide-caption{ padding:40px 16px 36px; }
  .hero-slider .slide-title{ font-size:18px; }
  .hero-slider .slide-excerpt{ display:none; }
  .hero-slider .nav{ width:36px; height:36px; }
}

/* ==================== STREAM / TIMELINE ==================== */
.stream{
  display:grid; grid-template-columns:1fr 1fr; gap:18px;
  margin:0 0 30px;
}
.stream-item{
  background:var(--surface); border:1px solid var(--border-soft);
  border-radius:var(--radius); overflow:hidden;
  display:flex; gap:14px; padding:14px;
  transition:box-shadow .2s ease, transform .2s ease;
}
.stream-item:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.stream-thumb{
  flex:0 0 160px; aspect-ratio:4/3;
  border-radius:var(--radius-sm); overflow:hidden;
  background:var(--surface-2);
}
.stream-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.stream-body{
  flex:1; min-width:0; display:flex; flex-direction:column; gap:6px;
}
.stream-cat{
  display:inline-block; align-self:flex-start;
  font-size:11px; font-weight:800;
  color:var(--primary); text-transform:uppercase; letter-spacing:.4px;
}
.stream-title{
  font-size:15px; font-weight:700; line-height:1.4; margin:0;
  color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.stream-item:hover .stream-title{ color:var(--primary); }
.stream-meta{
  font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center;
}
.stream-meta::before{ content:""; width:3px; height:3px; border-radius:50%; background:var(--muted); display:inline-block; }
.stream-meta:first-child::before{ display:none; }
.stream-excerpt{
  font-size:13px; color:var(--muted); margin:0; line-height:1.5;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
@media(max-width:1024px){ .stream{ grid-template-columns:1fr; } }
@media(max-width:640px){
  .stream-item{ padding:10px; gap:10px; }
  .stream-thumb{ flex:0 0 110px; }
  .stream-title{ font-size:14px; }
  .stream-excerpt{ display:none; }
}

/* ==================== KHỐI CHUYÊN ĐỀ (Topic) ==================== */
.topic{ margin:0 0 32px; }
.topic-head{
  display:flex; align-items:center; justify-content:space-between;
  margin:0 0 16px; padding-bottom:12px;
  border-bottom:2px solid var(--primary);
}
.topic-head h2{
  margin:0; font-size:20px; font-weight:800;
  text-transform:uppercase; letter-spacing:.4px; color:var(--text);
  display:inline-flex; align-items:center; gap:10px;
}
.topic-head h2 a{ color:var(--text); }
.topic-head h2 a:hover{ color:var(--primary); }
.topic-head h2::before{
  content:""; width:5px; height:22px; background:var(--primary); border-radius:2px;
}
.topic-more{
  font-size:13px; font-weight:700; color:var(--primary);
  display:inline-flex; align-items:center; gap:4px;
  text-transform:uppercase; letter-spacing:.3px;
}
.topic-more:hover{ color:var(--primary-hover); }
.topic-more::after{ content:"›"; font-size:18px; line-height:1; }

.topic-grid{
  display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:18px;
}
.topic-hero{
  display:block; background:var(--surface);
  border:1px solid var(--border-soft); border-radius:var(--radius);
  overflow:hidden; transition:box-shadow .2s ease, transform .2s ease;
}
.topic-hero:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); }
.topic-hero img{ width:100%; aspect-ratio:16/10; object-fit:cover; display:block; background:var(--surface-2); }
.topic-hero .t{
  padding:14px 16px 16px; font-weight:800; font-size:17px;
  line-height:1.35; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.topic-hero:hover .t{ color:var(--primary); }
.topic-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:14px; }
.topic-list li{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-sm); padding:10px; display:flex; gap:10px; transition:background-color .15s ease; }
.topic-list li:hover{ background:var(--surface-2); }
.topic-list .ti-thumb{
  flex:0 0 84px; aspect-ratio:4/3; border-radius:var(--radius-sm);
  overflow:hidden; background:var(--surface-2);
}
.topic-list .ti-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.topic-list .ti-title{
  flex:1; min-width:0; font-size:13px; font-weight:700; line-height:1.4; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.topic-list li:hover .ti-title{ color:var(--primary); }
@media(max-width:1024px){
  .topic-grid{ grid-template-columns:1fr 1fr; }
  .topic-list:last-child{ display:none; }
}
@media(max-width:640px){
  .topic-grid{ grid-template-columns:1fr; }
  .topic-list:nth-child(2){ display:flex; }
  .topic-list:last-child{ display:none; }
}

/* ==================== HOME FEATURE (HERO) ==================== */
.news-box{ margin:8px 0 14px; }
.news-box .box-header{ display:flex; justify-content:space-between; align-items:center; padding-bottom:10px; border-bottom:1px solid var(--border); margin-bottom:12px; }
.news-box .box-title{ display:inline-flex; align-items:center; gap:10px; font-size:18px; font-weight:800; color:var(--text); text-transform:uppercase; letter-spacing:.3px; }
.news-box .box-title::before{ content:""; width:4px; height:20px; background:var(--primary); border-radius:2px; }

.home-feature{
  display:grid; grid-template-columns:2fr 1fr; gap:16px;
  margin:14px 0 26px; background:transparent; border:0; box-shadow:none;
}
.home-feature-left{ position:relative; border-radius:var(--radius-lg); overflow:hidden; background:var(--surface); box-shadow:var(--shadow-md); }
.home-feature-left .hero-img{ width:100%; height:480px; object-fit:cover; display:block; transition:transform .4s ease; }
.home-feature-left:hover .hero-img{ transform:scale(1.02); }
.home-feature-left .hero-title{
  position:absolute; inset:auto 0 0 0; padding:40px 22px 22px;
  background:linear-gradient(180deg, transparent 0%, rgba(0,0,0,.65) 55%, rgba(0,0,0,.92) 100%);
  color:#fff; font-size:22px; font-weight:800; line-height:1.3;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}

.home-feature-right{ background:var(--surface); border-radius:var(--radius-lg); padding:4px; box-shadow:var(--shadow-md); display:flex; flex-direction:column; }
.home-feature-right .side-item{
  display:flex; gap:12px; padding:12px; border-radius:var(--radius-sm);
  color:var(--text); align-items:center;
  border-bottom:1px solid var(--border-soft);
  transition:background-color .15s ease;
}
.home-feature-right .side-item:last-child{ border-bottom:0; }
.home-feature-right .side-item:hover{ background:var(--surface-2); }
.home-feature-right .side-thumb{ width:96px; height:68px; border-radius:var(--radius-sm); object-fit:cover; flex-shrink:0; background:var(--surface-2); }
.home-feature-right .side-title{ font-size:14px; font-weight:700; line-height:1.35; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--text); }
.home-feature-right .side-item:hover .side-title{ color:var(--primary); }

/* ==================== GRID 6 ==================== */
.home-grid6{ display:grid; grid-template-columns:repeat(6,1fr); gap:14px; margin:16px 0 30px; }
.home-card{ background:var(--surface); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); border:1px solid var(--border-soft); transition:transform .2s ease, box-shadow .2s ease; display:block; }
.home-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.home-card img{ width:100%; aspect-ratio:3/2; object-fit:cover; display:block; background:var(--surface-2); height:auto; }
.home-card .card-title{ padding:10px 12px 14px; font-size:13px; font-weight:700; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.home-card:hover .card-title{ color:var(--primary); }

/* ==================== NỔI BẬT (MOST DOWNLOAD) ==================== */
.most-download{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-lg); padding:22px; margin:0 0 28px; box-shadow:var(--shadow-sm); }
.most-download .md-title{ font-size:18px; font-weight:800; margin:0 0 16px; color:var(--text); text-transform:uppercase; letter-spacing:.3px; display:inline-flex; align-items:center; gap:10px; }
.most-download .md-title::before{ content:""; width:4px; height:20px; background:var(--primary); border-radius:2px; }
.md-grid{ list-style:none; padding:0; margin:0; display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px 24px; }
.md-item{ list-style:none; display:flex; gap:14px; align-items:flex-start; }
.md-rank{
  font-size:36px; font-weight:900; line-height:1;
  background:linear-gradient(180deg, var(--primary), var(--primary-hover));
  -webkit-background-clip:text; background-clip:text;
  -webkit-text-fill-color:transparent; color:var(--primary);
  min-width:48px; font-feature-settings:"tnum";
}
.md-item a{ font-weight:700; font-size:15px; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.md-item a:hover{ color:var(--primary); }
.md-meta{ font-size:12px; color:var(--muted); margin-top:4px; }

/* ==================== CATEGORY BOXES ==================== */
.cat-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:18px; margin:0 0 28px; }
.cat-grid4{ display:grid; grid-template-columns:repeat(4, 1fr); gap:18px; margin:0 0 28px; }
.grid-box{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow-sm); transition:box-shadow .2s ease; display:flex; flex-direction:column; }
.grid-box:hover{ box-shadow:var(--shadow-md); }
.grid-box-head{ padding:14px 16px 12px; border-bottom:1px solid var(--border-soft); }
.grid-box-head a,
.grid-box-head .box-title{
  font-weight:800; text-transform:uppercase; letter-spacing:.3px;
  color:var(--text); font-size:14px;
  display:inline-flex; align-items:center; gap:8px;
}
.grid-box-head a::before,
.grid-box-head .box-title::before{ content:""; width:3px; height:16px; background:var(--primary); border-radius:2px; }
.grid-box-head a:hover{ color:var(--primary); }
.grid-box-hero{ display:block; }
.grid-box-hero img{ width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:var(--surface-2); height:auto; transition:transform .3s ease; }
.grid-box-hero:hover img{ transform:scale(1.02); }
.grid-box-hero-title{ padding:12px 16px; font-weight:700; font-size:15px; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.grid-box-hero:hover .grid-box-hero-title{ color:var(--primary); }
.grid-box-list{ padding:0 16px 10px; flex:1; }
.grid-box-list a{ display:block; padding:10px 0; border-top:1px solid var(--border-soft); font-weight:600; font-size:13px; line-height:1.45; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.grid-box-list a:first-child{ border-top:0; }
.grid-box-list a:hover{ color:var(--primary); }
.grid-box-more{
  display:block; margin:12px 16px 16px; text-align:center;
  background:var(--surface-2); padding:10px 12px; border-radius:var(--radius-sm);
  font-weight:700; color:var(--text); border:1px solid var(--border-soft);
  font-size:13px; text-transform:uppercase; letter-spacing:.3px;
  transition:background-color .15s ease, color .15s ease, border-color .15s ease;
}
.grid-box-more:hover{ background:var(--primary); color:#fff; border-color:var(--primary); }

/* ==================== BACK TO TOP ==================== */
#backToTop{ position:fixed; right:20px; bottom:20px; width:48px; height:48px; background:var(--primary); color:#fff; border:none; border-radius:50%; cursor:pointer; display:none; align-items:center; justify-content:center; box-shadow:var(--shadow-lg); z-index:999; transition:transform .2s ease, background-color .2s ease; }
#backToTop:hover{ transform:translateY(-3px); background:var(--primary-hover); }

/* ==================== FOOTER ==================== */
.site-footer{ margin-top:40px; background:var(--surface); border-top:1px solid var(--border); color:var(--text); }
.site-footer a{ color:var(--text); font-weight:600; }
.site-footer a:hover{ color:var(--primary); }
.footer-menu{ background:var(--surface-2); border-bottom:1px solid var(--border); }
.footer-menu .footer-menu-inner{ display:flex; gap:18px; align-items:center; padding:12px 16px; flex-wrap:wrap; }
.footer-menu a{ color:var(--text); font-weight:700; text-transform:uppercase; font-size:13px; letter-spacing:.3px; }
.footer-menu a:hover{ color:var(--primary); }
.footer-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:32px; padding:32px 16px 36px; }
.footer-title{ font-weight:800; margin:0 0 14px; color:var(--text); font-size:15px; text-transform:uppercase; letter-spacing:.3px; }
.footer-links{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.footer-links a{ color:var(--muted); font-size:14px; font-weight:500; }
.footer-links a:hover{ color:var(--primary); }
.footer-social a{ display:flex; align-items:center; gap:10px; padding:6px 0; font-size:14px; color:var(--muted); font-weight:500; }
.footer-social a:hover{ color:var(--primary); }
.footer-ico{ width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; }

/* ==================== POST/CAT PAGE — full container width 1380px ==================== */
.post-wrapper{ margin:24px 0; background:var(--surface); padding:28px 36px; border-radius:var(--radius-lg); box-shadow:var(--shadow-sm); border:1px solid var(--border-soft); }
.post-wrapper.cat-wrap{ padding:22px 26px; }
.breadcrumb{ font-size:12px; color:var(--muted); margin-bottom:14px; text-transform:uppercase; letter-spacing:.4px; font-weight:600; }
.breadcrumb a{ color:var(--primary); }
h1.post-title{ font-size:32px; font-weight:800; color:var(--text); margin:0 0 14px; line-height:1.25; overflow-wrap:break-word; }
.post-meta{ font-size:13px; color:var(--muted); margin-bottom:22px; padding-bottom:14px; border-bottom:1px solid var(--border-soft); }
.post-content{ font-size:17px; line-height:1.75; color:var(--text); }
.post-content p{ margin:0 0 18px; }
.post-content table{ width:100%; border-collapse:collapse; margin:22px 0; border:1px solid var(--border); display:table; table-layout:fixed; }
.post-content th, .post-content td{ border:1px solid var(--border); padding:12px 14px; vertical-align:top; text-align:left; word-wrap:break-word; }
.post-content th{ background:var(--surface-2); font-weight:700; color:var(--primary); }
.post-content img{ max-width:100%!important; height:auto!important; display:block; margin:22px auto; border-radius:var(--radius-sm); }
.post-content h2, .post-content h3{ color:var(--text); margin:28px 0 14px; font-weight:800; line-height:1.3; }
.post-content h2{ font-size:24px; padding-left:14px; border-left:4px solid var(--primary); }
.post-content h3{ font-size:20px; }
.post-content ul, .post-content ol{ padding-left:22px; margin:0 0 18px; }
.post-content li{ margin-bottom:8px; }
.post-content a{ color:var(--primary); font-weight:600; text-decoration:none; border-bottom:1px dashed transparent; }
.post-content a:hover{ color:var(--primary-hover); border-bottom-color:var(--primary-hover); }
.post-content blockquote{ border-left:4px solid var(--primary); background:var(--surface-2); padding:12px 18px; margin:18px 0; color:var(--text); border-radius:0 var(--radius-sm) var(--radius-sm) 0; }

.btn-download-wrapper{ text-align:center; margin:36px 0; padding:24px; background:var(--primary-soft); border:2px dashed var(--primary); border-radius:var(--radius); }
.btn-download-now{ display:inline-block; padding:14px 32px; background:var(--primary); color:#fff; font-size:17px; font-weight:800; border-radius:999px; box-shadow:var(--shadow-md); text-transform:uppercase; letter-spacing:.5px; }
.btn-download-now:hover{ background:var(--primary-hover); color:#fff; transform:translateY(-2px); }
.note-download{ margin-top:10px; font-size:13px; color:var(--muted); font-style:italic; }

.post-footer-box{ margin-top:28px; border:1px solid var(--border-soft); background:var(--surface-2); padding:16px 18px; border-radius:var(--radius); display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:14px; }
.cat-label{ font-weight:700; color:var(--primary); font-size:14px; }
.share-area{ display:flex; gap:10px; }
.share-btn{ width:38px; height:38px; border-radius:50%; border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--text); background:var(--surface); }
.share-btn:hover{ background:var(--primary); color:#fff; border-color:var(--primary); }
.share-btn svg{ width:18px; height:18px; display:block; }

.maybe-interested{ border:1px solid var(--border-soft); border-radius:var(--radius-lg); padding:22px; margin:28px 0; background:var(--surface); }
.maybe-header{ font-size:16px; font-weight:800; color:var(--text); margin-bottom:16px; text-transform:uppercase; letter-spacing:.3px; display:inline-flex; align-items:center; gap:10px; }
.maybe-header::before{ content:""; width:4px; height:18px; background:var(--primary); border-radius:2px; }
.maybe-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.maybe-item{ border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; background:var(--surface); transition:transform .2s ease, box-shadow .2s ease; }
.maybe-item:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.maybe-thumb{ aspect-ratio:16/10; overflow:hidden; background:var(--surface-2); }
.maybe-thumb img{ width:100%; height:100%; object-fit:cover; }
.maybe-title{ padding:10px; font-size:13px; font-weight:700; color:var(--text); line-height:1.4; }

/* ==================== CATEGORY PAGE ==================== */
.cat-wrap{ padding:22px; }
.cat-head{ margin:12px 0 18px; }
.cat-head h1{ margin:0; font-size:28px; font-weight:800; color:var(--text); }
.cat-head p{ margin:8px 0 0; color:var(--muted); font-size:14px; line-height:1.7; }
.cat-feature{ display:grid; grid-template-columns:2fr 1fr; gap:16px; margin-top:16px; }
.cat-hero{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-lg); overflow:hidden; }
.cat-hero img{ width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:var(--surface-2); height:auto; }
.cat-hero .t{ padding:14px 16px; font-weight:800; font-size:20px; line-height:1.3; color:var(--text); }
.cat-hero .ex{ padding:0 16px 16px; color:var(--muted); font-size:14px; line-height:1.6; }
.cat-right{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.cat-mcard{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; display:block; transition:transform .2s ease; }
.cat-mcard:hover{ transform:translateY(-2px); }
.cat-mcard img{ width:100%; aspect-ratio:16/10; object-fit:cover; display:block; background:var(--surface-2); height:auto; }
.cat-mcard .t{ padding:10px 12px 12px; font-weight:700; font-size:13px; line-height:1.4; color:var(--text); }
.cat-mcard:hover .t{ color:var(--primary); }
.cat-grid6{ display:grid; grid-template-columns:repeat(6, 1fr); gap:14px; margin:16px 0 18px; }
.cat-scard{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); overflow:hidden; display:block; transition:transform .2s ease; }
.cat-scard:hover{ transform:translateY(-2px); }
.cat-scard img{ width:100%; aspect-ratio:4/3; object-fit:cover; display:block; background:var(--surface-2); height:auto; }
.cat-scard .t{ padding:10px; font-weight:700; font-size:13px; line-height:1.4; color:var(--text); }
.cat-scard:hover .t{ color:var(--primary); }
.cat-cols-row{ display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin:0 0 14px; }
.cat-col{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); padding:10px; }
.cat-row-item{ display:flex; gap:10px; align-items:center; padding:8px; border-radius:var(--radius-sm); }
.cat-row-item:hover{ background:var(--surface-2); }
.cat-row-item img{ width:80px; height:60px; object-fit:cover; border-radius:var(--radius-sm); background:var(--surface-2); flex-shrink:0; }
.cat-row-title{ font-weight:700; font-size:14px; line-height:1.4; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cat-row-item:hover .cat-row-title{ color:var(--primary); }
.load-more-wrap{ display:flex; justify-content:center; margin:18px 0 10px; }
.btn-more{ padding:11px 22px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--text); font-weight:700; cursor:pointer; font-size:14px; transition:all .15s ease; }
.btn-more:hover{ background:var(--primary); color:#fff; border-color:var(--primary); }
.btn-more[disabled]{ opacity:.5; cursor:not-allowed; }
.cat-long{ margin-top:22px; padding-top:22px; border-top:1px solid var(--border-soft); }
.cat-long-title{ display:none; }
.cat-long-body{ font-size:16px; color:var(--text); line-height:1.75; }
.cat-long-body img{ max-width:100%; height:auto; border-radius:var(--radius-sm); }

/* ==================== LEGACY SUPPORT ==================== */
.top-hot-wrapper{ display:grid; grid-template-columns:2fr 1fr; gap:20px; margin-bottom:30px; background:var(--surface); padding:20px; border-radius:var(--radius-lg); border:1px solid var(--border-soft); }
.top-big-post img{ width:100%; height:380px; object-fit:cover; border-radius:var(--radius); }
.top-big-post h1{ font-size:24px; margin:15px 0 5px; color:var(--text); }
.sub-item{ display:flex; gap:12px; margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid var(--border-soft); }
.sub-item:last-child{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
.sub-item .thumb{ width:100px; height:70px; object-fit:cover; border-radius:var(--radius-sm); flex-shrink:0; }
.sub-item a{ font-weight:700; font-size:14px; color:var(--text); }
.sub-item a:hover{ color:var(--primary); }
.cat-row{ display:grid; grid-template-columns:1fr 1fr; gap:30px; margin-bottom:30px; }
.news-box .box-body{ display:grid; grid-template-columns:1.2fr 1fr; gap:20px; }
.main-post .thumb{ width:100%; height:220px!important; object-fit:cover; border-radius:var(--radius-sm); display:block; margin-bottom:10px; background:var(--surface-2); }
.main-post div{ font-weight:700; font-size:16px; color:var(--text); }
.directory-section{ grid-column:1/-1; border:1px solid var(--border-soft); border-radius:var(--radius-lg); margin-top:30px; background:var(--surface); }
.dir-header{ background:var(--primary); color:#fff; padding:12px 20px; font-weight:800; text-transform:uppercase; letter-spacing:.3px; }
.dir-grid{ display:grid; grid-template-columns:repeat(3,1fr); }
.dir-item{ padding:15px; border-bottom:1px solid var(--border-soft); border-right:1px solid var(--border-soft); display:flex; align-items:center; min-width:0; color:var(--text); }
.dir-item:nth-child(3n){ border-right:none; }
.dir-icon svg{ width:32px; height:32px; fill:var(--primary); margin-right:15px; }

/* ==================== TOC ==================== */
.post-content h2, .post-content h3, .post-content h4{ scroll-margin-top:var(--sticky-top); }
@media (min-width:901px){
  .toc-fab, .toc-backdrop, .toc-drawer, .mobile-drawer, .drawer-backdrop { display:none !important; }
  .toc-dots{ display:block; }
}
@media (max-width:900px){ .toc-dots{ display:none !important; } }
.toc-dots{ position:fixed; right:calc(var(--side-safe) + env(safe-area-inset-right, 0px)); top:50%; transform:translateY(-50%); z-index:12080; }
.toc-dots .toc-box{ border:0; background:transparent; padding:8px; margin:0; }
.toc-dots .toc-title{ display:none; }
.toc-dots .toc-item-lv-3{ display:none; }
.toc-dots .toc-body ul{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:10px; }
.toc-dots .toc-link{ width:12px; height:12px; display:block; border-radius:999px; border:2px solid var(--muted); background:var(--muted); font-size:0; color:transparent; transition:all .12s ease; opacity:.5; }
.toc-dots .toc-link:hover,
.toc-dots .toc-link.is-active{ background:var(--primary); border-color:var(--primary); opacity:1; transform:scale(1.2); }
.toc-fab{ position:fixed; left:calc(var(--side-safe) + env(safe-area-inset-left, 0px)); bottom:calc(18px + env(safe-area-inset-bottom, 0px)); width:var(--toc-fab); height:var(--toc-fab); border-radius:999px; border:1px solid var(--border); background:var(--surface); box-shadow:var(--shadow-md); display:flex; align-items:center; justify-content:center; z-index:12090; cursor:pointer; color:var(--text); }
.toc-backdrop{ position:fixed; inset:0; background:rgba(31,41,55,.55); z-index:12085; opacity:0; pointer-events:none; transition:opacity .2s ease; }
.toc-backdrop.open{ opacity:1; pointer-events:auto; }
.toc-drawer{ position:fixed; top:0; right:-420px; width:var(--toc-drawer-w); max-width:92vw; height:100vh; background:var(--surface); z-index:12088; box-shadow:-14px 0 30px rgba(0,0,0,.2); transition:right .24s ease; display:flex; flex-direction:column; }
.toc-drawer.open{ right:0; }
.toc-drawer-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 14px 10px; border-bottom:1px solid var(--border-soft); }
.toc-drawer-title{ font-weight:800; font-size:16px; color:var(--text); }
.toc-drawer-close{ border:1px solid var(--border); background:var(--surface-2); border-radius:10px; width:40px; height:40px; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }
.toc-drawer-body{ padding:12px 14px 20px; overflow:auto; }
.toc-drawer .toc-box{ border:0; background:transparent; padding:0; margin:0; }
.toc-drawer .toc-title{ display:none; }
.toc-drawer .toc-body ul{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.toc-drawer .toc-link{ display:block; padding:10px 12px; border-radius:var(--radius-sm); border:1px solid var(--border-soft); background:var(--surface); color:var(--text); font-weight:600; }
.toc-drawer .toc-link:hover{ background:var(--primary-soft); border-color:var(--primary); color:var(--primary); }
body.toc-open{ overflow:hidden; }

/* ==================== RESPONSIVE ==================== */
@media (max-width:1200px){
  .home-grid6{ grid-template-columns:repeat(4,1fr); }
  .cat-grid4{ grid-template-columns:repeat(3, 1fr); }
  .cat-grid6{ grid-template-columns:repeat(4, 1fr); }
  .md-grid{ grid-template-columns:1fr 1fr; }
}
@media (max-width:1024px){
  .nav-link{ padding:6px 8px; font-size:12px; }
  .home-feature{ grid-template-columns:1fr; }
  .home-feature-left .hero-img{ height:360px; }
  .cat-feature{ grid-template-columns:1fr; }
  .cat-grid4{ grid-template-columns:repeat(2, 1fr); }
  .maybe-grid{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width:900px){
  .nav-actions{ display:none; }
  .menu-toggle{ display:flex; }
  .search-wrap{ justify-content:flex-start; }
  .search-form{ max-width:none; }
  .cat-grid2{ grid-template-columns:1fr; }
  .home-grid6{ grid-template-columns:repeat(3,1fr); }
  .md-grid{ grid-template-columns:1fr; }
  .footer-grid{ grid-template-columns:1fr; gap:20px; padding:24px 16px 28px; }
  .dir-grid{ grid-template-columns:1fr; }
  .dir-item{ border-right:none; }
  .cat-right{ grid-template-columns:1fr 1fr; }
  .cat-grid6{ grid-template-columns:repeat(3, 1fr); }
  .cat-cols-row{ grid-template-columns:1fr; }
  :root{ --sticky-top:112px; --toc-drawer-w:86vw; --side-safe:12px; }
}
@media (max-width:640px){
  .topbar-inner{
    display:grid;
    grid-template-columns:auto 1fr auto auto;
    grid-template-areas:"brand spacer toggle theme" "search search search search";
    gap:10px; padding:10px 0;
  }
  .brand{ grid-area:brand; min-width:auto; }
  .brand img{ max-width:140px; height:36px; }
  .menu-toggle{ grid-area:toggle; }
  .theme-toggle{ grid-area:theme; width:40px; height:40px; }
  .search-wrap{ grid-area:search; width:100%; }
  .search-form{ width:100%; }
  .container{ padding:0 12px; }
  h1.post-title{ font-size:24px; }
  .post-wrapper{ padding:18px 16px; }
  .post-content{ font-size:16px; }
  .post-content h2{ font-size:20px; }
  .post-content h3{ font-size:18px; }
  .post-content table{ display:block; overflow-x:auto; white-space:nowrap; table-layout:auto; }
  .post-content th, .post-content td{ min-width:140px; white-space:normal; font-size:15px; }
  .home-feature-left .hero-img{ height:240px; }
  .home-feature-left .hero-title{ font-size:17px; padding:24px 16px 16px; }
  .home-feature-right .side-thumb{ width:80px; height:58px; }
  .home-grid6{ grid-template-columns:repeat(2,1fr); }
  .cat-grid4{ grid-template-columns:1fr; }
  .maybe-grid{ grid-template-columns:repeat(2,1fr); }
  .cat-grid6{ grid-template-columns:repeat(2, 1fr); }
  .cat-right{ grid-template-columns:1fr; }
  .top-hot-wrapper, .cat-row, .news-box .box-body{ grid-template-columns:1fr; }
  .top-big-post img{ height:220px; }
}

@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior:auto !important; }
  a, .maybe-item, .home-card, .grid-box, #backToTop,
  .home-feature-left .hero-img, .grid-box-hero img{ transition:none !important; transform:none !important; }
}

/* ====================================================
   COUPON CARD (mục 6) — auto inject mã giảm giá vào post
   ==================================================== */
.coupon-card{
  display:flex; gap:14px; align-items:stretch;
  background:linear-gradient(135deg, #fdf6e3 0%, #faf0d4 100%);
  border:1.5px dashed var(--primary);
  border-radius:12px; padding:14px;
  margin:1.5em 0;
  box-shadow:0 2px 8px rgba(184,134,11,.08);
  position:relative;
}
.coupon-card::before{
  content:""; position:absolute; left:-1px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; background:var(--bg); border-radius:50%; border:1.5px dashed var(--primary); border-right:none; border-top:none;
}
.coupon-card::after{
  content:""; position:absolute; right:-1px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; background:var(--bg); border-radius:50%; border:1.5px dashed var(--primary); border-left:none; border-bottom:none;
}
.coupon-thumb{ flex:0 0 90px; }
.coupon-thumb img{ width:90px; height:90px; object-fit:cover; border-radius:8px; display:block; margin:0 !important; }
.coupon-body{ flex:1; display:flex; flex-direction:column; justify-content:center; gap:6px; }
.coupon-tag{ font-size:11px; color:var(--accent); font-weight:700; text-transform:uppercase; letter-spacing:.5px; }
.coupon-title{ font-size:15px; font-weight:600; color:#1f2937; line-height:1.35; margin:0 !important; }
.coupon-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:4px; }
.coupon-code{
  display:inline-block; padding:6px 14px;
  background:#fff; border:2px dashed var(--primary); color:var(--accent);
  font-family:Consolas,monospace; font-weight:700; font-size:14px;
  border-radius:6px; letter-spacing:1px;
}
.coupon-btn{
  display:inline-block; padding:7px 18px;
  background:var(--primary); color:#fff !important;
  border:0; border-radius:6px; font-weight:700; font-size:13px;
  text-decoration:none !important;
  transition:background .15s;
}
.coupon-btn:hover{ background:var(--primary-hover); color:#fff !important; }
.coupon-meta{ font-size:11px; color:var(--muted); }
.coupon-exp{ background:#fff; padding:2px 8px; border-radius:10px; }
@media (max-width:560px){
  .coupon-card{ flex-direction:column; }
  .coupon-thumb img{ width:100%; height:160px; }
}

/* ====================================================
   BANNER SLOT (mục 7-8) — Ads + Banner manager
   ==================================================== */
.banner-slot{
  margin:1.6em auto;
  text-align:center;
  position:relative;
  max-width:100%;
}
.banner-slot .banner-label{
  display:block; font-size:10px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.6px;
  margin-bottom:6px; opacity:.7;
}
.banner-slot img,
.banner-slot video,
.banner-slot iframe,
.banner-slot ins{
  display:block; max-width:100%; height:auto; margin:0 auto !important;
  border-radius:8px;
}
.banner-embed{ overflow:hidden; }
.banner-adsense{ min-height:90px; }
@media (max-width:560px){
  .banner-slot{ margin:1.2em auto; }
}
/* ==================== MSN GRID CHUẨN: MỖI BOX LÀ 1 KHUÔN ==================== */
.pvk-msn-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense; /* Tự động xếp gạch lấp ô trống */
    gap: 16px;
    margin-bottom: 40px;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 30px;
}
@media (max-width: 1024px) { .pvk-msn-box { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .pvk-msn-box { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .pvk-msn-box { grid-template-columns: 1fr; display: flex; flex-direction: column; } }

/* THẺ BÀI VIẾT CHUNG */
.msn-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.msn-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-2px); }

/* BÀI NHỎ (Chiếm 1 ô vuông) */
.msn-card.is-normal { grid-column: span 1; grid-row: span 1; }
.msn-card.is-normal .msn-card-img { width: 100%; aspect-ratio: 16/11; object-fit: cover; border-bottom: 1px solid #f3f4f6; }
.msn-card.is-normal .msn-card-body { padding: 12px; display: flex; flex-direction: column; flex: 1; }

/* BÀI TO ĐẦU TIÊN (Chiếm 2x2 ô) - Chữ đè lên ảnh */
.msn-card.is-large { grid-column: span 2; grid-row: span 2; }
.msn-card.is-large .msn-card-img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }
.msn-card-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 60px 16px 16px; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%); color: #fff; z-index: 2; }

/* NỘI DUNG TEXT */
.msn-card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; margin-bottom: 8px; font-weight: 500; text-transform: uppercase; }
.msn-card.is-large .msn-card-meta { color: #d1d5db; }
.msn-card-meta img { width: 16px; height: 16px; border-radius: 50%; }
.msn-card-title { font-size: 15px; font-weight: 700; line-height: 1.4; margin: 0 0 10px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.msn-card:hover .msn-card-title { color: #0056b3; }
.msn-card.is-large .msn-card-title { color: #fff; font-size: 22px; -webkit-line-clamp: 3; }
.msn-card.is-large:hover .msn-card-title { color: #fff; text-decoration: underline; }
.msn-card-actions { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #6b7280; margin-top: auto; }
.msn-card-actions span { display: flex; align-items: center; gap: 4px; }
.msn-card-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ==================== BOX QUẢNG CÁO SHOPEE (Đúng theo ảnh bạn gửi) ==================== */
.msn-ad-card {
    grid-column: span 1;
    grid-row: span 2; /* Box dọc dài bằng 2 ô vuông */
    background: #fff;
    border: 1px solid #ffcc80;
}
.msn-ad-card .ad-top { background: #ff5722; color: white; padding: 25px 10px 20px; text-align: center; position: relative; }
.msn-ad-card .ad-tag { position: absolute; top: 10px; left: 10px; background: #d84315; font-size: 10px; padding: 3px 6px; border-radius: 4px; font-weight: bold; display:flex; align-items:center; gap:3px; }
.msn-ad-card .ad-icon { font-size: 40px; margin-bottom: 5px; line-height: 1;}
.msn-ad-card .ad-title { font-size: 22px; font-weight: 900; line-height: 1.2; text-transform: uppercase; }
.msn-ad-card .ad-bottom { padding: 15px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.msn-ad-card .ad-desc { font-size: 14px; font-weight: 700; color: #1f2937; margin-bottom: 15px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.msn-ad-card .ad-btn { background: #fff3e0; color: #ff5722; border: 1px solid #ff5722; padding: 8px; font-weight: 800; font-size: 13px; border-radius: 4px; text-align: center; transition: background 0.2s; }
.msn-ad-card:hover .ad-btn { background: #ff5722; color: #fff; }
/* ==================== FOOTER 3 CỘT (PHONG THỦY KIM - THỔ 1984) ==================== */
.site-footer {
    margin-top: 40px;
    background: var(--surface);
    border-top: 4px solid var(--primary);
    color: var(--text);
}

.footer-custom-container {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 40px 24px;
    box-sizing: border-box;
}

/* HIỂN THỊ TRÊN MÁY TÍNH: 3 CỘT (1 CỘT TO, 2 CỘT VỪA) */
.footer-main-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr; /* Tỉ lệ: Cột 1 lớn nhất, cột 2 & 3 bằng nhau */
    gap: 30px;
    align-items: start;
}

/* HIỂN THỊ TRÊN ĐIỆN THOẠI: 1 CỘT DỌC */
@media (max-width: 900px) {
    .footer-main-row {
        grid-template-columns: 1fr; /* Ép về 1 cột duy nhất */
        gap: 24px;
    }
    .footer-custom-container {
        padding: 30px 16px;
    }
}

/* Làm đẹp tiêu đề & box - CHUẨN SEO KHÔNG DÙNG THẺ H */
.footer-main-row .footer-col-title {
    font-weight: 800;
    font-size: 16px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

.footer-main-row .footer-col-title::before {
    content: "";
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.fb-wrapper, .map-wrapper {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    background: var(--surface-2);
    height: 250px; /* Khóa cứng chiều cao cho 2 khung bằng nhau */
}

/* Dải link trang tĩnh dưới cùng */
.footer-pages-wrap {
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}
.footer-pages {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: center;
    max-width: 1380px;
    margin: 0 auto;
}
.footer-pages a {
    color: var(--text) !important;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s ease;
}
.footer-pages a:hover {
    color: var(--primary) !important;
}
