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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

a { color: var(--primary-strong); text-underline-offset: 3px; }
a:hover { color: var(--primary); }

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

/* Thuộc tính hidden luôn thắng các kiểu display của thành phần */
[hidden] { display: none !important; }

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

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container { padding: 0 24px; }
}

.section { padding: 40px 0; }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 20px;
}
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--text-2); }

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }

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

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: var(--on-primary);
  border-radius: var(--radius-btn);
}
.skip-link:focus { top: 12px; color: var(--on-primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
