/* ===================================================================
   AgingOne — main.css (design system v1)
   palette: น้ำเงินเข้ม (หลัก) / เทาเงิน (รอง) / พื้นขาว · ดึงโทนจากโลโก้
   font:    Kanit (self-host, web/fonts/) · สไตล์การ์ด K PLUS · mobile-first
   ที่มา:   ดึง inline CSS เดิมจาก web/index.html มารวมเป็น stylesheet กลาง
   =================================================================== */

/* ---------- self-hosted Kanit ---------- */
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kanit';
  src: url('../fonts/Kanit-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- design tokens ---------- */
:root {
  /* -- palette: navy (แบรนด์หลัก) / sage อุ่น (accent) / ครีม (พื้น) -- */
  --navy:        #1c3d6e;   /* น้ำเงินเข้ม — สีหลัก */
  --navy-dark:   #14294d;   /* เข้มขึ้น — hover / gradient */
  --navy-deep:   #0f1f3d;   /* เข้มสุด — footer */
  --navy-light:  #2f5694;   /* น้ำเงินสว่าง — accent */
  --navy-pale:   #e7eef7;   /* น้ำเงินจางมาก — พื้นไอคอน/soft */

  --silver:      #8a97a8;   /* เทาเงิน — สีรอง */
  --silver-light:#c3ccd8;   /* เทาเงินอ่อน — เส้น/ไอคอนรอง */
  --silver-pale: #f2f4f7;   /* เทาเงินจาง — พื้น (legacy) */

  /* -- warm layer: ครีม + เซจ ให้โทนอบอุ่น human-centered (design refresh) -- */
  --cream:       #faf7f1;   /* ครีมอุ่น — พื้นหน้าหลัก ทำให้การ์ดขาวลอยเด่น */
  --cream-deep:  #f3ece0;   /* ครีมเข้ม — section สลับ / พื้น soft */
  --sand:        #e9dfce;   /* ทราย — เส้น/ขอบอุ่น decorative */
  --sage:        #7e9b86;   /* เซจเขียวนุ่ม — accent อุ่น */
  --sage-deep:   #5c7a66;   /* เซจเข้ม — hover/ข้อความ */
  --sage-pale:   #e8efe7;   /* เซจจาง — พื้นไอคอน/แท็ก */
  --honey:       #c9a35b;   /* ทองน้ำผึ้งจาง — เส้นเน้นบางๆ (สัมผัสหรู) */

  /* -- semantic surfaces -- */
  --bg:        var(--cream); /* พื้นครีมอุ่น */
  --bg-card:   #ffffff;
  --bg-soft:   var(--cream-deep);
  --text:      #25303d;     /* ดำน้ำเงินอุ่นเล็กน้อย */
  --text-soft: #5e6b78;
  --border:    #ece4d6;     /* ขอบโทนอุ่น */
  --border-cool: #e2e7ee;   /* ขอบโทนเย็น (สำหรับการ์ดบนพื้นขาว) */

  /* -- role tokens (component layer อ้างถึงตัวนี้ → re-theme ที่เดียว) -- */
  --brand-primary:      var(--navy);
  --brand-primary-dark: var(--navy-dark);
  --brand-accent:       var(--navy-light);
  --brand-soft:         var(--navy-pale);

  /* -- การ์ด: มุมโค้งนุ่มขึ้น + เงาโทนอุ่น (luxury soft) -- */
  --radius:    20px;
  --radius-sm: 12px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --shadow:        0 6px 22px rgba(64, 54, 38, 0.07);
  --shadow-hover:  0 16px 40px rgba(64, 54, 38, 0.14);
  --shadow-soft:   0 2px 10px rgba(64, 54, 38, 0.05);
  --shadow-header: 0 2px 18px rgba(64, 54, 38, 0.08);

  /* -- motion (สมูท · ใช้ร่วมทั้งเว็บ) -- */
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      0.28s;

  /* -- type + spacing (mobile-first base) -- */
  --fs-base: 18px;          /* ตัวใหญ่อ่านง่าย — กลุ่มผู้สูงอายุ */
  --space:   16px;
  --maxw:    1200px;
  --tap:     48px;          /* touch target ขั้นต่ำ */
}

/* ---------- reset + base (mobile-first) ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Kanit', -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
}

svg {
  display: block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  left: 12px;
}

/* visually-hidden แต่ screen-reader อ่านได้ (เช่น <h1> ของหน้า) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space);
}

/* ---------- utility bar (แถบช่วยเหลือ / accessibility) ---------- */
.utility-bar {
  background: var(--navy);
  color: #fff;
  padding: 10px 0;
  font-size: 16px;
}

.utility-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.utility-bar .phone {
  font-weight: 600;
}

.utility-bar .controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.font-btn,
.contrast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
}

.font-btn:hover,
.contrast-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.font-btn.active {
  background: #fff;
  color: var(--navy);
}

/* ---------- header (frosted · design refresh) ---------- */
header.main {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid rgba(233, 223, 206, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease);
  will-change: transform;
}

/* ยกเงาเมื่อเลื่อนพ้นบนสุด (toggle .is-scrolled ผ่าน main.js) */
header.main.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-header);
}

/* auto-hide on scroll (home.2 · toggle .is-hidden ผ่าน main.js) */
header.main.is-hidden {
  transform: translateY(-100%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 4px 14px rgba(64, 54, 38, 0.12), inset 0 0 0 1px rgba(201, 163, 91, 0.18);
}

.logo-text .name {
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.3px;
}

.logo-text .tag {
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
}

/* mobile-first: nav ซ่อนเป็น dropdown · เปิดด้วยปุ่ม hamburger (toggle .open ผ่าน JS) */
nav.main-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow);
  z-index: 99;
}

nav.main-nav.open {
  display: flex;
}

nav.main-nav a {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 17px;
  transition: all 0.2s;
}

nav.main-nav a:hover {
  background: var(--bg-soft);
  color: var(--navy);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: var(--navy);
}

/* ---------- buttons ---------- */
.btn-primary,
.btn-secondary {
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  min-height: var(--tap);
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(28, 61, 110, 0.25);
}

