/* ==========================================================================
   base.css — Reset + nền tảng typography + accessibility
   ========================================================================== */

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ff-base);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-text);
  background: var(--c-shell);
  /* Không dùng min-width cố định.
     Trang mẫu đặt min-width:1200px trên shell, gây tràn ngang 205px @1024
     và 461px @768 (P01). Bản dựng này cố tình KHÔNG lặp lại lỗi đó. */
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--ff-display);
  line-height: var(--lh-tight);
  font-weight: 600;
}

p { margin: 0 0 var(--s-3); }

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: var(--c-gold);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* --- Focus: điểm cải thiện có chủ đích so với bản gốc ---
   P01 đo được bản gốc chỉ có 5 rule :focus-visible trên tổng 16.306 rule.
   Ở đây mọi phần tử tương tác đều có vòng focus rõ ràng. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-xs);
  position: relative;
  z-index: 1;
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  left: var(--s-3);
  top: var(--s-3);
  z-index: var(--z-skip);
  padding: var(--s-3) var(--s-5);
  background: var(--c-gold);
  color: var(--c-text-on-gold);
  font-weight: 700;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* --- Tiện ích --- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* Phần tử bị inert không được nhận focus bàn phím */
[inert] { pointer-events: none; }

/* --- Nhãn dữ liệu mẫu ---
   Mọi số liệu trong bản dựng này là hư cấu. Nhãn phải nhìn thấy được. */
.sample-flag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 2px var(--s-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-text-on-gold);
  background: var(--c-gold);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.sample-flag--quiet {
  color: var(--c-gold);
  background: transparent;
  border: 1px dashed var(--c-gold);
}

[data-sample="true"] {
  /* Giá trị mẫu được gạch chân nét đứt mảnh để phân biệt bằng mắt */
  text-decoration: underline dotted rgba(252, 228, 3, .45);
  text-underline-offset: 4px;
}
