/* ============================================
   หน่วยงานราชการ (เครือ) — Design System
   Style: Traditional Thai Government, Navy + Gold
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Colors */
  --navy-900: #08213f;
  --navy-800: #0b2a52;
  --navy-700: #103770;
  --navy-600: #1a4a8c;
  --navy-50:  #eef3fb;

  --gold-700: #8a6a1f;
  --gold-600: #b8902f;
  --gold-500: #c9a14a;
  --gold-400: #d9b86a;
  --gold-100: #f6ecd1;
  --gold-50:  #fdf8e9;

  --ink:      #1a1f2e;
  --ink-2:    #2f3647;
  --muted:    #5a6072;
  --muted-2:  #8a8f9e;

  --bg:       #faf7f1;
  --bg-2:     #f3eede;
  --paper:    #ffffff;

  --line:     #e6e0d0;
  --line-2:   #d8d0bb;

  --danger:   #b3261e;
  --success:  #2f7a3a;

  /* Type */
  --font: 'Sarabun', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Layout */
  --container: 1240px;
  --radius:    6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-700); text-decoration: underline; text-underline-offset: 3px; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Top accessibility bar
   ============================================ */
.topbar {
  background: var(--navy-900);
  color: #cfd6e3;
  font-size: 14px;
  border-bottom: 2px solid var(--gold-600);
}
.topbar .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px;
}
.topbar .left { display: flex; gap: 18px; align-items: center; }
.topbar .left a { color: #cfd6e3; }
.topbar .right { display: flex; gap: 6px; align-items: center; }
.topbar button {
  background: transparent;
  border: 1px solid #2b3a55;
  color: #cfd6e3;
  width: 28px; height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}
.topbar button:hover { background: #102c4f; color: #fff; }
.topbar .sep { width: 1px; height: 16px; background: #2b3a55; margin: 0 6px; }
.topbar .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: #102c4f; font-size: 12px;
}
.topbar .pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #5cd47b; }
.topbar .label-a { font-size: 12px; color: #8a9bbf; white-space: nowrap; }
.topbar .lang-btn {
  color: #cfd6e3; font-size: 13px; padding: 3px 10px;
  border: 1px solid #2b3a55; border-radius: 4px;
  text-decoration: none;
}
.topbar .lang-btn.lang-active {
  background: var(--gold-600); color: var(--navy-900);
  border-color: var(--gold-600); font-weight: 600;
}
.topbar .lang-btn:hover { background: #102c4f; color: #fff; }

/* ============================================
   Header
   ============================================ */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding-top: 22px;
  padding-bottom: 22px;
}
.brand { display: flex; align-items: center; gap: 18px; }
.brand .emblem {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-400), var(--gold-700) 70%, var(--gold-700));
  display: grid; place-items: center;
  color: var(--navy-900);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.1;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--gold-700);
  flex-shrink: 0;
}
.brand .emblem span { display: block; font-size: 22px; line-height: 1; }
.brand .name h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.2px;
}
.brand .name .sub {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}
.brand .name .en {
  font-size: 12px;
  color: var(--muted-2);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.brand .name .header-address {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 4px;
}
.brand .name .header-contact {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 2px;
}

.header-search {
  display: flex;
  border: 1.5px solid var(--navy-800);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.header-search input {
  flex: 1;
  border: 0; outline: 0;
  padding: 11px 14px;
  font-family: inherit; font-size: 15px;
  background: #fff;
}
.header-search button {
  background: var(--navy-800);
  color: #fff;
  border: 0;
  padding: 0 18px;
  font-family: inherit; font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}
.header-search button:hover { background: var(--navy-900); }

.header-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 14px; color: var(--muted);
}
.header-meta .phone {
  display: flex; align-items: center; gap: 10px;
  padding-left: 16px; border-left: 1px solid var(--line);
}
.header-meta .phone .icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--gold-50);
  color: var(--gold-700);
  display: grid; place-items: center;
  font-size: 18px;
}
.header-meta .phone strong {
  display: block; color: var(--navy-900);
  font-size: 17px; line-height: 1.2;
}
.header-meta .phone small {
  display: block; color: var(--muted);
  font-size: 12px;
}