.btn-primary:hover {
  background: var(--navy-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 2px solid var(--navy);
}

.btn-secondary:hover {
  background: var(--bg-soft);
}

/* ปุ่ม primary — โค้งนุ่มขึ้น + เงาอุ่น (design refresh) */
.btn-primary {
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(28, 61, 110, 0.22);
}
.btn-secondary {
  border-radius: 999px;
}

/* ===================================================================
   Hero — home (design refresh)
   warm gradient + organic orbs ลอยจาง + wave divider สมูทลง section ถัดไป
   เวกเตอร์/gradient ล้วน (ไม่มีรูปถ่าย) · mobile-first · a11y
   =================================================================== */
.hero-home {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(125% 90% at 100% 0%, var(--sage-pale) 0%, transparent 55%),
    radial-gradient(125% 90% at 0% 95%, var(--navy-pale) 0%, transparent 52%),
    linear-gradient(180deg, #fffdf9 0%, var(--cream) 100%);
  padding: 36px 0 92px;
}

.hero-home-inner {
  position: relative;
  z-index: 1;
}

/* organic orbs — แต่งพื้นหลังจางๆ ให้ดูมีมิติ ไม่รก */
.hero-home-orb {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  filter: blur(6px);
  opacity: 0.55;
}
.hero-home-orb-1 {
  width: 190px;
  height: 190px;
  top: -44px;
  right: -54px;
  background: radial-gradient(circle, rgba(126, 155, 134, 0.4) 0%, transparent 70%);
}
.hero-home-orb-2 {
  width: 230px;
  height: 230px;
  bottom: 40px;
  left: -86px;
  background: radial-gradient(circle, rgba(47, 86, 148, 0.18) 0%, transparent 70%);
}

.hero-home-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: 16px;
}
.hero-home-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--honey);
  box-shadow: 0 0 0 4px rgba(201, 163, 91, 0.18);
}

.hero-home-title {
  font-size: 33px;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--navy);
  margin-bottom: 16px;
}
.hero-home-title .hl {
  position: relative;
  color: var(--navy);
  white-space: nowrap;
}
.hero-home-title .hl::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: 5px;
  height: 36%;
  z-index: -1;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(126, 155, 134, 0.5), rgba(201, 163, 91, 0.4));
}

.hero-home-lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-soft);
  max-width: 540px;
  margin-bottom: 26px;
}

.hero-home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-home-stats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--sand);
}
.hero-home-stats li {
  display: flex;
  flex-direction: column;
}
.hero-home-stats strong {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--navy);
}
.hero-home-stats span {
  font-size: 13px;
  color: var(--text-soft);
}

/* wave divider — โค้งนุ่มเชื่อมเข้า section ถัดไป (พื้นครีม) */
.hero-home-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: 0;
  line-height: 0;
}
.hero-home-wave svg {
  display: block;
  width: 100%;
  height: 64px;
}
.hero-home-wave path {
  fill: var(--cream);
}

/* entrance — ค่อยๆ ลอยขึ้น (เคารพ prefers-reduced-motion) */
@media (prefers-reduced-motion: no-preference) {
  .hero-home-eyebrow,
  .hero-home-title,
  .hero-home-lead,
  .hero-home-cta,
  .hero-home-stats {
    animation: heroRise 0.7s var(--ease-out) both;
  }
  .hero-home-title  { animation-delay: 0.06s; }
  .hero-home-lead   { animation-delay: 0.12s; }
  .hero-home-cta    { animation-delay: 0.18s; }
  .hero-home-stats  { animation-delay: 0.24s; }
}
@keyframes heroRise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* scroll-reveal — เพิ่ม .reveal ผ่าน JS (main.js #5) เท่านั้น */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

.hero-home-title .hl,
body.font-large .hero-home-title,
body.font-xlarge .hero-home-title { white-space: normal; }

body.font-large  .hero-home-title { font-size: 38px; }
body.font-xlarge .hero-home-title { font-size: 42px; }
body.font-large  .hero-home-lead  { font-size: 20px; }
body.font-xlarge .hero-home-lead  { font-size: 22px; }

@media (min-width: 768px) {
  .hero-home { padding: 64px 0 116px; }
  .hero-home-title { font-size: 48px; }
  .hero-home-lead { font-size: 20px; max-width: 580px; }
  .hero-home-orb-1 { width: 320px; height: 320px; }
  .hero-home-orb-2 { width: 380px; height: 380px; }
  .hero-home-wave svg { height: 90px; }
  .hero-home-stats strong { font-size: 30px; }
}

@media (min-width: 1024px) {
  .hero-home-title { font-size: 56px; }
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(47, 86, 148, 0.12) 0%, transparent 52%),
    radial-gradient(circle at 8% 84%, rgba(138, 151, 168, 0.12) 0%, transparent 52%),
    var(--bg);
  padding: 48px 0 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  align-items: center;
}

.hero h1 {
  font-size: 32px;
  line-height: 1.25;
  color: var(--text);
  font-weight: 800;
  margin-bottom: 18px;
}

.hero h1 .highlight {
  color: var(--navy);
  background: linear-gradient(transparent 64%, var(--navy-pale) 64%);
  padding: 0 4px;
}

.hero p.lead {
  font-size: 19px;
  color: var(--text-soft);
  margin-bottom: 26px;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-card .pillar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.hero-card .pillar:last-child {
  margin-bottom: 0;
}

.hero-card .pillar:hover {
  background: var(--bg-soft);
}

.hero-card .pillar-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--navy-pale);
  color: var(--navy);
}

.hero-card .pillar-text strong {
  display: block;
  font-size: 17px;
  color: var(--text);
  font-weight: 700;
}

.hero-card .pillar-text span {
  font-size: 15px;
  color: var(--text-soft);
}

/* ---------- search ---------- */
.search-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
}

