/* ═══════════════════════════════════════════════════════════════
   home4.css — หน้าแรก (index2.php) แบบใหม่ตามแบบร่าง "แบบร่าง2.png"
   ใช้ตัวแปร/คอมโพเนนต์จาก site.css + theme.css · ไม่ใช้ home.css/home3.css/feature.js แล้ว
   โครง: .h4-sec (แถบเต็มความกว้าง) > .wrap > หัวข้อ .h4-head + เนื้อหา
   ═══════════════════════════════════════════════════════════════ */
/* ฟอนต์ทั้งหน้าแรก (หัวข้อ/การ์ด/แท็บ/หัวเว็บ) = ฟอนต์เดียวกับเมนู (Sarabun) · เดิมหัวข้อใช้ Prompt */
:root { --font-head: var(--font); }
.h4 { display: block; }
.h4-sec { padding-block: 26px 12px; }
.h4-sec.alt { background: linear-gradient(180deg, #eaf3fd 0%, #f3f8fe 100%); }
.h4-sec > .wrap { min-width: 0; }
.h4-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.h4-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; font: 700 1.2rem/1.3 var(--font-head); color: var(--navy); }
.h4-head h2 .ic { width: 26px; height: 26px; color: var(--blue); }
.h4-more { display: inline-flex; align-items: center; gap: 6px; font: 500 .87rem var(--font-head); color: var(--blue); white-space: nowrap; }
.h4-more:hover { text-decoration: none; color: var(--navy); }
.h4-more .ic { width: 16px; height: 16px; }

/* ── Hero ────────────────────────────────────────────── */
.hero4 { position: relative; overflow: hidden; background: linear-gradient(135deg, #2b78d0 0%, #0a3a82 100%); width: 100%; aspect-ratio: 1920 / 670; max-height: 670px; }
.hero4 .h4-slides { position: absolute; inset: 0; }
.hero4 .h4-slide { position: absolute; inset: 0; display: block; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s; }
.hero4 .h4-slide.is-on { opacity: 1; visibility: visible; }
.hero4 .h4-slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; }
.hero4 .h4-ov { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: flex; align-items: center; background: linear-gradient(90deg, rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .55) 38%, rgba(255, 255, 255, 0) 66%); }
.hero4.no-text .h4-ov { display: none; }
.hero4 .h4-ov .wrap { width: 100%; }
.hero4 .h4-copy { max-width: min(560px, 100%); padding-bottom: 28px; pointer-events: auto; }
.hero4 h1 { margin: 0; font: 800 clamp(1.7rem, 3.6vw, 2.9rem)/1.2 var(--font-head); color: var(--navy); text-shadow: 0 2px 0 rgba(255, 255, 255, .7); }
.hero4 .h4-sub { margin: 4px 0 0; font: 700 clamp(1.15rem, 2.4vw, 1.9rem)/1.3 var(--font-head); color: var(--blue); text-shadow: 0 2px 0 rgba(255, 255, 255, .7); }
.hero4 .h4-slogan { margin: 10px 0 0; font: 500 clamp(.95rem, 1.5vw, 1.2rem)/1.5 var(--font-head); color: var(--navy); }
.hero4 .h4-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.hero4 .h4-btn { display: inline-flex; align-items: center; gap: 10px; padding: 11px 26px; border-radius: 99px; font: 600 1rem var(--font-head); border: 2px solid var(--blue); box-shadow: 0 6px 16px rgba(10, 58, 130, .22); transition: transform .15s, background .15s; }
.hero4 .h4-btn:hover { text-decoration: none; transform: translateY(-2px); }
.hero4 .h4-btn.p { background: var(--blue); color: #fff; }
.hero4 .h4-btn.p:hover { background: var(--navy); border-color: var(--navy); }
.hero4 .h4-btn.o { background: #fff; color: var(--blue); }
.hero4 .h4-btn.o:hover { background: var(--sky); }
.hero4 .h4-btn .ic { width: 20px; height: 20px; }
.hero4 .h4-dots { position: absolute; z-index: 4; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.hero4 .h4-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: rgba(10, 58, 130, .75); box-shadow: 0 0 0 1.5px rgba(10, 58, 130, .85), 0 1px 4px rgba(0, 0, 0, .35); cursor: pointer; }
.hero4 .h4-dots button[aria-current="true"] { background: #f5a623; border-color: #fff; transform: scale(1.3); }
.hero4 .h4-wave { display: none !important; position: absolute; z-index: 3; left: 0; right: 0; bottom: -1px; width: 100%; height: 44px; display: block; pointer-events: none; }
.hero4 .h4-wave path { fill: var(--bg); }

/* เลือกภาษา */
.h4-tr { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 4px; }
.hm-tr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--navy); font: 500 .85rem var(--font); cursor: pointer; box-shadow: var(--shadow); }
.hm-tr-btn:hover, .hm-tr-btn[aria-expanded="true"] { background: var(--sky); border-color: var(--blue); }

/* ── บริการประชาชน (E-Service) ─────────────────────── */
.h4-svc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }   /* แถวละ 4 ใบ */
.h4-svc li { display: flex; min-width: 0; }
.svc4 { --c: #1d6fd6; --bgc: #eaf3ff; --bd: #cfe1fa; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 20px 14px 18px; background: var(--bgc); border: 1px solid var(--bd); border-radius: 16px; color: var(--ink); transition: transform .2s, box-shadow .2s; }
.svc4:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 14px 28px rgba(10, 58, 130, .16); }
.svc4:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.svc4 .ico { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: var(--c); color: #fff; margin-bottom: 8px; box-shadow: 0 6px 14px rgba(0, 0, 0, .16); }
.svc4 .ico .ic { width: 34px; height: 34px; }
.svc4 b { font: 700 .87rem/1.35 var(--font-head); color: var(--c); overflow-wrap: anywhere; }
.svc4 small { font-size: .82rem; line-height: 1.45; color: #4d5b73; overflow-wrap: anywhere; }
/* ปุ่มลิงก์แบบรูปล้วน (banner-link) — ไม่มีกรอบการ์ด · ช่องขนาดเท่ากัน 2:1 (รูปเดิมเป็นริบบิ้น ~337×166 พื้นโปร่งใส) แสดงครบไม่ครอบ · แถวสุดท้ายอยู่กึ่งกลาง */
.h4-bnr { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 16px; }
.h4-bnr li { flex: 0 0 calc(25% - 12px); min-width: 0; }
.h4-bnr a { display: block; aspect-ratio: 2 / 1; border-radius: 12px; transition: transform .2s, filter .2s; }
.h4-bnr a:hover { transform: translateY(-4px); filter: drop-shadow(0 10px 14px rgba(10, 58, 130, .22)); text-decoration: none; }
.h4-bnr a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.h4-bnr img { display: block; width: 100%; height: 100%; object-fit: contain; }
.h4-svc li:nth-child(5n+2) .svc4 { --c: #1f9d57; --bgc: #eaf8f0; --bd: #c8ead6; }
.h4-svc li:nth-child(5n+3) .svc4 { --c: #ee8a1b; --bgc: #fff4e4; --bd: #fadfb6; }
.h4-svc li:nth-child(5n+4) .svc4 { --c: #e5484d; --bgc: #fdeced; --bd: #f6c9cb; }
.h4-svc li:nth-child(5n+5) .svc4 { --c: #7a4bd6; --bgc: #f1ebfd; --bd: #dccdf8; }

/* ── ข่าวสาร / ประกาศ: แท็บ + รายการเอกสาร + ตัวอย่าง ─────── */
.h4-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 0 14px; padding: 0 0 6px; overflow-x: auto; scrollbar-width: thin; border: 0; }
.h4-tabs [role="tab"] { flex: 0 0 auto; white-space: nowrap; padding: 8px 18px; border: 1px solid var(--blue); border-radius: 99px; background: #fff; color: var(--blue); font: 500 .87rem/1.2 var(--font-head); cursor: pointer; }
.h4-tabs [role="tab"]:hover { background: var(--sky); }
.h4-tabs [role="tab"][aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(15, 95, 194, .3); }
.h4-docs { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }   /* การ์ดซ้าย-ขวาสูงเท่ากัน */
.h4-doclist { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 16px; min-width: 0; }
.h4-doclist ul { list-style: none; margin: 0; padding: 0; }
.h4-doclist ul[hidden] { display: none; }
.doc { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: 0; }
.doc.is-sel { background: linear-gradient(90deg, #f1f7ff, rgba(241, 247, 255, 0)); box-shadow: inset 3px 0 0 var(--blue); padding-left: 8px; margin-left: -8px; }
.dk { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 8px; background: var(--bg, #eef2f9); color: var(--c, #5b6b8c); }
.dk .ic { width: 22px; height: 22px; }
.doc .dmain { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.doc .dt { color: var(--navy); font: 600 .87rem/1.45 var(--font-head); overflow-wrap: anywhere; }
a.dt:hover { color: var(--blue); text-decoration: none; }
.doc .dm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .78rem; }
.doc .dm .chip { padding: 0 10px; border-radius: 6px; background: var(--sky); color: var(--blue); font: 500 .74rem/1.7 var(--font-head); }
.doc .dm time { display: inline-flex; align-items: center; gap: 4px; }
.doc .dm .ic { width: 13px; height: 13px; }
.doc .dfile { text-align: center; line-height: 1.25; min-width: 58px; }
.doc .dfile b { display: block; font: 700 .78rem var(--font-head); color: var(--c, #5b6b8c); }
.doc .dfile small { color: var(--muted); font-size: .72rem; }
.dact { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--sky); color: var(--blue); cursor: pointer; transition: background .15s, color .15s; }
.dact:hover { background: var(--blue); color: #fff; text-decoration: none; }
.dact .ic { width: 17px; height: 17px; }
.dact.off { visibility: hidden; }
.dk.ft-pdf, .dk.ft-word, .dk.ft-excel, .dk.ft-ppt, .dk.ft-zip, .dk.ft-img, .dk.ft-video, .dk.ft-cloud, .dk.ft-link, .dk.ft-file { background: var(--bg); color: var(--c); }
.doc[data-kind] .dfile b { color: inherit; }

.pv { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px 18px; min-width: 0; position: sticky; top: 90px; }
.pv-h { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font: 600 .87rem var(--font-head); color: var(--navy); }
.pv-h .ic { color: var(--blue); width: 18px; height: 18px; }
.pv-t { margin: 0 0 8px; font: 700 .87rem/1.45 var(--font-head); color: var(--navy); overflow-wrap: anywhere; }
.pv-m { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: .8rem; }
.pv-m li { display: inline-flex; align-items: center; gap: 5px; }
.pv-m .ic { width: 14px; height: 14px; color: var(--blue); }
.pv-box { border-radius: 10px; overflow: hidden; background: #3a4150; aspect-ratio: 3 / 3.2; display: grid; }
.pv-box iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.pv-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.pv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; color: #dfe6f3; background: #3a4150; }
.pv-empty .ic { width: 44px; height: 44px; opacity: .7; }
.pv-empty p { margin: 0; font-size: .9rem; }
.pv-empty[hidden] { display: none; }
.pv-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pv-act a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 8px; font: 600 .87rem var(--font-head); border: 1px solid transparent; }
.pv-act a:hover { text-decoration: none; filter: brightness(1.08); }
.pv-act a[hidden] { display: none; }
.pv-act .ic { width: 16px; height: 16px; }
.pv-act .red { background: #e0393e; color: #fff; }
.pv-act .out { background: #fff; color: var(--blue); border-color: #c4d7f2; }

/* ── ภาพกิจกรรม ─────────────────────────────────────── */
.h4-acts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.h4-acts li { display: flex; min-width: 0; }
.h4-acts a { flex: 1; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); color: inherit; transition: transform .2s, box-shadow .2s; }
.h4-acts a:hover { text-decoration: none; transform: translateY(-4px); box-shadow: 0 14px 26px rgba(10, 58, 130, .16); }
.h4-acts .ph { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--sky); color: var(--blue-2); overflow: hidden; }
.h4-acts .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.h4-acts a:hover .ph img { transform: scale(1.05); }
.h4-acts .new { position: absolute; left: 8px; top: 8px; padding: 1px 10px; border-radius: 99px; background: var(--red); color: #fff; font: 600 .72rem var(--font-head); }
.h4-acts .bd { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.h4-acts .tt { color: var(--navy); font: 600 .87rem/1.45 var(--font-head); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h4-acts time { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
.h4-acts time .ic { width: 14px; height: 14px; color: var(--blue); }

/* ── บริการสำคัญ (4 ช่อง) ───────────────────────────── */
.h4-key { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.h4-key li { display: flex; min-width: 0; }
.key4 { --k1: #0a4aa6; --k2: #1d7ae0; flex: 1; display: flex; align-items: center; gap: 16px; min-height: 100px; padding: 16px 20px; border-radius: 14px; color: #fff; background: linear-gradient(120deg, var(--k1), var(--k2)); box-shadow: 0 8px 20px rgba(10, 58, 130, .22); transition: transform .2s, filter .2s; position: relative; overflow: hidden; }
.key4::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.key4:hover { text-decoration: none; color: #fff; transform: translateY(-3px); filter: brightness(1.08); }
.key4 .ico { flex: none; display: grid; place-items: center; width: 62px; height: 62px; }
.key4 .ico .ic { width: 54px; height: 54px; stroke-width: 1.6; }
.key4 .tx { min-width: 0; display: grid; gap: 2px; line-height: 1.4; }
.key4 b { font: 700 .87rem/1.35 var(--font-head); overflow-wrap: anywhere; }
.key4 small { font-size: .82rem; opacity: .92; overflow-wrap: anywhere; }
.h4-key li:nth-child(2) .key4 { --k1: #a4131f; --k2: #e0393e; }
.h4-key li:nth-child(3) .key4 { --k1: #0a5f9e; --k2: #17a2c8; }
.h4-key li:nth-child(4) .key4 { --k1: #7a5a14; --k2: #c3992f; }

/* ── โปสเตอร์ · แบนเนอร์คั่น ─────────────────────────── */
.h4-posters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.h4-posters .poster { display: block; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
a.poster:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(10, 58, 130, .16); }
.h4-posters .poster img { display: block; width: 100%; height: auto; }
.h4-break { display: block; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.h4-break img { display: block; width: 100%; height: auto; }
.hm-intro { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; box-shadow: var(--shadow); overflow-x: auto; }
.hm-intro img { max-width: 100%; height: auto; }
/* เกริ่นนำ + สาส์นจากนายกฯ (2 การ์ดเท่ากัน · ใบเดียว = เต็มกว้าง) */
.h4-welcome { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: stretch; }
.h4-welcome .wcard:first-child .wb img { width: 100%; }   /* เกริ่นนำ: รูปกว้างเต็มการ์ด */
/* สาส์นจากนายกฯ: การ์ดแคบ สูงเท่าเกริ่นนำ (ไม่กำหนดความสูงแถวเอง — รูปย่อให้พอดีพื้นที่) */
.h4-welcome:not(.one) .wcard.mayor { position: relative; }
.h4-welcome:not(.one) .wcard.mayor .wb { position: absolute; inset: 0; padding: 0; overflow: hidden; }
.h4-welcome:not(.one) .wcard.mayor .wb img { position: absolute !important; inset: 10px; width: calc(100% - 20px) !important; height: calc(100% - 20px) !important; max-width: none !important; object-fit: contain; margin: 0 !important; }
.wcard .wh { display: none !important; }   /* ไม่แสดงหัวการ์ด (ยังเก็บ h2 ไว้ใน HTML ให้อ่านออกเสียง/โครงสร้างเอกสาร) */
.h4-welcome .wcard:first-child { min-height: 300px; }
.h4-welcome .wcard:first-child .wb { padding: 14px; }
.h4-welcome.one { grid-template-columns: minmax(0, 1fr); }
.wcard { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.wcard .wh { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 18px; font: 700 1.2rem/1.3 var(--font-head); color: var(--navy); background: var(--sky); border-bottom: 1px solid var(--line); }
.wcard .wh .ic { width: 22px; height: 22px; color: var(--blue); flex: none; }
.wcard .wb { padding: 16px 18px; overflow-x: auto; font-size: .87rem; line-height: 1.7; }
.wcard .wb > :first-child { margin-top: 0; }
.wcard .wb > :last-child { margin-bottom: 0; }
.wcard .wb img { max-width: 100%; height: auto; display: block; margin-inline: auto; border-radius: 8px; }
@media (max-width: 1000px) {
  .h4-welcome { grid-template-columns: minmax(0, 1fr); }
  .h4-welcome:not(.one) .wcard.mayor { position: static; }
  .h4-welcome:not(.one) .wcard.mayor .wb { position: static; display: block; overflow-x: auto; padding: 16px 18px; }
  .h4-welcome:not(.one) .wcard.mayor .wb img { position: static !important; width: auto !important; max-width: 100% !important; height: auto !important; margin-inline: auto !important; }
}

/* ── ประกาศ กองคลัง ─────────────────────────────────── */
.h4-fin { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 18px 16px; }
.fin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.fin-list li { min-width: 0; border-bottom: 1px solid var(--line); }
.fin-list a { display: flex; gap: 14px; align-items: center; height: 100%; padding: 10px 4px; color: inherit; }
.fin-list a:hover { background: var(--sky); text-decoration: none; }
.fin-list .th { flex: none; width: 92px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sky); display: grid; place-items: center; color: var(--blue-2); }
.fin-list .th img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.fin-list .tx { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.fin-list .tt { color: var(--navy); font-weight: 500; font-size: .87rem; line-height: 1.5; overflow-wrap: anywhere; }
.fin-list .mt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fin-list time { color: var(--muted); font-size: .78rem; }
.fin-list .chip { padding: 1px 12px; border-radius: 99px; background: var(--sky); color: var(--blue); font: 600 .75rem/1.6 var(--font-head); }
.fin-list .chip.is-new { background: #fde8ea; color: var(--red); }
.h4-more-c { margin-top: 12px; text-align: center; }

/* ── วิดีโอ · หน่วยงานภายใน · หน่วยงานภายนอก ───────────── */
.h4-vu { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 26px; align-items: stretch; }
.h4-vu.one { grid-template-columns: minmax(0, 1fr); }
.h4-vid { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0a2a5c; box-shadow: var(--shadow); }
.h4-vid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.h4-vid:hover img { transform: scale(1.04); }
.h4-vid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 20, 50, .78) 0%, rgba(0, 20, 50, 0) 55%); }
.h4-vid .pl { position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: #fff; color: #0a3a82; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.h4-vid .pl .ic { width: 30px; height: 30px; margin-left: 3px; }
.h4-vid .vt { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 12px; color: #fff; font: 700 .87rem/1.4 var(--font-head); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.h4-vthumbs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.h4-vthumbs a { display: block; color: var(--navy); font-size: .8rem; line-height: 1.4; }
.h4-vthumbs a:hover { text-decoration: none; color: var(--blue); }
.h4-vthumbs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 4px; }
.h4-vthumbs span { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.h4-units { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.h4-units a { display: flex; align-items: center; gap: 12px; padding: 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); color: var(--navy); transition: transform .2s, box-shadow .2s; }
.h4-units a:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 22px rgba(10, 58, 130, .14); }
.h4-units .ui { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--sky); color: var(--blue); }
.h4-units .ui .ic { width: 22px; height: 22px; }
.h4-units b { display: block; font: 600 .87rem/1.35 var(--font-head); overflow-wrap: anywhere; }
.h4-units small { display: block; color: var(--muted); font-size: .75rem; }
.h4-ext { list-style: none; margin: 0; padding: 0; columns: 2 200px; column-gap: 28px; }
.h4-rin { display: flex; flex-direction: column; gap: 22px; }
.h4-extwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.h4-extwrap .h4-extbox { flex: 1; min-height: 0; overflow-y: auto; }
/* จอใหญ่: คอลัมน์ขวาสูงเท่าวิดีโอด้านซ้าย (หน่วยงานภายนอกเลื่อนดูได้ถ้ายาว) */
@media (min-width: 1001px) {
  .h4-vu:not(.one) .h4-rcol { position: relative; min-height: 0; }
  .h4-vu:not(.one) .h4-rin { position: absolute; inset: 0; }
}
.h4-ext li { break-inside: avoid; padding: 7px 0 7px 18px; position: relative; border-bottom: 1px dashed var(--line); }
.h4-ext li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.h4-ext a { color: var(--navy); overflow-wrap: anywhere; }
.h4-ext a:hover { color: var(--blue); }
.h4-extbox { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px 20px 10px; }

/* ── จอเล็ก ──────────────────────────────────────────── */
@media (max-width: 1200px) {
  .h4-svc { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h4-bnr li { flex-basis: calc(33.333% - 11px); }
  .h4-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .h4-key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .h4-docs, .h4-vu { grid-template-columns: minmax(0, 1fr); }
  .pv { position: static; }
  .fin-list { grid-template-columns: minmax(0, 1fr); }
  .h4-posters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero4 .h4-ov { background: linear-gradient(90deg, rgba(255, 255, 255, .86) 0%, rgba(255, 255, 255, .6) 70%, rgba(255, 255, 255, .25) 100%); }
  .hero4 .h4-copy { padding-bottom: 36px; }
  .hero4 .h4-btn { padding: 9px 18px; font-size: .92rem; }
  .h4-svc { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .h4-bnr { gap: 10px; }
  .h4-bnr li { flex-basis: calc(50% - 5px); }
  .h4-acts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .h4-key { grid-template-columns: minmax(0, 1fr); }
  .h4-posters { grid-template-columns: minmax(0, 1fr); }
  .h4-head h2 { font-size: 1.2rem; }
  .doc { grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; }
  .doc .dfile { display: none; }
  .h4-vthumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .h4-svc .svc4 { padding: 16px 8px 12px; }
  .svc4 .ico { width: 56px; height: 56px; }
  .svc4 b { font-size: .87rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hero4 .h4-slide { transition: none; }
}