/* ============================================
   Main navigation
   - default: ใต้ Header
   - .is-stuck: ตรึงไว้ด้านบนเมื่อ scroll พ้น
   ============================================ */
.mainnav {
  background: var(--navy-800);
  border-bottom: 3px solid var(--gold-600);
  z-index: 1000;
  transition: box-shadow 0.2s;
}
.mainnav.is-stuck {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.25);
  animation: navSlideDown 0.25s ease;
}
.mainnav-spacer { display: none; }
.mainnav-spacer.is-active { display: block; }
@keyframes navSlideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}
.mainnav .container {
  display: flex;
  align-items: stretch;
  padding: 0 24px;
}
.mainnav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex: 1;
}
.mainnav li { position: relative; }
.mainnav a {
  display: flex; align-items: center;
  padding: 14px 18px;
  color: #fff;
  font-size: 15px; font-weight: 500;
  border-right: 1px solid rgba(255,255,255,0.08);
  height: 100%;
  text-decoration: none;
  transition: background 0.15s;
}
.mainnav li:first-child a { border-left: 1px solid rgba(255,255,255,0.08); }
.mainnav a:hover,
.mainnav a.active { background: var(--navy-900); color: var(--gold-400); text-decoration: none; }
.mainnav a.active { box-shadow: inset 0 -3px 0 var(--gold-500); }
.mainnav .home-icon { font-size: 18px; }

/* dropdown */
.mainnav .has-sub > a::after {
  content: '▾'; margin-left: 6px; font-size: 11px; opacity: 0.7;
}
.mainnav .sub {
  position: absolute; top: 100%; left: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold-600);
  min-width: 240px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  display: none;
  z-index: 100;
}
.mainnav .has-sub:hover .sub { display: block; }
.mainnav .sub a {
  color: var(--ink);
  padding: 11px 18px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.mainnav .sub a:hover { background: var(--gold-50); color: var(--navy-800); }
.mainnav .sub li:last-child a { border-bottom: 0; }

/* ============================================
   Breadcrumb
   ============================================ */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb .container {
  padding: 12px 24px;
  display: flex; align-items: center; gap: 8px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--navy-700); }
.breadcrumb .sep { color: var(--line-2); }
.breadcrumb .current { color: var(--navy-900); font-weight: 600; }

/* ============================================
   Hero
   ============================================ */
.hero {
  background: var(--navy-900);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(800px 400px at 80% 20%, rgba(201,161,74,0.18), transparent 60%),
    radial-gradient(600px 500px at 10% 80%, rgba(26,74,140,0.5), transparent 60%);
  pointer-events: none;
}
.hero .container {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  padding: 72px 24px 80px;
  align-items: center;
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(217,184,106,0.4);
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--gold-400);
  font-size: 13px;
  letter-spacing: 0.5px;
  margin-bottom: 22px;
}
.hero .eyebrow .dot { width: 6px; height: 6px; background: var(--gold-500); border-radius: 50%; }
.hero h2 {
  margin: 0 0 18px;
  font-size: 46px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-wrap: pretty;
}
.hero h2 .accent { color: var(--gold-400); }
.hero p.lead {
  font-size: 18px;
  line-height: 1.7;
  color: #d8def0;
  max-width: 540px;
  margin: 0 0 28px;
}
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--gold-500);
  color: var(--navy-900);
  border-color: var(--gold-500);
}
.btn-primary:hover { background: var(--gold-400); color: var(--navy-900); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.3);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }
.btn-outline {
  background: #fff;
  color: var(--navy-800);
  border-color: var(--navy-800);
}
.btn-outline:hover { background: var(--navy-800); color: #fff; text-decoration: none; }

.hero-art {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(217,184,106,0.3);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.5);
}
.hero-art .frame-label {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(8,33,63,0.9);
  color: var(--gold-400);
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* announcement strip below hero */
.announce {
  background: var(--gold-500);
  color: var(--navy-900);
  font-weight: 600;
  font-size: 15px;
}
.announce .container {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
}
.announce .label {
  background: var(--navy-900);
  color: var(--gold-400);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.announce .marquee {
  overflow: hidden; flex: 1;
  white-space: nowrap;
}
.announce .marquee > span {
  display: inline-block; padding-left: 100%;
  animation: scroll 40s linear infinite;
}
@keyframes scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.announce a { color: var(--navy-900); text-decoration: underline; }

/* ============================================
   Section base
   ============================================ */
.section {
  padding: 72px 0;
}
.section.tight { padding: 56px 0; }
.section.alt { background: var(--paper); }
.section.cream { background: var(--bg-2); }
.section-head {
  margin-bottom: 36px;
}
.section-head .eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold-700);
  font-size: 13px; font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head .eyebrow::before {
  content: ''; display: block;
  width: 28px; height: 2px;
  background: var(--gold-600);
}
.section-head h2 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: var(--navy-900);
  letter-spacing: -0.3px;
}
.section-head .row { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 640px;
  text-wrap: pretty;
}