.search-box {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.search-box:focus-within {
  border-color: var(--navy);
  background: #fff;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 18px;
  font-size: 18px;
  font-family: inherit;
  color: var(--text);
}

.search-box button {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px 24px;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.search-box button:hover {
  background: var(--navy-dark);
}

.search-suggest {
  text-align: center;
  margin-top: 14px;
  font-size: 16px;
  color: var(--text-soft);
}

.search-suggest a {
  color: var(--navy);
  border-bottom: 1px dashed var(--navy);
  margin: 0 6px;
  display: inline-block;
}

/* ---------- sections ---------- */
section {
  padding: 48px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 36px;
}

.section-title h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.section-title p {
  font-size: 18px;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- category cards (โทนน้ำเงิน/เทา) ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: all 0.25s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.category-card:hover,
.category-card:focus {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--navy);
  outline: none;
}

.category-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--navy-pale);
  color: var(--navy);
}

/* หมวดทั้งหมดใช้โทนน้ำเงิน/เทา (monochrome navy family) */
.icon-health,
.icon-food,
.icon-mind,
.icon-rights,
.icon-tech {
  background: var(--navy-pale);
  color: var(--navy);
}

.icon-food,
.icon-tech {
  background: var(--silver-pale);
  color: var(--silver);
}

.category-card h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.category-card p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.5;
}

.category-card .arrow {
  margin-top: 14px;
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
}

/* ---------- articles ---------- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.article-card {
  background: #fff;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}

.article-img {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  background: var(--navy-pale);
}

.article-img.a1,
.article-img.a2,
.article-img.a3 {
  background: var(--navy-pale);
}

.article-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-tag {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--sage-deep);
  background: var(--sage-pale);
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 12px;
  align-self: flex-start;
}

.article-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.article-card p {
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-soft);
}

.article-meta .read-more {
  color: var(--navy);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 8px 4px;
  transition: color var(--dur) var(--ease);
}

.article-meta .read-more:hover,
.article-meta .read-more:focus-visible {
  color: var(--sage-deep);
}

/* ---------- CTA ---------- */
.cta-section {
  background: var(--navy);
  color: #fff;
  text-align: center;
}

.cta-section h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 14px;
}

.cta-section p {
  font-size: 18px;
  opacity: 0.92;
  max-width: 600px;
  margin: 0 auto 28px;
}

.cta-section .btn-primary {
  background: #fff;
  color: var(--navy);
}

.cta-section .btn-primary:hover {
  background: var(--bg-soft);
}

/* ---------- footer (gradient + gold accent · design refresh) ---------- */
footer {
  position: relative;
  background: linear-gradient(180deg, var(--navy-deep) 0%, #0a1729 100%);
  color: #c9d4e0;
  padding: 52px 0 28px;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--honey) 60%, var(--navy-light) 100%);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.footer-col h4 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 16px;
  font-weight: 700;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 16px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-col.about p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.social-links {
  display: flex;
  gap: 10px;
}

.social-links a {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.social-links a:hover {
  background: var(--sage);
  color: #fff;
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  text-align: center;
  font-size: 15px;
}

/* ===================================================================
   Shared shell (design.2) — help-bar · sticky header · bottom tab bar
   =================================================================== */

/* เผื่อที่ให้ bottom tab bar (fixed) ไม่ทับเนื้อหา */
body {
  padding-bottom: 76px;
}

/* แถบช่วยเหลือ: โทรฉุกเฉิน + ปุ่มปรับการแสดงผล */
.help-bar {
  background: linear-gradient(90deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #fff;
  padding: 8px 0;
  font-size: 15px;
}

.help-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.emergency-call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  transition: background 0.2s;
}

.emergency-call:hover {
  background: rgba(255, 255, 255, 0.28);
}

.emergency-call svg {
  width: 18px;
  height: 18px;
}

.a11y-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.a11y-label {
  font-size: 13px;
  opacity: 0.85;
}

/* bottom tab bar — เมนูล่างแบบแอพ (frosted · pill active · design refresh) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(64, 54, 38, 0.1);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  min-height: 56px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  transition: color var(--dur) var(--ease);
}

.bottom-nav-item.active {
  color: var(--navy);
}

.bottom-nav-item:hover {
  color: var(--navy-light);
}

/* ไอคอนมี pill ไฮไลต์เมื่อ active (แบบแอพ) */
.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 30px;
  border-radius: 999px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.bottom-nav-item.active .bottom-nav-icon {
  background: var(--navy-pale);
}

.bottom-nav-item:active .bottom-nav-icon {
  transform: scale(0.92);
}

.bottom-nav-icon svg {
  width: 24px;
  height: 24px;
}

/* ===================================================================
   Home skeleton (home.1) — section layout + placeholders (เติม home.2–6)
   =================================================================== */
.home-section {
  padding: 44px 0;
}

/* จังหวะ section: พื้นครีม สลับด้วยแถบครีมเข้ม (แทนเส้น 1px ที่ซ้ำซาก) */
.home-articles {
  background: var(--cream-deep);
}

.home-vision {
  background:
    radial-gradient(120% 80% at 50% 0%, var(--sage-pale) 0%, transparent 60%),
    var(--cream);
}

.home-section-title {
  position: relative;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  padding-bottom: 12px;
  margin-bottom: 20px;
  letter-spacing: -0.005em;
}

/* accent bar ใต้หัวข้อ — gradient sage→honey สัมผัสหรู */
.home-section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sage) 0%, var(--honey) 100%);
}

@media (min-width: 768px) {
  .home-section { padding: 64px 0; }
  .home-section-title { font-size: 28px; }
}

.home-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 96px;
  padding: 20px;
  border: 2px dashed var(--silver-light);
  border-radius: var(--radius);
  background: var(--silver-pale);
  color: var(--text-soft);
  font-size: 15px;
}

.home-placeholder-lg {
  min-height: 40vh;
}

/* ===================================================================
   Home — category box (home.3)
   18 ไอคอน · 4 ต่อแถว · กล่องเลื่อนแนวตั้ง · max-height 40vh
   แถวที่ 4 ถูกขอบล่างบังครึ่งเพื่อสื่อ affordance ว่าเลื่อนเพิ่มได้
   =================================================================== */
.home-cat-hint {
  font-size: 14px;
  color: var(--text-soft);
  margin: -8px 0 12px;
}

