/* ==========================================================================
   BASE — reset nhẹ, typography, các quy tắc nền tảng dùng cho TOÀN SITE.
   Nạp SAU variables.css, TRƯỚC components.css.
   ========================================================================== */

*{ box-sizing: border-box; }

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

body{
  font-family: var(--font-chinh);
  background: var(--nen-body);
  color: var(--chu-chinh);
  transition: background-color .2s ease, color .2s ease;
  /* Không cho phép cuộn ngang toàn trang trên mobile khi 1 phần tử lỡ tràn */
  overflow-x: hidden;
}

img{ max-width: 100%; height: auto; }

a{ color: var(--mau-chinh); }
a:hover{ color: var(--mau-chinh-dam); }

/* Chữ Hán hiển thị đẹp, nét rõ ràng hơn font hệ thống mặc định */
.chu-han, .han-text{
  font-family: var(--font-han);
}

::selection{
  background: var(--mau-chinh);
  color: var(--chu-tren-mau);
}

/* ----- Vô hiệu hóa animation cho người dùng yêu cầu giảm chuyển động ----- */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----- Tiện ích dùng chung ----- */
.text-mau-chinh{ color: var(--mau-chinh) !important; }
.bg-mau-chinh{ background: var(--mau-chinh) !important; }
.shadow-token{ box-shadow: var(--bong); }
.bo-goc-lon{ border-radius: var(--bo-goc-lg); }

/* ----- Container không tràn màn hình nhỏ ----- */
.container, .container-fluid{
  max-width: 100%;
}

/* ----- Bảng dữ liệu: cho phép cuộn ngang trên mobile thay vì vỡ layout ----- */
.table-responsive{
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px){
  h1, .display-4{ font-size: clamp(26px, 7vw, 40px); }
  h2{ font-size: clamp(22px, 6vw, 30px); }
  .container{ padding-left: 14px; padding-right: 14px; }
}
