/* ══════════════════════════════════════════════════════════════════════
   BASE — reset + typography. Không chứa component nào.
══════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
h1, h2, h3, h4 { font-weight: var(--fw-semi); line-height: var(--lh-tight); }
h1 { font-size: var(--fs-lg); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-base); }

ul, ol { margin: 0; padding: 0; list-style: none; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Viền focus dùng bàn phím — bắt buộc giữ, đừng xoá cho "gọn" */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

[hidden] { display: none !important; }

/* Thanh cuộn mảnh */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: var(--radius-full);
  border: 3px solid transparent; background-clip: content-box;
}

/* Chỉ hiện cho trình đọc màn hình */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Khung cuộn ngang cho bảng rộng — TRANG KHÔNG BAO GIỜ được cuộn ngang */
.scroll-x { overflow-x: auto; overscroll-behavior-x: contain; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}