.home-cat-box {
  /* spec: เต็มกว้าง · สูง ≤40% ของจอ · scroll แนวตั้งในกล่อง */
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  padding: 12px 8px 0;        /* ไม่ใส่ bottom padding เพื่อให้แถวล่างถูกขอบบังครึ่งเอง */
}

.home-cat-box:focus-visible {
  outline: 3px solid var(--navy-light);
  outline-offset: 2px;
}

.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* row-height คงที่ 86px → ใน 40vh (~324px viewport 812) แสดง 3.5 แถว → row 4 บังครึ่ง = affordance scroll */
  grid-auto-rows: 86px;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-cat-item {
  list-style: none;
}

.home-cat-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  height: 100%;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-cat-link:hover,
.home-cat-link:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.home-cat-link:active {
  transform: scale(0.97);
}

.home-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--navy);          /* คุมโทน inline SVG ทั้งชุด — content.2 ใช้ stroke=currentColor */
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

/* hover/focus — ไอคอนเปลี่ยนเป็น navy เต็ม สดใสขึ้น */
.home-cat-link:hover .home-cat-icon,
.home-cat-link:focus-visible .home-cat-icon {
  background: var(--navy);
  color: #fff;
  transform: translateY(-2px);
}

.home-cat-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.home-cat-name {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  /* ชื่อยาวบางหมวด — clamp 2 บรรทัด */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* high-contrast variant */
body.high-contrast .home-cat-box {
  background: #111;
  border-color: #fff;
}
body.high-contrast .home-cat-link {
  color: #fff;
}
body.high-contrast .home-cat-link:hover,
body.high-contrast .home-cat-link:focus-visible {
  background: #222;
}
body.high-contrast .home-cat-icon {
  background: #000;
  color: #ffd84a;
}
body.high-contrast .home-cat-name {
  color: #fff;
}

/* font-scale (ก+/ก++) — ป้ายชื่อหมวดต้องโตตามเหมือนส่วนอื่นของเว็บ
   (a11y สำคัญสำหรับผู้สูงอายุ · code review home.3) — เพิ่ม row-height ด้วยกัน clamp ตัดเกินไป */
body.font-large .home-cat-name  { font-size: 13px; }
body.font-xlarge .home-cat-name { font-size: 14px; }
body.font-large  .home-cat-grid { grid-auto-rows: 92px; }
body.font-xlarge .home-cat-grid { grid-auto-rows: 98px; }

/* tablet+: 6 ไอคอน/แถว ใช้พื้นที่กว้างขึ้น (mobile-first; home.3 spec มือถือ — desktop ปรับขึ้น) */
@media (min-width: 768px) {
  .home-cat-grid { grid-template-columns: repeat(6, 1fr); grid-auto-rows: 104px; }
  .home-cat-icon { width: 52px; height: 52px; }
  .home-cat-icon svg { width: 30px; height: 30px; }
  .home-cat-name { font-size: 13px; }
}

/* ===================================================================
   Accessibility — high contrast + font scaling (toggle ผ่าน body class)
   =================================================================== */
body.high-contrast {
  background: #000;
  color: #fff;
}

body.high-contrast header.main,
body.high-contrast .article-card,
body.high-contrast .category-card,
body.high-contrast .hero-card {
  background: #111;
  color: #fff;
}

body.high-contrast .hero,
body.high-contrast .search-section {
  background: #000;
}

body.high-contrast .section-title h2,
body.high-contrast .hero h1,
body.high-contrast .category-card h3,
body.high-contrast .article-card h3,
body.high-contrast .logo-text .name {
  color: #fff;
}

body.high-contrast p,
body.high-contrast .lead,
body.high-contrast .article-card p {
  color: #e2e2e2;
}

body.high-contrast .btn-primary {
  background: #ffd84a;
  color: #000;
}

/* high-contrast — ครอบ shell components (home.2: help-bar / bottom-nav / placeholder) */
body.high-contrast .help-bar {
  background: #000;
  border-bottom: 1px solid #fff;
}

body.high-contrast .bottom-nav {
  background: #000;
  border-top: 1px solid #fff;
}

body.high-contrast .bottom-nav-item {
  color: #ddd;
}

body.high-contrast .bottom-nav-item.active {
  color: #ffd84a;
}

body.high-contrast .home-placeholder {
  background: #111;
  border-color: #fff;
  color: #fff;
}

/* high-contrast — ครอบ component ใหม่ของ design refresh (hero / section bands / accent) */
body.high-contrast .hero-home {
  background: #000;
}
body.high-contrast .hero-home-orb {
  display: none;
}
body.high-contrast .hero-home-eyebrow {
  color: #ffd84a;
}
body.high-contrast .hero-home-eyebrow-dot {
  background: #ffd84a;
  box-shadow: none;
}
body.high-contrast .hero-home-title {
  color: #fff;
}
body.high-contrast .hero-home-title .hl {
  color: #ffd84a;
}
body.high-contrast .hero-home-title .hl::after {
  display: none;
}
body.high-contrast .hero-home-lead {
  color: #e2e2e2;
}
body.high-contrast .hero-home-stats {
  border-top-color: #fff;
}
body.high-contrast .hero-home-stats strong {
  color: #fff;
}
body.high-contrast .hero-home-stats span {
  color: #ddd;
}
body.high-contrast .hero-home-wave path {
  fill: #000;
}

/* section bands → ดำล้วน (ตัดโทนอุ่นออกในโหมดอ่านง่าย) */
body.high-contrast .home-articles,
body.high-contrast .home-vision {
  background: #000;
}
body.high-contrast .home-section-title {
  color: #fff;
}
body.high-contrast .home-section-title::after {
  background: #ffd84a;
}

/* bottom-nav active pill → ดำ (ไอคอนเหลืองอยู่แล้ว) */
body.high-contrast .bottom-nav-item.active .bottom-nav-icon {
  background: #333;
}

/* footer gold accent → เหลืองล้วน */
body.high-contrast footer::before {
  background: #ffd84a;
}

body.font-large {
  --fs-base: 20px;
}

body.font-large .hero h1 {
  font-size: 38px;
}

body.font-large .section-title h2 {
  font-size: 32px;
}

body.font-xlarge {
  --fs-base: 22px;
}

body.font-xlarge .hero h1 {
  font-size: 42px;
}

body.font-xlarge .section-title h2 {
  font-size: 34px;
}

/* ===================================================================
   Responsive — mobile-first base ด้านบน · ขยายขึ้นที่ ≥768 / ≥1024
   =================================================================== */
@media (min-width: 768px) {
  /* desktop: nav กลับเป็นแถวแนวนอน inline · ซ่อนปุ่ม hamburger */
  nav.main-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: none;
    padding: 0;
    box-shadow: none;
  }

  .menu-toggle {
    display: none;
  }

  .hero {
    padding: 64px 0 72px;
  }

  .hero-grid {
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .section-title h2 {
    font-size: 34px;
  }

  section {
    padding: 64px 0;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
  }

  .category-icon {
    width: 84px;
    height: 84px;
  }
}

@media (min-width: 1024px) {
  .hero h1 {
    font-size: 48px;
  }

  .hero p.lead {
    font-size: 21px;
  }

  .section-title h2 {
    font-size: 38px;
  }
}

/* ===================================================================
   About page (pages.3) — วิสัยทัศน์ hero · 3 เสาหลัก · กลยุทธ์ 3 เฟส
   reuse: .container .section-title .cta-section .btn-* (design.1) + :root tokens
   =================================================================== */

/* -- วิสัยทัศน์ (hero) -- */
.about-hero {
  background:
    radial-gradient(circle at 85% 12%, rgba(47, 86, 148, 0.12) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(138, 151, 168, 0.12) 0%, transparent 55%),
    var(--bg);
  text-align: center;
  padding: 40px 0 36px;
}

.about-eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy-light);
  margin-bottom: 12px;
}

