/* SaigonGoWhere – giao diện chung */
:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --ink: #1f2a24;
  --ink-soft: #5a6660;
  --line: #e7e1d6;
  --green: #1d5c45;
  --green-soft: #e6efe9;
  --accent: #d2602e;
  --accent-soft: #fbe9df;
  --todo: #fff1a8;
  --radius: 14px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "PingFang SC", "Microsoft YaHei",
          system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917;
    --surface: #1c2320;
    --ink: #ecefe9;
    --ink-soft: #a8b2ac;
    --line: #2c3531;
    --green: #7cc7a3;
    --green-soft: #1f2e27;
    --accent: #f08a5d;
    --accent-soft: #33241c;
    --todo: #5a4c10;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
/* tiếng Hàn: không ngắt giữa một từ; tiếng Trung giữ cách ngắt dòng bình thường */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }
@media (max-width: 480px) {
  .logo { font-size: 18px; }
  .lang-switch a { padding: 6px 8px; font-size: 13px; }
}
a { color: var(--green); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* đầu trang */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo span, h1 span { color: var(--accent); }
.logo.small { font-size: 17px; margin-bottom: 4px; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
  font-size: 14px; text-decoration: none; color: var(--ink-soft);
  padding: 6px 10px; border-radius: 999px;
}
.lang-switch a[aria-current] { background: var(--green-soft); color: var(--green); font-weight: 700; }

/* phần mở đầu */
.hero { background: var(--green); color: #fff; padding: 48px 0 40px; }
.hero h1 { margin: 0 0 12px; font-size: clamp(26px, 5vw, 40px); line-height: 1.3; letter-spacing: -0.02em; }
.hero p { margin: 0; max-width: 640px; opacity: .9; }
.hero-home { padding: 72px 0 56px; text-align: center; }
.hero-home h1 { font-size: clamp(36px, 8vw, 64px); }
.hero-home h1 span { color: #ffb48a; }
.hero-home p { margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; margin-bottom: 8px !important; }
@media (prefers-color-scheme: dark) { .hero { background: #163d2f; } }

/* chọn ngôn ngữ ở trang chủ */
.lang-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: -28px 0 56px; }
.lang-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; text-decoration: none; color: var(--ink);
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
  transition: transform .15s, border-color .15s;
}
.lang-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.lang-card-name { font-size: 22px; font-weight: 800; }
.lang-card-tag { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }

/* trang danh sách bài */
.cat { margin: 40px 0; }
.cat h2 { font-size: 20px; margin: 0 0 16px; padding-left: 12px; border-left: 4px solid var(--accent); line-height: 1.3; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 20px; text-decoration: none; color: var(--ink);
  transition: border-color .15s;
}
.card:hover { border-color: var(--green); }
.card-num { font-size: 13px; font-weight: 700; color: var(--accent); }
.card-title { font-weight: 700; line-height: 1.45; }
.card-desc {
  color: var(--ink-soft); font-size: 14.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* trang bài viết */
.article-wrap { max-width: 760px; padding-top: 24px; padding-bottom: 48px; }
.crumbs { font-size: 14px; color: var(--ink-soft); }
.crumbs a { text-decoration: none; }
.crumbs span { margin: 0 6px; opacity: .6; }
.article h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.35; letter-spacing: -0.02em; margin: 12px 0 24px; }
.article h2 { font-size: 22px; margin: 40px 0 12px; line-height: 1.4; }
.article h3 { font-size: 18px; margin: 28px 0 8px; color: var(--green); }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin: 4px 0; }
.article hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0 16px; }
.article hr ~ p { font-size: 14px; color: var(--ink-soft); }
.article table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; display: block; overflow-x: auto; }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--green-soft); white-space: nowrap; }
.article strong { color: var(--ink); }
.other-langs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 32px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px;
}
.other-langs span { color: var(--ink-soft); margin-right: 4px; }
.other-langs a { background: var(--accent-soft); color: var(--accent); padding: 4px 12px; border-radius: 999px; text-decoration: none; font-weight: 600; }
mark.todo { background: var(--todo); color: inherit; padding: 0 4px; border-radius: 4px; font-size: .9em; }

/* chân trang */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--ink-soft); font-size: 14px; }
.site-footer p { margin: 4px 0; }

/* ---------- bổ sung 10/2026 ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
/* tiêu đề không bị thanh đầu trang che khi bấm mục lục */
.article h2, .cat { scroll-margin-top: 76px; }

/* trang danh sách: hàng chip nhảy tới chuyên mục */
.hero-count { margin-top: 14px !important; font-size: 14px; opacity: .75 !important; }
.jump {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 20px 0 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px;
}
.jump::-webkit-scrollbar { display: none; }
.jump a {
  flex: none; padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none;
}
.jump a:hover { border-color: var(--accent); color: var(--accent); }
.cat:first-of-type { margin-top: 24px; }

/* trang chủ */
.lang-card-cats { color: var(--ink-soft); font-size: 13px; line-height: 1.6; margin-top: 8px; }
.lang-card-count { margin-top: auto; padding-top: 12px; font-size: 14px; font-weight: 700; color: var(--accent); }

/* trang bài viết */
.article .meta { margin: -12px 0 20px; font-size: 14px; color: var(--ink-soft); }
.cover { margin: 0 0 24px; }
.cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.toc {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 18px; margin: 0 0 28px; font-size: 15px;
}
.toc summary { cursor: pointer; font-weight: 700; padding: 10px 0; color: var(--green); }
.toc ol { margin: 0 0 12px; padding-left: 1.4em; }
.toc li { margin: 2px 0; }
.toc a { text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--green); text-decoration: underline; }
.article a { text-underline-offset: 2px; }
.related { margin-top: 40px; }
.related h2 { font-size: 18px; margin: 0 0 14px; }
.back { margin: 32px 0 0; font-size: 15px; }
.back a { text-decoration: none; font-weight: 600; }
.footer-langs a { color: var(--ink-soft); }
@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .article h2 { font-size: 20px; margin-top: 36px; }
  .hero { padding: 36px 0 32px; }
}
