/* หน้าเนื้อหาในโลก "สายน้ำในมุมใหม่" (Liquid Glass) ต่อยอด motion.css + glass.css
   ใช้กับ <body class="mo-page ig-page gl"> · โทนมืดเป็นค่าเริ่มต้น โทนสว่างอยู่ท้ายไฟล์
   บล็อก: gl-hero · gl-sec · gl-h2/gl-h3/gl-kicker · gl-grid + gl-card · gl-split · gl-table · gl-list · gl-stat · gl-chip · gl-sources */

.gl { padding-bottom: 0; }
.gl [hidden] { display: none !important; } /* gl-card ฯลฯ ตั้ง display เอง จึงต้องให้ hidden ชนะ */
.gl-main { position: relative; }
.gl-main a:not(.btn) { color: #f29a3f; text-underline-offset: .2em; }

/* ----- หัวหน้า ----- */
.gl-hero { position: relative; padding: 88px 0 72px; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.gl-hero-sky { position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 78% 20%, #1c1e52 0%, #12143a 40%, #0b0c29 75%); }
.gl-hero-sky::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -40%; height: 70%; border-radius: 50%; border-top: 1px solid rgb(220 214 255 / .22); box-shadow: 0 -30px 80px -40px rgb(220 214 255 / .35); }
.gl-kicker { font: 500 .95rem/1.4 var(--display); letter-spacing: .04em; color: #f29a3f; margin: 0 0 14px; }
.gl-title { font: 500 clamp(2.6rem, 5vw, 4.4rem)/1.25 var(--display); letter-spacing: -.02em; margin: 0 0 20px; max-width: 18ch; }
.gl-lede { font-size: 1.1rem; line-height: 1.85; color: var(--dim); max-width: 58ch; margin: 0 0 28px; }

/* ----- ส่วนเนื้อหา ----- */
.gl-sec { padding: 88px 0; position: relative; scroll-margin-top: 16px; }
.gl-sec + .gl-sec { border-top: 1px solid var(--line); }
.gl-sec--tint { background: linear-gradient(180deg, #0e1033, #0b0c29); }
.gl-h2 { font: 500 clamp(1.9rem, 3.4vw, 2.9rem)/1.35 var(--display); margin: 0 0 18px; max-width: 24ch; }
.gl-h3 { font: 500 1.3rem/1.4 var(--display); margin: 0 0 10px; }
.gl-intro { color: var(--dim); max-width: 62ch; margin: 0 0 36px; }

/* ----- การ์ดกระจก (ใช้คู่กับคลาส glass) ----- */
.gl-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); margin: 0; padding: 0; list-style: none; }
/* Buttons under a card grid need room; .mo-actions has no top margin of its own. */
.gl-grid + .mo-actions { margin-top: 28px; }
.gl-grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.gl-card { padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gl-card > :last-child { margin-bottom: 0; }
.gl-card p { margin: 0; color: var(--dim); font-size: .98rem; }
.gl-card .btn { align-self: flex-start; margin-top: auto; }
.gl-card img { width: 100%; height: auto; border-radius: 10px; display: block; }
.gl-card-n { font: 500 1.9rem/1 var(--display); color: #b5b1ce; }

.gl-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.gl-split--wide { grid-template-columns: 1.3fr 1fr; }

/* ----- ตัวเลขเด่น / ป้ายสถานะ ----- */
.gl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0; margin: 0; }
.gl-stat { padding: 18px 22px 18px 0; border-top: 1px solid #6660a4; }
.gl-stat dt { color: var(--dim); font-size: .92rem; }
.gl-stat dd { margin: 4px 0 0; font: 500 2rem/1.2 var(--display); }
.gl-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); width: max-content; }
.gl-chip[data-level="ok"] { color: var(--ok); border-color: currentColor; }
.gl-chip[data-level="warn"] { color: var(--warn); border-color: currentColor; }
.gl-chip[data-level="bad"] { color: var(--bad); border-color: currentColor; }

/* ----- รายการ / ตาราง ----- */
.gl-list { list-style: none; margin: 0; padding: 0; }
.gl-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.gl-list li b { display: block; }
.gl-list li span { color: var(--dim); font-size: .95rem; }
.gl-table-wrap { overflow-x: auto; border-radius: 16px; }
.gl-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.gl-table caption { caption-side: top; text-align: left; font: 500 1.1rem/1.4 var(--display); color: var(--dim); padding: 18px 20px 8px; }
.gl-table th, .gl-table td { text-align: left; padding: 13px 20px; border-top: 1px solid var(--line); vertical-align: top; }
.gl-table thead th { font-weight: 600; color: var(--dim); border-top: 0; }
.gl-table .gl-num { font: 500 1.05rem/1.35 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ----- ที่ว่างรอรูป/ไฟล์จริง ----- */
.gl-ph { display: grid; place-items: center; min-height: 160px; padding: 16px; text-align: center; border: 1px dashed rgb(220 214 255 / .35); border-radius: 12px; color: var(--dim); font-size: .88rem; background: rgb(220 214 255 / .04); }

/* ----- ฟอร์ม (ใช้ mo-form ของ motion.css เป็นฐาน) ----- */
.gl .mo-form input:not([type="radio"]):not([type="checkbox"]), .gl .mo-form select, .gl .mo-form textarea { background: #151845; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font: inherit; min-height: 50px; width: 100%; }
.gl .mo-form textarea { min-height: 120px; resize: vertical; }

/* ----- เชิงอรรถ / แหล่งที่มา ----- */
.gl-fn { font-size: .7em; vertical-align: super; text-decoration: none; }
.gl-sources ol { margin: 0; padding-left: 1.4em; color: var(--dim); font-size: .9rem; display: grid; gap: 6px; }
.gl-note { font-size: .88rem; color: var(--dim); max-width: 70ch; margin: 20px 0 0; }

@media (max-width: 1099px) {
  .gl-split, .gl-split--wide { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .ig-page .gl-main .mo-wrap { width: calc(100% - 32px); }
  .gl-hero { padding: 56px 0 48px; }
  .gl-title { font-size: 2.3rem; }
  .gl-lede { font-size: 1rem; }
  .gl-sec { padding: 60px 0; }
  .gl-card { padding: 22px 20px; }
  .gl-table th, .gl-table td { padding: 11px 14px; }
}
/* Table columns get too narrow for Thai words on phones: stack each row, label cells from the header (glass-pages.js sets data-label). */
@media (max-width: 640px) {
  .gl-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gl-table, .gl-table caption, .gl-table tbody, .gl-table tr, .gl-table tbody th, .gl-table td { display: block; }
  .gl-table tbody tr { border-top: 1px solid var(--line); padding-block: 10px; }
  .gl .gl-table tbody tr th, .gl .gl-table tbody tr td { border-top: 0; padding-block: 4px; width: auto; }
  .gl-table td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 600; color: var(--dim); }
}

/* ----- โทนสว่าง ----- */
[data-theme="light"] .gl-main a:not(.btn) { color: var(--accent); }
[data-theme="light"] .gl-hero-sky { background: radial-gradient(ellipse at 78% 20%, #ece8f4 0%, #f1eee9 40%, #f6f7f3 75%); }
[data-theme="light"] .gl-hero-sky::after { border-top-color: rgb(29 79 145 / .2); box-shadow: 0 -30px 80px -40px rgb(29 79 145 / .25); }
[data-theme="light"] .gl-kicker { color: #b34812; }   /* rust kicker, as on map/sai-series1.html */
[data-theme="light"] .gl-sec--tint { background: #eceee6; }
[data-theme="light"] .gl-card-n { color: var(--dim); }
[data-theme="light"] .gl-stat { border-top-color: #a9a9a2; }
[data-theme="light"] .gl-ph { border-color: rgb(21 21 21 / .25); background: rgb(255 255 255 / .5); }
[data-theme="light"] .gl .mo-form input:not([type="radio"]):not([type="checkbox"]), [data-theme="light"] .gl .mo-form select, [data-theme="light"] .gl .mo-form textarea { background: #fff; border-color: rgb(21 21 21 / .25); }