.about-vision-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 10px;
}

.about-vision-title .hl {
  color: var(--navy);
  background: linear-gradient(transparent 64%, var(--navy-pale) 64%);
  padding: 0 4px;
}

.about-vision-th {
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 18px;
}

.about-lead {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-soft);
  max-width: 680px;
  margin: 0 auto;
}

.about-lead strong {
  color: var(--text);
  font-weight: 700;
}

/* -- สามเสาหลัก -- */
.pillars-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.pillar-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-cool);
  border-top: 4px solid var(--silver-light);
  padding: 26px 24px;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.pillar-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.pillar-card.is-ready {
  border-top-color: var(--navy);
}

.pillar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pillar-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--navy-pale);
  color: var(--navy);
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.pillar-status {
  font-size: 14px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
}

.pillar-status.status-ready {
  background: var(--navy);
  color: #fff;
}

.pillar-status.status-soon {
  background: var(--silver-pale);
  color: var(--text-soft);
  border: 1px solid var(--silver-light);
}

.pillar-card h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* -- กลยุทธ์ 3 เฟส -- */
.strategy-steps {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.strategy-step {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 4px solid var(--navy);
}

.strategy-step .step-phase {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-light);
  margin-bottom: 4px;
}

.strategy-step h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.strategy-step .step-year {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
  padding: 2px 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.strategy-step p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

/* -- CTA actions (อยู่ใต้ .cta-section เดิม) -- */
.about-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* -- high-contrast: ครอบ component ใหม่ของ about (เสริมจาก design.1) -- */
body.high-contrast .about-hero {
  background: #000;
}

body.high-contrast .about-vision-title,
body.high-contrast .about-vision-th,
body.high-contrast .pillar-card h3,
body.high-contrast .strategy-step h3 {
  color: #fff;
}

body.high-contrast .about-vision-title .hl {
  background: none;
  color: #ffd84a;
}

body.high-contrast .about-lead,
body.high-contrast .about-lead strong,
body.high-contrast .pillar-card p,
body.high-contrast .strategy-step p {
  color: #e2e2e2;
}

body.high-contrast .pillar-card,
body.high-contrast .strategy-step {
  background: #111;
  border-color: #fff;
}

body.high-contrast .pillar-status.status-soon {
  background: #111;
  color: #fff;
  border-color: #fff;
}

body.high-contrast .strategy-step .step-year {
  background: #000;
  color: #fff;
  border-color: #fff;
}

/* -- font scale: ขยาย h1 + body text ตามปุ่ม ก+/ก++ (ระบบ design.1 · กลุ่มผู้สูงอายุ) -- */
body.font-large .about-vision-title {
  font-size: 36px;
}

body.font-large .about-lead {
  font-size: 19px;
}

body.font-large .pillar-card p,
body.font-large .strategy-step p {
  font-size: 18px;
}

body.font-xlarge .about-vision-title {
  font-size: 40px;
}

body.font-xlarge .about-lead {
  font-size: 21px;
}

body.font-xlarge .pillar-card p,
body.font-xlarge .strategy-step p {
  font-size: 20px;
}

/* -- responsive: เสาหลัก/กลยุทธ์ → 3 คอลัมน์ ที่ ≥768 -- */
@media (min-width: 768px) {
  .about-hero {
    padding: 56px 0 48px;
  }

  .about-vision-title {
    font-size: 40px;
  }

  .pillars-grid,
  .strategy-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* ===== หน้าแสดงข้อผิดพลาด (404/403/500) — deploy.1 ===== */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58vh;
  text-align: center;
  padding: 48px 0 64px;
}

.error-inner {
  max-width: 560px;
}

.error-code {
  font-size: 110px;
  font-weight: 800;
  line-height: 1;
  color: var(--navy-pale);
  margin: 0 0 4px;
}

.error-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 12px;
}

.error-desc {
  font-size: var(--fs-base);
  color: var(--text-soft);
  margin: 0 auto 28px;
  max-width: 42ch;
}

.error-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

body.high-contrast .error-code {
  color: var(--silver-light);
}

body.high-contrast .error-title {
  color: #fff;
}

/* ---------- knowledge hub (pages.1) ---------- */
.kh-hero {
  background: linear-gradient(180deg, var(--navy-pale) 0%, var(--bg) 100%);
  padding: 36px 0 28px;
}

.kh-eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-light);
  margin: 0 0 10px;
}

.kh-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 14px;
}