/* ============================================
   Quick services
   ============================================ */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.quick-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.quick-card:hover {
  border-color: var(--gold-600);
  box-shadow: 0 8px 24px -8px rgba(184,144,47,0.4);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--navy-900);
}
.quick-card .icon {
  width: 54px; height: 54px;
  border-radius: 12px;
  background: var(--navy-50);
  color: var(--navy-800);
  display: grid; place-items: center;
  font-size: 24px;
  border: 1px solid var(--navy-50);
}
.quick-card:hover .icon {
  background: var(--gold-50);
  color: var(--gold-700);
  border-color: var(--gold-100);
}
.quick-card .label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================
   News
   ============================================ */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.tabs button {
  background: transparent; border: 0;
  padding: 12px 18px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button .count {
  background: var(--bg-2); color: var(--muted);
  font-size: 12px; padding: 2px 8px; border-radius: 999px;
  font-weight: 500;
}
.tabs button:hover { color: var(--navy-800); }
.tabs button.active {
  color: var(--navy-900);
  border-bottom-color: var(--gold-600);
}
.tabs button.active .count { background: var(--gold-100); color: var(--gold-700); }

.news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.news-feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.news-feature .thumb { aspect-ratio: 16/9; }
.news-feature .body { padding: 24px 26px 26px; }
.news-feature .meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 10px;
}
.news-feature .meta .tag {
  background: var(--navy-50); color: var(--navy-800);
  padding: 3px 10px; border-radius: 4px;
  font-weight: 600; letter-spacing: 0.3px;
}
.news-feature h3 {
  margin: 0 0 10px;
  font-size: 22px; line-height: 1.35;
  color: var(--navy-900);
  font-weight: 700;
  text-wrap: pretty;
}
.news-feature p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}
.news-feature .more {
  font-weight: 600; color: var(--gold-700);
}

.news-list {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.news-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.news-item:hover { background: var(--gold-50); text-decoration: none; }
.news-item:last-child { border-bottom: 0; }
.news-item .date {
  text-align: center;
  background: var(--navy-50);
  border-radius: 6px;
  padding: 8px 0;
  height: fit-content;
}
.news-item .date .day {
  display: block; font-size: 22px; font-weight: 700;
  color: var(--navy-900); line-height: 1;
}
.news-item .date .my {
  display: block; font-size: 11px;
  color: var(--navy-700);
  margin-top: 2px;
}
.news-item .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 4px;
  text-wrap: pretty;
}
.news-item .item-meta {
  font-size: 12px; color: var(--muted);
  display: flex; gap: 10px;
}

/* ============================================
   Cards & grids
   ============================================ */
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.card .thumb { aspect-ratio: 16/10; }
.card .body { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.card .meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--muted);
  margin-bottom: 8px;
}
.card .meta .tag {
  background: var(--gold-50); color: var(--gold-700);
  padding: 3px 9px; border-radius: 4px;
  font-weight: 600; font-size: 12px;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 18px; line-height: 1.35;
  font-weight: 700;
  color: var(--navy-900);
  text-wrap: pretty;
}
.card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14.5px; line-height: 1.6;
  flex: 1;
}
.card .more {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold-700);
  font-weight: 600;
  font-size: 14px;
}

/* ============================================
   Image placeholder
   ============================================ */
