/* ================================
   Root & Box Model (Fast Render)
================================ */
html {
  font-size: 16px;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body,
article,
section,
header,
footer,
main,
nav,
aside,
div,
p,
h1, h2, h3, h4,
ul, ol, li,
figure,
figcaption,
blockquote,
dl, dt, dd {
  box-sizing: inherit;
}

/* ================================
   Body (LCP Optimized)
================================ */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont,
               "Noto Sans Thai", "Sarabun",
               "Segoe UI", Arial, sans-serif;
  line-height: 1.75;
  color: #1f2937;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  align-content: center;
  text-align: center;
}

/* ================================
   Layout Container
================================ */
article {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ================================
   Headings (SEO Friendly)
================================ */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
  color: #111827;
  margin: 0 0 1rem;
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  padding-left: 12px;
  border-left: 4px solid #2563eb;
}

h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
}

h4 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
}

/* ================================
   Text
================================ */
p {
  margin: 0 0 1.2rem;
  font-size: 1rem;
}

strong {
  color: #111827;
}

/* ================================
   Links (Low Cost)
================================ */
a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ================================
   Lists
================================ */
ul,
ol {
  margin: 0 0 1.5rem 1.25rem;
}

li {
  margin-bottom: 0.4rem;
}

/* ================================
   FAQ
================================ */
dl {
  margin-top: 1.5rem;
}

dt {
  font-weight: 600;
  margin-top: 1.2rem;
}

dd {
  margin-left: 1rem;
  margin-bottom: 1rem;
  color: #374151;
}

/* ================================
   Images (CLS Safe)
================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ================================
   Footer
================================ */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.95rem;
  color: #4b5563;
}

/* ================================
   Accessibility
================================ */
:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

/* ================================
   Mobile Optimization
================================ */
@media (max-width: 768px) {
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.55rem; }
  h3 { font-size: 1.25rem; }

  article {
    padding: 20px 14px;
  }
}