.kh-title .hl {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.kh-lead {
  font-size: var(--fs-base);
  color: var(--text-soft);
  max-width: 640px;
  line-height: 1.65;
  margin: 0 0 22px;
}

.kh-stats {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.kh-stat {
  font-size: 14px;
  color: var(--text-soft);
  padding-top: 14px;
}

.kh-stat strong {
  display: block;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}

.kh-stat-note {
  display: block;
  font-size: 12px;
  color: var(--silver);
  margin-top: 2px;
}

.kh-section {
  padding: 28px 0 36px;
}

.kh-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.kh-item {
  display: block;
}

.kh-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.kh-card:hover,
.kh-card:focus-within {
  box-shadow: var(--shadow-hover);
  border-color: var(--navy-light);
}

.kh-card-head {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 14px;
}

.kh-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--navy-pale);
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kh-card-icon svg {
  width: 30px;
  height: 30px;
}

.kh-card-titles {
  min-width: 0;
}

.kh-card-th {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.kh-card-en {
  font-size: 12px;
  color: var(--silver);
  margin: 2px 0 0;
  line-height: 1.2;
}

.kh-card-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: var(--navy-pale);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.kh-card-body {
  border-top: 1px solid var(--border);
}

.kh-card-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  min-height: 44px;
}

.kh-card-summary::-webkit-details-marker {
  display: none;
}

.kh-card-summary:hover {
  background: var(--navy-pale);
}

.kh-card-summary:focus-visible {
  background: var(--navy-pale);
  outline: 2px solid var(--navy);
  outline-offset: -2px;
}

.kh-card-chev {
  transition: transform 0.2s;
  color: var(--navy);
  flex-shrink: 0;
}

.kh-card-body[open] .kh-card-chev {
  transform: rotate(180deg);
}

.kh-card-body[open] .kh-card-summary {
  background: var(--navy-pale);
}

.kh-subtopics {
  list-style: none;
  margin: 0;
  padding: 6px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kh-subtopics li {
  position: relative;
  padding: 8px 0 8px 18px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  border-bottom: 1px dashed var(--border);
}

.kh-subtopics li:last-child {
  border-bottom: 0;
}

.kh-subtopics li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy-light);
}

.kh-card-soon {
  margin: 4px 16px 14px;
  font-size: 13px;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kh-soon-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--silver);
  background: var(--silver-pale);
  border: 1px solid var(--silver-light);
  padding: 3px 9px;
  border-radius: 999px;
}

.kh-cta {
  background: var(--silver-pale);
  padding: 36px 0;
  text-align: center;
}

.kh-cta h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}

.kh-cta p {
  color: var(--text-soft);
  margin: 0 0 20px;
}

.kh-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .kh-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .kh-title {
    font-size: 36px;
  }
}

@media (min-width: 1024px) {
  .kh-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .kh-hero {
    padding: 56px 0 36px;
  }
  .kh-title {
    font-size: 40px;
  }
}

/* high contrast (โหมดอ่านง่าย) */
body.high-contrast .kh-hero {
  background: #000;
}

body.high-contrast .kh-title,
body.high-contrast .kh-title .hl,
body.high-contrast .kh-eyebrow {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

body.high-contrast .kh-lead,
body.high-contrast .kh-stat,
body.high-contrast .kh-stat-note {
  color: #ddd;
}

body.high-contrast .kh-stat strong {
  color: #fff;
}

body.high-contrast .kh-card {
  background: #111;
  border-color: #fff;
}

body.high-contrast .kh-card-th {
  color: #fff;
}

body.high-contrast .kh-card-en {
  color: #c3ccd8;
}

body.high-contrast .kh-card-icon {
  background: #fff;
  color: #000;
}

body.high-contrast .kh-card-count {
  background: #fff;
  color: #000;
}

body.high-contrast .kh-card-body,
body.high-contrast .kh-subtopics li {
  border-color: #fff;
}

body.high-contrast .kh-card-summary {
  color: #fff;
}

body.high-contrast .kh-card-body[open] .kh-card-summary,
body.high-contrast .kh-card-summary:hover,
body.high-contrast .kh-card-summary:focus-visible {
  background: #222;
}

body.high-contrast .kh-subtopics li {
  color: #fff;
}

body.high-contrast .kh-subtopics li::before {
  background: #fff;
}

body.high-contrast .kh-card-soon {
  color: #ddd;
}

body.high-contrast .kh-soon-pill {
  background: #222;
  color: #fff;
  border-color: #fff;
}

body.high-contrast .kh-cta {
  background: #111;
}

body.high-contrast .kh-cta h2 {
  color: #fff;
}

body.high-contrast .kh-cta p {
  color: #ddd;
}

/* font-scale overrides (ก/ก+/ก++) — สำคัญสำหรับกลุ่มผู้สูงอายุ */
body.font-large .kh-title {
  font-size: 36px;
}
body.font-large .kh-lead {
  font-size: 20px;
}
body.font-large .kh-card-th {
  font-size: 19px;
}
body.font-large .kh-card-summary,
body.font-large .kh-subtopics li {
  font-size: 17px;
}
body.font-large .kh-cta h2 {
  font-size: 26px;
}

body.font-xlarge .kh-title {
  font-size: 40px;
}
body.font-xlarge .kh-lead {
  font-size: 22px;
}
body.font-xlarge .kh-card-th {
  font-size: 21px;
}
body.font-xlarge .kh-card-summary,
body.font-xlarge .kh-subtopics li {
  font-size: 19px;
}
body.font-xlarge .kh-cta h2 {
  font-size: 30px;
}

/* ===================================================================
   Articles list + Article detail (pages.2)
   reuse: .container .section-title .articles-grid .article-card .article-img
          .article-body .article-tag .article-meta .btn-* (design.1)
   ใหม่:  .articles-intro · .article-detail · .article-disclaimer · .article-related
   =================================================================== */

/* -- intro (รายการบทความ) -- */
.articles-intro {
  background:
    radial-gradient(circle at 85% 12%, rgba(47, 86, 148, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(138, 151, 168, 0.10) 0%, transparent 55%),
    var(--bg);
  text-align: center;
  padding: 36px 0 28px;
}

.articles-eyebrow,
.article-eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--navy-light);
  margin-bottom: 10px;
}