.ph {
  background:
    repeating-linear-gradient(135deg,
      rgba(11,42,82,0.04) 0,
      rgba(11,42,82,0.04) 10px,
      rgba(11,42,82,0.08) 10px,
      rgba(11,42,82,0.08) 20px);
  background-color: var(--navy-50);
  position: relative;
  display: grid; place-items: center;
  color: var(--navy-800);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 16px;
  min-height: 60px;
}
.ph::after {
  content: ''; position: absolute; inset: 8px;
  border: 1px dashed rgba(11,42,82,0.3);
  border-radius: 4px;
  pointer-events: none;
}
.ph.gold {
  background:
    repeating-linear-gradient(135deg,
      rgba(184,144,47,0.06) 0,
      rgba(184,144,47,0.06) 10px,
      rgba(184,144,47,0.12) 10px,
      rgba(184,144,47,0.12) 20px);
  background-color: var(--gold-50);
  color: var(--gold-700);
}
.ph.gold::after { border-color: rgba(184,144,47,0.4); }

/* ============================================
   Mayor / message section
   ============================================ */
.message-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: center;
}
.message-row .portrait {
  aspect-ratio: 3/4;
  border: 6px solid #fff;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.2);
  border-radius: 4px;
}
.message-row blockquote {
  margin: 0;
  font-size: 19px;
  line-height: 1.8;
  color: var(--ink-2);
  border-left: 4px solid var(--gold-500);
  padding: 4px 0 4px 24px;
  text-wrap: pretty;
}
.message-row .sig {
  margin-top: 22px;
  font-family: 'Sarabun', serif;
  font-weight: 600;
}
.message-row .sig .name { color: var(--navy-900); font-size: 18px; }
.message-row .sig .role { color: var(--muted); font-size: 14px; font-weight: 500; }

/* ============================================
   Stats / transparency
   ============================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--navy-900);
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.stat {
  padding: 36px 28px;
  border-right: 1px solid rgba(255,255,255,0.08);
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.stat.in-view {
  opacity: 1;
  transform: translateY(0);
}
.stat:last-child { border-right: 0; }
.stat .k {
  font-size: 13px;
  color: var(--gold-400);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.stat .v {
  font-size: 38px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.5px;
}
.stat .v small { font-size: 16px; font-weight: 500; color: #d8def0; margin-left: 4px; }
.stat .d {
  font-size: 13px;
  color: #aeb6c8;
  margin-top: 8px;
}

/* ============================================
   Two-col content
   ============================================ */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 36px;
  align-items: start;
}
.sidebar-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-card .head {
  background: var(--navy-800);
  color: #fff;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: 3px solid var(--gold-600);
}
.sidebar-card .body { padding: 8px 0; }
.sidebar-card ul { list-style: none; margin: 0; padding: 0; }
.sidebar-card ul a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 18px;
  font-size: 14.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.sidebar-card ul a::before {
  content: '›';
  color: var(--gold-600);
  font-weight: 700;
}
.sidebar-card ul li:last-child a { border-bottom: 0; }
.sidebar-card ul a:hover { background: var(--gold-50); color: var(--navy-800); text-decoration: none; }

/* ============================================
   Table
   ============================================ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
}
.tbl thead { background: var(--navy-800); color: #fff; }
.tbl thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  border-right: 1px solid rgba(255,255,255,0.1);
}
.tbl thead th:last-child { border-right: 0; }
.tbl tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.tbl tbody tr:hover { background: var(--gold-50); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: center; color: var(--muted); width: 60px; }
.tbl .actions { text-align: right; width: 140px; }
.tbl .pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.tbl .pill.new { background: var(--gold-100); color: var(--gold-700); }
.tbl .pill.urgent { background: #fae0de; color: var(--danger); }
.tbl .pill.normal { background: var(--navy-50); color: var(--navy-800); }

/* ============================================
   Footer
   ============================================ */
