/* ============ Theme tokens ============ */
:root,
.theme-school {
  --primary: #2f5fa8;
  --primary-dark: #22487f;
  --primary-soft: #dfe9f7;
  --topbar-bg: #2f5fa8;
  --topbar-fg: #fff;
  --header-bg: #d8e4f4;
  --header-fg: #22385c;
  --nav-active-bg: #2f5fa8;
  --nav-active-fg: #fff;
  --panel-bg: #dbe7f7;
  --footer-bg: #3d2d24;
  --footer-fg: #eadfd6;
  --accent: #6cb26a;
  --text: #333;
  --muted: #777;
  --radius: 14px;
}
.theme-gov {
  --primary: #7a6548;
  --primary-dark: #5a4a36;
  --primary-soft: #f1ece3;
  --topbar-bg: #f7f5f1;
  --topbar-fg: #6b5d4c;
  --header-bg: #6e5c46;
  --header-fg: #fff;
  --nav-active-bg: #a8916e;
  --nav-active-fg: #fff;
  --panel-bg: #f5f1ea;
  --footer-bg: #5a4a3b;
  --footer-fg: #efe7dc;
  --accent: #d0583a;
  --radius: 4px;
}

/* ============ Base ============ */
body { font-family: var(--font-body, 'Sarabun', sans-serif); color: var(--text); background: #fff; font-size: 16px; line-height: 1.65; }
h1, h2, h3, h4, h5, h6, .brand-text b, .main-nav, .btn, .side-title, .modal-title { font-family: var(--font-heading, var(--font-body, sans-serif)); }
.skip-link { position: absolute; left: 8px; top: 8px; z-index: 2000; background: #fff; padding: 8px 14px; border-radius: 6px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
.section { padding: 48px 0; }
.section-alt { background: #f6f7f9; }
.theme-gov .section-alt { background: #faf8f4; }
.btn-theme { background: var(--primary); color: #fff; border: 0; }
.btn-theme:hover { background: var(--primary-dark); color: #fff; }

/* ============ Sticky top (topbar + header) ============ */
.site-top { position: sticky; top: 0; z-index: 1030; transition: box-shadow .25s; }
.scrolled .site-top { box-shadow: 0 4px 18px rgba(0,0,0,.12); }

/* ============ Topbar ============ */
.topbar { background: var(--topbar-bg); color: var(--topbar-fg); font-size: 13px; padding: 6px 0; max-height: 40px; overflow: hidden; transition: max-height .25s, padding .25s; }
.scrolled .topbar { max-height: 0; padding: 0; }
.topbar .social a { color: var(--topbar-fg); opacity: .9; }
.topbar .social a:hover { opacity: 1; }

/* ============ Header & Nav ============ */
.site-header { background: var(--header-bg); color: var(--header-fg); position: relative; z-index: 1000; }
.site-header > .container { min-height: 78px; gap: 20px; transition: min-height .25s; }
.scrolled .site-header > .container { min-height: 62px; }
.scrolled .brand img { height: 42px; }
.scrolled .cta-phone { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand img { height: 52px; width: auto; transition: height .25s; }
.brand-icon { width: 48px; height: 48px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary); color: #fff; font-size: 24px; flex: none; }
.theme-gov .brand-icon { background: #c8b48f; color: #4b3c2b; border: 2px solid #fff; }
.brand-icon.big { width: 92px; height: 92px; font-size: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 19px; font-weight: 600; color: inherit; }
.brand-text small { font-size: 11px; letter-spacing: 2px; opacity: .75; text-transform: uppercase; }
.site-header .brand { color: var(--header-fg); }

.main-nav { flex: 1; }
.nav-root, .main-nav .sub { list-style: none; margin: 0; padding: 0; }
.nav-root { display: flex; gap: 2px; }
.nav-li { position: relative; }
.nav-li > a { display: block; color: var(--header-fg); padding: 8px 12px; border-radius: 6px; }
.nav-li.lvl-0 > a { text-align: center; line-height: 1.2; }
.nav-li.lvl-0 > a small { display: block; font-size: 10px; opacity: .65; }
.nav-li.lvl-0 > a .caret { font-size: 10px; }
.nav-li.lvl-0:hover > a, .nav-li.lvl-0.active > a { background: var(--nav-active-bg); color: var(--nav-active-fg); }
.main-nav .sub { position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); border-radius: 8px; padding: 6px 0; opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s; }
.main-nav .sub .sub { top: -6px; left: 100%; }
.nav-li:hover > .sub { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub .nav-li > a { color: #333; padding: 8px 18px; border-radius: 0; font-size: 15px; }
.main-nav .sub .nav-li > a .caret { transform: rotate(-90deg); float: right; margin-top: 4px; }
.main-nav .sub .nav-li > a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.sub-toggle { display: none; }
.header-cta { text-align: right; }
.btn-cta { background: var(--primary); color: #fff; border-radius: 30px; padding: 6px 18px; font-size: 14px; }
.btn-cta:hover { background: var(--primary-dark); color: #fff; }
.cta-phone { font-size: 12px; opacity: .75; margin-top: 3px; }
.header-search { display: flex; background: #fff; border-radius: 3px; overflow: hidden; }
.header-search input { border: 0; padding: 5px 10px; font-size: 14px; width: 170px; outline: 0; }
.header-search button { border: 0; background: #3e3226; color: #fff; font-size: 13px; padding: 0 10px; }
.nav-toggler { display: none; background: none; border: 0; font-size: 30px; color: var(--header-fg); line-height: 1; padding: 4px; }
.nav-search { display: none; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .nav-li > a { padding: 8px 8px; font-size: 15px; }
  .brand-text b { font-size: 17px; }
  .header-search input { width: 120px; }
  .site-header > .container { gap: 12px; }
}

@media (max-width: 991.98px) {
  .nav-toggler { display: block; }
  .header-cta { display: none; }
  .site-header > .container { min-height: 64px; }
  .brand img { height: 42px; }
  .brand-text b { font-size: 17px; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 10px 20px rgba(0,0,0,.1); max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow: auto; overscroll-behavior: contain; }
  .nav-search { display: flex; margin: 0 16px 16px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
  .nav-search input { flex: 1; border: 0; padding: 10px 12px; outline: 0; min-width: 0; }
  .nav-search button { border: 0; background: var(--primary); color: #fff; padding: 0 16px; }
  .nav-open { overflow: hidden; }
  .nav-open .main-nav { display: block; }
  .nav-root { flex-direction: column; padding: 8px 0; }
  .nav-li > a, .nav-li.lvl-0 > a { color: #333; text-align: left; padding: 10px 20px; border-radius: 0; }
  .nav-li.lvl-0 > a small, .nav-li .caret { display: none; }
  .main-nav .sub, .main-nav .sub .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; display: none; padding: 0 0 0 16px; background: #fafafa; }
  .nav-li.open > .sub { display: block; }
  .sub-toggle { display: block; position: absolute; right: 8px; top: 4px; border: 0; background: none; font-size: 18px; color: #666; padding: 4px 10px; }
  .nav-li.open > .sub-toggle i { transform: rotate(45deg); }
}

/* ============ Hero ============ */
.hero { position: relative; }
.hero .carousel-item img { height: clamp(260px, 42vw, 560px); object-fit: cover; }
.hero-caption { position: absolute; left: 0; right: 0; bottom: 14%; }
.hero-caption-inner { display: inline-block; max-width: 640px; background: rgba(0,0,0,.45); color: #fff; padding: 18px 24px; border-left: 4px solid #fff; }
.hero-caption h2 { font-size: clamp(20px, 3vw, 34px); margin: 0 0 6px; font-weight: 600; }
.hero-caption p { margin: 0 0 10px; }
.theme-gov .hero-caption-inner { background: none; border: 0; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.theme-gov .hero-caption h2 { font-size: clamp(24px, 4vw, 44px); text-transform: uppercase; }

/* ============ Director ============ */
.director-card { text-align: center; }
.director-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); }
.director-msg { font-size: 14px; color: var(--muted); margin: 14px 0 10px; text-align: left; }
.director-name { font-family: 'Prompt'; color: var(--primary); font-weight: 500; font-size: 17px; }
.director-title { font-size: 13px; color: var(--muted); }

/* gov intro */
.gov-intro { background: linear-gradient(#6e5c46, #85725a); color: #fff; padding: 30px 0; }
.gov-intro-box { display: flex; gap: 20px; align-items: center; }
.gov-intro-box h2 { font-size: 30px; margin: 0; }
.gov-director-col { position: relative; }
.theme-gov .director-card { background: #fff; color: var(--text); padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); margin: 0 0 24px; position: relative; z-index: 2; }
.theme-gov .director-card.overlap { margin-top: -230px; }
.intro-logo { height: 92px; width: auto; }
.theme-gov .director-card .director-body { background: var(--primary); color: #fff; margin: 10px -10px -10px; padding: 12px; }
.theme-gov .director-card .director-msg, .theme-gov .director-card .director-title, .theme-gov .director-card .director-name { color: #fff; }
.theme-gov .director-card img { aspect-ratio: 1; }
@media (max-width: 991.98px) { .theme-gov .director-card, .theme-gov .director-card.overlap { margin-top: 0; max-width: 340px; margin-inline: auto; } .gov-intro-box h2 { font-size: 22px; } .brand-icon.big, .intro-logo { width: 64px; height: 64px; font-size: 30px; } }
@media (max-width: 767.98px) { .director-card { max-width: 320px; margin: 0 auto; } .news-panel { padding: 18px; border-radius: 16px; } .section { padding: 32px 0; } .article-title { font-size: 23px; } }

/* ============ News ============ */
.news-panel { background: var(--panel-bg); border-radius: 22px; padding: 26px; }
.news-panel-title { font-size: 20px; color: var(--primary-dark); margin-bottom: 18px; }
.news-item { display: flex; gap: 12px; color: var(--text); }
.news-item img { width: 110px; height: 76px; object-fit: cover; border-radius: 8px; flex: none; }
.news-item h4 { font-size: 15px; margin: 0 0 4px; color: var(--primary-dark); }
.news-item p { font-size: 13px; margin: 0; color: var(--muted); }
.news-item:hover h4 { text-decoration: underline; }

.section-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--primary-soft); margin-bottom: 18px; padding-bottom: 8px; }
.section-head h3 { font-size: 21px; margin: 0; color: var(--primary-dark); position: relative; }
.section-head a { font-size: 14px; }
.center-title { text-align: center; font-size: 20px; color: var(--primary-dark); margin-bottom: 18px; }

.news-row { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px dashed #ddd; color: var(--text); }
.news-row img { width: 150px; height: 100px; object-fit: cover; flex: none; border-radius: var(--radius); }
.news-row h4 { font-size: 17px; color: var(--primary-dark); margin: 0 0 4px; }
.news-row p { font-size: 14px; margin: 0 0 4px; color: var(--muted); }
.news-row small { color: var(--muted); }
@media (max-width: 575.98px) { .news-row img { width: 100px; height: 72px; } }

/* ============ Logo strip ============ */
.logo-strip { display: flex; align-items: center; gap: 8px; }
.strip-track { display: flex; gap: 26px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1; padding: 6px 0; }
.strip-track::-webkit-scrollbar { display: none; }
.logo-item { flex: 0 0 auto; width: 110px; text-align: center; color: var(--muted); font-size: 12px; }
.logo-item img { width: 80px; height: 80px; object-fit: contain; border-radius: 50%; display: block; margin: 0 auto 6px; transition: transform .2s; }
.logo-item:hover img { transform: scale(1.08); }
.strip-btn { border: 0; background: #eee; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.strip-btn:hover { background: var(--primary); color: #fff; }
.strip-btn:disabled { opacity: .35; pointer-events: none; }

/* ============ Bulletins (วารสาร A4) ============ */
.bulletin-section { background: linear-gradient(180deg, #fff, var(--panel-bg)); }
.bulletin-strip { display: flex; align-items: center; gap: 10px; }
.bulletin-track { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 10px; }
.bulletin-track::-webkit-scrollbar { display: none; }
.bulletin-slot { scroll-snap-align: start; }
@media (max-width: 991.98px) { .bulletin-track { grid-auto-columns: calc((100% - 2 * 16px) / 3); gap: 16px; } }
@media (max-width: 575.98px) { .bulletin-track { grid-auto-columns: calc((100% - 14px) / 2); gap: 14px; } .bulletin-strip .strip-btn { display: none; } }
.bulletin-card { display: block; width: 100%; border: 0; background: none; padding: 0; text-align: left; color: var(--text); }
.bulletin-thumb { display: block; position: relative; aspect-ratio: 210 / 297; border-radius: 6px; overflow: hidden; background: #eee; box-shadow: 0 4px 14px rgba(0,0,0,.12); transition: transform .2s, box-shadow .2s; }
.bulletin-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bulletin-thumb .zoom { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); color: #fff; font-size: 30px; opacity: 0; transition: opacity .2s; }
.bulletin-card:hover .bulletin-thumb, .bulletin-card:focus-visible .bulletin-thumb { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.bulletin-card:hover .zoom, .bulletin-card:focus-visible .zoom { opacity: 1; }
.bulletin-meta { display: block; margin-top: 10px; line-height: 1.35; }
.bulletin-meta b { display: block; font-size: 15px; color: var(--primary-dark); font-weight: 600; }
.bulletin-meta small { display: block; color: var(--muted); font-size: 12px; }
.bulletin-full { max-width: 100%; max-height: 78vh; border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.bulletin-desc { white-space: pre-line; }
.bm-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(0,0,0,.2); z-index: 2; }
.bm-nav.prev { left: 16px; } .bm-nav.next { right: 16px; }
.bm-nav:hover { background: var(--primary); color: #fff; }
.sidebar .bulletin-meta b { font-size: 13px; }

/* ============ Cards ============ */
.act-card { display: block; color: var(--text); }
.act-thumb { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #e9edf3; }
.act-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.act-card:hover .act-thumb img { transform: scale(1.05); }
.act-card h4 { font-size: 15px; margin: 8px 0 2px; }
.act-card small { color: var(--muted); }
.fb-box { background: #fff; border: 1px solid #eee; border-radius: var(--radius); overflow: hidden; }

.post-card .ratio { display: block; border-radius: 4px; overflow: hidden; background: #e9edf3; }
.post-card img { object-fit: cover; width: 100%; height: 100%; }
.post-card h3 { font-size: 17px; margin: 12px 0 6px; }
.post-card h3 a { color: var(--primary-dark); }
.theme-gov .post-card h3 a { color: #b0703a; }
.post-card p { font-size: 14px; color: var(--muted); }
.btn-read { background: #333; color: #fff; font-size: 12px; border-radius: 2px; padding: 3px 10px; }
.theme-gov .btn-read { background: var(--primary-dark); }
.btn-read:hover { background: var(--primary); color: #fff; }
.pagination .page-link { color: var(--primary); }
.pagination .active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============ Inner pages ============ */
.page-banner { position: relative; display: flex; align-items: center; height: clamp(110px, 14vw, 190px); background: var(--primary) center / cover no-repeat; color: var(--bn-fg, #fff); }
.page-banner.bn-sm { height: clamp(70px, 8vw, 110px); }
.page-banner.bn-lg { height: clamp(150px, 20vw, 280px); }
.page-banner.has-img::before { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--bn-ov, 0); }
.page-banner-text { position: relative; line-height: 1.3; }
.page-banner .pb-title { font-size: clamp(22px, 3.2vw, 40px); font-weight: 700; }
.page-banner .pb-sub { font-size: clamp(14px, 1.4vw, 18px); opacity: .92; margin-top: 4px; }
.page-banner.has-img .page-banner-text { text-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
@media (max-width: 575.98px) { .page-banner { height: auto; min-height: 90px; padding: 18px 0; } .page-banner.bn-lg { min-height: 140px; } }
.breadcrumb-bar { background: #f3f3f3; padding: 14px 0; font-size: 13px; }
.breadcrumb-bar a { color: var(--primary); }
.article-title { font-size: 28px; color: var(--primary-dark); margin-bottom: 6px; }
.theme-gov .article-title { color: #b0703a; font-weight: 400; }
.article-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.share { display: flex; gap: 4px; margin-bottom: 24px; }
.share a { width: 26px; height: 26px; display: inline-grid; place-items: center; color: #fff; border-radius: 3px; font-size: 13px; }
.share a:hover { opacity: .85; color: #fff; }
.article-image { text-align: center; margin-bottom: 28px; }
.article-image img { max-height: 520px; border-radius: 4px; }
.article-content { line-height: 1.85; }
.article-content h2, .article-content h3 { color: var(--primary-dark); margin-top: 1.4em; font-size: 1.3em; }
.article-content img { height: auto; border-radius: 4px; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.article-content table td, .article-content table th { border: 1px solid #ddd; padding: 8px; }
.article-content table th { background: var(--primary-soft); }

/* ============ Sidebar ============ */
.sidebar { background: #fafafa; padding: 14px; border-radius: 6px; }
.side-box { margin-bottom: 22px; }
.side-title { font-size: 15px; background: var(--primary); color: #fff; padding: 7px 12px; border-radius: 4px; margin-bottom: 8px; }
.theme-gov .side-title { background: none; color: var(--primary-dark); border-bottom: 2px solid var(--primary); border-radius: 0; padding: 4px 0; }
.side-menu { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.side-menu li a { display: block; padding: 6px 8px; color: #444; border-bottom: 1px solid #eee; }
.side-menu li a:hover { color: var(--primary); background: #fff; }
.side-menu ul { list-style: none; padding-left: 14px; }
.mini-post { display: flex; gap: 10px; margin-bottom: 12px; color: var(--text); }
.mini-post img { width: 70px; height: 52px; object-fit: cover; border-radius: 4px; flex: none; }
.mini-post b { display: block; font-size: 13px; font-weight: 600; color: var(--primary-dark); }
.mini-post small { color: var(--muted); font-size: 12px; }

/* ============ Contact ============ */
.map-wrap iframe { width: 100%; height: clamp(260px, 32vw, 420px); border: 0; display: block; }
.contact-name { color: var(--primary-dark); }
.contact-list li { margin-bottom: 10px; padding-left: 26px; position: relative; }
.contact-list li > i { position: absolute; left: 0; top: 2px; color: var(--primary); }
.site-footer .contact-list li > i { color: inherit; opacity: .8; }
.form-title { color: var(--primary); }
.theme-school .contact-form .form-control { background: #3a3f47; color: #fff; border-color: #3a3f47; }
.theme-school .contact-form .form-control::placeholder { color: #bbb; }
.theme-gov .contact-form .form-control { border: 0; border-bottom: 1px solid #ccc; border-radius: 0; }
.btn-send { background: var(--accent); color: #fff; }
.btn-send:hover { filter: brightness(.92); color: #fff; }

/* ============ Footer ============ */
.site-footer { background: var(--footer-bg); color: var(--footer-fg); padding-top: 44px; }
.site-footer h6 { color: #fff; font-size: 16px; margin-bottom: 14px; }
.site-footer a { color: var(--footer-fg); }
.site-footer a:hover { color: #fff; }
.site-footer ul li { margin-bottom: 6px; }
.copyright { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding: 14px 0; opacity: .8; }
.site-footer a[href^="tel"], .site-footer a[href^="mailto"] { word-break: break-all; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; opacity: 0; pointer-events: none; transition: .3s; z-index: 999; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top:hover { color: #fff; background: var(--primary-dark); }

/* ============ Responsive safety ============ */
html, body { overflow-x: clip; }
@media (max-width: 575.98px) {
  .row.g-4, .row.g-5 { --bs-gutter-x: 1.5rem; }
  .row.g-5 { --bs-gutter-y: 2rem; }
  .container { padding-left: 16px; padding-right: 16px; }
  .article-content img, .article-content iframe, .article-content video { max-width: 100%; height: auto; }
  .article-content iframe { aspect-ratio: 16 / 9; }
  .article-content table { display: block; overflow-x: auto; }
  .breadcrumb { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .hero-caption { bottom: 12%; }
  .hero-caption-inner { padding: 10px 14px; }
  .hero-caption p { display: none; }
}

/* ============ บุคลากร / ผังองค์กร ============ */
.staff-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 36px; }
.staff-tabs a { padding: 6px 16px; border-radius: 999px; border: 1px solid #dde3ec; color: var(--text); font-size: 15px; background: #fff; }
.staff-tabs a:hover { border-color: var(--primary); color: var(--primary); }
.staff-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.staff-cats { margin-bottom: 16px; }
.staff-cats + .staff-tabs { margin-top: 0; }
.staff-cats a { font-weight: 600; }
.staff-cat-title { display: flex; align-items: center; gap: 14px; font-size: 24px; color: var(--primary-dark); margin: 8px 0 32px; }
.staff-cat-title::after { content: ""; flex: 1; height: 2px; background: var(--primary-soft); }
.staff-group { margin-bottom: 56px; }
.staff-group-head { text-align: center; margin-bottom: 26px; }
.staff-group-head h2 { display: inline-block; font-size: 22px; color: var(--primary-dark); padding: 6px 24px; border-radius: 999px; background: var(--primary-soft); margin: 0; }
.staff-group-head p { color: var(--muted); margin: 8px 0 0; }

.person { --w: 170px; width: var(--w); border: 0; background: #fff; padding: 0; text-align: center; color: var(--text); border-radius: 14px; box-shadow: 0 2px 10px rgba(16,24,40,.08); overflow: hidden; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.person:hover, .person:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(16,24,40,.14); outline: 0; }
.person-lg { --w: 210px; }
.person-sm { --w: 150px; }
.person-photo { display: block; aspect-ratio: 3 / 4; background: #e9edf3; overflow: hidden; border-bottom: 4px solid var(--primary); }
.person-lg .person-photo { border-bottom-color: var(--accent); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.person-info { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 12px; line-height: 1.35; flex: 1; }
.person-info b { font-size: 15px; color: var(--primary-dark); }
.person-lg .person-info b { font-size: 16.5px; }
.person-info .pos { font-size: 13.5px; color: var(--text); }
.person-info small { font-size: 12.5px; color: var(--muted); }

.org-scroll { overflow-x: auto; padding: 4px 4px 16px; scrollbar-width: thin; }
.org-tree, .org-tree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 26px 0 0; position: relative; }
.org-tree { padding-top: 0; min-width: max-content; margin: 0 auto; }
.org-tree li { position: relative; padding: 26px 10px 0; display: flex; flex-direction: column; align-items: center; }
.org-tree li::before, .org-tree li::after { content: ''; position: absolute; top: 0; right: 50%; width: 50%; height: 26px; border-top: 2px solid #c9d2df; }
.org-tree li::after { right: auto; left: 50%; border-left: 2px solid #c9d2df; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border: 0; }
.org-tree li:last-child::before { border-right: 2px solid #c9d2df; border-radius: 0 8px 0 0; }
.org-tree li:first-child::after { border-radius: 8px 0 0 0; }
.org-tree li:only-child::before { display: none; }
.org-tree li:only-child::after { border-top: 0; border-radius: 0; }
.org-tree ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid #c9d2df; }
.org-tree > li { padding-top: 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }

.staff-heads { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-bottom: 28px; }
.staff-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.staff-grid .person { --w: 170px; }
.staff-grid + .staff-grid { margin-top: 28px; padding-top: 28px; border-top: 2px dashed var(--primary-soft); }
.staff-grid .person-md { --w: 190px; }
.staff-grid .person-md .person-photo { border-bottom-color: var(--primary-dark); }

@media (max-width: 767.98px) {
  .org-scroll { overflow: visible; }
  .org-tree, .org-tree ul { display: block; padding: 0; min-width: 0; }
  .org-tree ul { margin-left: 22px; padding-left: 16px; border-left: 2px solid #c9d2df; }
  .org-tree li { display: block; padding: 12px 0 0; }
  .org-tree li::before, .org-tree li::after, .org-tree ul::before { display: none; }
  .org-tree ul > li::before { display: block; content: ''; position: absolute; left: -16px; top: 46px; width: 14px; height: 0; border-top: 2px solid #c9d2df; border-right: 0; border-radius: 0; }
  .org-tree ul > li:last-child::after { display: block; content: ''; position: absolute; left: -18px; top: 48px; bottom: 0; border: 0; border-left: 4px solid #fff; width: 0; height: auto; }
  .org-tree .person, .staff-heads .person, .staff-grid .person, .staff-grid .person-md { --w: 100%; max-width: 420px; flex-direction: row; text-align: left; align-items: center; }
  .org-tree .person-photo, .staff-heads .person-photo, .staff-grid .person-photo { width: 72px; flex: none; border-bottom: 0; border-right: 3px solid var(--primary); }
  .staff-grid .person-md .person-photo { border-right-color: var(--primary-dark); }
  .staff-grid { display: flex; flex-direction: column; align-items: center; gap: 12px; }
}

.person-modal { border-radius: 18px; overflow: hidden; display: flex; flex-direction: row; }
.person-modal .btn-close { position: absolute; right: 14px; top: 14px; z-index: 2; background-color: #fff; border-radius: 50%; padding: 8px; opacity: .9; }
.pm-photo { width: 42%; flex: none; background: #e9edf3; }
.pm-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; min-height: 300px; }
.pm-body { padding: 26px 24px; }
.pm-body h3 { font-size: 21px; color: var(--primary-dark); margin: 0 0 4px; }
.pm-pos { font-weight: 600; }
.pm-rank { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.pm-list { list-style: none; padding: 0; margin: 0; font-size: 14.5px; }
.pm-list li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px dashed #e3e7ee; }
.pm-list i { color: var(--primary); }
@media (max-width: 575.98px) { .person-modal { flex-direction: column; } .pm-photo { width: 100%; } .pm-photo img { max-height: 320px; min-height: 0; } }
.home-personnel .org-tree .person-sm { --w: 140px; }
.mi-icon { margin-right: 2px; }
.main-nav .ext { font-size: 10px; opacity: .55; }

/* ============ ลิงก์ด่วน (ไอคอน) ============ */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.ql-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 22px 12px 18px; border-radius: 16px; background: #fff; border: 1px solid #e6eaf0; color: var(--text); transition: transform .2s, box-shadow .2s, border-color .2s; min-height: 132px; }
.ql-item:hover, .ql-item:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(16,24,40,.1); border-color: var(--primary); color: var(--primary-dark); outline: 0; }
.ql-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 27px; background: var(--primary-soft); color: var(--primary); transition: background .2s, color .2s; }
.ql-item:hover .ql-icon { background: var(--primary); color: #fff; }
.ql-item b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.ql-item .ext { font-size: 11px; color: var(--muted); }
.sidebar .quick-links { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sidebar .ql-item { min-height: 0; padding: 14px 8px 12px; }
.sidebar .ql-icon { width: 42px; height: 42px; font-size: 20px; border-radius: 12px; }
.sidebar .ql-item b { font-size: 13px; }
@media (max-width: 575.98px) { .quick-links { grid-template-columns: repeat(3, 1fr); gap: 10px; } .ql-item { padding: 14px 6px 12px; min-height: 0; } .ql-icon { width: 46px; height: 46px; font-size: 22px; } .ql-item b { font-size: 13px; } }
@media (max-width: 359.98px) { .quick-links { grid-template-columns: repeat(2, 1fr); } }

/* ============ ITA ============ */
.ita-hero { display: flex; gap: 22px; align-items: center; background: linear-gradient(135deg, var(--primary-soft), #fff); border: 1px solid #e3e8f0; border-radius: 20px; padding: 28px 30px; }
.ita-hero h1 { font-size: 26px; color: var(--primary-dark); margin: 0 0 6px; }
.ita-hero p { color: var(--muted); margin: 0 0 10px; }
.ita-badge { width: 84px; height: 84px; border-radius: 22px; background: var(--primary); color: #fff; font-size: 42px; display: grid; place-items: center; flex: none; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.ita-stat { display: flex; gap: 10px; flex-wrap: wrap; }
.ita-stat span { background: #fff; border: 1px solid #e3e8f0; border-radius: 999px; padding: 3px 14px; font-size: 14px; }
.ita-stat b { color: var(--primary); font-size: 16px; }
.ita-topic { margin-top: 36px; }
.ita-topic h2 { font-size: 21px; color: var(--primary-dark); display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--primary-soft); padding-bottom: 10px; margin-bottom: 14px; }
.ita-tcode { background: var(--primary); color: #fff; border-radius: 8px; padding: 2px 10px; font-size: 15px; font-weight: 600; }
.ita-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; }
.ita-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid #e6eaf0; border-radius: 14px; background: #fff; color: var(--text); transition: .2s; }
.ita-item:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(16,24,40,.08); transform: translateY(-2px); color: var(--primary-dark); }
.ita-code { min-width: 52px; height: 40px; padding: 0 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.ita-code.big { height: auto; padding: 2px 12px; font-size: .8em; vertical-align: middle; }
.ita-title { flex: 1; min-width: 0; font-weight: 600; line-height: 1.4; }
.ita-title small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ita-item > .bi-chevron-right { color: #b5bfcc; }
.ita-crumb { color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.ita-link { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: var(--primary); color: #fff; margin-bottom: 24px; max-width: 560px; }
.ita-link:hover { color: #fff; filter: brightness(1.08); }
.ita-link i { font-size: 22px; }
.ita-link small { display: block; opacity: .8; font-size: 13px; word-break: break-all; }
.ita-files-title { font-size: 18px; color: var(--primary-dark); margin: 10px 0 12px; }
.ita-files { display: grid; gap: 10px; }
.ita-file { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid #e6eaf0; border-radius: 12px; background: #fff; color: var(--text); }
.ita-file:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.ita-file > i:first-child { font-size: 30px; }
.ita-file span { flex: 1; min-width: 0; }
.ita-file b { display: block; word-break: break-word; }
.ita-file small { color: var(--muted); }
.ita-file .dl { color: var(--primary); font-size: 20px; }
.ita-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 36px; }
.ita-nav a { border: 1px solid #e6eaf0; border-radius: 12px; padding: 12px 16px; color: var(--text); }
.ita-nav a:hover { border-color: var(--primary); }
.ita-nav small { display: block; color: var(--muted); }
.ita-nav b { display: block; font-weight: 600; color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ita-side { max-height: 60vh; overflow-y: auto; }
.ita-side a.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 600; }
.ita-side b { color: var(--primary); }
@media (max-width: 575.98px) {
  .ita-hero { flex-direction: column; text-align: center; padding: 22px 18px; }
  .ita-hero h1 { font-size: 21px; } .ita-stat { justify-content: center; }
  .ita-items { grid-template-columns: 1fr; }
  .ita-nav { grid-template-columns: 1fr; }
}

/* ============ สารสนเทศ (Infographic) ============ */
.info-page { --ink: #1d1d1b; --ink-2: #52514e; --ink-3: #8a8985; --grid: #e6e5e0; --card: #fcfcfb; }
.info-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; justify-content: space-between; margin-bottom: 24px; }
.info-head h1 { font-size: 30px; font-weight: 700; color: var(--primary-dark); margin: 0; }
.info-head p { color: var(--muted); margin: 4px 0 0; }
.kpi-row { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid #e6e8ec; border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { color: var(--ink-2); font-size: 15px; }
.kpi-label i { color: var(--primary); margin-right: 4px; }
.kpi-value { font-size: 40px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-hero .kpi-value { font-size: 52px; }
.kpi-value small { font-size: 16px; font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.kpi-sub { color: var(--ink-3); font-size: 13.5px; }
.seg-bar { display: flex; gap: 2px; height: 26px; border-radius: 6px; overflow: hidden; margin-top: 6px; }
.seg-bar span { display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 600; min-width: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--ink-2); }
.legend .sw, .chart-tip .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.legend .sw.ref, .chart-tip .sw.ref { width: 3px; height: 14px; border-radius: 1px; vertical-align: -2px; }
.fact-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.fact { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid #e6e8ec; border-radius: 14px; padding: 12px 16px; color: var(--ink); }
.fact b { font-size: 22px; font-variant-numeric: tabular-nums; }
.fact small { display: block; color: var(--ink-3); font-size: 13px; }
.fact-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 20px; flex: none; }
.viz-card { background: var(--card); border: 1px solid #e6e8ec; border-radius: 18px; padding: 20px 22px; }
.viz-card header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.viz-card header > div { flex: 1; }
.viz-card h2 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; }
.viz-card header p { font-size: 13.5px; color: var(--ink-3); margin: 2px 0 0; }
.viz-card .legend { margin-bottom: 6px; }
.viz-card .viz-table { display: none; }
.viz-card.show-table .viz-table { display: block; }
.viz-card.show-table .chart, .viz-card.show-table > .legend { display: none; }
.chart { width: 100%; min-height: 60px; }
.chart-svg { display: block; overflow: visible; font-family: var(--font-body, sans-serif); }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .base { stroke: #c9c8c2; stroke-width: 1; }
.chart-svg .axis { fill: var(--ink-2); font-size: 12.5px; }
.chart-svg .val { fill: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-svg .track { fill: #f0efec; }
.chart-svg .ref { stroke-width: 3; stroke-linecap: round; }
.chart-svg .dot { stroke: var(--card); stroke-width: 2; }
.chart-svg path, .chart-svg rect, .chart-svg circle, .chart-svg g { outline: none; cursor: default; }
.chart-svg [tabindex]:hover, .chart-svg [tabindex]:focus-visible { opacity: .85; }
.chart-tip { position: fixed; z-index: 2000; pointer-events: none; background: #1d1d1b; color: #f0efec; font-size: 13px; line-height: 1.5; padding: 8px 11px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); opacity: 0; transition: opacity .12s; max-width: 260px; }
.chart-tip .muted { color: #c3c2b7; }
@media (max-width: 991.98px) { .kpi-row { grid-template-columns: repeat(3, 1fr); } .kpi-hero { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; } .kpi { padding: 14px 16px; } .kpi-value { font-size: 30px; } .kpi-hero .kpi-value { font-size: 40px; } .info-head h1 { font-size: 24px; } .viz-card { padding: 16px 14px; } }

/* ============ กิจกรรมที่กำลังจะมาถึง ============ */
.up-item { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px 4px; border-bottom: 1px solid #eef0f3; border-radius: 0; }
.up-item:hover { background: #f6f8fc; }
.up-date { --c: #3056d3; width: 46px; flex: none; text-align: center; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, #fff); border-top: 3px solid var(--c); padding: 3px 0; line-height: 1.1; }
.up-date b { display: block; font-size: 19px; color: #111827; }
.up-date small { font-size: 11px; color: #4b5563; }
.up-text b { display: block; font-size: 14px; color: #111827; line-height: 1.35; }
.up-text small { color: #6b7280; font-size: 12px; }
a.up-item { color: inherit; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; }

/* ============ กระดานถามตอบ ============ */
.wb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; justify-content: space-between; margin-bottom: 24px; }
.wb-head h1 { font-size: 28px; font-weight: 700; color: var(--primary-dark); margin: 0; }
.wb-head p { color: var(--muted); margin: 4px 0 0; }
.wb-cats { display: flex; flex-direction: column; gap: 4px; }
.wb-cats a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; color: var(--text); }
.wb-cats a:hover { background: var(--primary-soft); }
.wb-cats a.active { background: var(--primary); color: #fff; }
.wb-cats a span { flex: 1; }
.wb-cats b { font-weight: 600; font-size: 13px; opacity: .7; }
.wb-search { display: flex; gap: 8px; margin-bottom: 14px; }
.wb-search .form-select { max-width: 150px; }
.wb-list { border: 1px solid #e6e8ec; border-radius: 16px; overflow: hidden; background: #fff; }
.wb-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid #eef0f3; color: var(--text); }
.wb-row:last-child { border-bottom: 0; }
.wb-row:hover { background: #f8fafc; color: var(--text); }
.wb-row.pinned { background: color-mix(in srgb, var(--primary) 5%, #fff); }
.wb-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 19px; flex: none; }
.wb-main { flex: 1; min-width: 0; }
.wb-title { display: block; font-weight: 600; font-size: 16px; color: var(--primary-dark); line-height: 1.4; }
.wb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 2px; }
.wb-count { display: flex; flex-direction: column; align-items: center; min-width: 54px; line-height: 1.2; }
.wb-count b { font-size: 17px; color: var(--text); }
.wb-count small { font-size: 11.5px; color: var(--muted); }
.wb-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; margin-right: 4px; }
.wb-badge.ok { background: #ecfdf3; color: #15803d; }
.wb-badge.pin { background: #fff7ed; color: #c2410c; }
.wb-badge.lock { background: #f3f4f6; color: #4b5563; }
.wb-badge.staff { background: var(--primary); color: #fff; }
.wb-empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.wb-empty i { font-size: 40px; }
.wb-topic-head { margin-bottom: 18px; }
.wb-topic-head h1 { font-size: 26px; font-weight: 700; color: var(--text); margin: 6px 0 10px; line-height: 1.35; }
.wb-cat { font-size: 13.5px; color: var(--primary); font-weight: 600; }
.wb-post { display: flex; gap: 14px; padding: 18px; border: 1px solid #e6e8ec; border-radius: 16px; background: #fff; margin-bottom: 12px; }
.wb-post.reply { margin-left: 28px; }
.wb-post.staff { border-color: color-mix(in srgb, var(--primary) 35%, #fff); background: color-mix(in srgb, var(--primary) 4%, #fff); }
.wb-post.pending { border-style: dashed; opacity: .75; }
.wb-avatar { width: 44px; height: 44px; border-radius: 50%; background: #e9edf3; color: #4b5563; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.wb-avatar.staff { background: var(--primary); color: #fff; }
.wb-post-body { flex: 1; min-width: 0; }
.wb-post-meta { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.wb-post-meta b { color: var(--text); }
.wb-text { line-height: 1.75; overflow-wrap: anywhere; }
.wb-replies-title { font-size: 18px; font-weight: 700; margin: 28px 0 12px; }
.wb-form { background: #fff; border: 1px solid #e6e8ec; border-radius: 16px; padding: 22px; }
.wb-form h3 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.wb-new { max-width: 760px; margin: 0 auto; }
.wb-new h1 { font-size: 26px; font-weight: 700; color: var(--primary-dark); }
.wb-mini a { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef0f3; color: var(--text); }
.wb-mini a:hover { color: var(--primary); }
.wb-mini b { display: block; font-size: 14px; line-height: 1.4; }
.wb-mini small { color: var(--muted); font-size: 12px; }
@media (max-width: 575.98px) {
  .wb-head h1 { font-size: 23px; } .wb-head .btn { width: 100%; }
  .wb-cats { flex-direction: row; overflow-x: auto; scrollbar-width: none; } .wb-cats a { white-space: nowrap; } .wb-cats b { display: none; }
  .wb-row { padding: 12px 14px; gap: 10px; } .wb-ic { display: none; }
  .wb-post { padding: 14px; } .wb-post.reply { margin-left: 0; } .wb-avatar { width: 36px; height: 36px; font-size: 15px; }
  .wb-search .form-select { max-width: 120px; }
}

/* ===== E-Service: การ์ดลิงก์ระบบ (ใช้ใน HTML ของหน้าเพจ: .svc-section > .svc-head + .svc-grid > a.svc-card.svc-<สี>) ===== */
.svc-section { margin: 0 0 2.6rem; }
.svc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 1.1rem; }
.article-content .svc-head h2, .svc-head h2 { margin: 0; font-size: 1.45rem; font-weight: 700; color: #1f2333; }
.svc-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px; border-radius: 999px; background: #eeedf8; color: #5a55a0; font-size: .92rem; }
.svc-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #6b63c9; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.svc-card { --c: var(--primary); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 22px 12px 20px; background: #fff; border: 1px solid #e6e7ef; border-bottom: 4px solid var(--c); border-radius: 14px;
  box-shadow: 0 2px 6px rgba(30, 35, 60, .05); color: inherit; text-decoration: none; transition: transform .18s, box-shadow .18s; line-height: 1.35; }
.svc-card:hover, .svc-card:focus-visible { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(30, 35, 60, .12); color: inherit; }
.svc-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; background: var(--c); color: #fff; font-size: 1.8rem; margin-bottom: 14px; }
.svc-title { display: block; color: var(--c); font-weight: 700; font-size: 1.08rem; }
.svc-sub { display: block; color: #6b6f80; font-size: .88rem; margin-top: 4px; }
.svc-badge { position: absolute; top: 10px; right: 12px; color: #8a8fa3; font-size: .85rem; }
@media (max-width: 575.98px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .svc-card { padding: 16px 8px 14px; }
  .svc-icon { width: 52px; height: 52px; font-size: 1.45rem; border-radius: 14px; margin-bottom: 10px; }
  .svc-title { font-size: .98rem; } .svc-sub { font-size: .8rem; }
}

.svc-teal { --c: #3a9688; } .svc-amber { --c: #e3962b; } .svc-indigo { --c: #4f46e5; } .svc-blue { --c: #2f6fe0; } .svc-green { --c: #3a8a5c; } .svc-orange { --c: #e0612b; } .svc-sky { --c: #3b9fd8; } .svc-violet { --c: #7c3aed; } .svc-pink { --c: #c93a76; } .svc-plum { --c: #5b2a86; } .svc-slate { --c: #3d6a9a; }

/* ---------- ไฟล์ PDF แนบ ---------- */
.attachments-title { font-size: 1.2rem; font-weight: 700; color: var(--primary-dark); border-bottom: 2px solid var(--primary-soft); padding-bottom: 8px; margin-bottom: 16px; }
.att-item { border: 1px solid #e3e6ec; border-radius: 8px; margin-bottom: 20px; background: #fff; overflow: hidden; }
.att-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.att-icon { font-size: 1.9rem; color: #d93025; flex: none; }
.att-name { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.att-name small { display: block; font-weight: 400; color: #6b7280; }
.att-actions { display: flex; gap: 6px; flex: none; }
.pdf-viewer { border-top: 1px solid #e3e6ec; background: #525659; }
.pdf-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #3b3e41; color: #e8eaed; position: sticky; top: 0; z-index: 2; }
.pdf-pages-wrap { --pdf-zoom: 1; max-height: 80vh; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.pdf-page { width: calc(100% * var(--pdf-zoom)); max-width: calc(900px * var(--pdf-zoom)); margin: 0 auto 12px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-loading { color: #e8eaed; text-align: center; padding: 48px 12px; }
.pdf-loading a { color: #fff; text-decoration: underline; }
@media (max-width: 575.98px) {
  .pdf-pages-wrap { padding: 6px; max-height: 75vh; }
  .att-head { padding: 10px; gap: 8px; }
}

/* ---------- ข่าวสารแยกตามประเภท ---------- */
.news-tabs-wrap { background: #fff; border-radius: var(--radius, 8px); box-shadow: 0 2px 10px rgba(20,40,80,.06); overflow: hidden; }
.news-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding: 8px 8px 0; background: var(--primary-soft); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.news-tabs .nav-link { white-space: nowrap; border: 0; border-radius: 8px 8px 0 0; color: var(--primary-dark); font-weight: 600; padding: 10px 16px; background: transparent; }
.news-tabs .nav-link:hover { background: rgba(255,255,255,.55); }
.news-tabs .nav-link.active { background: #fff; color: var(--primary); box-shadow: 0 -2px 0 var(--primary) inset; }
.news-tab-content { padding: 18px 20px 20px; }
.news-line { display: flex; align-items: center; gap: 14px; padding: 10px 4px; border-bottom: 1px dashed #e1e4ea; color: var(--text, #222); }
.news-line:last-child { border-bottom: 0; }
.news-line:hover .nl-title { color: var(--primary); text-decoration: underline; }
.nl-date { flex: none; width: 54px; text-align: center; font-size: 12px; line-height: 1.2; color: var(--primary-dark); background: var(--primary-soft); border-radius: 6px; padding: 5px 0; }
.nl-date b { display: block; font-size: 19px; }
.nl-body { flex: 1; min-width: 0; }
.nl-title { margin-right: 6px; }
.nl-new { display: inline-block; font-size: 11px; font-weight: 700; color: #fff; background: #e53935; border-radius: 4px; padding: 0 6px; margin-right: 4px; vertical-align: 2px; }
.nl-pdf { color: #d93025; margin-right: 4px; }
.nl-cat { display: block; font-size: 12px; color: var(--muted, #6b7280); }
.news-empty { color: var(--muted, #6b7280); text-align: center; padding: 28px 0; margin: 0; }
.news-thumb { display: block; color: var(--text, #222); }
.news-thumb .nt-img { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #eef1f6; }
.news-thumb .nt-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nt-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; margin-top: 8px; line-height: 1.45; }
.news-thumb small { color: var(--muted, #6b7280); }
.news-thumb:hover .nt-title { color: var(--primary); }
.news-box { background: #fff; border-radius: var(--radius, 8px); box-shadow: 0 2px 10px rgba(20,40,80,.06); height: 100%; display: flex; flex-direction: column; }
.news-box-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 2px solid var(--primary-soft); }
.news-box-head h4 { font-size: 18px; margin: 0; color: var(--primary-dark); }
.news-box-head a { font-size: 13px; white-space: nowrap; }
.nb-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; flex: none; }
.news-box-body { padding: 6px 16px 12px; flex: 1; }
.cat-list { background: #fff; border-radius: var(--radius, 8px); padding: 6px 18px; box-shadow: 0 2px 10px rgba(20,40,80,.06); }
@media (max-width: 575.98px) {
  .news-tab-content { padding: 12px; }
  .news-tabs .nav-link { padding: 8px 12px; font-size: 15px; }
  .news-line { gap: 10px; }
}

/* ---------- การ์ดข่าวใหญ่ (หน้าแรก / news.php) ---------- */
.nc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.nc-head h2 { margin: 0; font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; color: #1f2a44; line-height: 1.2; }
.nc-head h2 span { color: var(--primary); }
.nc-head a { font-weight: 600; font-size: 17px; white-space: nowrap; }
.nc-head a i { transition: transform .2s; display: inline-block; }
.nc-head a:hover i { transform: translateX(4px); }
.news-card { display: flex; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 14px rgba(25,45,90,.07); height: 100%; transition: box-shadow .2s, transform .2s; }
.news-card:hover { box-shadow: 0 8px 26px rgba(25,45,90,.13); transform: translateY(-2px); }
.nc-media { position: relative; flex: 0 0 40%; min-height: 220px; background: #eef1f6; overflow: hidden; }
.nc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .nc-media img { transform: scale(1.04); }
.nc-badge, .nc-latest { position: absolute; top: 12px; z-index: 1; color: #fff; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.18); white-space: nowrap; }
.nc-badge { left: 12px; max-width: calc(100% - 90px); overflow: hidden; text-overflow: ellipsis; }
.nc-latest { right: 12px; background: #d93838; }
.nc-body { flex: 1; min-width: 0; padding: 22px 24px; display: flex; flex-direction: column; }
.nc-body h3 { font-size: 19px; font-weight: 700; line-height: 1.5; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-body h3 a { color: #1f2a44; }
.nc-body h3 a:hover { color: var(--primary); }
.nc-body p { color: var(--muted); font-size: 15px; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nc-more { font-weight: 600; font-size: 16px; }
.nc-foot small { color: var(--muted); }
.news-filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.news-filter a { --c: var(--primary); flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid #dde2ea; color: var(--text); background: #fff; font-size: 15px; }
.news-filter a i { color: var(--c); }
.news-filter a.active, .news-filter a:hover { background: var(--c); border-color: var(--c); color: #fff; }
.news-filter a.active i, .news-filter a:hover i { color: #fff; }
@media (max-width: 575.98px) {
  .news-card { flex-direction: column; }
  .nc-media { flex-basis: auto; min-height: 0; aspect-ratio: 16 / 10; }
  .nc-body { padding: 16px; }
  .nc-body h3 { font-size: 17px; }
}

/* ---------- สารผู้บริหาร (เต็มความกว้าง) ---------- */
.director-wide { display: flex; gap: 32px; align-items: center; background: #fff; border-radius: 14px; padding: 24px; box-shadow: 0 2px 14px rgba(25,45,90,.07); }
.director-wide > img { width: 200px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; flex: none; }
.dw-body { flex: 1; min-width: 0; }
.dw-label { font-size: 14px; font-weight: 600; color: var(--primary); letter-spacing: .5px; margin-bottom: 6px; }
.dw-msg { font-size: 18px; line-height: 1.8; color: var(--text); margin: 0 0 14px; padding-left: 18px; border-left: 4px solid var(--primary-soft); }
@media (max-width: 767.98px) {
  .director-wide { flex-direction: column; text-align: center; padding: 20px; gap: 16px; }
  .director-wide > img { width: 160px; }
  .dw-msg { border-left: 0; padding-left: 0; font-size: 16px; }
}

/* ---------- หน้าแรก: ส่วนที่โหลดเมื่อเลื่อนถึง ---------- */
.lazy-block { min-height: 360px; padding: 48px 0; }
.lb-skeleton { display: grid; gap: 14px; }
.lb-skeleton span { display: block; height: 18px; border-radius: 8px; background: linear-gradient(90deg, #eef1f6 25%, #f7f8fb 50%, #eef1f6 75%); background-size: 200% 100%; animation: lb-shimmer 1.3s infinite linear; }
.lb-skeleton span:first-child { width: 32%; height: 28px; }
.lb-skeleton span:nth-child(2) { height: 180px; }
.lb-skeleton span:nth-child(3) { width: 70%; }
@keyframes lb-shimmer { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .lb-skeleton span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- ประกาศข่าวสำคัญ (ป๊อปอัป) ---------- */
.ann-modal .modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.ann-modal .modal-header { border-bottom: 0; padding: 14px 18px 4px; }
.ann-kicker { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #c62828; font-size: 15px; }
.ann-title { font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; color: var(--primary-dark); text-align: center; margin: 0 0 14px; line-height: 1.45; }
.ann-img { display: block; max-width: 100%; height: auto; margin: 0 auto 12px; border-radius: 10px; }
.ann-content { font-size: 16px; }
.ann-modal .modal-footer { border-top: 1px solid #eef0f4; }
.ann-pager { display: flex; align-items: center; gap: 8px; }
.ann-count { font-size: 14px; color: var(--muted); min-width: 44px; text-align: center; }

/* ---------- สารผู้บริหาร + การ์ดข่าว (แถวเดียวกัน) ---------- */
/* การ์ด ผอ. สูงเท่าคอลัมน์ข่าวพอดี: รูปยืดเต็มพื้นที่ที่เหลือ */
.nc-director { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 14px rgba(25,45,90,.07); height: 100%; display: flex; flex-direction: column; }
.nc-director img { display: block; width: 100%; flex: 1 1 0; min-height: 220px; object-fit: cover; object-position: center 20%; }
.ncd-body { padding: 14px 16px 16px; text-align: center; flex: none; }
.ncd-msg { font-size: 14px; line-height: 1.7; color: var(--text); text-align: left; margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.with-director .nc-head { margin-bottom: 18px; }
.with-director .nc-head h2 { font-size: clamp(24px, 2.6vw, 32px); }
/* การ์ดข่าวแบบเตี้ย */
.with-director .news-card { height: auto; }
.with-director .nc-media { flex-basis: 36%; min-height: 0; height: 150px; }
.with-director .nc-body { padding: 12px 16px; }
.with-director .nc-body h3 { font-size: 16px; line-height: 1.45; margin-bottom: 4px; -webkit-line-clamp: 2; }
.with-director .nc-body p { font-size: 13.5px; margin-bottom: 6px; -webkit-line-clamp: 1; }
.with-director .nc-more { font-size: 14px; }
.with-director .nc-foot small { font-size: 12.5px; }
.with-director .nc-badge { font-size: 12px; padding: 3px 10px; left: 10px; top: 10px; max-width: calc(100% - 20px); }
.with-director .nc-latest { font-size: 12px; padding: 3px 10px; top: auto; bottom: 10px; right: auto; left: 10px; }
.with-director .row.g-4 .row.g-4 { --bs-gutter-y: 1rem; --bs-gutter-x: 1rem; }
@media (min-width: 768px) and (max-width: 1199.98px) {
  /* ข่าวเหลือคอลัมน์เดียว (คอลัมน์สูง) → การ์ด ผอ. สูงตามเนื้อหาและค้างไว้ขณะเลื่อน */
  .nc-director { height: auto; position: sticky; top: 96px; }
  .nc-director img { flex: none; min-height: 0; aspect-ratio: 4 / 5; }
}
@media (max-width: 767.98px) {
  .nc-director { height: auto; flex-direction: row; align-items: flex-start; gap: 14px; padding: 14px; }
  .nc-director img { width: 92px; flex: none; min-height: 0; aspect-ratio: 4 / 5; border-radius: 10px; }
  .ncd-body { padding: 0; text-align: left; min-width: 0; flex: 1; }
  .with-director .nc-latest { top: 10px; bottom: auto; left: auto; right: 10px; }
}
@media (max-width: 575.98px) {
  .with-director .nc-media { height: auto; aspect-ratio: 16 / 9; }
  .with-director .nc-body p { -webkit-line-clamp: 2; }
}

/* ---------- ผลงานและรางวัล ---------- */
.news-filter button { --c: var(--primary); flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid #dde2ea; color: var(--text); background: #fff; font: inherit; font-size: 15px; }
.news-filter button i { color: var(--c); }
.news-filter button.active, .news-filter button:hover { background: var(--c); border-color: var(--c); color: #fff; }
.news-filter button.active i, .news-filter button:hover i { color: #fff; }
.award-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 14px rgba(25,45,90,.07); height: 100%; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.award-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(25,45,90,.13); }
.aw-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #f4f1e6; overflow: hidden; }
.aw-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.award-card:hover .aw-media img { transform: scale(1.04); }
.aw-noimg { --c: #b7791f; display: grid; place-items: center; width: 100%; height: 100%; font-size: 52px; color: var(--c); background: radial-gradient(circle at 50% 40%, #fff 0, #f6efd9 70%); }
.aw-type { position: absolute; left: 10px; top: 10px; color: #fff; font-size: 12.5px; font-weight: 600; padding: 3px 11px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.aw-type.static { position: static; display: inline-block; }
.aw-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.aw-prize { align-self: flex-start; font-size: 13px; font-weight: 700; color: #9a6700; background: #fff4d6; border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.aw-body h3 { font-size: 16px; line-height: 1.5; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aw-body h3 a { color: #1f2a44; }
.aw-body h3 a:hover { color: var(--primary); }
.aw-who { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.aw-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.aw-meta span + span::before { content: "·"; margin-right: 10px; }
.ad-img { width: 100%; border-radius: 12px; box-shadow: 0 4px 18px rgba(25,45,90,.12); aspect-ratio: auto; }
div.ad-img { aspect-ratio: 4 / 3; }
.ad-prize { font-size: 22px; font-weight: 700; color: #9a6700; margin-top: 10px; }
.ad-meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 16px 0 20px; padding: 16px; background: #f7f8fb; border-radius: 10px; }
.ad-meta dt { font-weight: 600; color: var(--primary-dark); }
.ad-meta dd { margin: 0; }
@media (max-width: 575.98px) {
  .aw-body { padding: 10px 12px 12px; }
  .aw-body h3 { font-size: 14.5px; }
  .aw-type { font-size: 11px; padding: 2px 8px; }
  .ad-meta { grid-template-columns: 1fr; gap: 2px; }
  .ad-meta dd { margin-bottom: 8px; }
}
