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

:root {
  --teal-50: #E1F5EE;
  --teal-100: #9FE1CB;
  --teal-600: #0F6E56;
  --teal-700: #085041;
  --purple-50: #EEEDFE;
  --purple-200: #AFA9EC;
  --purple-600: #534AB7;
  --purple-700: #3C3489;
  --amber-50: #FAEEDA;
  --coral-50: #FAECE7;
  --gray-50: #F7F6F2;
  --gray-100: #EEEDE8;
  --gray-200: #D3D1C7;
  --gray-800: #2C2C2A;
  --text-primary: #1a1a18;
  --text-secondary: #5a5955;
  --border: rgba(0,0,0,0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  /* Override per article */
  --article-accent: #0F6E56;
  --article-accent-light: #9FE1CB;
  --article-hero-gradient: linear-gradient(160deg, #E8F8F2 0%, #EEF0FD 50%, #FDF0EC 100%);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Sarabun', 'IBM Plex Sans Thai', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-primary);
  background: #FAFAF8;
}

/* ─── NAV ─── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-size: 15px; font-weight: 600; color: var(--article-accent);
  text-decoration: none; letter-spacing: -0.01em;
}
.nav-logo span { color: var(--text-secondary); font-weight: 400; }
.nav-back {
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  display: flex; align-items: center; gap: 4px; transition: color 0.2s;
}
.nav-back:hover { color: var(--article-accent); }

/* ─── HERO ─── */
.hero {
  background: var(--article-hero-gradient);
  padding: 4rem 1.5rem 3.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  background: white; color: var(--article-accent);
  border: 1px solid var(--article-accent-light);
  padding: 5px 16px; border-radius: 100px; margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(26px, 5vw, 38px); font-weight: 700; line-height: 1.35;
  color: var(--gray-800); margin-bottom: 1rem; letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--article-accent); }
.hero .lead {
  font-size: 17px; color: var(--text-secondary);
  max-width: 520px; margin: 0 auto 2rem;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 1.5rem; }
.hero-tag {
  font-size: 12px; font-weight: 500; padding: 4px 12px; border-radius: 100px;
  border: 1px solid var(--border); background: white; color: var(--text-secondary);
}

/* ─── LAYOUT ─── */
.container { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; }

/* ─── ARTICLE BODY ─── */
.article-body { padding: 3rem 0 4rem; }
.section { margin-bottom: 3.5rem; }

.section-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--article-accent); margin-bottom: 0.75rem;
}
.section-label::before {
  content: ''; display: inline-block; width: 16px; height: 2px;
  background: var(--article-accent); border-radius: 2px;
}
.section h2 {
  font-size: clamp(20px, 3.5vw, 24px); font-weight: 700; line-height: 1.4;
  color: var(--gray-800); margin-bottom: 1.25rem; letter-spacing: -0.01em;
}
.section p { color: var(--text-secondary); margin-bottom: 1.25rem; font-size: 16px; }
.section p strong { color: var(--text-primary); font-weight: 600; }

/* ─── AGE CARDS ─── */
.age-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1.5rem 0; }
.age-card {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.375rem;
  position: relative; overflow: hidden;
}
.age-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.age-card.young::before { background: linear-gradient(90deg, #1D9E75, #5DCAA5); }
.age-card.older::before { background: linear-gradient(90deg, #534AB7, #7F77DD); }
.age-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 100px; margin-bottom: 0.75rem;
}
.age-tag.y { background: var(--teal-50); color: var(--teal-600); }
.age-tag.o { background: var(--purple-50); color: var(--purple-600); }
.age-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-800); }
.age-card p { font-size: 14px; line-height: 1.75; color: var(--text-secondary); margin: 0; }

/* ─── ILLUSTRATION FIGURE ─── */
.illus-figure { margin: 1.5rem 0; border-radius: var(--radius-md); overflow: hidden; line-height: 0; }
.illus-figure svg { width: 100%; height: auto; display: block; }

/* ─── HIGHLIGHT / TIP BOXES ─── */
.highlight-box {
  background: #E8F8F2; border-left: 4px solid #1D9E75;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.125rem 1.375rem; margin: 1.5rem 0;
}
.highlight-box p { font-size: 15px; color: var(--teal-700); margin: 0; }
.highlight-box p strong { color: var(--teal-600); }
.tip-box {
  background: var(--purple-50); border-left: 4px solid #7F77DD;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.125rem 1.375rem; margin: 1.5rem 0;
}
.tip-box p { font-size: 15px; color: var(--purple-700); margin: 0; }
.tip-box p strong { color: var(--purple-600); }

/* ─── DIVIDER ─── */
.divider { border: none; border-top: 1px solid var(--border); margin: 3rem 0; }

/* ─── REFERENCE SECTION ─── */
.ref-section {
  background: white; border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 2rem; margin-top: 1rem;
}
.ref-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 1.5rem; color: var(--gray-800); }
.ref-list { list-style: none; }
.ref-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.ref-item:last-child { border-bottom: none; padding-bottom: 0; }
.ref-num {
  width: 26px; height: 26px; flex-shrink: 0; background: var(--purple-50);
  color: var(--purple-600); border-radius: 50%; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.ref-text { font-size: 14px; line-height: 1.75; color: var(--text-secondary); }
.ref-text strong { color: var(--text-primary); font-weight: 600; }

/* ─── FOOTER ─── */
footer {
  background: var(--gray-800); color: #aaa;
  text-align: center; padding: 2.5rem 1.5rem; font-size: 14px;
}
footer a { color: #9FE1CB; text-decoration: none; }
footer .footer-logo { font-size: 16px; font-weight: 700; color: white; margin-bottom: 0.5rem; }

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .age-grid { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 24px; }
  .article-body { padding: 2rem 0 3rem; }
  .section { margin-bottom: 2.5rem; }
  .ref-section { padding: 1.25rem; border-radius: var(--radius-lg); }
}