.site-footer {
  background: var(--navy-900);
  color: #cfd6e3;
  padding: 56px 0 0;
  border-top: 4px solid var(--gold-600);
  font-size: 14.5px;
}
.site-footer h4 {
  margin: 0 0 18px;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.site-footer h4::before {
  content: ''; width: 18px; height: 2px; background: var(--gold-500);
}
.site-footer a { color: #cfd6e3; }
.site-footer a:hover { color: var(--gold-400); }
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 44px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.site-footer .grid ul { list-style: none; margin: 0; padding: 0; line-height: 2; }
.site-footer .brand-block { display: flex; gap: 16px; }
.site-footer .brand-block .name { color: #fff; font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.site-footer .brand-block p { color: #aeb6c8; line-height: 1.7; margin: 6px 0 0; }
.site-footer .colophon {
  padding: 18px 0;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: #8a93a8;
  flex-wrap: wrap; gap: 8px;
}
.site-footer .colophon .seal { display: flex; gap: 16px; }
.site-footer .brand-block { display: flex; align-items: flex-start; gap: 16px; }
.site-footer .footer-logo { width: 72px; height: 72px; object-fit: contain; flex-shrink: 0; }
.site-footer .colophon-right { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-footer .colophon-right a { color: #b8c4d8; text-decoration: none; }
.site-footer .colophon-right a:hover { color: #fff; }

/* ============================================
   Page title (interior)
   ============================================ */
.page-title {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #fff;
  padding: 44px 0;
  border-bottom: 3px solid var(--gold-600);
}
.page-title h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.page-title .sub {
  color: var(--gold-400);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ============================================
   Org chart
   ============================================ */
.org-chart { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0; }
.org-node {
  background: #fff;
  border: 1.5px solid var(--navy-800);
  border-top: 4px solid var(--gold-600);
  border-radius: 6px;
  padding: 14px 22px;
  text-align: center;
  min-width: 220px;
}
.org-node .role {
  font-size: 13px; color: var(--gold-700); font-weight: 600;
  letter-spacing: 0.5px;
}
.org-node .nm { font-weight: 700; color: var(--navy-900); font-size: 16px; }
.org-node.sm { padding: 10px 14px; min-width: 180px; border-top-width: 3px; }
.org-node.sm .nm { font-size: 14px; }
.org-node.sm .role { font-size: 12px; }
.org-line { width: 2px; height: 28px; background: var(--gold-600); }
.org-row {
  display: flex; gap: 14px; justify-content: center; position: relative;
}
.org-row::before {
  content: ''; position: absolute; top: -14px; left: 12%; right: 12%;
  height: 2px; background: var(--gold-600);
}

/* ============================================
   Personnel cards
   ============================================ */
.person {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}
.person .ph { aspect-ratio: 1/1; }
.person .body { padding: 16px 14px 20px; }
.person .role {
  color: var(--gold-700);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.person h4 { margin: 0; font-size: 15.5px; color: var(--navy-900); font-weight: 700; }
.person .dept { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ============================================
   Form
   ============================================ */
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
.form-grid .full { grid-column: span 2; }
.field label {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--navy-900); margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit; font-size: 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--navy-800);
  box-shadow: 0 0 0 3px rgba(11,42,82,0.1);
}

/* utility */
.flex-row { display: flex; gap: 16px; align-items: center; }
.mt-32 { margin-top: 32px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }

/* contact map */
.map-box {
  aspect-ratio: 16/9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ============================================
   Accessibility helpers
   ============================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--navy-900); color: #fff;
  padding: 10px 18px; border-radius: 0 0 6px 6px;
  z-index: 2000; font-weight: 600;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; color: #fff; text-decoration: none; }
:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

/* ============================================
   Hamburger / mobile nav toggle
   ============================================ */
.nav-toggle {
  display: none;
  background: transparent; border: 0;
  padding: 10px 8px; cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: #fff; margin: 5px 0; border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.mainnav.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mainnav.open .nav-toggle span:nth-child(2) { opacity: 0; }
.mainnav.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-collapse { display: flex; flex: 1; }

/* ============================================
   Back-to-top button
   ============================================ */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy-800); color: var(--gold-400);
  border: 2px solid var(--gold-600);
  font-size: 20px; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s;
  z-index: 900;
  box-shadow: 0 6px 18px -6px rgba(8,33,63,0.5);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--navy-900); color: #fff; }

/* responsive */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid, .two-col, .message-row, .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .site-footer .grid { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 32px; }

  /* topbar: ซ่อน left side, เก็บแค่ปุ่ม right */
  .topbar .left { display: none; }
  .topbar .container { justify-content: flex-end; }

  /* header: stack แนวตั้ง, ค้นหาเต็มความกว้าง */
  .site-header .container {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 12px;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .header-meta { grid-column: 2; grid-row: 1; }
  .header-search { grid-column: 1 / -1; grid-row: 2; max-width: 100%; margin: 0; }

  /* mobile menu: hamburger อยู่ซ้าย, เมนูพับ */
  .mainnav .container {
    position: relative;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .nav-toggle { display: block; margin-left: 0; }
  .nav-collapse {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--navy-800);
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-direction: column;
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.3);
    max-height: 75vh; overflow-y: auto;
    z-index: 1100;
    width: 100%;
  }
  .mainnav.open .nav-collapse { display: flex; }
  .mainnav .nav-collapse ul { flex-direction: column; width: 100%; }
  .mainnav .nav-collapse a {
    white-space: nowrap;
    word-break: keep-all;
    padding: 14px 24px;
    font-size: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  /* dropdown ในมือถือ: แสดงเป็น list ซ้อน ไม่ใช่ hover */
  .mainnav .has-sub .sub {
    position: static; display: none;
    min-width: 0; box-shadow: none; border: 0;
    border-top: 0; background: var(--navy-900);
  }
  .mainnav .has-sub.sub-open .sub { display: block; }
  .mainnav .has-sub .sub a { color: #cfd6e3; padding-left: 36px; }
  .mainnav .has-sub > a::after { content: '▾'; margin-left: auto; }
}

@media (max-width: 560px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
  .site-footer .grid { grid-template-columns: 1fr; }
  .hero h2 { font-size: 26px; }
  .brand .name h1 { font-size: 18px; }
  .brand .emblem-img { width: 58px; height: 58px; }
  .header-meta { display: none; } /* ซ่อน phone block บน mobile เล็กมาก */
  .site-header .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .header-search { grid-column: 1; grid-row: 2; }
}

/* Footer Staff Bar — banner style */
.footer-staff-bar {
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.footer-staff-bar .fsb-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  border: 1px solid var(--gold-600);
  border-radius: 8px; padding: 10px 16px;
  background: rgba(255,255,255,0.04);
}
.footer-staff-bar .fsb-left {
  display: flex; align-items: center; gap: 10px;
}
.footer-staff-bar .fsb-icon {
  font-size: 22px; line-height: 1;
}
.footer-staff-bar strong { color: #fff; font-size: 13px; }
.footer-staff-bar small { color: #8a93a8; font-size: 12px; margin-left: 4px; }
.footer-staff-bar .fsb-badge {
  display: inline-block; margin-left: 8px;
  background: rgba(201,161,74,0.2); color: var(--gold-400);
  font-size: 11px; padding: 2px 8px; border-radius: 20px;
  vertical-align: middle;
}
.footer-staff-bar .fsb-links {
  display: flex; align-items: center; gap: 10px;
}
.footer-staff-bar .fsb-link-main {
  color: var(--gold-400); text-decoration: none; font-size: 13px; font-weight: 600;
}
.footer-staff-bar .fsb-link-main:hover { color: #fff; }
.footer-staff-bar .fsb-sep { color: #2b3a55; }
.footer-staff-bar .fsb-link-out {
  color: #8a93a8; text-decoration: none; font-size: 13px;
}
.footer-staff-bar .fsb-link-out:hover { color: #fff; }
.footer-staff-bar .fsb-public { display: block; width: 100%; flex: 1 1 100%; min-width: 0; }
/* โมดูลที่วางใน footer-4 (เช่น ตัวนับผู้เข้าชม) ให้ยืดเต็มความกว้างเสมอ */
.footer-staff-bar .fsb-public > * { display: block; width: 100%; box-sizing: border-box; }
.footer-staff-bar .fsb-public table { width: 100%; }
.footer-staff-bar .fsb-public img { max-width: 100%; }
.footer-staff-bar .fsb-public ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.footer-staff-bar .fsb-public ul li a {
  display: inline-block;
  background: var(--gold-600); color: var(--navy-900) !important;
  padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background 0.2s;
}
.footer-staff-bar .fsb-public ul li a:hover {
  background: #fff; color: var(--navy-900) !important;
}
