/* =========================================================
   SPTI PCRU — ระบบดีไซน์ ม่วงทอง (สีจากโลโก้)
   แก้สี/ระยะทั้งเว็บได้ที่ :root ที่เดียว
   ========================================================= */
:root {
  /* สีแบรนด์ (ดูดจากโลโก้) */
  --brand: #5b2a86;        /* ม่วง PCRU */
  --brand-700: #46206a;
  --brand-900: #26113a;    /* ม่วงเข้ม พื้นหลัง hero/footer */
  --brand-100: #ece3f5;
  --brand-50: #f7f2fb;
  --gold: #d6a32e;         /* ทอง SPTI */
  --gold-400: #e8c25a;
  --gold-600: #9c7212;     /* ทองสำหรับตัวหนังสือบนพื้นขาว */
  --gold-50: #fcf6e6;

  /* สีกลาง */
  --ink: #211a2b;
  --muted: #5f5670;
  --line: #e6dfee;
  --bg: #ffffff;
  --bg-soft: #faf8fc;

  /* ตัวอักษร */
  --font: "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, sans-serif;
  --font-head: "Anuphan", "IBM Plex Sans Thai", system-ui, sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
  --fs-2xl: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);

  /* ระยะ มุม เงา */
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4.5rem;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(38, 17, 58, .06), 0 6px 18px rgba(38, 17, 58, .07);
  --shadow-2: 0 14px 36px rgba(38, 17, 58, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --container: 1200px;
}

/* ---------- พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.7;
  color: var(--ink); background: var(--bg);
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.3; margin: 0 0 var(--space-3); color: var(--brand-900); text-wrap: balance; }
p { margin: 0 0 var(--space-4); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: var(--brand-900); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ไอคอนเส้น (SVG sprite) */
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; padding: .72em 1.35em;
  border-radius: 999px; border: 2px solid transparent; font: 600 var(--fs-sm)/1.2 var(--font);
  text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), background .2s, color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-gold { background: var(--gold); color: var(--brand-900); }
