/* ===== Brand Ratio — Bộ trang Pháp lý (/legal/*) — scope .lg-* =====
   Bố cục: tab 4 văn bản → 2 cột (mục lục cố định trái + nội dung phải).
   Màu/typography theo hệ brand Ratio: token --brand-* (giấy ấm #f6f5f2, đen Equinox #28282f, mint hover).
   Token-only — KHÔNG hardcode hex. Mục lục sticky + scroll-spy (legal.js gắn .is-active). */

/* ---- HEADER trang ---- */
/* Container khớp chiều rộng header brand (.brand-inner: max-width 1496px, padding ngang 28px) — owner chốt */
/* Bỏ viền ngang full-width dưới header trang + dưới hàng tab (owner chốt) — giữ trang thoáng */
.lg-head-inner { max-width: 1496px; margin: 0 auto; padding: 64px 28px 36px; }
.lg-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--brand-ink); font-weight: 700; margin-bottom: 22px;
}
.lg-eyebrow::before { content: ''; width: 30px; height: 1.5px; background: var(--brand-ink); display: inline-block; }
.lg-title {
  font-family: var(--brand-font-display); font-weight: var(--brand-weight-display);
  font-size: clamp(32px, 4.2vw, 52px); line-height: 1.06; letter-spacing: -0.026em;
  margin: 0 0 14px; color: var(--brand-ink);
}
.lg-updated { font-size: 13.5px; color: var(--brand-muted); margin: 0; font-weight: 500; }

/* ---- TAB BAR 4 văn bản ---- */
.lg-tabs { background: var(--brand-bg); }
.lg-tabs-inner {
  max-width: 1496px; margin: 0 auto; padding: 0 28px;
  display: flex; gap: 28px; overflow-x: auto;
  scrollbar-width: none;
}
.lg-tabs-inner::-webkit-scrollbar { display: none; }
.lg-tab {
  position: relative; white-space: nowrap; flex: none;
  padding: 16px 2px; font-size: 14px; font-weight: 550; color: var(--brand-ink-2);
  text-decoration: none; transition: color var(--brand-dur-fast);
}
.lg-tab:hover { color: var(--brand-ink); }
.lg-tab.is-active { color: var(--brand-ink); font-weight: 700; }
.lg-tab.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--brand-ink);
}

/* ---- SHELL 2 cột (mục lục + nội dung) ---- */
.lg-shell {
  max-width: 1496px; margin: 0 auto; padding: 40px 28px 80px;
  display: grid; grid-template-columns: 280px 1fr; gap: 72px; align-items: start;
}

/* ---- MỤC LỤC (sticky trái) ---- */
.lg-toc { position: sticky; top: 96px; }
.lg-toc-toggle { display: none; } /* chỉ hiện ở mobile */
.lg-toc-heading {
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-muted); margin: 0 0 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--brand-line);
}
.lg-toc-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.lg-toc-list li { margin: 0; }
.lg-toc-link {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 0 7px 13px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 13.5px; line-height: 1.45; color: var(--brand-ink-2);
  text-decoration: none;
  transition: color var(--brand-dur-fast), border-color var(--brand-dur-fast);
}
.lg-toc-link:hover { color: var(--brand-ink); }
.lg-toc-link.is-active {
  color: var(--brand-ink); font-weight: 650;
  border-left-color: var(--brand-ink);
}
.lg-toc-no { flex: none; font-size: 11.5px; color: var(--brand-muted); font-variant-numeric: tabular-nums; min-width: 16px; }
.lg-toc-link.is-active .lg-toc-no { color: var(--brand-ink); }

/* ---- NỘI DUNG (phải) ---- nội dung fill hết cột để mép phải chạm mép header (owner chốt) ---- */
.lg-content { min-width: 0; }
.lg-intro {
  font-size: 16.5px; line-height: 1.75; color: var(--brand-ink-2);
  margin: 0 0 12px; padding-bottom: 32px; border-bottom: 1px solid var(--brand-line);
}
.lg-sec { padding-top: 40px; scroll-margin-top: 100px; }
.lg-sec:first-of-type { padding-top: 36px; }
.lg-sec-title {
  display: flex; gap: 14px; align-items: baseline;
  font-family: var(--brand-font-display); font-weight: 750;
  font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.02em; line-height: 1.2;
  margin: 0 0 18px; color: var(--brand-ink);
}
.lg-sec-no {
  flex: none; font-size: 15px; font-weight: 250; color: var(--brand-muted);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.lg-content p { font-size: 15px; line-height: 1.75; color: var(--brand-ink-2); margin: 0 0 16px; }
.lg-sub { font-size: 16px; font-weight: 700; color: var(--brand-ink); margin: 24px 0 10px; letter-spacing: -0.01em; }
.lg-content ul, .lg-content ol { margin: 0 0 16px; padding-left: 22px; }
.lg-content li { font-size: 15px; line-height: 1.7; color: var(--brand-ink-2); margin-bottom: 8px; }
.lg-content blockquote {
  margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--brand-ink);
  font-size: 15.5px; line-height: 1.7; color: var(--brand-ink); font-style: italic;
}

/* Khối tóm tắt đời thường "Nói cách khác…" — nền giấy đậm + viền trái.
   Selector .lg-content p.lg-summary (0,2,1) thắng .lg-content p (0,1,1) theo specificity — KHÔNG cần !important. */
.lg-content p.lg-summary {
  background: var(--brand-strip-2); border-left: 3px solid var(--brand-ink);
  border-radius: 0 var(--brand-radius-sm) var(--brand-radius-sm) 0;
  padding: 14px 18px; margin: 0 0 18px;
  font-size: 14.5px; font-weight: 600; color: var(--brand-ink); line-height: 1.6;
}

/* Về đầu trang */
.lg-top {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 44px;
  font-size: 13.5px; font-weight: 600; color: var(--brand-ink-2); text-decoration: none;
  transition: color var(--brand-dur-fast);
}
.lg-top:hover { color: var(--brand-ink); }

/* ===== Responsive: <980px → 1 cột, mục lục thành accordion bấm mở ===== */
@media (max-width: 980px) {
  .lg-shell { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .lg-toc {
    position: static; top: auto; margin-bottom: 24px;
    border: 1px solid var(--brand-line); border-radius: var(--brand-radius); overflow: hidden;
  }
  .lg-toc-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 14px 16px; background: var(--brand-surface); border: none; cursor: pointer;
    font-family: var(--brand-font); font-size: 13px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-ink);
  }
  .lg-toc-toggle svg { width: 14px; height: 14px; transition: transform var(--brand-dur-fast) var(--brand-ease); }
  .lg-toc.is-open .lg-toc-toggle svg { transform: rotate(180deg); }
  .lg-toc-heading { display: none; }
  .lg-toc-nav { display: none; padding: 6px 16px 14px; }
  .lg-toc.is-open .lg-toc-nav { display: block; }
  .lg-toc-link { padding-left: 11px; }
}

/* Mobile: bỏ scroll-margin lớn dư, vẫn chừa cho header fixed 72px */
@media (max-width: 980px) {
  .lg-sec { scroll-margin-top: 84px; }
}
