/* =========================================================
   CẦU NỐI GIAO DIỆN cho các trang cũ (/tin-tuc/, /ai-automation-seo/)
   Nạp SAU <style> riêng của trang: đưa phông, nền, màu của web mới vào,
   và chặn CSS cũ (nav{}, footer{}, a{}…) làm vỡ header/footer mới.
   Nội dung bài (bảng, khối lệnh, hộp…) giữ nguyên CSS riêng của trang.
   ========================================================= */

/* 1. Phông & màu: ánh xạ biến cũ sang token mới */
:root {
  --font: var(--font-sans);
  --font-head: var(--font-serif);
  --navy: #15171c;
  --blue: #8f7034;
  --gold: #c6a15b;
  --ink: #15171c;
  --muted: #5d616b;
  --line: rgba(21, 23, 28, 0.12);
  --bg2: #ece7dd;
}
html body { font-family: var(--font-sans); background: var(--paper); color: var(--text); padding-top: var(--header-h); }
html body h1, html body h2, html body h3 { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }

/* 2. Header mới: miễn nhiễm CSS cũ */
.site-header nav.nav { position: static; top: auto; height: auto; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; z-index: auto; }
.site-header .nav a, .site-header .nav button { text-decoration: none; }
.site-header .nav__link { color: var(--text-inv-2); font-weight: 500; font-size: 0.875rem; }
.site-header .nav__menu-link { color: var(--text-inv); }
.site-header .btn--primary { color: var(--ink); }
.site-header .brand { color: var(--text-inv); text-decoration: none; }
.site-header, .mobile-nav { font-family: var(--font-sans); line-height: 1.65; }
.site-header *, .mobile-nav *, .site-footer * { box-sizing: border-box; }
.mobile-nav a { text-decoration: none; color: inherit; }
.mobile-nav__list a { font-family: var(--font-serif); }
.mobile-nav__sub a { font-family: var(--font-sans); }
.site-header .container, .site-footer .container { max-width: calc(var(--container) + var(--gutter) * 2); padding-inline: var(--gutter); margin-inline: auto; }

/* 3. Thanh "quay về" giữ lại từ menu cũ */
.mcb-subbar { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.mcb-subbar .container { max-width: calc(var(--container) + var(--gutter) * 2); padding: 10px var(--gutter); margin-inline: auto; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.mcb-subbar a { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; color: var(--brass-3); text-decoration: none; }
.mcb-subbar a:hover { color: var(--text); }
.mcb-back { margin: 40px 0 0; font-size: 0.875rem; }
.mcb-back a { color: var(--brass-3); font-weight: 600; text-decoration: none; }

/* 4. Footer mới: miễn nhiễm footer{} cũ */
footer.site-footer { display: block; margin: 0; padding: clamp(64px, 8vw, 112px) 0 0; border-top: 1px solid var(--line-inv); background: var(--ink); color: var(--text-inv-2); font-size: var(--fs-sm); line-height: 1.65; justify-content: initial; gap: 0; }
footer.site-footer a { color: inherit; font-weight: inherit; text-decoration: none; }
footer.site-footer .footer__risk a { color: var(--text-inv-2); text-decoration: underline; }
footer.site-footer p { margin: 0; }
footer.site-footer .footer__tagline { margin-top: 20px; }
footer.site-footer ul { list-style: none; margin: 0; padding: 0; }
.mcb-legacy-footer { margin-top: 48px; }

/* 5. Trang cũ có nền sáng ngay đầu trang → header luôn nền tối (web mới thì trong suốt trên hero tối) */
.site-header { background: rgba(11, 13, 17, 0.94); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line-inv); }

/* 6. Chống tràn ngang trên điện thoại (phông mới rộng hơn phông hệ thống cũ) */
html body :where(article, main, .wrap) { overflow-wrap: anywhere; }
html body :where(article, main, .wrap) button { white-space: normal; max-width: 100%; }
html body pre { max-width: 100%; overflow-x: auto; }
html body :where(article, main, .wrap) table { display: block; max-width: 100%; overflow-x: auto; }
html body #gate .row { flex-wrap: wrap; }
html body #gate input { max-width: 100%; }
html body #gate button { white-space: normal; }
