/* ==========================================================================
   กองกลาง มฉก. — ธีมสีเหลือง
   ========================================================================== */

:root {
  --yellow-900: #7a5c00;
  --yellow-800: #a37a00;
  --yellow-700: #c99700;
  --yellow-600: #e8ac00;
  --yellow-500: #FFC107;   /* หลัก */
  --yellow-400: #FFCD3C;
  --yellow-300: #FFDD73;
  --yellow-200: #FFEBA8;
  --yellow-100: #FFF6D9;
  --yellow-50:  #FFFBEE;
  --ink-900: #2b2200;
  --ink-700: #4a3c05;
  --gray-700: #555555;
  --gray-500: #7a7a7a;
  --gray-300: #e2e2e2;
  --gray-100: #f7f7f5;
  --white: #ffffff;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(122, 92, 0, 0.10);
  --shadow-md: 0 8px 24px rgba(122, 92, 0, 0.14);
  --font-th: "Noto Sans Thai", "Sarabun", "Prompt", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-th);
  color: var(--ink-900);
  background: var(--yellow-50);
  line-height: 1.65;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ink-900);
  color: var(--yellow-200);
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar a { color: var(--yellow-200); }
.topbar a:hover { color: var(--yellow-400); }
.topbar-links { display: flex; gap: 16px; align-items: center; }
.topbar-links .divider { opacity: .4; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 4px solid var(--yellow-500);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--yellow-400), var(--yellow-600));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-900);
  font-weight: 800;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-text .brand-title {
  font-weight: 800;
  font-size: 17px;
  color: var(--ink-900);
  line-height: 1.3;
}
.brand-text .brand-sub {
  font-size: 12px;
  color: var(--gray-500);
  letter-spacing: .02em;
}

/* ---------- Nav ---------- */
.main-nav {
  background: var(--yellow-500);
}
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.main-nav a {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--yellow-600);
  border-bottom-color: var(--ink-900);
}
.nav-toggle {
  display: none;
  background: var(--yellow-500);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* dropdown submenus */
.main-nav li { position: relative; }
.main-nav .caret { font-size: 10px; opacity: .7; }
.main-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: var(--white);
  border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-md);
  border-top: 3px solid var(--ink-900);
  z-index: 60;
  padding: 6px 0;
}
.main-nav .dropdown a {
  color: var(--ink-900);
  background: var(--white);
  padding: 10px 18px;
  border-bottom: none;
  font-weight: 500;
  white-space: normal;
}
.main-nav .dropdown a:hover,
.main-nav .dropdown a.active {
  background: var(--yellow-100);
  color: var(--yellow-800);
}
.main-nav li.has-dropdown:hover .dropdown,
.main-nav li.has-dropdown:focus-within .dropdown {
  display: block;
}

/* ---------- Hero / Banner ---------- */
.hero {
  background: linear-gradient(135deg, var(--yellow-400) 0%, var(--yellow-500) 45%, var(--yellow-600) 100%);
  padding: 46px 0;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
}
.hero .container { position: relative; z-index: 1; }
.hero-crumb {
  font-size: 13px;
  color: var(--ink-700);
  margin-bottom: 10px;
}
.hero h1 {
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--ink-900);
}
.hero p {
  max-width: 620px;
  color: var(--ink-700);
  margin: 0;
}

/* ---------- Section ---------- */
.section { padding: 46px 0; }
.section-alt { background: var(--white); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 10px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: 22px;
  margin: 0;
  padding-left: 14px;
  border-left: 6px solid var(--yellow-500);
}
.section-head .more {
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow-800);
}
.section-head .more:hover { color: var(--ink-900); }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 22px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--yellow-200);
  display: flex;
  flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.card-thumb {
  aspect-ratio: 16/10;
  background: var(--yellow-100);
  overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.card-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow-800);
  background: var(--yellow-100);
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
  align-self: flex-start;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink-900);
}
.card-desc {
  font-size: 13.5px;
  color: var(--gray-700);
  margin: 0 0 12px;
  flex: 1;
}
.card-meta {
  font-size: 12px;
  color: var(--gray-500);
  border-top: 1px dashed var(--gray-300);
  padding-top: 10px;
}