.articles-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 14px;
}

.articles-title .hl {
  color: var(--navy);
  background: linear-gradient(transparent 64%, var(--navy-pale) 64%);
  padding: 0 4px;
}

.articles-lead {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-soft);
  max-width: 680px;
  margin: 0 auto;
}

/* -- ปรับ .article-img ให้ขึ้น inline SVG ของหมวด (จาก content.2) สวยงาม -- */
.article-img > svg {
  width: 72px;
  height: 72px;
  color: var(--navy);
}

/* -- ทำหัว h3 ใน article-card คลิกได้แบบไม่ขีดเส้นใต้ -- */
.article-card h3 a,
.article-card h3 a:visited {
  color: inherit;
  text-decoration: none;
}

.article-card h3 a:hover,
.article-card h3 a:focus-visible {
  color: var(--navy);
}

/* ===================================================================
   Article detail (article.php) — หน้าอ่านบทความ
   =================================================================== */
.article-detail {
  padding: 24px 0 8px;
}

.article-container {
  max-width: 760px;
  margin: 0 auto;
}

/* breadcrumb */
.article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.article-breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
}

.article-breadcrumb a:hover,
.article-breadcrumb a:focus-visible {
  color: var(--navy);
  text-decoration: underline;
}

/* header */
.article-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-header .article-tag {
  margin-bottom: 14px;
}

.article-header h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 14px;
}

.article-excerpt {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-soft);
}

.byline-author {
  font-weight: 600;
  color: var(--text);
}

.byline-sep {
  color: var(--silver-light);
}

/* body */
.article-body-detail p {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  margin-bottom: 18px;
}

.article-body-detail p:last-child {
  margin-bottom: 0;
}

/* disclaimer */
.article-disclaimer {
  margin-top: 28px;
  background: var(--navy-pale);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.article-disclaimer h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.article-disclaimer p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.article-disclaimer a {
  color: var(--navy);
  font-weight: 700;
}

/* actions */
.article-actions {
  margin-top: 24px;
  text-align: center;
}

/* related */
.article-related {
  padding: 32px 0 40px;
  background: var(--bg-soft);
}

/* not found */
.article-notfound {
  text-align: center;
  padding: 48px 0;
}

.article-notfound h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 12px;
}

.article-notfound p {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 18px;
}

/* .article-eyebrow merged with .articles-eyebrow above (pages.2 code review #8) */

/* responsive: desktop ขึ้นขนาดหัวข้อ */
@media (min-width: 768px) {
  .articles-title { font-size: 34px; }
  .article-header h1 { font-size: 34px; }
}

/* font-scale support (sync กับ ก/ก+/ก++ จาก home.2) */
body.font-large .article-body-detail p,
body.font-large .article-excerpt,
body.font-large .article-disclaimer p {
  font-size: 19px;
  line-height: 1.9;
}

body.font-xlarge .article-body-detail p,
body.font-xlarge .article-excerpt,
body.font-xlarge .article-disclaimer p {
  font-size: 21px;
  line-height: 1.95;
}

/* high-contrast */
body.high-contrast .articles-intro,
body.high-contrast .article-detail,
body.high-contrast .article-related {
  background: #111;
}

body.high-contrast .articles-title,
body.high-contrast .article-header h1,
body.high-contrast .article-notfound h1,
body.high-contrast .byline-author {
  color: #fff;
}

body.high-contrast .articles-title .hl {
  color: #fff;
  background: #2f5694;
}

body.high-contrast .articles-lead,
body.high-contrast .article-excerpt,
body.high-contrast .article-body-detail p,
body.high-contrast .article-notfound p,
body.high-contrast .article-byline {
  color: #ddd;
}

body.high-contrast .article-disclaimer {
  background: #1c2a3a;
  border-left-color: #fff;
}

body.high-contrast .article-disclaimer h2,
body.high-contrast .article-disclaimer p,
body.high-contrast .article-disclaimer a {
  color: #fff;
}

body.high-contrast .article-breadcrumb a,
body.high-contrast .article-breadcrumb {
  color: #ddd;
}

/* ===================================================================
   Home — search box + suggestion chips (home.4)
   ช่องค้นหา demo UI · ยังไม่ต่อ DB
   - กล่อง search ทรงแบน เงา K PLUS · ปุ่ม navy เด่น · ไอคอน prefix
   - chips กดได้ (visual demo — ไม่ submit จริง) · tap-target ≥ 44px
   override .search-box เดิม (ทำไว้ใน design.1 จาก index.html เก่า) เฉพาะเมื่ออยู่ใน section.home-search
   =================================================================== */
.home-search .search-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 6px 6px 6px 14px;
  gap: 6px;
  align-items: center;
}

.home-search .search-box-icon {
  display: inline-flex;
  align-items: center;
  color: var(--silver);
  flex: 0 0 auto;
}

.home-search .search-box:focus-within .search-box-icon {
  color: var(--navy);
}

.home-search .search-box-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 6px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  min-height: 44px;
}

.home-search .search-box-input::placeholder {
  color: var(--silver);
}

.home-search .search-box-submit {
  flex: 0 0 auto;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-weight: 700;
  font-size: 16px;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.2s;
}

.home-search .search-box-submit:hover,
.home-search .search-box-submit:focus-visible {
  background: var(--navy-dark);
  outline: none;
}

.home-search .search-suggest {
  margin-top: 14px;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.home-search .search-suggest-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  margin-right: 4px;
}

.home-search .search-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-search .search-chip {
  background: var(--navy-pale);
  color: var(--navy);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  min-height: 44px;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.home-search .search-chip:hover,
.home-search .search-chip:focus-visible {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  outline: none;
}

.home-search .search-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--silver);
  font-style: italic;
}

/* font-scale ใหญ่ — chips ขยายให้กดง่ายขึ้น */
body.font-large .home-search .search-chip,
body.font-xlarge .home-search .search-chip {
  font-size: 16px;
  min-height: 44px;
  padding: 10px 16px;
}