.btn-gold:hover { background: var(--gold-400); color: var(--brand-900); box-shadow: 0 8px 20px rgba(214, 163, 46, .35); }
.btn-purple { background: var(--brand); color: #fff; }
.btn-purple:hover { background: var(--brand-700); color: #fff; }
.btn-ghost { border-color: currentColor; color: var(--brand); background: transparent; }
.btn-ghost:hover { background: var(--brand-50); }
.btn-ghost-light { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.link-arrow { display: inline-flex; align-items: center; gap: .35em; font-weight: 600; text-decoration: none; }
.link-arrow .i { transition: transform .2s var(--ease); }
.link-arrow:hover .i { transform: translateX(3px); }

/* ---------- แถบบนสุด ---------- */
.topbar { background: var(--brand-900); color: #e9e0f3; font-size: var(--fs-xs); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); min-height: 40px; }
.topbar a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .4em; }
.topbar a:hover { color: var(--gold-400); }
.topbar-list { display: flex; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.topbar .i { color: var(--gold); }

/* ---------- ส่วนหัว + เมนู ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 84px; }
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--brand-900); }
.brand img { height: 58px; width: auto; }
.brand-text { line-height: 1.25; font-size: var(--fs-xs); color: var(--muted); border-left: 2px solid var(--gold); padding-left: var(--space-3); max-width: 15rem; }
.brand-text strong { display: block; font-family: var(--font-head); font-size: var(--fs-sm); color: var(--brand-900); }
.main-nav ul { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: .55em .9em; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: var(--fs-sm); transition: background .2s, color .2s;
}
.main-nav a:hover { background: var(--brand-50); color: var(--brand); }
.main-nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; color: var(--brand-900); cursor: pointer; }
.nav-toggle .i { width: 28px; height: 28px; }

/* ---------- Hero สไลด์ ---------- */
.hero { position: relative; background: var(--brand-900); color: #fff; overflow: hidden; isolation: isolate; }
.hero::before { /* แสงม่วงไล่เฉด */
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(70% 90% at 85% 20%, #6d3299 0%, transparent 60%), radial-gradient(60% 80% at 10% 100%, #3a1857 0%, transparent 70%);
}
.shards { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.shard { position: absolute; }
.shard-1 { right: 6%; top: 12%; width: 220px; height: 120px; background: linear-gradient(120deg, var(--gold), #b9851c); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); opacity: .9; }
.shard-2 { right: -2%; top: 12%; width: 300px; height: 120px; background: linear-gradient(100deg, #3e1660, #8a3fae 70%, #b45aa8); clip-path: polygon(22% 0, 100% 0, 100% 8%, 60% 100%, 0 100%); }
.shard-3 { right: 12%; top: calc(12% + 132px); width: 170px; height: 300px; background: linear-gradient(160deg, var(--gold), #a8781a); clip-path: polygon(0 0, 100% 0, 100% 100%); opacity: .85; }
.shard-4 { right: 1%; top: calc(12% + 132px); width: 150px; height: 300px; background: linear-gradient(170deg, var(--gold-400), var(--gold)); clip-path: polygon(0 0, 70% 0, 12% 100%); opacity: .55; }
.hero-slides { position: relative; min-height: 520px; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; visibility: hidden; transition: opacity .7s var(--ease), visibility .7s; }
.slide.is-active { opacity: 1; visibility: visible; position: relative; }
.slide-inner { padding-block: var(--space-8); max-width: 640px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em;
  color: var(--gold-400); text-transform: uppercase; margin-bottom: var(--space-3);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: currentColor; }
.hero h1, .hero h2 { color: #fff; font-size: var(--fs-2xl); margin-bottom: var(--space-4); }
.hero h1 em, .hero h2 em { font-style: normal; color: var(--gold); }
.hero p { color: #ddd0ea; font-size: var(--fs-lg); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.hero-controls { position: absolute; left: 0; right: 0; bottom: var(--space-5); }
.hero-controls .container { display: flex; align-items: center; gap: var(--space-3); }
.dot { width: 34px; height: 4px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, .3); cursor: pointer; padding: 0; transition: background .3s, width .3s; }
.dot[aria-selected="true"] { background: var(--gold); width: 56px; }
.hero-arrow { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; cursor: pointer; }
.hero-arrow:hover { background: rgba(255, 255, 255, .1); }
.hero-arrow:first-of-type { margin-left: auto; }

/* ---------- ส่วนเนื้อหา ---------- */
.section { padding-block: var(--space-8); }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head h2 { font-size: var(--fs-xl); margin: 0; }
.section-head p { color: var(--muted); margin: var(--space-2) 0 0; max-width: 40em; }
.kicker { display: inline-flex; align-items: center; gap: .5em; color: var(--gold-600); font-weight: 600; font-size: var(--fs-sm); margin-bottom: var(--space-2); }
.kicker::before { content: ""; width: 10px; height: 10px; background: var(--gold); clip-path: polygon(0 0, 100% 0, 0 100%); }
.grid { display: grid; gap: var(--space-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* การ์ดบริการ */
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5);
  box-shadow: var(--shadow-1); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); border-color: var(--brand-100); }
.card h3 { font-size: var(--fs-lg); margin-bottom: var(--space-2); }
.card p { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--space-4); }
.card-icon {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; margin-bottom: var(--space-4);
  background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: var(--gold-400);
}
.card-icon .i { width: 28px; height: 28px; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* ทั้งการ์ดกดได้ */
.card .link-arrow { font-size: var(--fs-sm); }

/* แถบตัวเลข/ข้อเท็จจริง */
.facts { background: linear-gradient(100deg, var(--brand-900), var(--brand-700)); color: #fff; border-radius: var(--radius); padding: var(--space-6); display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.fact { border-left: 3px solid var(--gold); padding-left: var(--space-4); }
.fact strong { display: block; font-family: var(--font-head); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem); color: var(--gold-400); line-height: 1.2; }
.fact span { color: #ddd0ea; font-size: var(--fs-sm); }

/* การ์ดทุน */
.fund {
  position: relative; display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.fund-top { background: var(--brand-900); color: #fff; padding: var(--space-5); position: relative; overflow: hidden; }
.fund-top::after { content: ""; position: absolute; right: -20px; top: 0; width: 120px; height: 100%; background: var(--gold); clip-path: polygon(55% 0, 100% 0, 100% 100%, 0 100%); opacity: .9; }
.fund-top h3 { color: #fff; margin-bottom: var(--space-1); position: relative; z-index: 1; max-width: 75%; }
.fund-top .amount { font-family: var(--font-head); font-size: var(--fs-xl); color: var(--gold-400); position: relative; z-index: 1; }
.fund-top .amount small { font-size: var(--fs-sm); color: #ddd0ea; }
.fund-body { padding: var(--space-5); flex: 1; display: flex; flex-direction: column; }
.fund-body ul { list-style: none; padding: 0; margin: 0 0 var(--space-5); display: grid; gap: var(--space-2); }
.fund-body li { display: flex; gap: .6em; font-size: var(--fs-sm); color: var(--muted); }
.fund-body li .i { color: var(--gold-600); margin-top: .2em; }
.fund-body .btn { margin-top: auto; align-self: flex-start; }

/* ป้ายสถานะ */
.badge { display: inline-flex; align-items: center; gap: .35em; font-size: var(--fs-xs); font-weight: 600; padding: .25em .75em; border-radius: 999px; background: var(--brand-50); color: var(--brand); }
.badge-gold { background: var(--gold-50); color: var(--gold-600); }
.badge-closed { background: #f1eff3; color: #6b6475; }
.badge-on-dark { background: rgba(255, 255, 255, .12); color: #fff; }

/* ข่าว */
.news-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-1); position: relative; transition: transform .25s var(--ease), box-shadow .25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.news-body { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.news-meta { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-xs); color: var(--muted); }
.news-meta .i { color: var(--gold-600); }
.news-card h3 { font-size: var(--fs-md); margin: 0; }
.news-card h3 a { color: var(--brand-900); text-decoration: none; }
.news-card h3 a::after { content: ""; position: absolute; inset: 0; }
.news-card p { font-size: var(--fs-sm); color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ภาพปกแทนรูป (เปลี่ยนเป็น <img> ได้) */
.cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--brand-900), var(--brand) 70%); overflow: hidden; color: var(--gold-400); display: grid; place-items: center; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover::before { content: ""; position: absolute; right: -10%; top: 0; width: 55%; height: 45%; background: var(--gold); clip-path: polygon(40% 0, 100% 0, 60% 100%, 0 100%); opacity: .85; }
.cover::after { content: ""; position: absolute; right: 8%; bottom: -5%; width: 28%; height: 60%; background: var(--gold-400); clip-path: polygon(0 0, 100% 0, 100% 100%); opacity: .35; }
.cover .i { width: 54px; height: 54px; position: relative; z-index: 1; stroke-width: 1.4; }
.cover .badge { position: absolute; left: var(--space-4); top: var(--space-4); z-index: 2; background: rgba(255, 255, 255, .95); }

/* ขั้นตอน */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); list-style: none; padding: 0; margin: 0; }
.steps li { position: relative; padding-top: var(--space-6); }
.steps li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; top: 0; left: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.5rem; color: var(--gold);
}
.steps li::after { content: ""; position: absolute; top: 18px; left: 48px; right: 0; height: 2px; background: linear-gradient(90deg, var(--brand-100), transparent); }
.steps h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.steps p { font-size: var(--fs-sm); color: var(--muted); margin: 0; }

/* แบนเนอร์ชวนติดต่อ */
.cta { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--brand-900); color: #fff; padding: var(--space-7) var(--space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; isolation: isolate; }
.cta::before { content: ""; position: absolute; right: 0; top: 0; width: 260px; height: 100%; background: linear-gradient(160deg, var(--gold), #a8781a); clip-path: polygon(45% 0, 100% 0, 100% 100%, 0 100%); z-index: -1; opacity: .9; }
.cta h2 { color: #fff; font-size: var(--fs-xl); margin: 0 0 var(--space-2); }
.cta p { color: #ddd0ea; margin: 0; }

/* ---------- หัวหน้าย่อย ---------- */
.page-hero { position: relative; background: var(--brand-900); color: #fff; overflow: hidden; isolation: isolate; padding-block: var(--space-7) var(--space-7); }
.page-hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(60% 120% at 90% 0%, #6d3299 0%, transparent 60%); }
.page-hero::after { content: ""; position: absolute; right: 4%; top: 0; width: 260px; height: 100%; z-index: -1; background: linear-gradient(160deg, var(--gold), #a8781a); clip-path: polygon(50% 0, 100% 0, 40% 100%, 0 100%); opacity: .55; }
.page-hero h1 { color: #fff; font-size: var(--fs-2xl); margin: 0 0 var(--space-2); }
.page-hero p { color: #ddd0ea; margin: 0; max-width: 40em; }
.breadcrumb { display: flex; gap: .5em; list-style: none; padding: 0; margin: 0 0 var(--space-3); font-size: var(--fs-xs); color: #cbb9de; }
.breadcrumb a { color: var(--gold-400); text-decoration: none; }
.breadcrumb li + li::before { content: "/"; margin-right: .5em; opacity: .6; }

/* เนื้อหายาว */
.prose { max-width: 46em; }
.prose h2 { font-size: var(--fs-xl); margin-top: var(--space-6); }
.prose h3 { font-size: var(--fs-lg); margin-top: var(--space-5); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--gold); }
.split { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--space-7); align-items: start; }
.split.reverse { grid-template-columns: .85fr 1.15fr; }
.split.reverse > :first-child { order: 2; }
.split > .cover { border-radius: var(--radius); }
.panel { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.panel h3 { font-size: var(--fs-lg); }

/* พันธกิจ */
.mission { display: flex; gap: var(--space-4); align-items: flex-start; }
.mission .num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-50); color: var(--gold-600); font-family: var(--font-head); font-weight: 700; }
.mission h3 { font-size: var(--fs-md); margin-bottom: var(--space-1); }
.mission p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

/* ทีมงาน */
.person { text-align: center; }
.avatar { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto var(--space-3); display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: var(--gold-400); font-family: var(--font-head); font-size: 1.75rem; font-weight: 600; box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--gold); }
.person h3 { font-size: var(--fs-md); margin-bottom: 0; }
.person p { color: var(--muted); font-size: var(--fs-sm); margin: 0; }

/* แท็บกรองข่าว */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.filter { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: .5em 1.1em; border-radius: 999px; font: 500 var(--fs-sm) var(--font); cursor: pointer; }
.filter:hover { border-color: var(--brand); color: var(--brand); }
.filter[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
[hidden] { display: none !important; }

/* ไทม์ไลน์ทุน */
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--brand-100); }
.timeline li { position: relative; padding: 0 0 var(--space-5) var(--space-5); }
.timeline li::before { content: ""; position: absolute; left: -8px; top: .45em; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px #fff; }
.timeline strong { display: block; color: var(--brand-900); }
.timeline span { color: var(--muted); font-size: var(--fs-sm); }

/* ตาราง */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 560px; }
th, td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--brand-50); color: var(--brand-900); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* ติดต่อ */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.contact-list li { display: flex; gap: var(--space-3); }
.contact-list .ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.contact-list strong { display: block; color: var(--brand-900); }
.contact-list span, .contact-list a { font-size: var(--fs-sm); color: var(--muted); }
.map { border: 0; width: 100%; height: 340px; border-radius: var(--radius); background: var(--brand-50); }
.form { display: grid; gap: var(--space-4); }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.field label { display: block; font-weight: 500; font-size: var(--fs-sm); margin-bottom: var(--space-1); color: var(--brand-900); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: var(--fs-sm); padding: .75em 1em; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.form-note { font-size: var(--fs-xs); color: var(--muted); }

/* บทความข่าว */
.article-cover { border-radius: var(--radius); margin-bottom: var(--space-5); }
.article-cover.cover { aspect-ratio: 21 / 9; }
.share { display: flex; gap: var(--space-2); align-items: center; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- ส่วนท้าย ---------- */
.site-footer { background: var(--brand-900); color: #cbb9de; font-size: var(--fs-sm); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: var(--space-6); padding-block: var(--space-7); }
.footer-logo { display: inline-block; background: #fff; border-radius: 12px; padding: 10px 14px; margin-bottom: var(--space-4); }
.footer-logo img { height: 52px; width: auto; }
.site-footer h3 { color: #fff; font-size: var(--fs-md); margin-bottom: var(--space-4); }
.site-footer h3::after { content: ""; display: block; width: 32px; height: 3px; background: var(--gold); margin-top: var(--space-2); border-radius: 2px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-footer a { color: #e9e0f3; text-decoration: none; }
.site-footer a:hover { color: var(--gold-400); }
.footer-contact li { display: flex; gap: .6em; }
.footer-contact .i { color: var(--gold); margin-top: .25em; }
.social { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; }
.social a:hover { background: var(--gold); color: var(--brand-900); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding-block: var(--space-4); font-size: var(--fs-xs); display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1080px) {
  .brand-text { display: none; }
  .grid-4, .facts { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav { position: fixed; inset: 84px 0 auto 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-2); padding: var(--space-3) 1rem var(--space-5); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s var(--ease); max-height: calc(100vh - 84px); overflow-y: auto; }
  .main-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: var(--space-1); }
  .main-nav a { padding: .8em 1em; border-radius: var(--radius-sm); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: var(--space-6); }
  .shards { opacity: .35; }
}
@media (max-width: 640px) {
  .topbar-list li:not(:first-child) { display: none; }
  .topbar .container > a { display: none; }
  .brand img { height: 46px; }
  .site-header .container { min-height: 72px; }
  .main-nav { inset: 72px 0 auto 0; max-height: calc(100vh - 72px); }
  .grid-2, .grid-3, .grid-4, .facts, .steps, .footer-top, .form .row { grid-template-columns: 1fr; }
  .hero-slides { min-height: 560px; }
  .slide-inner { padding-block: var(--space-7) var(--space-8); }
  .section { padding-block: var(--space-7); }
  .cta { padding: var(--space-6) var(--space-5); }
  .cta::before { width: 120px; opacity: .5; }
  .steps li::after { display: none; }
  /* การ์ดบริการแบบแนวนอน ไม่ให้หน้ายาวเกิน */
  .card { display: grid; grid-template-columns: 48px 1fr; column-gap: var(--space-4); padding: var(--space-4); }
  .card-icon { width: 48px; height: 48px; margin: 0; grid-row: span 3; }
  .card-icon .i { width: 24px; height: 24px; }
  .card > :not(.card-icon) { grid-column: 2; }
  .card p { margin-bottom: var(--space-2); }
  .grid-3 { gap: var(--space-3); }
}
@media (max-width: 960px) {
  .split.reverse { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- ส่วนที่ใช้กับระบบ PHP ---------- */
.badge-open { background: #e5f5ea; color: #1b6b37; }
.cover.has-img::before, .cover.has-img::after { display: none; }
.filters a.filter { text-decoration: none; }
.filter[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-6); }
.pager a { display: grid; place-items: center; min-width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.empty { color: var(--muted); text-align: center; padding: var(--space-7) 0; }
.divider { border: 0; border-top: 1px solid var(--line); margin: var(--space-5) 0; }
.alert { display: flex; gap: .6em; align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.alert .i { margin-top: .2em; }
.alert-ok { background: #e5f5ea; color: #1b6b37; }
.alert-error { background: #fdecec; color: #a32020; }
.field-error { color: #a32020; font-size: var(--fs-xs); margin: var(--space-1) 0 0; }
.field [aria-invalid="true"] { border-color: #c43b3b; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ปุ่มแสดง/ซ่อนรหัสผ่าน */
.pw-wrap { position: relative; }
.field .pw-wrap input { padding-right: 3.2em; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--brand); background: var(--brand-50); }
.pw-toggle[aria-pressed="true"] { color: var(--brand); }

/* SweetAlert2 ให้เข้าธีม */
.swal-spti.swal2-popup { font-family: var(--font); border-radius: var(--radius); padding: var(--space-6) var(--space-5) var(--space-5); color: var(--ink); }
.swal-spti .swal2-title { font-family: var(--font-head); color: var(--brand-900); font-size: var(--fs-lg); }
.swal-spti .swal2-html-container { color: var(--muted); font-size: var(--fs-md); line-height: 1.7; }
.swal-spti .swal2-actions { gap: var(--space-3); }
.swal-spti .swal2-icon.swal2-warning { border-color: var(--gold); color: var(--gold-600); }
.swal-spti .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(91, 42, 134, .25); }
.swal-spti .swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--brand); }
.swal-spti.swal-toast { padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-2); }
.swal-spti.swal-toast .swal2-title { font-family: var(--font); font-size: var(--fs-sm); font-weight: 500; color: var(--ink); margin: 0 0 0 var(--space-2); }
.swal-spti .swal2-timer-progress-bar { background: var(--gold); }
.btn-danger { background: #b42318; color: #fff; }
.btn-danger:hover { background: #912018; color: #fff; }