/* ---------- Service icons ---------- */
.service-card {
  text-align: center;
  padding: 28px 18px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--yellow-200);
  box-shadow: var(--shadow-sm);
}
.service-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--yellow-100);
  color: var(--yellow-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
}
.service-card h3 { font-size: 16px; margin: 0 0 8px; }
.service-card p { font-size: 13px; color: var(--gray-700); margin: 0 0 8px; }
.service-count { font-size: 12px; color: var(--yellow-800); font-weight: 700; }

/* ---------- Layout with sidebar ---------- */
.layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 30px;
  align-items: start;
}
.widget {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--yellow-200);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 22px;
}
.widget h3 {
  font-size: 15px;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--yellow-300);
  color: var(--ink-900);
}
.list-plain li { padding: 9px 0; border-bottom: 1px dashed var(--gray-300); font-size: 13.5px; }
.list-plain li:last-child { border-bottom: none; }
.list-plain a:hover { color: var(--yellow-800); }
.list-plain .li-date { font-size: 11.5px; color: var(--gray-500); display: block; margin-top: 2px; }

/* calendar widget */
.cal-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--gray-300); }
.cal-item:last-child { border-bottom: none; }
.cal-date {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background: var(--yellow-500);
  color: var(--ink-900);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1.1;
}
.cal-date span { font-size: 11px; font-weight: 600; }
.cal-text { font-size: 13.5px; }
.cal-text small { color: var(--gray-500); display: block; margin-top: 2px; }

/* ---------- Personnel ---------- */
.person-card { text-align: center; padding: 20px; }
.person-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 14px;
  border: 4px solid var(--yellow-300);
  background: var(--yellow-100);
}
.person-pic img { width: 100%; height: 100%; object-fit: cover; }
.person-name { font-weight: 700; font-size: 15px; }
.person-role { font-size: 12.5px; color: var(--yellow-800); margin: 4px 0 8px; font-weight: 700; }
.person-detail { font-size: 12.5px; color: var(--gray-700); }

/* ---------- Detail page ---------- */
.detail-head { margin-bottom: 20px; }
.detail-head h1 { font-size: 26px; margin: 0 0 10px; }
.detail-meta { font-size: 13px; color: var(--gray-500); }
.detail-thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.detail-body { font-size: 15.5px; color: var(--ink-700); }
.detail-body p { margin: 0 0 16px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--yellow-800);
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--yellow-500);
  color: var(--ink-900);
  font-weight: 700;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { background: var(--yellow-600); }
.btn-outline { background: transparent; border: 2px solid var(--yellow-500); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid var(--yellow-300);
  background: var(--white);
}
.pagination .current { background: var(--yellow-500); border-color: var(--yellow-500); }
.pagination a:hover { background: var(--yellow-100); }

/* ---------- Download table ---------- */
.dl-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.dl-table th, .dl-table td { padding: 14px 16px; text-align: left; font-size: 13.5px; border-bottom: 1px solid var(--gray-300); }
.dl-table th { background: var(--yellow-500); color: var(--ink-900); font-weight: 800; }
.dl-table tr:last-child td { border-bottom: none; }
.dl-table tr:hover td { background: var(--yellow-50); }
.dl-cat { font-size: 11px; font-weight: 700; color: var(--yellow-800); background: var(--yellow-100); padding: 3px 10px; border-radius: 100px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-900);
  color: var(--yellow-100);
  margin-top: 50px;
}
.footer-top { padding: 44px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 30px; }
.footer-grid h4 { color: var(--yellow-400); font-size: 15px; margin: 0 0 14px; }
.footer-grid p, .footer-grid li { font-size: 13px; color: #e9dfb8; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a:hover { color: var(--yellow-400); }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--yellow-300);
}
.footer-social a:hover { background: var(--yellow-500); color: var(--ink-900); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 16px 0;
  font-size: 12px;
  color: #cbbf8c;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 13px; color: var(--gray-500); margin-bottom: 18px; }
.crumb a:hover { color: var(--yellow-800); }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--gray-500); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-block; }
  .main-nav ul { display: none; flex-direction: column; }
  .main-nav ul.open { display: flex; }
  .main-nav a { border-bottom: 1px solid rgba(0,0,0,.08); }
  .hero h1 { font-size: 24px; }
  .main-nav .dropdown {
    display: block;
    position: static;
    box-shadow: none;
    border-top: none;
    border-radius: 0;
    background: var(--yellow-50);
    padding: 0;
  }
  .main-nav .dropdown a { padding-left: 32px; font-size: 13px; }
}
