/**
 * === Base CSS - Reset, typography defaults, container, skip link ===
 *
 * Mô tả: Stylesheet nền tảng của theme. Thiết lập box-sizing global,
 *        normalize nhẹ, typography defaults, skip link accessibility,
 *        và container utility. Không chứa component-specific styles.
 *
 * Flow:
 *   1. Box-sizing reset toàn cục
 *   2. Normalize nhẹ cho margin/padding mặc định trình duyệt
 *   3. Body typography defaults dùng design tokens
 *   4. Skip link CSS (ẩn mặc định, hiện khi focus — spec 4.8.1)
 *   5. Container utility với max-width từ --container-max
 *   6. Screen reader only utility class
 *
 * Depends on: design-tokens.css (phải load trước)
 */

/* ============================================================
   1. Box-sizing reset
   ============================================================ */

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

/* ============================================================
   2. Normalize nhẹ
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
  /* Offset cho hash anchor (#faq-...) tránh bị sticky header che */
  scroll-padding-top: var(--sticky-header-height, 160px);
  /* Ẩn scrollbar mặc định nhưng vẫn giữ khả năng cuộn bằng wheel/touch/keyboard. */
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Scroll-behavior smooth được Lenis quản lý — KHÔNG đặt scroll-behavior ở đây
   * vì sẽ conflict với Lenis (lib tự handle wheel/touch easing).
   * scroll-snap đã bỏ vì gây cảm giác giật khi cuộn dài bằng bánh xe.
   */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Giữ scroll-margin để hash anchor (vd #section-form-map từ hero CTA) không bị header che */
section[id^="section-"] {
  scroll-margin-top: var(--sticky-header-height, 140px);
}

body {
  margin: 0;
  padding: 0;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ============================================================
   3. Body typography defaults
   ============================================================ */

html {
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--lh-body);
  color: var(--color-ink-950);
  background-color: var(--color-surface-warm);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--lh-heading);
  color: var(--color-ink-950);
  margin: 0 0 0.5em;
}

h1, .h1, .section-title-main {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-heading);
}

h2, .h2, .section__title {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
}

h3, .h3, .card__title {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--lh-heading);
}

h4, .h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

h5 { font-size: var(--text-body); font-weight: var(--weight-medium); }
h6 { font-size: var(--text-small); font-weight: var(--weight-medium); }

.hero-title {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-heading);
  font-family: var(--font-heading);
}

p, .body-text { font-size: var(--text-body); line-height: var(--lh-body); }
.caption, small { font-size: var(--text-small); }
.badge, .label { font-size: var(--text-micro); }

.eyebrow {
  font-family: var(--font-accent);
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  color: var(--color-primary-700);
  line-height: var(--lh-snug);
  display: inline-block;
  margin-bottom: var(--space-2);
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--color-primary-800);
  transition: color var(--motion-fast) var(--ease-standard);
}

a:hover {
  color: var(--color-primary-600);
}

a:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   4. Skip link (spec section 4.8.1)
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--color-primary-800);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: top 150ms var(--ease-standard);
}

.skip-link:focus {
  top: 16px;
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ============================================================
   5. Container utility
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter-mobile);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--gutter-tablet);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--gutter-desktop);
  }
}

/* ============================================================
   6. WP Admin bar offset - đảm bảo site-header không bị gap thừa
   ============================================================ */

body:not(.admin-bar) .site-header {
  margin-top: 0;
}

body.admin-bar .site-header {
  margin-top: 32px;
}

/* ============================================================
   7. Screen reader only utility
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================
   Body + Section background unification - Trắng thuần, không decor
   ============================================================ */

body {
  background: var(--color-surface);
  /* Clip horizontal overflow gây bởi decorative elements (orbs, motifs,
   * hero blob) trên mobile. Dùng clip thay vì hidden để không phá vỡ
   * position: sticky của primary nav. Fallback hidden cho browser cũ. */
  overflow-x: hidden;
  overflow-x: clip;
}

html {
  overflow-x: hidden;
  overflow-x: clip;
}

/* ── Section background unification ────────────────────────────
 * Force TẤT CẢ <section> dùng body BG trắng. Chỉ section--form-map
 * giữ BG riêng (theo yêu cầu user).
 *
 * QUAN TRỌNG: chỉ target HTML <section> tag để tránh match nhầm
 * các element con (button, card, ...) có class chứa "section-".
 */
section[class*="section"] {
  background-color: transparent !important;
  background-image: none !important;
}

/* Bỏ overlay radial-gradient của section--values (duplicate với global orbs) */
.section--values::before,
.section--intro::before,
.section--history::before,
.section--news::before { display: none !important; }

/* Ẩn toàn bộ section description trên homepage (theo yêu cầu user)
 * — chỉ giữ eyebrow + title, bỏ đoạn mô tả phụ dưới title.
 */
.section-description { display: none !important; }

/* OPT-OUT: section--form-map giữ BG dark đặc biệt (Thông tin cần biết & Đặt lịch)
 * Selector dùng `section.section--form-map` để có specificity (0,1,1) bằng với
 * rule `section[class*="section"]` ở trên — cùng !important nhưng đứng sau
 * trong cascade nên thắng. Nếu chỉ dùng `.section--form-map` (0,1,0) sẽ bị
 * rule trên đè và bg-image bị set về none.
 */
section.section--form-map {
  background-color: var(--color-primary-900, var(--color-brand-primary)) !important;
  background-image: var(--form-section-bg) !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