body.font-large .home-search .search-box-input,
body.font-xlarge .home-search .search-box-input {
  font-size: 19px;
}

/* high-contrast — chips อ่านง่ายบนพื้นมืด */
body.high-contrast .home-search .search-box {
  background: #111;
  border-color: #fff;
}

body.high-contrast .home-search .search-box-input {
  color: #fff;
}

body.high-contrast .home-search .search-box-input::placeholder {
  color: #aaa;
}

body.high-contrast .home-search .search-chip {
  background: #1c2a3a;
  color: #fff;
  border-color: #fff;
}

body.high-contrast .home-search .search-chip:hover,
body.high-contrast .home-search .search-chip:focus-visible {
  background: #fff;
  color: #000;
}

body.high-contrast .home-search .search-note,
body.high-contrast .home-search .search-suggest-label {
  color: #ddd;
}

/* ===================================================================
   Home section 5/6 (home.6) — บทความเด่น + วิสัยทัศน์ 3 เสาหลัก
   reuse .articles-grid / .article-card (จาก index port) + .pillar-card
   (จาก about.php) — เพิ่มเฉพาะ lead / "ดูทั้งหมด" link
   =================================================================== */
.home-articles-more,
.home-vision-cta {
  margin: 18px 0 0;
  text-align: right;
}

.home-articles-more a,
.home-vision-cta a {
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  padding: 8px 4px;
  min-height: var(--tap);
  line-height: 1.4;
}

.home-articles-more a:hover,
.home-articles-more a:focus-visible,
.home-vision-cta a:hover,
.home-vision-cta a:focus-visible {
  color: var(--navy-dark);
  text-decoration: underline;
}

.home-vision-lead {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.55;
}

.home-articles-empty {
  padding: 24px 16px;
  border: 2px dashed var(--silver-light);
  border-radius: var(--radius);
  background: var(--silver-pale);
  color: var(--text-soft);
  text-align: center;
}

.home-articles-empty a {
  color: var(--navy);
  font-weight: 700;
  margin-left: 8px;
}

/* high-contrast — section 5/6 readability */
body.high-contrast .home-articles-more a,
body.high-contrast .home-vision-cta a,
body.high-contrast .read-more {
  color: #ffd84a;
}

body.high-contrast .article-tag {
  background: #222;
  color: #fff;
}

body.high-contrast .article-meta {
  color: #ddd;
}

body.high-contrast .home-vision-lead {
  color: #e2e2e2;
}

/* ===================================================================
   Home — promo carousel (home.5)
   เลื่อนสไลด์ JS · 3 banners จาก data/promos.php · ไม่มี AI/LINE banner
   accent classes map กับ field accent ใน promos.php: navy / navy-deep / silver
   =================================================================== */
.home-promo-carousel {
  position: relative;
  user-select: none;
}

.home-promo-viewport {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.home-promo-track {
  display: flex;
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
}

.home-promo-slide {
  flex: 0 0 100%;
  min-width: 0;
  padding: 24px 22px 26px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 196px;
}

.home-promo-slide.is-accent-navy {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.home-promo-slide.is-accent-navy-deep {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
}

.home-promo-slide.is-accent-silver {
  background: linear-gradient(135deg, var(--navy-pale) 0%, #d6dde9 100%);
  color: var(--navy-deep);
}

.home-promo-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.85;
  text-transform: none;
}

.home-promo-slide.is-accent-silver .home-promo-eyebrow {
  color: var(--navy);
  opacity: 1;
}

.home-promo-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
  margin: 0;
}

.home-promo-subtitle {
  font-size: 14.5px;
  line-height: 1.55;
  margin: 4px 0 6px;
  opacity: 0.92;
}

.home-promo-slide.is-accent-silver .home-promo-subtitle {
  color: var(--text);
  opacity: 1;
}

.home-promo-cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  font-size: 14.5px;
  min-height: 44px;
  transition: background 160ms ease, transform 160ms ease;
}

.home-promo-cta:hover,
.home-promo-cta:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}

.home-promo-slide.is-accent-silver .home-promo-cta {
  background: var(--navy);
  color: #fff;
}

.home-promo-slide.is-accent-silver .home-promo-cta:hover,
.home-promo-slide.is-accent-silver .home-promo-cta:focus-visible {
  background: var(--navy-dark);
}

.home-promo-cta:focus-visible {
  outline: 3px solid #ffd84a;
  outline-offset: 2px;
}

.home-promo-dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.home-promo-dot {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  position: relative;
  border-radius: 999px;
}

/* WCAG 2.5.5 — hit area เต็ม 44×44 (สำคัญสำหรับผู้สูงอายุ) · จุดมองเห็น 8px วางกลางปุ่ม */
.home-promo-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--silver-light);
  transition: background 160ms ease, width 160ms ease;
}

.home-promo-dot.is-active::after {
  background: var(--navy);
  width: 22px;
  border-radius: 999px;
}

.home-promo-dot:focus-visible {
  outline: 3px solid #ffd84a;
  outline-offset: 2px;
}

/* prefers-reduced-motion: ปิด transition (JS อ่าน flag เดียวกัน → ปิด autoplay) */
@media (prefers-reduced-motion: reduce) {
  .home-promo-track {
    transition: none;
  }
  .home-promo-dot::after {
    transition: none;
  }
  .home-promo-cta {
    transition: none;
  }
}

/* high-contrast: ใช้สีตัดดำ-เหลือง ตามแบบ component อื่น */
body.high-contrast .home-promo-slide {
  background: #000 !important;
  color: #fff !important;
  border: 1px solid #ffd84a;
}

body.high-contrast .home-promo-eyebrow,
body.high-contrast .home-promo-title {
  color: #ffd84a !important;
  opacity: 1;
}

body.high-contrast .home-promo-subtitle {
  color: #fff !important;
  opacity: 1;
}

body.high-contrast .home-promo-cta {
  background: #ffd84a !important;
  color: #000 !important;
}

body.high-contrast .home-promo-dot::after {
  background: #fff;
}

body.high-contrast .home-promo-dot.is-active::after {
  background: #ffd84a;
}
