/* ============================================================
   REG 2026 — สำนักส่งเสริมวิชาการและงานทะเบียน ม.ราชภัฏธนบุรี
   ธีมการศึกษาสมัยใหม่ (น้ำเงินมหาวิทยาลัย + สีกลุ่มผู้ใช้)
   ============================================================ */
:root {
	--reg-blue: #1e3a8a;
	--reg-blue2: #1d4ed8;
	--reg-blue-soft: #eff4ff;
	--reg-green: #0e9f6e;
	--reg-amber: #d97706;
	--reg-red: #dc2626;
	--reg-orange: #ea580c;
	--reg-ink: #0f172a;
	--reg-muted: #64748b;
	--reg-line: #e2e8f0;
	--reg-bg: #f1f5f9;
	--container: 1440px;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(2, 6, 23, .06), 0 8px 24px rgba(2, 6, 23, .07);
}
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
	font-family: 'Noto Sans Thai', 'Segoe UI', Tahoma, sans-serif;
	background: var(--reg-bg);
	color: var(--reg-ink);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
main, .layout, .home-wrap { flex: 1 0 auto; }
a { text-decoration: none; }
h1, h2, h3, h4, .brand-title, .hh3 { font-family: 'Prompt', 'Noto Sans Thai', sans-serif; }

