/* base.css — reset nhẹ + nền tảng chữ/nền.
   Vì sao reset tối giản: đây là công cụ vận hành, không cần normalize
   đồ sộ; chỉ triệt các khác biệt gây vỡ layout. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  /* iOS hay tự phóng chữ khi xoay ngang — chặn để layout ổn định */
  -webkit-text-size-adjust: 100%;
}

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

h1 {
  font-size: var(--fs-xl);
}

h2 {
  font-size: var(--fs-lg);
}

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

a {
  color: var(--brand-600);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* form control kế thừa font của body — mặc định trình duyệt dùng font riêng */
input,
button,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

/* focus nhìn thấy được cho điều hướng bàn phím (§9.5 có phím tắt) */
:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

::selection {
  background: var(--brand-100);
  color: var(--text);
}

/* scrollbar mảnh — danh sách khách/tin cuộn nhiều, thanh to chiếm chỗ */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--r-sm);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Ẩn khỏi mắt nhưng screen reader vẫn đọc — dùng cho label phụ trợ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* !important có chủ đích: .hidden phải thắng mọi display khác (banner, badge…) */
.hidden {
  display: none !important;
}