.skip-link {
	position: absolute; left: -999px; top: 0; z-index: 3000;
	background: #fff; color: var(--reg-blue); padding: 10px 18px;
	border-radius: 0 0 10px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Topbar ---------- */
.topbar { background: #0b1e4b; color: #cbd5e1; font-size: 12.5px; }
.topbar-inner {
	max-width: var(--container); margin: 0 auto; padding: 6px 16px;
	display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.topbar .fa-solid { color: #93c5fd; margin-right: 4px; }
.topbar-inner > div { display: flex; gap: 18px; flex-wrap: wrap; }
.tb-right a { color: #e2e8f0; }
.tb-right a:hover { color: #fff; }
.tb-sep { width: 1px; height: 12px; background: #334155; display: inline-block; }

/* ---------- Brandbar ---------- */
.brandbar { background: linear-gradient(120deg, var(--reg-blue) 0%, #1e40af 55%, #2563eb 100%); color: #fff; }
.brandbar-inner {
	max-width: var(--container); margin: 0 auto; padding: 16px;
	display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-badge {
	width: 52px; height: 52px; border-radius: 14px; background: #fff; color: var(--reg-blue);
	display: inline-flex; align-items: center; justify-content: center;
	font-weight: 800; font-size: 18px; letter-spacing: .5px; box-shadow: var(--shadow); flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-title { font-size: 21px; font-weight: 700; }
.brand-sub { font-size: 12px; opacity: .85; }
.brand-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-cta {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
	box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.btn-cta:hover { transform: translateY(-2px); }
.btn-cta-blue { background: #fff; color: var(--reg-blue); }
.btn-cta-blue:hover { color: var(--reg-blue); }
.btn-cta-green { background: var(--reg-green); color: #fff; }
.btn-cta-green:hover { color: #fff; }
.navtoggle {
	display: none; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
	color: #fff; width: 44px; height: 44px; border-radius: 12px; font-size: 18px;
}

/* ---------- Main nav ---------- */
.mainnav { background: #fff; border-bottom: 1px solid var(--reg-line); box-shadow: 0 1px 0 rgba(2,6,23,.04); }
.mainnav-inner { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.navlinks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.navlinks li a {
	display: block; padding: 13px 18px; font-weight: 600; font-size: 14.5px; color: #334155;
	border-bottom: 3px solid transparent;
}
.navlinks li a:hover { color: var(--reg-blue2); background: var(--reg-blue-soft); }
.navlinks li a.active { color: var(--reg-blue); border-bottom-color: var(--reg-blue2); }

/* ---------- Breadcrumb ---------- */
.crumb { background: #fff; border-bottom: 1px solid var(--reg-line); }
.crumb-inner {
	max-width: var(--container); margin: 0 auto; padding: 10px clamp(16px, 3vw, 48px);
	font-size: 13px; color: var(--reg-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.crumb-inner a { color: var(--reg-blue2); font-weight: 600; }
.crumb-inner .sep { font-size: 10px; color: #cbd5e1; }
.crumb-inner span:last-child { color: var(--reg-ink); font-weight: 600; }

/* ---------- Home ---------- */
.home-wrap { max-width: var(--container); width: 100%; margin: 0 auto; padding: 26px clamp(16px, 3vw, 48px) 40px; }

.hero {
	background: linear-gradient(115deg, #0b1e4b 0%, var(--reg-blue) 45%, #2563eb 100%);
	border-radius: 20px; color: #fff; padding: 34px 34px 0; overflow: hidden; position: relative;
	box-shadow: var(--shadow);
}
.hero h1 { font-size: clamp(20px, 3.4vw, 30px); font-weight: 700; margin-bottom: 8px; }
.hero p { color: #dbeafe; max-width: 640px; margin-bottom: 18px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-badge {
	background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25);
	padding: 6px 14px; border-radius: 999px; font-size: 12.5px; color: #eff6ff;
}
.hero-deco {
	position: absolute; right: -40px; top: -30px; width: 260px; height: 260px;
	background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.16), transparent 60%);
	border-radius: 50%;
}

/* --- ปุ่มลิงก์จาก WEBMSG.URLLINK (แสดงเฉพาะข่าวที่กรอกลิงก์) --- */
.hero-link-btn {
	background: rgba(255,255,255,.94); color: var(--reg-blue); font-weight: 600; border-color: transparent;
	transition: transform .15s ease, box-shadow .15s ease;
}
.hero-link-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.28); color: var(--reg-blue2); }

/* --- Hero สไลด์ข่าวประชาสัมพันธ์ --- */
.hero-slide { display: none; }
.hero-slide.is-active { display: flex; gap: 26px; align-items: stretch; }
.hero-slide-body { flex: 1 1 auto; min-width: 0; }
.hero-kicker {
	display: inline-flex; align-items: center; gap: 7px;
	background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
	padding: 5px 13px; border-radius: 999px; font-size: 12.5px; color: #eff6ff;
	margin-bottom: 12px; font-weight: 600;
}
.hero-slide-text {
	color: #dbeafe; max-width: 720px; margin-bottom: 18px;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-slide-text * { color: #dbeafe !important; }
.hero-slide-img {
	flex: 0 0 300px; align-self: center; border-radius: 14px; overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25);
	background: rgba(255,255,255,.1);
}
.hero-slide-img img { display: block; width: 100%; height: 210px; object-fit: cover; }
.hero-dots { display: flex; gap: 8px; justify-content: center; padding: 0 0 16px; position: relative; z-index: 2; }
.hero-dot {
	width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: rgba(255,255,255,.35); transition: all .2s ease;
}
.hero-dot.is-active { background: #fff; transform: scale(1.25); }

/* --- โมดัลเนื้อข่าวเต็ม --- */
.hero-news-modal .modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.hero-news-modal .modal-header {
	background: linear-gradient(115deg, #0b1e4b, var(--reg-blue) 60%, #2563eb);
}
.hero-news-modal .modal-title { color: #fff; font-weight: 700; font-size: 17px; padding-right: 30px; }
.hero-news-modal .btn-close { filter: invert(1); opacity: .85; }
.hero-news-meta { font-size: 13px; color: var(--reg-muted); margin-bottom: 14px; }
.hero-news-img { margin-bottom: 16px; border-radius: 12px; overflow: hidden; border: 1px solid var(--reg-line); }
.hero-news-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #f1f5f9; }
.hero-news-full { font-size: 15px; line-height: 1.8; color: var(--reg-ink); }
.hero-news-full img { max-width: 100%; height: auto; border-radius: 10px; }
.hero-news-full table { max-width: 100%; }
@media (max-width: 767px) {
	.hero-slide.is-active { flex-direction: column; }
	.hero-slide-img { flex-basis: auto; width: 100%; order: -1; }
	.hero-slide-img img { height: 170px; }
}

.notice-strip {
	margin-top: 18px; background: #fff; border: 1px solid var(--reg-line); border-radius: var(--radius);
	padding: 14px 18px; display: flex; align-items: flex-start; gap: 12px; box-shadow: var(--shadow);
}
.notice-strip .fa-bullhorn { color: var(--reg-amber); margin-top: 3px; }
.notice-strip b { color: var(--reg-blue); }

.home-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 16px; }
.home-title h2 { font-size: 20px; font-weight: 700; margin: 0; }
.home-title .line { flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--reg-blue2), transparent); }
.home-title a { font-size: 13px; font-weight: 600; color: var(--reg-blue2); white-space: nowrap; }

.hub-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.hub-card {
	background: #fff; border: 1px solid var(--reg-line); border-radius: 18px;
	padding: 22px 22px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
	transition: transform .16s ease, box-shadow .16s ease;
}
.hub-card:hover { transform: translateY(-4px); box-shadow: 0 4px 10px rgba(2,6,23,.08), 0 18px 40px rgba(2,6,23,.12); }
.hub-card .hub-ico {
	width: 54px; height: 54px; border-radius: 16px; display: inline-flex;
	align-items: center; justify-content: center; font-size: 22px; color: #fff; margin-bottom: 12px;
}
.hub-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.hub-card .hub-desc { color: var(--reg-muted); font-size: 13px; margin-bottom: 10px; }
.hub-card ul { list-style: none; margin: 0 0 12px; padding: 0; }
.hub-card ul li { padding: 6px 0; border-top: 1px dashed var(--reg-line); }
.hub-card ul li a { color: #334155; font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.hub-card ul li a:hover { color: var(--reg-blue2); }
.hub-card ul li a::before { content: '›'; color: var(--reg-blue2); font-weight: 700; }
.hub-more { font-weight: 600; font-size: 13.5px; color: var(--reg-blue2); display: inline-flex; align-items: center; gap: 6px; }
.hub-green .hub-ico { background: var(--reg-green); }
.hub-blue  .hub-ico { background: var(--reg-blue2); }
.hub-orange .hub-ico { background: var(--reg-orange); }
.hub-red   .hub-ico { background: var(--reg-red); }

/* Quick links */
.quick-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-card {
	background: #fff; border: 1px solid var(--reg-line); border-radius: 16px; padding: 16px;
	display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow); color: var(--reg-ink);
	transition: transform .15s ease;
}
.quick-card:hover { transform: translateY(-3px); color: var(--reg-ink); }
.quick-card .q-ico {
	width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto;
	display: inline-flex; align-items: center; justify-content: center; font-size: 18px; color: #fff;
}
.quick-card b { display: block; font-size: 14px; }
.quick-card small { color: var(--reg-muted); font-size: 12px; }
.qi-green  { background: var(--reg-green); }
.qi-blue   { background: var(--reg-blue2); }
.qi-amber  { background: var(--reg-amber); }
.qi-red    { background: var(--reg-red); }
.qi-purple { background: #7c3aed; }
.qi-teal   { background: #0d9488; }
.qi-orange { background: var(--reg-orange); }
.qi-slate  { background: #475569; }
.qi-sky    { background: #0284c7; }
.qi-rose   { background: #e11d48; }

/* ---------- Layout 2 columns ---------- */
.layout { max-width: var(--container); width: 100%; margin: 0 auto; padding: 22px clamp(16px, 3vw, 48px) 44px; }
.layout-inner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.layout-main { min-width: 0; }

.page-card {
	background: #fff; border: 1px solid var(--reg-line); border-radius: var(--radius);
	padding: 26px 28px; box-shadow: var(--shadow);
}
.page-card h3 { color: var(--reg-blue); font-size: 20px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.page-card h3 .fa-solid { color: var(--reg-blue2); }
.page-card h4.alert-heading { color: var(--reg-blue); font-size: 16.5px; font-weight: 700; }
.page-card ul { padding-left: 4px; list-style: none; }
.page-card ul > li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px dashed #eef2f7; }
.page-card ul > li::before {
	content: '\f0da'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
	color: var(--reg-blue2); position: absolute; left: 8px; top: 7px;
}
.page-card ul ul > li::before { content: '–'; font-family: inherit; font-weight: 700; }
.page-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.page-card table th, .page-card table td { border: 1px solid var(--reg-line); padding: 8px 10px; vertical-align: top; }
.page-card table thead th { background: var(--reg-blue-soft); color: var(--reg-blue); }

/* แถบลัดภายในหน้า (reg.full) */
.chipnav {
	display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
}
.chipnav a {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 15px; border-radius: 999px;
	background: #fff; border: 1px solid var(--reg-line); color: var(--reg-blue);
	font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
	transition: transform .12s ease, background .12s ease;
}
.chipnav a:hover { background: var(--reg-blue-soft); transform: translateY(-2px); color: var(--reg-blue2); }
.page-section { margin-bottom: 18px; scroll-margin-top: 16px; }

/* details/summary ของแผนยุทธศาสตร์ */
details.callout > summary { cursor: pointer; user-select: none; list-style: none; }
details.callout > summary::-webkit-details-marker { display: none; }
details.callout > summary::before {
	content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
	font-size: 11px; margin-right: 8px; color: var(--reg-blue2);
	display: inline-block; transition: transform .15s ease;
}
details.callout[open] > summary::before { transform: rotate(180deg); }
details.callout > summary:hover { opacity: .85; }

/* doc-grid — รายการเอกสารแบบหลายคอลัมน์ (ใช้พื้นที่กว้างคุ้มค่า) */
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; padding-left: 0; }
.doc-grid > li {
	border: 1px dashed #dbe3ee; border-radius: 12px; background: #f8fafc;
	padding: 10px 14px 10px 26px; margin: 0;
}
.doc-grid > li:hover { background: var(--reg-blue-soft); }
.doc-grid > li > ul { margin-top: 8px; }

/* callouts */
.callout { border-radius: 12px; padding: 16px 18px; margin: 0 0 16px; border: 1px solid; border-left-width: 5px; }
.callout-info    { background: var(--reg-blue-soft); border-color: #bfdbfe; border-left-color: var(--reg-blue2); }
.callout-success { background: #ecfdf5; border-color: #a7f3d0; border-left-color: var(--reg-green); }
.callout-warning { background: #fffbeb; border-color: #fde68a; border-left-color: var(--reg-amber); }
.callout-danger  { background: #fef2f2; border-color: #fecaca; border-left-color: var(--reg-red); }
.callout ul { margin: 0; }

/* news accordion */
.news-card { padding: 0; overflow: hidden; margin-bottom: 12px; }
.news-head {
	width: 100%; background: none; border: 0; text-align: left; padding: 15px 18px;
	display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.news-head:hover { background: #f8fafc; }
.news-ico {
	width: 38px; height: 38px; border-radius: 10px; background: var(--reg-blue-soft);
	color: var(--reg-blue2); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.news-title { font-weight: 600; font-size: 15px; flex: 1; color: var(--reg-ink); }
.news-date { color: var(--reg-muted); font-size: 12px; white-space: nowrap; }
.news-body { border-top: 1px solid var(--reg-line); }
.news-body-in { padding: 16px 18px 18px 68px; color: #334155; font-size: 14px; }
.news-body-in img { max-width: 100%; height: auto; }
/* ปุ่มลิงก์ + รูปประกอบในเนื้อข่าว (จาก WEBMSG.URLLINK / IMAGEFILENAME) */
.news-link-btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 16px; border-radius: 999px; margin-bottom: 12px;
	background: var(--reg-blue); color: #fff; font-size: 13px; font-weight: 600;
	box-shadow: var(--shadow); transition: transform .15s ease, background .15s ease;
}
.news-link-btn:hover { background: var(--reg-blue2); color: #fff; transform: translateY(-2px); }
.news-img { margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--reg-line); background: #f8fafc; }
.news-img img { display: block; width: 100%; max-height: 420px; object-fit: contain; }
.empty-note { text-align: center; color: var(--reg-muted); padding: 30px; }

/* ---------- Sidebar ---------- */
.layout-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 14px; }
.sidebox { background: #fff; border: 1px solid var(--reg-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.sidebox-head {
	background: linear-gradient(120deg, var(--reg-blue), #2563eb); color: #fff;
	padding: 12px 16px; font-weight: 700; font-size: 14.5px;
}
.sidebox-list { list-style: none; margin: 0; padding: 6px; }
.sidebox-list li a {
	display: block; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: #334155;
}
.sidebox-list li a:hover { background: var(--reg-blue-soft); color: var(--reg-blue); }
.sidebox-list li a.active { background: var(--reg-blue); color: #fff; font-weight: 600; }
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.quick-btn {
	border-radius: 12px; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px;
	font-size: 12px; font-weight: 600; color: #fff; text-align: center; line-height: 1.3;
}
.quick-btn i { font-size: 17px; }
.qb-blue { background: var(--reg-blue2); }
.qb-green { background: var(--reg-green); }
.qb-red { background: var(--reg-red); }
.qb-amber { background: var(--reg-amber); }
.sidebox.director { text-align: center; padding: 20px 16px; }
.dir-avatar {
	width: 74px; height: 74px; margin: 0 auto 10px; border-radius: 50%;
	background: linear-gradient(135deg, var(--reg-blue), #2563eb); color: #fff;
	display: flex; align-items: center; justify-content: center; font-size: 28px;
	overflow: hidden; border: 3px solid #dbeafe; box-shadow: var(--shadow);
}
.dir-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; /* รูปแนวตั้ง — เลื่อน focus ให้ใบหน้าลงตัววงกลม */ }
.dir-name { font-weight: 700; font-size: 14.5px; }
.dir-role { color: var(--reg-muted); font-size: 12.5px; margin-top: 4px; }

/* ผังองค์กร (reg.structure) */
.org-exec { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.org-exec .person { min-width: 240px; }
.org-link { color: var(--reg-blue2); font-size: 15px; opacity: .7; }

.org-heads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

.org-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.org-col { border: 1px dashed #dbe3ee; border-radius: 12px; overflow: hidden; background: #fff; }
.org-col-head {
	padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: #fff;
	display: flex; align-items: center; gap: 7px;
}
.og-blue { background: var(--reg-blue2); }
.og-green { background: var(--reg-green); }
.og-amber { background: var(--reg-amber); }
.og-teal  { background: #0d9488; }
.org-staff { list-style: none; margin: 0; padding: 8px; }
.org-staff li {
	display: flex; align-items: center; gap: 9px;
	padding: 6px 6px; border-bottom: 1px dashed #eef2f7; font-size: 12.5px;
}
.org-staff li:last-child { border-bottom: 0; }
.org-staff li img {
	width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
	background: #e2e8f0; border: 2px solid #f1f5f9;
}
.org-staff li span { line-height: 1.35; }

@media (max-width: 991px) {
	.org-heads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.org-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
	.org-heads { grid-template-columns: 1fr; }
	.org-cols { grid-template-columns: 1fr; }
}

/* person grid (โครงสร้างบุคลากร) */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.person {
	background: #f8fafc; border: 1px solid var(--reg-line); border-radius: 14px;
	padding: 14px 10px; text-align: center;
}
.person .p-ava {
	width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 50%; overflow: hidden;
	background: #e2e8f0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 24px;
}
.person img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; /* รูปบัตรแนวตั้ง — เลื่อน focus ขึ้นบนให้ใบหน้าลงตัววงกลม */ }
.person b { display: block; font-size: 13px; }
.person small { color: var(--reg-muted); font-size: 12px; }
.person-lead .p-ava { width: 84px; height: 84px; }

/* video grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.video-grid video { width: 100%; border-radius: 12px; background: #000; }

/* pdf chip */
.dl-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
	background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 600; margin-left: 6px;
}

/* ---------- Footer ---------- */
.site-footer { background: #0b1e4b; color: #cbd5e1; margin-top: auto; }
.footer-inner {
	max-width: var(--container); margin: 0 auto; padding: 34px 16px 20px;
	display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px;
}
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; margin-bottom: 12px; line-height: 1.35; }
.footer-brand .brand-badge { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }
.footer-addr { font-size: 13px; }
.footer-map { color: #93c5fd; font-size: 13px; font-weight: 600; }
.footer-col h6 { color: #fff; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 4px 0; font-size: 13px; }
.footer-col a { color: #cbd5e1; }
.footer-col a:hover { color: #fff; }
.footer-copy {
	border-top: 1px solid #1e3a8a; max-width: var(--container); margin: 0 auto; padding: 14px 16px 22px;
	display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: #94a3b8;
}

/* 404 */
.nf-box { text-align: center; padding: 60px 20px; }
.nf-code { font-size: 72px; font-weight: 800; color: var(--reg-blue2); font-family: 'Prompt', sans-serif; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1199px) {
	.hub-grid, .quick-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.doc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
	.hub-grid, .quick-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.layout-inner { grid-template-columns: 1fr; }
	.layout-side { position: static; }
	.footer-inner { grid-template-columns: 1fr 1fr; }
	.brandbar-inner { padding: 12px 14px; }
	.brand-title { font-size: 17px; }
	.brand-sub { display: none; }
}
@media (max-width: 767px) {
	.brand-cta { display: none; }
	body.nav-open .brand-cta {
		display: flex; width: 100%; order: 5;
	}
	.brand-cta .btn-cta { flex: 1; justify-content: center; }
	.navtoggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
	.brand { margin-right: 0; }
	.mainnav { display: none; }
	body.nav-open .mainnav { display: block; }
	.navlinks { flex-direction: column; }
	.navlinks li a { border-bottom: 1px solid var(--reg-line); border-bottom-width: 1px !important; }
	.news-body-in { padding-left: 18px; }
	.footer-inner { grid-template-columns: 1fr; }
	.hero { padding: 24px 20px 0; }
	.topbar .tb-left span:nth-child(2) { display: none; }
}
@media (max-width: 575px) {
	.hub-grid, .quick-row { grid-template-columns: 1fr; }
	.doc-grid { grid-template-columns: 1fr; }
}
@media print {
	.topbar, .mainnav, .layout-side, .site-footer, .crumb, .brand-cta { display: none !important; }
	body { background: #fff; }
	.page-card, .hub-card, .sidebox { box-shadow: none; border-color: #ccc; }
}

/* ============================================================
   กิจกรรม/โครงการ — แกลเลอรีเลื่อนดูรูป (page/view/projects)
   ข้อมูลจากหลังบ้าน admin/acts (ตาราง REG_ACTIVITIES)
   ============================================================ */
.act-block { padding: 18px 20px 20px; }
.act-date { color: var(--reg-muted); font-size: 13px; margin: 0 0 8px; }
.act-desc { color: #334155; font-size: 14.5px; line-height: 1.75; margin-bottom: 10px; }
.act-desc a { color: var(--reg-blue2); font-weight: 600; }
.act-desc ul, .act-desc ol { margin: 6px 0; padding-left: 0; list-style: none; }
.act-desc ul > li { padding: 4px 0 4px 24px; position: relative; border-bottom: 0; }
.act-desc ul > li::before {
	content: '\f0da'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
	color: var(--reg-blue2); position: absolute; left: 6px; top: 4px;
}

/* แถบเลื่อนดูรูป */
.act-slider { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.act-track {
	flex: 1 1 auto; min-width: 0; display: flex; gap: 12px;
	overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	padding: 4px 2px 10px; border-radius: 12px; scrollbar-width: thin;
}
.act-track::-webkit-scrollbar { height: 8px; }
.act-track::-webkit-scrollbar-track { background: rgba(2,6,23,.05); border-radius: 999px; }
.act-track::-webkit-scrollbar-thumb { background: rgba(30,58,138,.28); border-radius: 999px; }
.act-slide {
	flex: 0 0 clamp(200px, 38%, 340px); scroll-snap-align: start; margin: 0;
	background: #fff; border: 1px solid rgba(2,6,23,.08); border-radius: 12px; overflow: hidden;
	box-shadow: 0 4px 14px rgba(2,6,23,.08); cursor: zoom-in;
}
.act-track.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.act-slide img { display: block; width: 100%; height: 210px; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.act-slide figcaption {
	padding: 8px 12px; font-size: 12.5px; color: var(--reg-muted); text-align: center;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-nav {
	flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
	border: 1px solid rgba(2,6,23,.12); background: #fff; color: var(--reg-blue);
	font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	box-shadow: var(--shadow); transition: transform .12s ease, background .12s ease;
}
.act-nav:hover { background: var(--reg-blue-soft); transform: scale(1.06); }
.act-count { font-size: 12.5px; color: var(--reg-muted); margin-top: 4px; }
.act-dots { display: flex; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.act-dot {
	width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: rgba(30,58,138,.22); transition: all .2s ease;
}
.act-dot.is-active { background: var(--reg-blue2); transform: scale(1.25); }

/* lightbox ดูรูปขยาย */
.act-lightbox .modal-content { border: 0; border-radius: 16px; position: relative; }
.act-lb-close {
	position: absolute; top: 10px; right: 12px; z-index: 5;
	background: rgba(255,255,255,.85); border-radius: 50%; padding: 6px; opacity: .9;
}
.act-lb-cap { color: var(--reg-muted); font-size: 13.5px; margin-top: 8px; min-height: 18px; }
.act-lb-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 10px 0 6px; }
.act-lb-nav button {
	display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
	background: var(--reg-blue-soft); color: var(--reg-blue2); border: 1px solid #c7d7fe;
	border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 600; font-family: inherit;
}
.act-lb-nav button:hover { background: #dbe7ff; }
.act-lb-nav .small { color: var(--reg-muted); }

@media (max-width: 575px) {
	.act-slide { flex-basis: 78%; }
	.act-slide img { height: 170px; }
	.act-nav { width: 34px; height: 34px; font-size: 13px; }
}

/* ============================================================
   ป็อปอัปรูปข่าวประชาสัมพันธ์หน้าแรก (เปิด/ปิดต่อข่าวจากหลังบ้าน)
   ============================================================ */
.news-popup .modal-content { border: 0; border-radius: 18px; overflow: hidden; background: #0b1e4b; }
.popup-close {
	position: absolute; top: 12px; right: 12px; z-index: 5;
	background-color: rgba(255,255,255,.92); border-radius: 50%; padding: 8px; opacity: 1;
	box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.popup-close:hover { background-color: #fff; }
.popup-media { position: relative; background: #0b1e4b; }
.popup-media img { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
.popup-golink {
	position: absolute; left: 14px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 16px; border-radius: 999px; background: rgba(255,255,255,.94);
	color: var(--reg-blue); font-weight: 600; font-size: 13px; box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.popup-golink:hover { background: #fff; color: var(--reg-blue2); }
.popup-nav {
	position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
	border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--reg-blue);
	font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
	box-shadow: 0 8px 20px rgba(0,0,0,.35); transition: .15s;
}
.popup-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.popup-prev { left: 12px; }
.popup-next { right: 12px; }
.popup-foot {
	background: #fff; padding: 14px 18px; display: flex; align-items: center;
	justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.popup-title { font-weight: 700; font-size: 15.5px; color: var(--reg-ink); }
.popup-foot-main { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; }
.popup-hide { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #64748b; cursor: pointer; user-select: none; }
.popup-hide input { width: 15px; height: 15px; accent-color: #2563eb; cursor: pointer; flex: none; }
.popup-hide:hover { color: #334155; }
.popup-dots { display: flex; gap: 7px; align-self: center; }
.popup-dot {
	width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0;
	background: #cbd5e1; cursor: pointer; transition: .2s;
}
.popup-dot.is-active { background: var(--reg-blue2); transform: scale(1.25); }
@media (max-width: 767px) {
	.popup-media img { max-height: 50vh; }
	.popup-nav { width: 36px; height: 36px; }
}

/* ============================================================
   LINE QR — ปุ่ม/ลิงก์ + โมดัลแสดงรูป QR (หน้าติดต่อ + footer)
   ============================================================ */
.line-ico { color: #06c755; font-size: 1.05em; }
a.line-link { font-weight: 600; }
a.line-link:hover { color: #06c755; }
.line-popup .modal-content { border: 0; border-radius: 18px; overflow: hidden; }
.line-modal-head {
	background: #06c755; color: #fff; padding: 14px 18px; font-weight: 700; font-size: 16px;
	display: flex; align-items: center; gap: 10px;
}
.line-modal-head .fa-line { font-size: 22px; }
.line-modal-body { padding: 18px; text-align: center; background: #fff; }
.line-modal-body img { max-width: 100%; max-height: 65vh; border-radius: 10px; }
.line-hint { margin: 12px 0 0; font-size: 13px; color: #64748b; }
