/* ===================================================================
   ฟอนต์ Prompt (หัวข้อ) + Sarabun (เนื้อความ) — โฮสต์ไว้ในเว็บเอง
   ดาวน์โหลดจากคลัง Google Fonts (สัญญาอนุญาต OFL) แปลงเป็น woff2
   ไม่ต้องพึ่ง Google Fonts จึงโหลดได้แม้เครือข่ายบล็อกภายนอก
   =================================================================== */
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Regular.woff2') format('woff2');  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Medium.woff2') format('woff2');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Prompt'; src: url('/fonts/Prompt-Bold.woff2') format('woff2');     font-weight: 700 900; font-style: normal; font-display: swap; }

@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Regular.woff2') format('woff2');  font-weight: 100 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Medium.woff2') format('woff2');   font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-SemiBold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Sarabun'; src: url('/fonts/Sarabun-Bold.woff2') format('woff2');     font-weight: 700 900; font-style: normal; font-display: swap; }

/* ===================================================================
   Design tokens — โทนเขียวเข้ม + ทอง
   =================================================================== */
:root {
  --teal-950: #082621;
  --teal-900: #0D3B35;
  --teal-800: #124A42;
  --teal-700: #155B51;
  --teal-600: #1A6E62;
  --teal-500: #1D7A6D;
  --teal-050: #F0F6F5;
  --sage-100: #E1ECE9;
  --sage-200: #CFE1DC;

  --gold-700: #A67F1D;
  --gold-600: #C59B27;
  --gold-500: #D8B24C;
  --gold-100: #F7EFCB;
  --gold-050: #FBF6E7;

  --ink-900: #16211F;
  --ink-700: #2A3835;
  --ink-600: #4A5D5A;
  --ink-400: #7C8D8A;

  --white: #FFFFFF;
  --paper: #F7FAF9;
  --border: #E1E9E6;

  /* Prompt = หัวข้อ/เมนู, Sarabun = เนื้อความ (อ่านง่ายบนจอกว่า TH Sarabun New) */
  --font-display: 'Prompt', sans-serif;
  --font-body: 'Sarabun', sans-serif;
  --font-accent: 'Prompt', sans-serif;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(8, 38, 33, 0.06);
  --shadow: 0 14px 40px rgba(8, 38, 33, 0.10);
  --shadow-lg: 0 24px 60px rgba(8, 38, 33, 0.16);

  /* ===== ขยายขนาดหน้าเว็บ ===== */
  --container: 1840px;   /* เดิม 1600px — ใช้พื้นที่จอกว้างได้เต็มขึ้น */
  --gutter: 44px;
  --base-size: 20px;     /* ใหญ่กว่าเดิม (18.5px) เพื่อให้อ่านชัดขึ้น */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: var(--base-size); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--teal-900); margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.gold-rule { width: 72px; height: 4px; background: var(--gold-600); margin: 0 0 14px; }
.gold-rule.center { margin-left: auto; margin-right: auto; }
.section { padding: 52px 0; }
.section-head { max-width: 860px; margin: 0 0 30px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow-label { font-family: var(--font-display); font-size: 0.9rem; font-weight: 600; color: var(--gold-700); margin: 0 0 8px; }
.section-title { font-size: clamp(1.75rem, 2.2vw, 2.4rem); font-weight: 600; }
.section-desc { color: var(--ink-600); font-size: 1.02rem; margin: 12px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 30px; border-radius: 999px; font-family: var(--font-display); font-weight: 500;
  font-size: 0.98rem; text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: all 0.25s ease;
}
.btn-gold { background: var(--gold-600); color: var(--teal-950); }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(197, 155, 39, 0.45); }
.btn-outline { border-color: rgba(255,255,255,0.55); color: var(--white); background: rgba(255,255,255,0.06); backdrop-filter: blur(2px); }
.btn-outline:hover { background: rgba(255,255,255,0.16); border-color: var(--white); }
.btn-teal { background: var(--teal-700); color: var(--white); }
.btn-teal:hover { transform: translateY(-2px); background: var(--teal-900); }

/* ===== Utility Bar ===== */
.utility-bar { background: var(--teal-950); color: var(--sage-100); font-size: 0.88rem; }
.utility-inner { display: flex; justify-content: space-between; align-items: center; padding: 10px var(--gutter); flex-wrap: wrap; gap: 8px; }
.utility-contact { display: flex; gap: 24px; flex-wrap: wrap; }
.utility-contact a, .utility-links a {
  color: var(--sage-100); text-decoration: none; opacity: 0.85; font-weight: 400;
  display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.2s;
}
.utility-contact a:hover, .utility-links a:hover { opacity: 1; color: var(--gold-500); }
.utility-links { display: flex; gap: 18px; align-items: center; }
.utility-links .divider { width: 1px; height: 12px; background: rgba(255,255,255,0.25); }

/* ===== Header ===== */
.site-header { background: rgba(255,255,255,0.94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: relative; z-index: 90; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter); gap: 20px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--teal-600), var(--teal-950));
  color: var(--gold-100); border: 2px solid var(--gold-500);
  font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-family: var(--font-display); font-size: 1.28rem; color: var(--teal-900); font-weight: 600; }
.brand-text em { font-style: normal; font-size: 0.82rem; color: var(--ink-600); font-weight: 400; letter-spacing: 0.2px; }

.header-actions { display: flex; align-items: center; gap: 14px; }

/* ===== Hero (แบนเนอร์ภาพล้วน) ===== */
.hero {
  position: relative; overflow: hidden; background: var(--teal-050);
  display: flex; justify-content: center;
}
/* แบนเนอร์เต็มความกว้างจอ
   ขนาดไฟล์ที่แนะนำ: 2400 × 600 px (อัตราส่วน 4:1) — ขั้นต่ำ 1920 × 480 px
   ควรวางข้อความ/โลโก้สำคัญไว้กลางภาพประมาณ 60% เพราะบนจอแคบขอบซ้ายขวาจะถูกตัด */
.hero img {
  width: 100%; max-width: none; height: auto; display: block;
}
/* จอแคบ: แสดงแบนเนอร์เต็มรูป ไม่ครอป จะได้ไม่มีชื่อวิทยาลัยหายไปจากขอบภาพ
   ถ้าต้องการแบนเนอร์มือถือที่อ่านง่ายขึ้น ให้เพิ่มไฟล์
   /images/banner/banner-mobile.jpg (แนะนำ 1080 × 720 px อัตราส่วน 3:2)
   ระบบจะสลับมาใช้ไฟล์นั้นบนจอแคบให้อัตโนมัติ */
.hero img.is-mobile-banner { height: 62vw; max-height: 420px; object-fit: cover; object-position: center; }

/* ===== Mega Nav ===== */
.mega-nav { background: var(--teal-950); border-bottom: 3px solid var(--gold-500); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 14px rgba(8,38,33,0.16); }
.mega-nav-inner { display: flex; align-items: stretch; }
.mega-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; flex: 1; flex-wrap: wrap; }
.mega-item { position: relative; display: flex; }
.mega-link-row { display: flex; align-items: stretch; transition: all 0.2s; }
.mega-link {
  display: flex; align-items: center; text-decoration: none; color: var(--sage-100);
  font-family: var(--font-display); font-weight: 500; font-size: 1rem;
  padding: 18px 6px 18px 20px; white-space: nowrap; border: none; background: none; cursor: pointer;
}
.mega-item-plain .mega-link { padding-right: 20px; }
.mega-item:hover .mega-link-row, .mega-item.open .mega-link-row, .mega-item:hover > .mega-link { background: var(--teal-800); }
.mega-item:hover .mega-link-row .mega-link, .mega-item.open .mega-link-row .mega-link, .mega-item:hover > .mega-link { color: var(--gold-100); }
.mega-caret {
  width: 16px; flex: none; background: none; border: none; cursor: pointer; padding: 0 16px 0 0;
  position: relative; opacity: 0.8; display: flex; align-items: center; justify-content: center;
}
.mega-caret::before {
  content: '▾'; font-size: 0.72rem; color: var(--gold-100); transition: transform 0.2s; display: inline-flex;
}
.mega-item:hover .mega-caret::before, .mega-item.open .mega-caret::before { transform: rotate(180deg); }

.mega-panel { transform: translateY(-6px);
  position: absolute; top: 100%; left: 0; min-width: 340px; background: var(--white); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: 12px; opacity: 0; visibility: hidden; transition: all 0.18s ease; z-index: 95; border-top: 3px solid var(--gold-500);
  max-height: 78vh; overflow-y: auto;
}
.mega-item:hover .mega-panel, .mega-item.open .mega-panel { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-panel ul { list-style: none; margin: 0; padding: 0; }
.mega-panel a { display: block; padding: 10px 14px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink-700); font-size: 0.93rem; transition: all 0.15s; }
.mega-panel a:hover { background: var(--teal-050); color: var(--teal-800); }
.mega-panel-wide { min-width: 620px; }
.mega-panel-wide > ul { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
/* เมนูย่อยระดับที่ 3 */
.mega-panel .sub-list { margin: 0 0 6px 12px; padding-left: 10px; border-left: 2px solid var(--sage-200); }
.mega-panel .sub-list a { font-size: 0.86rem; color: var(--ink-600); padding: 7px 12px; }
.mega-panel .sub-list a::before { content: '– '; color: var(--gold-600); }

.mega-toggle {
  display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 18px 20px; flex: none;
}
.mega-toggle span { width: 24px; height: 2px; background: var(--sage-100); border-radius: 2px; }

/* ===================================================================
   สไลด์ภาพประชาสัมพันธ์ / แสดงความยินดี (ข้อ 3)
   =================================================================== */
.promo-section { padding: 30px 0 10px; }
.slider {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--teal-950); box-shadow: var(--shadow);
  border: 1px solid var(--border);
  /* กว้างเท่าแบนเนอร์หัวเว็บ ภาพจึงไม่ถูกขยายเกินขนาดจริงจนเบลอหรือสูงเกินไป */
  max-width: 1200px; margin: 0 auto;
}
.slider-viewport { overflow: hidden; }
.slider-track { display: flex; transition: transform 0.55s cubic-bezier(.4,.0,.2,1); will-change: transform; }
.slide {
  flex: 0 0 100%; position: relative; min-width: 100%;
  height: 100%; background: var(--teal-950); overflow: hidden;
}
/* ความสูงของกรอบถูกคำนวณจากสัดส่วนภาพจริงใน main.js
   ค่าเริ่มต้นนี้ใช้ก่อนภาพโหลดเสร็จเท่านั้น */
.slider-viewport { height: 300px; transition: height 0.35s ease; }
.slider-track { height: 100%; }
.slide > a, .slide > .slide-inner {
  display: block; width: 100%; height: 100%; text-decoration: none; position: relative; z-index: 1;
}
/* contain = เห็นภาพทั้งใบเสมอ ไม่ว่าจะแนวนอน แนวตั้ง หรือสัดส่วนใด (เดิม cover ตัดหัว-ท้ายรูป) */
.slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
/* พื้นหลังเบลอจากภาพเดียวกัน เติมช่องว่างข้างรูปให้ไม่ดูโหว่ */
.slide-bg {
  position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
  filter: blur(30px) brightness(0.5); transform: scale(1.2);
}
.slide-caption {
  position: absolute; inset: auto 0 0 0; padding: 12px 24px; color: var(--white);
  background: linear-gradient(0deg, rgba(8,38,33,0.88), rgba(8,38,33,0.35) 60%, transparent);
  font-family: var(--font-display); font-size: 1.22rem; font-weight: 500; line-height: 1.5;
}
.slide-caption small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; opacity: 0.85; margin-top: 4px; }

.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.45);
  background: rgba(8,38,33,0.45); color: var(--white); font-size: 1.6rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; backdrop-filter: blur(4px); z-index: 3;
}
.slider-arrow:hover { background: var(--gold-500); color: var(--teal-950); border-color: var(--gold-500); }
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

.slider-dots {
  position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center;
  gap: 9px; z-index: 3;
}
.slider-dots button {
  width: 11px; height: 11px; border-radius: 999px; border: none; cursor: pointer; padding: 0;
  background: rgba(255,255,255,0.5); transition: all 0.25s;
}
.slider-dots button.active { background: var(--gold-500); width: 30px; }
.slider-empty {
  padding: 90px 24px; text-align: center; color: var(--sage-200); font-size: 1rem;
}
.slider-empty strong { display: block; color: var(--white); font-family: var(--font-display); margin-bottom: 6px; font-size: 1.1rem; }

/* ===== Programs ===== */
.program-card {
  background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); overflow: hidden; display: grid; grid-template-columns: 1.1fr 1fr;
}
/* หลักสูตรรอง — สลับฝั่งภาพ และย่อขนาดลงเล็กน้อยให้ต่างจากหลักสูตรหลัก */
.program-card-alt { margin-top: 28px; grid-template-columns: 1fr 0.85fr; }
.program-card-alt .program-info { padding: 40px 44px; }
.program-card-alt .program-info h3 { font-size: 1.38rem; }

.program-info { padding: 48px; }
.program-badge {
  display: inline-block; font-size: 0.82rem; font-weight: 600; color: var(--teal-800); background: var(--teal-050);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 16px; letter-spacing: 0.3px;
}
.program-badge.badge-gold { color: var(--gold-700); background: var(--gold-050); }
.program-info h3 { font-size: 1.6rem; }
.program-info p { color: var(--ink-600); }
.program-meta { display: flex; gap: 34px; margin: 26px 0 30px; flex-wrap: wrap; }
.program-meta div strong { display: block; font-family: var(--font-display); color: var(--teal-900); font-size: 1.1rem; }
.program-meta div span { font-size: 0.84rem; color: var(--ink-600); }

/* ฝั่งขวา: ใส่ภาพประกอบได้ในอนาคต โดยวางไฟล์ลงโฟลเดอร์ public/images/program/
   ถ้ายังไม่มีไฟล์ JS จะถอดแท็ก img ออก เหลือพื้นเขียวพร้อมไอคอนแบบเดิม */
.program-visual {
  background: var(--teal-900);
  display: flex; align-items: center; justify-content: center; padding: 48px; position: relative;
  min-height: 260px; overflow: hidden;
}
.program-visual .cap-icon { font-size: 6rem; opacity: 0.9; }
.program-visual .program-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; padding: 0;
}
.program-visual.has-photo { padding: 0; }
.program-visual.has-photo .cap-icon { display: none; }

/* ===== หน้าแรก 3 คอลัมน์ ===== */
/* คอลัมน์ข้างกว้างขึ้นเพื่อรองรับตัวอักษรขนาดใหญ่ ส่วนคอลัมน์กลางยังกว้างที่สุด */
.trio-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
.col-left, .col-right { display: flex; flex-direction: column; gap: 26px; }
.col-center { display: flex; flex-direction: column; gap: 30px; min-width: 0; }

.welcome-card {
  background: var(--teal-900); color: var(--white);
  border-radius: var(--radius-lg); padding: 34px 38px; box-shadow: var(--shadow-sm);
}
.welcome-card h2 { color: var(--white); font-size: 1.5rem; margin-bottom: 10px; }
.welcome-card p { color: var(--sage-100); font-size: 1rem; margin: 0; font-weight: 400; }

/* ===== News Section ===== */
.news-panel { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.news-panel-head { padding: 32px 34px 0; }

/* toolbar = แถวเดียว: แท็บ + ช่องค้นหาอยู่ในแถวเดียวกัน ไม่ขึ้นบรรทัดใหม่ */
.news-toolbar { padding: 16px 34px; }
.news-tabs {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
.news-tabs::-webkit-scrollbar { display: none; }

.tab {
  background: var(--teal-050); border: 1px solid transparent; color: var(--teal-900);
  padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 0.87rem;
  font-family: var(--font-body); font-weight: 500; white-space: nowrap; flex: none;
  transition: all 0.2s;
}
.tab.active, .tab:hover { background: var(--teal-800); color: var(--white); }

/* ช่องค้นหาอยู่ท้ายแถวเดียวกับแท็บ */
.news-search {
  margin-left: auto; flex: none;
  padding: 7px 18px; border-radius: 999px; border: 1px solid var(--border);
  font-family: var(--font-body); font-size: 0.9rem; outline: none; min-width: 0; width: 180px;
}
.news-search:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(197,155,39,0.15); }

.news-list { list-style: none; margin: 0; padding: 0 34px 10px; }
.news-item {
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
  padding: 19px 0; border-bottom: 1px solid var(--border); transition: padding-left 0.2s;
}
.news-item:hover { padding-left: 6px; }
.news-item:last-child { border-bottom: none; }
.news-cat {
  font-size: 0.78rem; color: var(--teal-800); background: var(--teal-050); padding: 4px 13px;
  border-radius: 999px; flex: none; font-weight: 600; white-space: nowrap;
}
.news-title { flex: 1; font-weight: 400; font-size: 1.03rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-title-link { color: var(--ink-900); text-decoration: none; }
.news-title-link:hover { color: var(--teal-700); text-decoration: underline; }
.news-badge-new { font-size: 0.7rem; font-weight: 700; color: var(--teal-950); background: var(--gold-500); padding: 2px 9px; border-radius: 999px; }
.news-date { font-size: 0.86rem; color: var(--ink-400); flex: none; font-weight: 400; }
.news-empty { padding: 30px 0; color: var(--ink-600); font-size: 0.98rem; text-align: center; }

/* ===== เลขหน้าข่าว ===== */
.news-pagination {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; padding: 18px 34px 24px;
  border-top: 1px solid var(--border);
}
.pg-btn {
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--white); color: var(--ink-900);
  font-family: var(--font-display); font-size: 0.92rem; cursor: pointer; transition: all 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.pg-btn:hover:not(:disabled):not(.active) { border-color: var(--teal-500); color: var(--teal-800); background: var(--teal-050); }
.pg-btn.active { background: var(--teal-800); border-color: var(--teal-800); color: var(--white); font-weight: 600; }
.pg-btn:disabled { opacity: 0.35; cursor: default; }
.pg-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; color: var(--ink-400); font-size: 0.92rem; }

/* ===== ไซด์บาร์ ===== */
.sidebar-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }

.director-mini { text-align: center; padding: 26px 20px 24px; }
.director-mini-img-wrap {
  width: 100%; height: 380px; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--teal-050); margin-bottom: 0; border: 1px solid var(--border);
}
.director-mini-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ป้ายชื่อโค้งซ้อนขึ้นมาทับรูปเล็กน้อย — ชื่อต้องอยู่บรรทัดเดียวเสมอ
   ใช้ clamp() ย่อขนาดอักษรอัตโนมัติเมื่อคอลัมน์แคบ แทนการตัดคำขึ้นบรรทัดใหม่
   line-height เผื่อไว้พอสำหรับวรรณยุกต์และสระบนของภาษาไทย ไม่ให้ถูกตัดหัว */
.director-info {
  position: relative; margin: -26px -20px 0; width: auto;
  background: var(--gold-500);
  border-radius: 22px; padding: 13px 10px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--gold-600);
}
.director-mini h4 {
  font-family: var(--font-display); font-size: clamp(0.78rem, 1.05vw, 1.02rem);
  margin: 0 0 4px; color: var(--teal-950); font-weight: 600;
  line-height: 1.55; white-space: nowrap;
}
/* ตำแหน่งยาว 44 ตัวอักษร — บังคับบรรทัดเดียวบนจอกว้าง (>1500px)
   จอแคบกว่านั้นปล่อยให้ตัดบรรทัดได้ ดีกว่าย่ออักษรจนอ่านไม่ออก */
.director-mini p {
  font-size: 0.74rem; color: var(--teal-900); margin: 0;
  font-weight: 500; line-height: 1.65; white-space: nowrap;
}
@media (max-width: 1700px) {
  .director-mini p { font-size: 0.7rem; }
}
@media (max-width: 1500px) {
  .director-mini p { white-space: normal; font-size: 0.76rem; }
}
/* จอเล็ก: คอลัมน์ซ้ายกลายเป็นเต็มความกว้าง — ขยายชื่อกลับให้อ่านสบาย (ยังบรรทัดเดียว) */
@media (max-width: 980px) {
  .director-mini h4 { font-size: 1.05rem; }
  .director-mini-img-wrap { height: 400px; }
}

/* ===================================================================
   ระบบสารสนเทศ sidebar — อ่านง่าย พื้นขาว ไม่ใช่ปุ่มสีเข้ม
   =================================================================== */
.sys-banner-card .system-grid,
.sys-banner-card .sys-banner-list {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
}
.sys-banner-card .sys-btn,
.sys-banner-card .sys-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  text-decoration: none; border: 1px solid var(--border);
  background: var(--white) !important; color: var(--ink-900) !important;
  font-size: 0.88rem; font-weight: 500; font-family: var(--font-display);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.sys-banner-card .sys-btn:hover,
.sys-banner-card .sys-banner:hover {
  transform: translateX(4px); border-color: var(--gold-500);
  background: var(--teal-050) !important; box-shadow: var(--shadow-sm);
  color: var(--teal-900) !important;
}
.sys-banner-card .sys-icon,
.sys-banner-card .sys-banner-icon {
  flex: none; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; background: var(--teal-050); border-radius: 8px;
  border: 1px solid var(--border);
}
.sys-banner-card .sys-btn:hover .sys-icon,
.sys-banner-card .sys-banner:hover .sys-banner-icon {
  background: var(--gold-100); border-color: var(--gold-500);
}
.sys-banner-card .sys-text { min-width: 0; }
.sys-banner-card .sys-text strong { font-size: 0.88rem; color: var(--teal-900); font-weight: 500; line-height: 1.4; }

@media (max-width: 640px) {
  .sys-banner-card .sys-btn,
  .sys-banner-card .sys-banner { padding: 10px 11px; gap: 10px; }
  .sys-banner-card .sys-icon,
  .sys-banner-card .sys-banner-icon { width: 32px; height: 32px; font-size: 1rem; }
}

.sidebar-title {
  font-size: 1rem; padding: 12px 18px; margin: 0; background: var(--teal-800);
  border-bottom: 3px solid var(--gold-600);
  color: var(--white); font-weight: 600; display: flex; align-items: center; gap: 8px;
}

/* ===== เมนูวิทยาลัย (ลิงก์ลัด) ===== */
.quick-link-list { list-style: none; margin: 0; padding: 10px; }
.quick-link-list li { border-bottom: 1px dashed var(--border); }
.quick-link-list li:last-child { border-bottom: none; }
.quick-link-list a {
  display: block; padding: 12px 14px; text-decoration: none; color: var(--ink-700); font-size: 0.92rem;
  transition: all 0.15s; border-radius: var(--radius-sm);
}
.quick-link-list a:hover { background: var(--teal-050); color: var(--teal-800); padding-left: 20px; }
.quick-link-list a.is-active { background: var(--teal-050); color: var(--teal-800); font-weight: 600; padding-left: 20px; border-right: 3px solid var(--teal-600); }
.quick-link-list a.is-stub { color: var(--ink-400); }
.quick-link-list a.is-stub::after { content: " (ร่าง)"; font-size: 0.78rem; }

/* ===== แอดมิน / Facebook ===== */
.admin-card-body { padding: 18px 22px 22px; }
.admin-card-body p { font-size: 0.9rem; color: var(--ink-600); margin-bottom: 14px; }
.fb-card {
  display: flex; align-items: center; gap: 16px; background: #1877F2;
  color: var(--white); text-decoration: none; border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.fb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fb-card-icon {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem;
}
.fb-card-text { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; line-height: 1.5; }
.fb-card-text small { font-weight: 400; opacity: 0.85; font-size: 0.82rem; }

/* ===== ระบบสารสนเทศ ===== */
.sys-banner-card { padding-bottom: 16px; }
.sys-banner-list { display: flex; flex-direction: column; gap: 9px; padding: 18px; }
.sys-banner {
  display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-radius: var(--radius-sm);
  text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 0.87rem; line-height: 1.35;
  color: var(--white); box-shadow: var(--shadow-sm); transition: all 0.2s ease; border: 1px solid rgba(255,255,255,0.18);
}
.sys-banner:hover { transform: translateX(4px); box-shadow: var(--shadow); filter: brightness(1.06); }
.sys-banner-icon { font-size: 1.1rem; flex: none; }
.sys-banner:nth-child(8n+1) { background: var(--teal-800); }
.sys-banner:nth-child(8n+2) { background: var(--gold-700); }
.sys-banner:nth-child(8n+3) { background: #256B4D; }
.sys-banner:nth-child(8n+4) { background: #9C3C26; }
.sys-banner:nth-child(8n+5) { background: var(--teal-700); }
.sys-banner:nth-child(8n+6) { background: #744B19; }
.sys-banner:nth-child(8n+7) { background: #244E73; }
.sys-banner:nth-child(8n+0) { background: var(--gold-600); }

/* ===== บริการออนไลน์ (ฟอร์ม/คำร้อง) ===== */
.service-list { list-style: none; margin: 0; padding: 12px; }
.service-list li { border-bottom: 1px dashed var(--border); padding: 4px 0; }
.service-list li:last-child { border-bottom: none; }
.service-list > li > a {
  display: block; padding: 10px 14px; text-decoration: none; color: var(--ink-700); font-size: 0.9rem; border-radius: var(--radius-sm);
}
.service-list > li > a:hover { background: var(--teal-050); color: var(--teal-800); }
.service-sub { display: flex; gap: 8px; padding: 0 14px 8px; flex-wrap: wrap; }
.service-sub a {
  font-size: 0.76rem; text-decoration: none; color: var(--teal-800); background: var(--teal-050);
  padding: 3px 12px; border-radius: 999px; border: 1px solid var(--border);
}
.service-sub a:hover { background: var(--teal-800); color: var(--white); }

.cta-card {
  background: var(--gold-600); border-radius: var(--radius-lg);
  padding: 32px 28px; color: var(--teal-950); text-align: center; box-shadow: var(--shadow-sm);
}
.cta-card h4 { font-size: 1.15rem; margin-bottom: 8px; color: var(--teal-950); }
.cta-card p { font-size: 0.9rem; margin-bottom: 18px; color: rgba(8,38,33,0.75); }
.cta-card .btn { width: 100%; background: var(--teal-950); color: var(--white); }
.cta-card .btn:hover { background: var(--teal-800); }

/* ===== วิดีโอ + ปฏิทิน ===== */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.media-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.media-card h4 { padding: 18px 22px 0; margin: 0 0 12px; font-size: 1.02rem; }
.media-frame { aspect-ratio: 16/9; }
.media-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.calendar-frame { height: 600px; }
.calendar-frame iframe { width: 100%; height: 100%; border: 0; }

/* ===== Gallery strip ===== */
.gallery-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.gallery-card { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); aspect-ratio: 4/5; position: relative; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-card:hover img { transform: scale(1.06); }
.gallery-card .cap {
  position: absolute; inset: auto 0 0 0; padding: 18px; color: var(--white); font-size: 0.9rem; font-weight: 500;
  background: linear-gradient(0deg, rgba(8,38,33,0.85), transparent);
}

/* ===== Footer ===== */
.site-footer { background: var(--teal-950); color: var(--sage-200); padding-top: 68px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 48px; padding-bottom: 44px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; text-decoration: none; }
.footer-brand strong { color: var(--white); font-family: var(--font-display); font-size: 1.1rem; }
.footer-col h4 { color: var(--white); font-family: var(--font-display); font-size: 1.02rem; margin-bottom: 16px; letter-spacing: 0.3px; }
.footer-col p { font-size: 0.92rem; color: var(--sage-200); opacity: 0.85; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-links a { color: var(--sage-200); text-decoration: none; font-size: 0.92rem; opacity: 0.85; transition: opacity 0.2s; }
.footer-links a:hover { opacity: 1; color: var(--gold-500); }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--sage-200);
  transition: all 0.2s;
}
.footer-social a:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--teal-950); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 24px 0; font-size: 0.86rem; color: var(--sage-200); opacity: 0.7; flex-wrap: wrap; gap: 10px; }
.back-to-top {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: var(--white); text-decoration: none; display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.back-to-top:hover { background: var(--gold-500); color: var(--teal-950); border-color: var(--gold-500); }

/* ===== Responsive ===== */
@media (max-width: 1700px) {
  .trio-layout { grid-template-columns: 320px minmax(0, 1fr) 340px; gap: 28px; }
  :root { --gutter: 32px; --base-size: 19.5px; }
}
@media (max-width: 1500px) {
  .trio-layout { grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 24px; }
  :root { --gutter: 28px; --base-size: 19px; }
}
@media (max-width: 1200px) {
  :root { --base-size: 18px; }
  .trio-layout { grid-template-columns: 240px minmax(0, 1fr) 260px; gap: 20px; }
  .mega-panel-wide { min-width: 480px; }
}
@media (max-width: 980px) {
  .mega-toggle { display: flex; }
  .mega-nav-inner { flex-wrap: wrap; position: relative; }
  .mega-menu { display: none; width: 100%; flex-direction: column; }
  .mega-menu.open { display: flex; }
  .mega-item { flex-direction: column; }
  .mega-link, .mega-link-row { width: 100%; }
  .mega-link-row { justify-content: space-between; }
  .mega-link { padding: 14px 18px; white-space: normal; }
  .mega-panel {
    position: static; display: none; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border-top: none; border-radius: 0; background: var(--teal-900); padding: 4px 10px 10px 26px; min-width: 0;
    max-height: none;
  }
  .mega-item.open .mega-panel { display: block; }
  .mega-panel-wide { min-width: 0; }
  .mega-panel-wide > ul { grid-template-columns: 1fr; }
  .mega-panel a { color: var(--sage-100); }
  .mega-panel a:hover { background: var(--teal-800); color: var(--gold-100); }
  .mega-panel .sub-list { border-left-color: rgba(255,255,255,0.25); }
  .mega-panel .sub-list a { color: var(--sage-200); }
  .mega-caret::before { color: var(--sage-100); }
  .program-card, .program-card-alt { grid-template-columns: 1fr; }
  .program-visual { padding: 30px; min-height: 200px; }
  .trio-layout { grid-template-columns: 1fr; }
  .col-center { order: 1; }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .gallery-strip { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  :root { --gutter: 16px; --base-size: 17px; }
  .header-inner { padding: 12px 16px; gap: 10px; }
  .brand-text em { display: none; }
  .brand-text strong { font-size: 1rem; }
  .brand-mark { width: 46px; height: 46px; font-size: 0.82rem; }
  .header-actions .btn { display: none; }
  .slider-arrow { width: 40px; height: 40px; font-size: 1.2rem; }
  .slider-arrow.prev { left: 10px; }
  .slider-arrow.next { right: 10px; }
  .slide-caption { padding: 16px 18px; font-size: 0.98rem; }
  .program-info { padding: 28px; }
  /* มือถือ: แท็บเลื่อนข้ามได้ ช่องค้นหาขึ้นบรรทัดใหม่ใต้แท็บ */
  .news-toolbar { padding: 12px 20px; display: flex; flex-direction: column; gap: 10px; }
  .news-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .news-search { width: 100%; margin-left: 0; }
  .news-list { padding: 0 20px 8px; }
  .news-pagination { padding: 14px 20px 20px; }
  .news-panel-head { padding: 22px 20px 0; }
  /* มือถือ: หัวข้อข่าวได้เต็มความกว้าง ไม่ถูกบีบจนตัดคำทีละ 2-3 ตัวอักษร
     บรรทัดบน = หมวดข่าว + วันที่ / บรรทัดล่าง = หัวข้อข่าว */
  .news-item {
    display: grid; grid-template-columns: auto 1fr;
    grid-template-areas: "cat date" "title title";
    gap: 9px 10px; align-items: center; padding: 16px 0;
  }
  .news-item:hover { padding-left: 0; }
  .news-cat { grid-area: cat; justify-self: start; }
  .news-date { grid-area: date; justify-self: end; }
  .news-title { grid-area: title; font-size: 0.98rem; line-height: 1.6; }
  .pg-btn { min-width: 34px; height: 34px; font-size: 0.86rem; }
}
@media (max-width: 560px) {
  .utility-contact { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .program-meta { gap: 18px; }
}
/* ===================================================================
   หน้าเนื้อหาภายใน (/page/<slug>)
   =================================================================== */
.page-hero {
  background: var(--teal-900);
  color: var(--white); padding: 46px 0 40px; border-bottom: 3px solid var(--gold-500);
}
.page-hero .page-title { color: var(--white); font-size: clamp(1.6rem, 2.6vw, 2.4rem); margin: 0 0 14px; }
.page-hero .gold-rule { margin-bottom: 0; }
.breadcrumb { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 0.88rem; margin-bottom: 14px; color: var(--sage-200); }
.breadcrumb a { color: var(--sage-100); text-decoration: none; opacity: 0.9; }
.breadcrumb a:hover { color: var(--gold-500); text-decoration: underline; }
.breadcrumb span { opacity: 0.65; }
.breadcrumb .crumb-current { color: var(--gold-100); opacity: 1; }

.page-body { padding: 52px 0 80px; }
.page-layout { display: grid; grid-template-columns: 1fr 340px; gap: 42px; align-items: start; }
.page-side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 92px; }
.page-content {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px 54px; box-shadow: var(--shadow-sm); min-width: 0;
}
.page-content h2 {
  font-size: 1.5rem; margin: 40px 0 16px; padding-left: 16px;
  border-left: 4px solid var(--gold-500);
}
.page-content h2:first-child { margin-top: 0; }
.page-content h3 { font-size: 1.15rem; margin: 26px 0 10px; }
.page-content p { color: var(--ink-700); }
.page-content .lead { font-size: 1.1rem; color: var(--ink-600); }
.page-content a { color: var(--teal-700); }
.page-content code {
  background: var(--teal-050); padding: 2px 7px; border-radius: 6px;
  font-size: 0.88em; font-family: ui-monospace, monospace; color: var(--teal-800);
}

.quote-block {
  margin: 0 0 20px; padding: 26px 30px; background: var(--teal-050);
  border-left: 5px solid var(--teal-700); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-700); font-size: 1.02rem;
}
.motto {
  font-family: var(--font-accent); font-size: 1.5rem; color: var(--teal-800);
  text-align: center; padding: 26px; background: var(--gold-050);
  border-radius: var(--radius); border: 1px dashed var(--gold-500);
}
.vision-text {
  font-family: var(--font-display); font-size: 1.25rem; color: var(--teal-900);
  font-weight: 500; line-height: 1.6;
}
.def-list { margin: 0 0 20px; }
.def-list dt { font-family: var(--font-display); font-weight: 600; color: var(--teal-800); margin-top: 16px; }
.def-list dd { margin: 6px 0 0; padding-left: 18px; border-left: 2px solid var(--sage-200); color: var(--ink-600); }

/* ไทม์ไลน์ประวัติ */
.timeline { list-style: none; margin: 0; padding: 0 0 0 8px; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: var(--gold-500);
}
.timeline > li { position: relative; padding: 0 0 30px 34px; }
.timeline > li::before {
  content: ''; position: absolute; left: 2px; top: 8px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--gold-500); border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--gold-500);
}
.tl-year {
  display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem;
  color: var(--teal-950); background: var(--gold-100); padding: 3px 14px; border-radius: 999px; margin-bottom: 8px;
}
.tl-body h3 { margin: 4px 0 8px; font-size: 1.1rem; }
.tl-body p { margin-bottom: 10px; }

/* พันธกิจ */
.mission-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.mission-list > li {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 16px; align-items: center;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px;
}
.mission-no {
  width: 40px; height: 40px; border-radius: 50%; background: var(--teal-800); color: var(--gold-100);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600;
}
.mission-list p { margin: 0; }
.mission-link { font-size: 0.84rem; white-space: nowrap; text-decoration: none; color: var(--teal-700); }
.mission-link:hover { text-decoration: underline; }

/* ค่านิยม LOVE CKR */
.value-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; margin-bottom: 24px; }
.value-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 22px; text-align: center; box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.value-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-500); }
.value-letter {
  display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px;
  border-radius: 50%; background: var(--teal-900);
  color: var(--gold-100); font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; margin-bottom: 12px;
}
.value-card h3 { margin: 0 0 4px; font-size: 1rem; }
.value-card p { margin: 0; font-size: 0.88rem; color: var(--ink-600); }

/* การ์ดลิงก์ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-bottom: 10px; }
.info-card {
  display: block; text-decoration: none; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--teal-600); }
.info-icon { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.info-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.info-card p { margin: 0; font-size: 0.88rem; color: var(--ink-600); }

/* Canva / ผังองค์กร */
.canva-embed {
  position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); background: var(--teal-050);
}
.canva-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-note { font-size: 0.88rem; color: var(--ink-600); margin-top: 12px; }

/* ผู้บริหาร */
.exec-lead { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: center; margin-bottom: 20px; }
.exec-photo { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.exec-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: top center; }
.exec-detail h2 { border: none; padding: 0; margin: 8px 0 10px; }
.exec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.exec-card { text-align: center; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.exec-card-photo {
  width: 92px; height: 92px; border-radius: 50%; background: var(--teal-050); margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center; font-size: 2.2rem; border: 1px solid var(--border);
}
.exec-card h3 { margin: 0 0 4px; font-size: 1rem; }
.exec-card p { margin: 0; font-size: 0.85rem; color: var(--ink-600); }

/* ติดต่อ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; margin-bottom: 20px; }
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list .ci { font-size: 1.2rem; flex: none; }
.contact-map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.contact-map iframe { width: 100%; height: 420px; border: 0; display: block; }

.page-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--border); }
.quick-link-list.plain { padding: 0; }
.quick-link-list.plain a { padding-left: 0; }

@media (max-width: 1100px) {
  .page-layout { grid-template-columns: 1fr; }
  .page-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .page-side > * { flex: 1 1 280px; }
  .contact-grid { grid-template-columns: 1fr; }
  .exec-lead { grid-template-columns: 1fr; }
  .exec-photo { max-width: 260px; }
}
@media (max-width: 640px) {
  .page-content { padding: 28px 22px; }
  .mission-list > li { grid-template-columns: 40px 1fr; }
  .mission-link { grid-column: 1 / -1; }
  .timeline > li { padding-left: 26px; }
}

/* ===================================================================
   รูปภาพคลิกเพื่อขยาย + Lightbox ซูมได้
   =================================================================== */
.zoom-figure { margin: 0 0 12px; }
.zoom-frame {
  position: relative; display: block; width: 100%; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  background: var(--teal-050); cursor: zoom-in; padding: 0; transition: all 0.2s;
}
.zoom-frame:hover { box-shadow: var(--shadow); border-color: var(--gold-500); }
.zoom-frame img { width: 100%; height: auto; display: block; }
.zoom-hint {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(8,38,33,0.72); color: var(--white); padding: 8px 16px; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.82rem; backdrop-filter: blur(4px); pointer-events: none;
}
.zoom-figure figcaption { font-size: 0.86rem; color: var(--ink-600); text-align: center; margin-top: 10px; }

.lightbox {
  position: fixed; inset: 0; z-index: 999; background: rgba(6,26,23,0.94);
  display: flex; flex-direction: column; opacity: 0; visibility: hidden; transition: opacity 0.2s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 22px; color: var(--sage-100); border-bottom: 1px solid rgba(255,255,255,0.12); flex-wrap: wrap;
}
.lightbox-title { font-family: var(--font-display); font-size: 0.98rem; margin: 0; color: var(--white); }
.lightbox-tools { display: flex; align-items: center; gap: 8px; }
.lb-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08); color: var(--white); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s; font-family: var(--font-body);
}
.lb-btn:hover { background: var(--gold-500); color: var(--teal-950); border-color: var(--gold-500); }
.lb-btn.wide { width: auto; padding: 0 16px; font-size: 0.88rem; gap: 7px; }
.lb-zoom-level { min-width: 62px; text-align: center; font-size: 0.86rem; color: var(--sage-200); }

.lightbox-stage {
  flex: 1; overflow: hidden; position: relative; cursor: grab; touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-stage.grabbing { cursor: grabbing; }
.lightbox-stage img {
  max-width: 92%; max-height: 92%; transform-origin: 0 0; user-select: none; -webkit-user-drag: none;
  transition: transform 0.12s ease-out; will-change: transform; background: var(--white); border-radius: 6px;
}
.lightbox-stage img.no-anim { transition: none; }
.lightbox-foot { padding: 10px 22px 16px; text-align: center; color: var(--ink-400); font-size: 0.8rem; }
body.lb-open { overflow: hidden; }

@media (max-width: 640px) {
  .lightbox-bar { padding: 10px 14px; }
  .lightbox-title { font-size: 0.85rem; width: 100%; }
  .lb-btn { width: 38px; height: 38px; }
  .lb-btn.wide { display: none; }
}

/* ผังกว้างพิเศษ: ให้สูงพอดูรู้เรื่อง ไม่บีบจนอ่านไม่ออก */
.zoom-frame.wide-chart { background: #F3F7F2; }
.zoom-frame.wide-chart img { max-height: 460px; object-fit: contain; }
@media (max-width: 640px) {
  .zoom-frame.wide-chart img { max-height: 220px; }
  .zoom-hint { right: 10px; bottom: 10px; padding: 6px 12px; font-size: 0.76rem; }
}

/* ===================================================================
   หน้าแกลเลอรี ขอแสดงความยินดี CKR
   =================================================================== */
.gallery-toolbar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  flex-wrap: wrap; padding: 14px 20px; margin-bottom: 24px;
  background: var(--teal-050); border-radius: var(--radius); border: 1px solid var(--border);
}
.gallery-toolbar .g-count { font-size: 0.94rem; color: var(--ink-700); }
.gallery-toolbar .g-count strong { color: var(--teal-800); font-family: var(--font-display); }
.gallery-toolbar .g-hint { font-size: 0.88rem; color: var(--ink-600); }

.congrat-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px;
}
.g-item { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.g-thumb {
  position: relative; display: block; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--sage-100); box-shadow: var(--shadow-sm); transition: all 0.2s ease;
  aspect-ratio: 4 / 3;
}
.g-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-500); }
.g-thumb:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
/* contain = เห็นภาพทั้งใบ ไม่ตัดหัวคน แม้รูปจะเป็นแนวตั้งหรือแนวนอน */
.g-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-thumb::after {
  content: '🔍'; position: absolute; right: 10px; bottom: 10px; width: 32px; height: 32px;
  border-radius: 50%; background: rgba(8,38,33,0.68); color: #fff; font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s;
}
.g-thumb:hover::after { opacity: 1; }
.g-date {
  font-size: 0.85rem; color: var(--ink-600); text-align: center; font-family: var(--font-body);
}

@media (max-width: 640px) {
  .congrat-gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .gallery-toolbar .g-hint { display: none; }
}

/* การ์ดข้อมูลที่ไม่ใช่ลิงก์ */
.info-card.static { cursor: default; }
.info-card.static:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }

/* ===== แก้ตัวหนังสือปุ่มในหน้าเนื้อหามองไม่เห็น =====
   สาเหตุ: .page-content a { color: var(--teal-700) } ทับสีขาวของปุ่ม
   ทำให้ตัวอักษรสีเขียวเข้มอยู่บนพื้นเขียวเข้ม */
.page-content .btn-teal,
.page-content .btn-teal:hover { color: var(--white); }
.page-content .btn-gold,
.page-content .btn-gold:hover { color: var(--teal-950); }
.page-content .cta-card .btn { color: var(--white); }
.page-content .btn { text-decoration: none; }

/* โลโก้ในส่วนท้ายเว็บ */
.footer-logo { width: 58px; height: 58px; object-fit: contain; flex: none; background: rgba(255,255,255,0.95); border-radius: 50%; padding: 4px; }

/* ===================================================================
   บอร์ดภาพประชาสัมพันธ์หน้าแรก
   =================================================================== */
.highlight-board {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px 18px 22px; box-shadow: var(--shadow-sm);
}
.hb-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px; padding-bottom: 16px; border-bottom: 2px solid var(--gold-500);
}
.hb-head .eyebrow-label { margin-bottom: 4px; }
.hb-title { font-size: 1.32rem; margin: 0; }
.hb-more { font-size: 0.9rem; color: var(--teal-700); text-decoration: none; white-space: nowrap; font-weight: 500; }
.hb-more:hover { color: var(--gold-700); text-decoration: underline; }

/* ===== สไลด์ภาพประชาสัมพันธ์ — แสดงทีละภาพ =====
   เวทีความสูงคงที่ + object-fit:contain = เห็นภาพเต็มใบเสมอ
   ไม่ว่าจะแนวตั้งหรือแนวนอน ส่วนที่เหลือเติมด้วยพื้นหลังเบลอจากภาพเดียวกัน */
.hb-gallery { position: relative; }
.hb-rail {
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--teal-950); box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}
.hb-rail::-webkit-scrollbar { display: none; }
.hb-rail:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.hb-rail.dragging { scroll-behavior: auto; cursor: grabbing; }
.hb-rail.dragging img { pointer-events: none; }

/* หนึ่งภาพ = เต็มความกว้างกรอบพอดี */
.hb-item {
  margin: 0; flex: 0 0 100%; min-width: 100%; scroll-snap-align: center;
  position: relative;
}
.hb-thumb {
  display: block; position: relative; width: 100%; padding: 0; border: none;
  cursor: zoom-in; background: transparent; overflow: hidden; text-decoration: none;
}
.hb-thumb.is-link { cursor: pointer; }
.hb-thumb:focus-visible { outline: 3px solid var(--gold-500); outline-offset: -3px; }

/* เวทีภาพ — ความสูงคงที่ ปรับตามขนาดจอ */
.hb-thumb img {
  position: relative; z-index: 1;
  width: 100%; height: 640px; object-fit: contain; object-position: center; display: block;
}
/* พื้นหลังเบลอจากภาพเดียวกัน เติมช่องว่างข้างภาพแนวตั้งให้ไม่ดูโหว่ */
.hb-blur {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  filter: blur(30px) brightness(0.45); transform: scale(1.15);
}

/* ป้ายบอกว่าภาพนี้กดแล้วไปต่อได้ */
.hb-link-tag { transform: translateY(-6px);
  position: absolute; right: 14px; top: 14px; z-index: 3;
  background: rgba(8, 38, 33, 0.82); color: var(--gold-100);
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 500;
  padding: 6px 14px; border-radius: 999px; opacity: 0; transition: all 0.2s ease; pointer-events: none;
}
.hb-thumb.is-link:hover .hb-link-tag,
.hb-thumb.is-link:focus-visible .hb-link-tag { opacity: 1; transform: translateY(0); }

/* คำบรรยายภาพ — ทับบนภาพแบบเดียวกับสไลด์ด้านบนของหน้า */
.hb-cap {
  position: absolute; inset: auto 0 0 0; z-index: 2; margin: 0;
  padding: 30px 24px 16px; color: var(--white);
  background: linear-gradient(0deg, rgba(8,38,33,0.9), rgba(8,38,33,0.4) 55%, transparent);
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 500; line-height: 1.5;
}

/* ปุ่มลูกศรซ้าย/ขวา — วางทับบนภาพ */
.hb-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.92); color: var(--teal-900); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 1.7rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  backdrop-filter: blur(4px);
}
.hb-arrow:hover:not(:disabled) { background: var(--gold-500); color: var(--teal-950); border-color: var(--gold-500); }
.hb-arrow:disabled { opacity: 0.35; cursor: default; }
.hb-arrow.prev { left: 16px; }
.hb-arrow.next { right: 16px; }

/* จุดบอกตำแหน่งภาพ */
.hb-dots { display: flex; justify-content: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.hb-dots button {
  width: 10px; height: 10px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--sage-200); background: var(--sage-100); transition: all 0.2s;
}
.hb-dots button:hover { background: var(--teal-300); }
.hb-dots button.is-active { background: var(--teal-700); border-color: var(--teal-700); width: 26px; border-radius: 999px; }

.hb-loading, .hb-empty {
  width: 100%; text-align: center; padding: 40px 16px; color: var(--ink-600); margin: 0;
}
.hb-empty small { color: var(--ink-400); font-size: 0.86rem; }

@media (max-width: 1200px) { .hb-thumb img { height: 500px; } }
@media (max-width: 980px) { .hb-thumb img { height: 540px; } }
@media (max-width: 640px) {
  .highlight-board { padding: 20px 18px 22px; }
  .hb-thumb img { height: 340px; }
  .hb-cap { font-size: 0.94rem; padding: 24px 16px 13px; }
  .hb-arrow { width: 40px; height: 40px; font-size: 1.35rem; }
  .hb-arrow.prev { left: 8px; }
  .hb-arrow.next { right: 8px; }
  .hb-more { font-size: 0.84rem; }
  /* บนมือถือให้ป้ายลิงก์แสดงตลอด เพราะไม่มีการ hover */
  .hb-thumb.is-link .hb-link-tag { opacity: 1; transform: none; }
}

/* ===================================================================
   หน้าประชาสัมพันธ์ข่าวสารตามพันธกิจ (/missions)
   =================================================================== */
.mission-layout { display: grid; grid-template-columns: 380px 1fr; gap: 34px; align-items: start; }
.mission-side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 92px; }

.mission-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mission-menu-loading { color: var(--ink-600); font-size: 0.92rem; padding: 8px 4px; }
.mission-menu-btn {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  text-align: left; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; font-family: var(--font-body); color: var(--ink-900);
  transition: all 0.2s ease;
}
.mission-menu-btn:hover { border-color: var(--gold-500); background: var(--teal-050); }
.mission-menu-btn.active { background: var(--teal-900); border-color: var(--teal-900); }
.mission-menu-btn.active .mm-text strong,
.mission-menu-btn.active .mm-text small { color: var(--white); }
.mission-menu-btn.active .mm-no { background: var(--gold-500); color: var(--teal-950); }
.mission-menu-btn.active .mm-count { background: rgba(255,255,255,0.18); color: var(--gold-100); }
.mission-menu-btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.mm-no {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--teal-050); color: var(--teal-800); font-family: var(--font-display); font-weight: 600;
}
.mm-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mm-text strong { font-family: var(--font-display); font-size: 0.98rem; color: var(--teal-900); font-weight: 600; }
.mm-text small {
  font-size: 0.82rem; color: var(--ink-600); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mm-count {
  font-size: 0.78rem; font-weight: 600; color: var(--ink-600); background: var(--paper);
  border-radius: 999px; padding: 2px 10px; min-width: 30px; text-align: center;
}

.mission-content { min-width: 0; }
.mission-head {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px 30px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--gold-500);
}
.mission-badge {
  display: inline-block; font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  color: var(--gold-700); background: var(--gold-050); padding: 5px 16px; border-radius: 999px; margin-bottom: 12px;
}
.mission-title { font-size: 1.3rem; margin: 0; line-height: 1.6; }

.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.mission-item { margin: 0; }
.mission-thumb {
  display: block; position: relative; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--sage-100); box-shadow: var(--shadow-sm); transition: all 0.2s ease; text-decoration: none;
}
.mission-thumb.is-link { cursor: pointer; }
.mission-thumb:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-500); }
.mission-thumb:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
/* กรอบสูงเท่ากันทุกใบ ภาพแนวตั้ง/แนวนอนจึงเรียงเป็นตารางสวยงาม */
.mission-thumb img { width: 100%; height: 230px; object-fit: cover; display: block; }
.mission-thumb.is-link:hover .hb-link-tag { opacity: 1; transform: translateY(0); }
.mission-item figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--ink-600); line-height: 1.5; }
.mission-loading, .mission-empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--ink-600);
  background: var(--white); border: 1px dashed var(--border); border-radius: var(--radius-lg); margin: 0;
}
.mission-empty small { color: var(--ink-400); font-size: 0.86rem; }

@media (max-width: 1200px) {
  .mission-layout { grid-template-columns: 320px 1fr; gap: 26px; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .mission-layout { grid-template-columns: 1fr; }
  .mission-side { position: static; }
  .mm-text small { -webkit-line-clamp: 1; }
}
@media (max-width: 640px) {
  .mission-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mission-thumb img { height: 150px; }
  .mission-head { padding: 20px 22px; }
  .mission-title { font-size: 1.08rem; }
  .mission-thumb.is-link .hb-link-tag { opacity: 1; transform: none; }
}

/* ===== ใบปลิวประชาสัมพันธ์หลักสูตร ===== */
.brochure-strip {
  margin-top: 36px;
  text-align: center;
}
.brochure-label {
  font-family: var(--font-display); font-size: 1rem; color: var(--ink-600);
  margin: 0 0 14px; font-weight: 500;
}
.brochure-thumb {
  display: inline-block; position: relative; padding: 0; cursor: zoom-in;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--sage-100);
  box-shadow: var(--shadow); transition: all 0.25s ease; max-width: 100%;
}
.brochure-thumb:hover { transform: translateY(-3px); border-color: var(--gold-500); box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,0.15)); }
.brochure-thumb:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
/* ภาพใบปลิวแนวนอน — กว้างเต็มกรอบ ความสูงตามสัดส่วนจริงของไฟล์ */
.brochure-thumb img { display: block; width: 100%; max-width: 1100px; height: auto; }
/* overlay "คลิกเพื่อดูขนาดเต็ม" โผล่ตอน hover */
.brochure-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 38, 33, 0.45); color: #fff;
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 600;
  opacity: 0; transition: opacity 0.2s ease; letter-spacing: 0.3px;
}
.brochure-thumb:hover .brochure-overlay,
.brochure-thumb:focus-visible .brochure-overlay { opacity: 1; }

@media (max-width: 640px) {
  .brochure-strip { margin-top: 24px; }
  /* บนมือถือแสดง overlay ตลอดเพราะไม่มี hover */
  .brochure-overlay { opacity: 1; font-size: 0.92rem; background: rgba(8,38,33,0.35); }
}
body {
  background-image: url('/images/background/site-bg.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed; /* ภาพนิ่งอยู่กับที่ ตอนสกอลล์หน้าเว็บ */
}
@media (max-width: 900px) {
  body { background-attachment: scroll; }
}
/* ===== อัลบั้มภาพประกอบหน้าเนื้อหา (images/pages/<ชื่อหน้า>/) ===== */
.page-gallery { margin: 32px 0 8px; }
.page-gallery[hidden] { display: none; }
.page-gallery-title {
  font-size: 1.08rem; color: var(--teal-900); margin: 0 0 14px;
  padding: 8px 0 8px 12px; border-left: 4px solid var(--gold-600);
  background: var(--teal-050);
}
.page-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pg-card {
  display: block; width: 100%; padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--sage-100);
  box-shadow: var(--shadow-sm); cursor: zoom-in; transition: all 0.2s ease;
  text-align: left;
}
.pg-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-500); }
.pg-card:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.pg-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.pg-cap {
  display: block; padding: 9px 12px; font-size: 0.86rem; color: var(--ink-700);
  background: var(--white); line-height: 1.45;
}
@media (max-width: 900px) { .page-gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .page-gallery-grid { grid-template-columns: 1fr; } }

/* ===== โซนจดหมายข่าวประชาสัมพันธ์หน้าแรก =====
   แสดงสองแผ่นต่อกันขนาดใหญ่ กระดาษ A4 แนวตั้ง (สัดส่วน 1:1.414) */
.nl-board {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px;
  max-width: 1240px; margin: 0 auto;
}
.nl-item { margin: 0; }
.nl-sheet {
  display: block; width: 100%; padding: 0; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--white); box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.nl-sheet:hover { transform: translateY(-5px); box-shadow: 0 16px 40px rgba(8,38,33,0.18); border-color: var(--gold-500); }
.nl-sheet:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }
.nl-sheet img { width: 100%; height: auto; display: block; aspect-ratio: 1 / 1.414; object-fit: cover; object-position: top center; }
.nl-cap {
  margin: 14px 4px 0; font-family: var(--font-display); font-size: 0.98rem;
  color: var(--teal-900); line-height: 1.55; text-align: center; font-weight: 500;
}
.nl-loading, .nl-empty {
  grid-column: 1 / -1; text-align: center; padding: 50px 16px; color: var(--ink-600); margin: 0;
}
.nl-empty small { color: var(--ink-400); font-size: 0.86rem; }
@media (max-width: 760px) {
  .nl-board { grid-template-columns: 1fr; gap: 26px; }
}

/* เผื่อระยะให้หัวข้อที่ถูกลิงก์ด้วย #anchor ไม่ถูกแถบเมนูที่ตรึงไว้บังหัว */
:target { scroll-margin-top: 96px; }
[id] { scroll-margin-top: 96px; }

/* ===== ตารางรายการเอกสาร (ใช้ในหน้า ITA และหน้าที่มีรายการเอกสารแนบ) ===== */
.doc-table {
  width: 100%; border-collapse: collapse; margin: 18px 0 28px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.doc-table th {
  background: var(--teal-800); color: var(--white); font-family: var(--font-display);
  font-weight: 600; text-align: left; padding: 12px 16px; font-size: 0.95rem;
}
.doc-table td { padding: 11px 16px; border-top: 1px solid var(--border); font-size: 0.95rem; vertical-align: top; }
.doc-table tbody tr:nth-child(even) { background: var(--paper); }
.doc-table tbody tr:hover { background: var(--teal-050); }
.doc-table a { color: var(--teal-700); font-weight: 500; }
@media (max-width: 640px) {
  .doc-table th, .doc-table td { padding: 9px 10px; font-size: 0.88rem; }
}

/* ===================================================================
   หน้า ITA — แถบหัวเรื่อง ปุ่มเลือกปี และรายการตัวชี้วัด
   =================================================================== */
.ita-hero {
  background: var(--teal-900); color: var(--white); text-align: center;
  padding: 34px 26px 30px; border-radius: var(--radius);
  border-bottom: 5px solid var(--gold-500); margin: 0 0 22px;
}
.ita-hero-mark {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 700;
  letter-spacing: 3px; color: var(--gold-500); margin: 0 0 6px; line-height: 1;
}
.ita-hero-title { font-size: 1.35rem; font-weight: 600; margin: 0 0 4px; color: var(--white); line-height: 1.5; }
.ita-hero-en { font-size: 1rem; margin: 0 0 8px; color: var(--gold-100); font-weight: 500; }
.ita-hero-year { font-size: 1.1rem; margin: 0; color: var(--white); font-weight: 600; }

/* แถวปุ่มเลือกปีงบประมาณ */
.ita-years { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 26px; }
.ita-year-btn {
  display: inline-block; padding: 9px 22px; border-radius: var(--radius-sm);
  background: var(--teal-700); color: var(--white); text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 0.96rem;
  border: 1px solid var(--teal-700); transition: all 0.18s ease;
}
.ita-year-btn:hover { background: var(--teal-900); border-color: var(--teal-900); color: var(--white); }
.ita-year-btn.is-current {
  background: var(--gold-500); border-color: var(--gold-600); color: var(--teal-950);
}
.ita-year-btn:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

.ita-org {
  text-align: center; font-family: var(--font-display); font-weight: 600;
  font-size: 1.08rem; color: var(--teal-900); background: var(--teal-050);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin: 0 0 22px;
}

.ita-oit { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 30px; background: var(--white); }
.ita-oit-title { font-size: 1.1rem; color: var(--teal-900); margin: 0 0 10px; font-weight: 600; }
.ita-oit-note { margin: 0; color: var(--ink-700); font-size: 0.96rem; line-height: 1.8; }
.ita-oit-link { margin: 18px 0 0; }

/* ตัวชี้วัดหลัก — แถบหัวข้อสีเข้ม */
.ita-indicator { margin: 0 0 26px; }
.ita-indicator-title {
  background: var(--teal-800); color: var(--white); font-size: 1.1rem; font-weight: 600;
  padding: 13px 20px; margin: 0; border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 3px solid var(--gold-600);
}
/* ตัวชี้วัดย่อย */
.ita-sub { border: 1px solid var(--border); border-top: none; padding: 16px 20px 8px; background: var(--white); }
.ita-indicator .ita-sub:last-child { border-radius: 0 0 var(--radius) var(--radius); padding-bottom: 16px; }
.ita-sub-title {
  font-size: 1.02rem; color: var(--teal-900); margin: 0 0 10px; font-weight: 600;
  padding-left: 12px; border-left: 4px solid var(--gold-600);
}
.ita-item-list { list-style: none; margin: 0; padding: 0; }
.ita-item-list li { border-bottom: 1px dashed var(--border); }
.ita-item-list li:last-child { border-bottom: none; }
.ita-item-list a, .ita-item-todo {
  display: block; padding: 10px 6px; text-decoration: none;
  color: var(--teal-700); font-size: 0.98rem; transition: all 0.15s ease;
}
.ita-item-list a:hover { background: var(--teal-050); color: var(--teal-900); padding-left: 14px; }
.ita-code {
  display: inline-block; min-width: 42px; font-family: var(--font-display);
  font-weight: 700; color: var(--gold-700);
}
.ita-item-todo { color: var(--ink-400); }
.ita-item-todo em {
  font-style: normal; font-size: 0.8rem; margin-left: 8px; padding: 1px 9px;
  border-radius: 999px; background: var(--paper); border: 1px solid var(--border); color: var(--ink-600);
}
.ita-empty, .ita-loading { color: var(--ink-600); padding: 14px 6px; margin: 0; font-size: 0.95rem; }
.ita-empty small { color: var(--ink-400); }

@media (max-width: 640px) {
  .ita-hero { padding: 24px 16px; }
  .ita-hero-mark { font-size: 2rem; }
  .ita-hero-title { font-size: 1.12rem; }
  .ita-year-btn { padding: 8px 16px; font-size: 0.9rem; }
  .ita-sub { padding: 14px 14px 6px; }
}

/* ===== แก้สีตัวหนังสือในหน้า ITA ที่ถูก .page-content ทับ =====
   .page-content p { color: var(--ink-700) } และ .page-content a { color: var(--teal-700) }
   มีความจำเพาะสูงกว่ากฎของ .ita-* จึงต้องระบุซ้ำโดยขึ้นต้นด้วย .page-content */
.page-content .ita-hero-mark { color: var(--gold-500); }
.page-content .ita-hero-title { color: var(--white); }
.page-content .ita-hero-en { color: var(--gold-100); }
.page-content .ita-hero-year { color: var(--white); }
.page-content .ita-year-btn { color: var(--white); text-decoration: none; }
.page-content .ita-year-btn:hover { color: var(--white); }
.page-content .ita-year-btn.is-current { color: var(--teal-950); }
.page-content .ita-org { color: var(--teal-900); }
.page-content .ita-indicator-title { color: var(--white); }
.page-content .ita-item-list a { color: var(--teal-700); }
.page-content .ita-item-list a:hover { color: var(--teal-900); }
.page-content .ita-item-todo { color: var(--ink-400); }

/* หัวข้อตัวชี้วัดย่อยแบบกดเป็นลิงก์ได้ */
.ita-sub.is-link-only { padding-bottom: 16px; }
.ita-sub-title .ita-sub-link {
  display: block; text-decoration: none; color: var(--teal-800);
  padding: 2px 0; transition: color 0.15s ease, transform 0.15s ease;
}
.ita-sub-title .ita-sub-link::after {
  content: "›"; margin-left: 10px; color: var(--gold-600); font-weight: 700;
}
.ita-sub-title .ita-sub-link:hover { color: var(--teal-950); }
.page-content .ita-sub-title .ita-sub-link { color: var(--teal-800); }
.page-content .ita-sub-title .ita-sub-link:hover { color: var(--teal-950); }

/* ===== รายการ o ที่มีลิงก์ของตัวเอง + รายการย่อยซ้อนใต้ (ตามโครงสร้าง OIT จริง) ===== */
.ita-item-link, .ita-item-head {
  display: block; padding: 10px 6px; font-size: 0.98rem;
  color: var(--teal-700); text-decoration: none; font-weight: 600;
}
.ita-item-link:hover { background: var(--teal-050); color: var(--teal-900); padding-left: 14px; }
.ita-item-head { color: var(--teal-900); cursor: default; }
.ita-item-list > li { padding: 0; }
.ita-item-list > li > .ita-item-todo { padding: 10px 6px; }

.ita-subitem-list {
  list-style: none; margin: 0 0 6px; padding: 0 0 0 30px;
}
.ita-subitem-list li { border-bottom: none !important; }
.ita-subitem-link {
  display: block; padding: 6px 6px 6px 14px; font-size: 0.92rem;
  color: var(--ink-700); text-decoration: none; position: relative;
}
.ita-subitem-link::before { content: "–"; position: absolute; left: 0; color: var(--gold-600); }
.ita-subitem-link:hover { color: var(--teal-800); background: var(--teal-050); padding-left: 18px; }
.ita-subitem-list .ita-item-todo { display: block; padding: 6px 6px 6px 14px; font-size: 0.92rem; }

.page-content .ita-item-link { color: var(--teal-700); }
.page-content .ita-item-link:hover { color: var(--teal-900); }
.page-content .ita-item-head { color: var(--teal-900); }
.page-content .ita-subitem-link { color: var(--ink-700); }
.page-content .ita-subitem-link:hover { color: var(--teal-800); }

/* ===== เมนูหลักมี 9 หัวข้อ — บีบระยะบนจอกลางเพื่อให้อยู่แถวเดียว ไม่ตกบรรทัด ===== */
@media (max-width: 1700px) and (min-width: 981px) {
  .mega-link { font-size: 0.97rem; padding: 17px 5px 17px 16px; }
  .mega-item-plain .mega-link { padding-right: 16px; }
  .mega-caret { padding-right: 12px; width: 15px; }
}
@media (max-width: 1500px) and (min-width: 981px) {
  .mega-link { font-size: 0.9rem; padding: 16px 4px 16px 12px; }
  .mega-item-plain .mega-link { padding-right: 12px; }
  .mega-caret { padding-right: 10px; width: 13px; }
}
/* ช่วง 981–1400px บีบแน่นขึ้นอีก (ต่ำกว่า 981px เปลี่ยนเป็นเมนูมือถืออยู่แล้ว) */
@media (max-width: 1400px) and (min-width: 981px) {
  .mega-link { font-size: 0.84rem; padding: 15px 2px 15px 9px; }
  .mega-item-plain .mega-link { padding-right: 9px; }
  .mega-caret { padding-right: 7px; width: 11px; }
}
@media (max-width: 1120px) and (min-width: 981px) {
  .mega-link { font-size: 0.7rem; padding: 14px 1px 14px 4px; }
  .mega-item-plain .mega-link { padding-right: 4px; }
  .mega-caret { padding-right: 3px; width: 8px; }
}

/* ===== ปุ่มไอคอนกลับหน้าแรก (ตัวแรกในแถบเมนู) ===== */
.mega-home { gap: 8px; padding-left: 16px; padding-right: 16px; }
.mega-home svg {
  width: 21px; height: 21px; flex: none; fill: currentColor;
  transition: transform 0.18s ease;
}
.mega-home:hover svg { transform: translateY(-2px); }
/* บนจอเดสก์ท็อปแสดงเฉพาะไอคอน — ประหยัดพื้นที่ให้เมนูอื่นอยู่แถวเดียวได้ */
.mega-home-text { display: none; }
.mega-item-home { border-right: 1px solid rgba(255,255,255,0.14); }

@media (max-width: 1400px) and (min-width: 981px) {
  .mega-home { padding-left: 12px; padding-right: 12px; }
  .mega-home svg { width: 19px; height: 19px; }
}
@media (max-width: 1120px) and (min-width: 981px) {
  .mega-home { padding-left: 9px; padding-right: 9px; }
  .mega-home svg { width: 17px; height: 17px; }
}
/* บนมือถือเมนูเรียงลงมาเป็นแถว จึงแสดงคำว่า "หน้าแรก" กำกับไอคอนด้วย */
@media (max-width: 980px) {
  .mega-home-text { display: inline; }
  .mega-item-home { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.14); }
  .mega-home { padding: 14px 18px; }
}

/* ===================================================================
   Visual refresh — ให้หน้าแรกโปร่ง สงบ และอ่านง่ายขึ้นบนทุกขนาดจอ
   =================================================================== */
html, body { max-width: 100%; overflow-x: clip; }

body {
  background-color: #f4f8f6;
  background-image:
    linear-gradient(180deg, rgba(247, 250, 249, 0.76) 0%, rgba(247, 250, 249, 0.94) 34%, rgba(247, 250, 249, 0.98) 100%),
    url('/images/background/site-bg.jpg');
}

.utility-bar {
  background: linear-gradient(90deg, var(--teal-950), #0f4a40);
}

.site-header {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 6px 18px rgba(8, 38, 33, 0.035);
}

.brand-logo {
  width: 58px !important;
  height: 58px !important;
  padding: 3px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--gold-100);
  box-shadow: 0 5px 14px rgba(8, 38, 33, 0.10);
}

.brand-text strong { letter-spacing: -0.25px; }
.brand-text em { color: var(--teal-700); }

.hero {
  border-bottom: 1px solid rgba(216, 178, 76, 0.35);
  background: #eaf2ef;
}

.promo-section { padding-top: 38px; }
.slider {
  border: 5px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 48px rgba(8, 38, 33, 0.15);
}

.trio-layout { align-items: stretch; }
.col-left, .col-right, .col-center { gap: 24px; }
.sidebar-card, .news-panel, .highlight-board, .media-card {
  box-shadow: 0 10px 28px rgba(8, 38, 33, 0.075);
}
.sidebar-card, .news-panel, .highlight-board { border-color: rgba(13, 59, 53, 0.10); }

.highlight-board { padding: 28px 24px 24px; }
.hb-head { margin-bottom: 20px; }
.hb-title, .section-title { letter-spacing: -0.25px; }

.news-panel-head { padding-top: 28px; }
.news-item { padding-top: 17px; padding-bottom: 17px; }
.news-item:hover {
  padding-left: 10px;
  margin-left: -10px;
  padding-right: 10px;
  margin-right: -10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--teal-050), transparent);
}

.quick-link-list a, .service-list > li > a { position: relative; }
.quick-link-list a::before, .service-list > li > a::before {
  content: '›';
  color: var(--gold-600);
  margin-right: 9px;
  font-size: 1.1em;
  font-weight: 700;
}

.cta-card {
  background: linear-gradient(135deg, #e2bd59, var(--gold-600));
  box-shadow: 0 14px 28px rgba(166, 127, 29, 0.20);
}

/* เมนูแนวนอนคุ้มค่ากับจอกว้างเท่านั้น: บนโน้ตบุ๊กเปลี่ยนเป็นเมนูพับ
   แทนการบีบตัวอักษรหรือปล่อยให้รายการสุดท้ายตกลงบรรทัดใหม่ */
@media (max-width: 1180px) {
  .mega-toggle { display: flex; }
  .mega-menu { display: none; width: 100%; flex-direction: column; }
  .mega-menu.open { display: flex; }
  .mega-item, .mega-link-row, .mega-link { width: 100%; }
  .mega-link { padding: 14px 18px; font-size: 0.96rem; }
  .mega-caret { margin-left: auto; width: 52px; padding-right: 18px; }
  .mega-panel, .mega-panel-wide {
    position: static; display: none; transform: none; opacity: 1; visibility: visible;
    min-width: 0; max-height: none; box-shadow: none; border-top: none; border-radius: 0;
    background: var(--teal-900); padding: 4px 10px 10px 26px;
  }
  .mega-item.open .mega-panel { display: block; }
  .mega-panel-wide > ul { grid-template-columns: 1fr; }
  .mega-panel a, .mega-panel .sub-list a { color: var(--sage-100); }
  .mega-panel a:hover { background: var(--teal-800); color: var(--gold-100); }
  .mega-home-text { display: inline; }
  .mega-item-home { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.14); }
  .mega-home { padding: 14px 18px; }
}

@media (max-width: 1180px) and (min-width: 981px) {
  .trio-layout { grid-template-columns: 230px minmax(0, 1fr) 245px; gap: 18px; }
  .director-mini-img-wrap { height: 320px; }
  .highlight-board { padding: 22px 18px; }
  .hb-thumb img { height: 460px; }
}

@media (max-width: 640px) {
  .header-inner { padding-top: 12px; padding-bottom: 12px; }
  .brand { gap: 10px; min-width: 0; }
  .brand-logo { width: 45px !important; height: 45px !important; }
  .brand-text strong { font-size: 0.98rem; }
  .brand-text em { display: none; }
  .header-actions .btn { padding: 9px 14px !important; font-size: 0.82rem !important; }
  .promo-section { padding-top: 18px; }
  .slider { border-width: 3px; border-radius: 18px; }
  .highlight-board { padding: 20px 16px 20px; }
  .news-panel-head, .news-toolbar { padding-left: 20px; padding-right: 20px; }
  .news-list { padding-left: 20px; padding-right: 20px; }
}

/* ===================================================================
   มือถือ: กล่องข่าวสารพับเก็บได้ทั้งกล่อง
   เมื่อพับอยู่ เหลือแค่แถบหัวข้อแถบเดียว หน้าตาเดียวกับการ์ด "ระบบสารสนเทศ"
   ปุ่มถูกสร้างด้วย JS ใน public/js/main.js — บนจอใหญ่ปุ่มจะไม่แสดงและข่าวกางอยู่เสมอ
   =================================================================== */
.news-toggle { display: none; }

@media (max-width: 980px) {
  /* หัวข้อเดิม (เส้นทอง + ตัวใหญ่) ถูกแทนที่ด้วยแถบหัวข้อกดได้ */
  .news-panel-head { padding: 0; }
  .news-panel-head .gold-rule,
  .news-panel-head .section-title { display: none; }

  .news-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; margin: 0; padding: 13px 18px; text-align: left;
    font-family: var(--font-display); font-size: 1rem; font-weight: 600;
    color: var(--white); background: var(--teal-800);
    border: 0; border-bottom: 3px solid var(--gold-600);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .news-toggle:active { background: var(--teal-700); }
  .news-toggle-caret { flex: none; font-size: 0.72rem; transition: transform 0.2s ease; }
  .news-panel:not(.is-collapsed) .news-toggle-caret { transform: rotate(180deg); }

  /* พับอยู่ = เหลือแค่แถบหัวข้อ ไม่มีพื้นที่ว่างเหลือท้ายกล่อง */
  .news-panel.is-collapsed .news-toolbar,
  .news-panel.is-collapsed .news-list,
  .news-panel.is-collapsed .news-pagination { display: none !important; }
  .news-panel.is-collapsed .news-toggle { border-bottom-width: 0; }
  .news-panel.is-collapsed { border-color: transparent; }
}

/* ===================================================================
   ลิงก์ข้ามไปเนื้อหาหลัก — ซ่อนไว้ โผล่เฉพาะตอนกด Tab (ผู้ใช้คีย์บอร์ด/โปรแกรมอ่านจอ)
   =================================================================== */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--gold-500); color: var(--teal-950); padding: 10px 18px;
  font-family: var(--font-display); font-weight: 600; border-radius: 0 0 12px 0; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ===================================================================
   รายการเอกสารในหน้าหน่วยงาน (.doc-group / .doc-list)
   ใช้ร่วมกันหลายหน้า: building, finance, hrm, hrd, procurement, strategy ฯลฯ
   =================================================================== */
.doc-group { margin: 0 0 34px; }
.doc-group:last-child { margin-bottom: 0; }
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-list > li {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 10px 16px; flex-wrap: wrap; padding: 13px 18px 13px 54px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
/* ไอคอนแผ่นเอกสารหน้ารายการ */
.doc-list > li::before {
  content: ''; position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 26px; border-radius: 3px 8px 3px 3px;
  background:
    linear-gradient(var(--teal-500), var(--teal-500)) 5px 9px / 11px 2px no-repeat,
    linear-gradient(var(--teal-500), var(--teal-500)) 5px 14px / 11px 2px no-repeat,
    linear-gradient(var(--gold-600), var(--gold-600)) 5px 19px / 7px 2px no-repeat,
    var(--teal-050);
  border: 1.5px solid var(--teal-500);
}
.doc-list > li:hover { border-color: var(--gold-500); box-shadow: var(--shadow-sm); transform: translateX(3px); }
.doc-list > li > a, .doc-name { flex: 1 1 260px; min-width: 0; line-height: 1.55; }
.doc-list > li > a { color: var(--teal-800); font-weight: 500; text-decoration: none; }
.doc-list > li > a::after { content: '↗'; margin-left: 8px; color: var(--gold-600); font-weight: 700; }
.doc-list > li > a:hover { color: var(--teal-950); text-decoration: underline; }
.doc-name { color: var(--ink-900); font-weight: 500; }
.doc-tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.doc-tag {
  display: inline-flex; align-items: center; padding: 3px 13px; border-radius: 999px;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; transition: filter 0.15s ease, transform 0.15s ease;
}
.doc-tag:hover { filter: brightness(0.94); transform: translateY(-1px); }
.doc-tag.pdf  { background: #FDECEC; color: #A3262C; border-color: #F3C6C8; }
.doc-tag.doc  { background: #EAF1FB; color: #1F4E8C; border-color: #C9DAF2; }
.doc-tag.xls  { background: #E7F4EC; color: #1E6B3A; border-color: #C2E3CD; }
.doc-tag.form { background: var(--gold-050); color: var(--gold-700); border-color: var(--gold-100); }

.ext-card {
  display: flex; flex-direction: column; gap: 4px; margin-top: 30px; padding: 22px 26px;
  border-radius: var(--radius); text-decoration: none; color: var(--white);
  background: linear-gradient(135deg, var(--teal-900), var(--teal-700));
  border-bottom: 3px solid var(--gold-500); box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ext-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ext-card strong { font-family: var(--font-display); font-size: 1.08rem; color: var(--white); }
.ext-card span { color: var(--sage-100); font-size: 0.9rem; }
.page-content .ext-card { color: var(--white); }

.side-contact { padding: 16px 20px 20px; font-size: 0.92rem; line-height: 2; color: var(--ink-700); }
.side-contact a { color: var(--teal-700); }

@media (max-width: 640px) {
  .doc-list > li { padding: 12px 14px 12px 48px; }
  .doc-list > li::before { left: 14px; }
}

/* ===================================================================
   หน้าหน่วยงานย่อยของงานอาคารสถานที่ — งานช่าง / งานคนสวน / งานแม่บ้าน
   (public/content/pages/building-*.html) และหน้ารวม building.html
   =================================================================== */
.unit-hero {
  position: relative; overflow: hidden; color: var(--white); padding: 40px 0 60px;
  background:
    radial-gradient(900px 440px at 88% 18%, rgba(216, 178, 76, 0.22), transparent 62%),
    radial-gradient(760px 520px at -5% 110%, rgba(29, 122, 109, 0.55), transparent 60%),
    linear-gradient(135deg, var(--teal-950) 0%, var(--teal-900) 55%, #0f4a40 100%);
  border-bottom: 3px solid var(--gold-500);
}
/* ลายเส้นทองบาง ๆ บนพื้นหลัง */
.unit-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.07;
  background-image:
    repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 26px),
    repeating-linear-gradient(-45deg, #fff 0 1px, transparent 1px 26px);
  mask-image: linear-gradient(90deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 70%);
}
.unit-hero-inner {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px; align-items: center;
}
.unit-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.86rem; letter-spacing: 0.3px;
  color: var(--gold-100); background: rgba(216, 178, 76, 0.14);
  border: 1px solid rgba(216, 178, 76, 0.38); padding: 5px 15px; border-radius: 999px;
}
.unit-hero .page-title {
  color: var(--white); font-size: clamp(2.2rem, 4.4vw, 3.8rem); font-weight: 700;
  line-height: 1.3; margin: 0 0 14px; letter-spacing: -0.5px;
}
.unit-hero .page-title .accent { color: var(--gold-500); }
.unit-lead { font-size: 1.08rem; color: var(--sage-100); max-width: 40em; margin: 0 0 26px; line-height: 1.8; }
.unit-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.unit-stats { list-style: none; display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 0; padding: 0; }
.unit-stats li {
  min-width: 128px; padding: 10px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
}
.unit-stats strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-500); line-height: 1.25; }
.unit-stats span { font-size: 0.82rem; color: var(--sage-200); }

/* ภาพซ้อนในกรอบโค้งยอดมน — ล้อรูปทรงเปลวเทียนในตราวิทยาลัย */
.unit-art { position: relative; height: 470px; }
.unit-art::before {
  content: ''; position: absolute; left: 50%; top: 46%; width: 78%; aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 207, 126, 0.42), rgba(216, 178, 76, 0) 68%);
  animation: unit-glow 5s ease-in-out infinite;
}
@keyframes unit-glow { 0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } }
.arch {
  position: absolute; margin: 0; overflow: hidden; background: var(--teal-800);
  border-radius: 999px 999px 22px 22px; border: 3px solid rgba(216, 178, 76, 0.9);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.38);
}
.arch img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease; }
.unit-art:hover .arch img { transform: scale(1.06); }
.arch-main { left: 24%; top: 0; width: 48%; height: 100%; z-index: 1; }
.arch-a { left: 0; bottom: 0; width: 31%; height: 60%; z-index: 2; }
.arch-b { right: 0; top: 7%; width: 31%; height: 60%; z-index: 2; }
.arch figcaption {
  position: absolute; inset: auto 0 0 0; padding: 26px 12px 12px; text-align: center;
  font-family: var(--font-display); font-size: 0.8rem; color: var(--white); line-height: 1.4;
  background: linear-gradient(0deg, rgba(8, 38, 33, 0.85), transparent);
}

/* หน้าที่ความรับผิดชอบ */
.duty-grid {
  list-style: none; margin: 0 0 8px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px;
}
.duty-grid li {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--white), var(--paper));
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.duty-grid li:hover { border-color: var(--gold-500); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.duty-ico {
  flex: none; width: 48px; height: 48px; border-radius: 14px 14px 14px 4px;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
  background: var(--teal-900); box-shadow: inset 0 -3px 0 var(--gold-500);
}
.duty-grid strong { display: block; font-family: var(--font-display); font-weight: 600; color: var(--teal-900); font-size: 1rem; line-height: 1.45; margin-bottom: 3px; }
.duty-grid span { display: block; font-size: 0.88rem; color: var(--ink-600); line-height: 1.65; }

/* คู่มือ + ตัวเปิดดูเอกสาร */
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin: 0 0 20px; }
.manual-card {
  display: flex; align-items: center; gap: 14px; padding: 15px 18px; text-decoration: none;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--white);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.manual-card:hover { border-color: var(--gold-500); box-shadow: var(--shadow); transform: translateY(-2px); }
.manual-card.is-active { border-color: var(--teal-600); background: var(--teal-050); box-shadow: inset 0 0 0 1px var(--teal-600); }
.manual-card:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.manual-ico {
  flex: none; width: 42px; height: 50px; border-radius: 5px 14px 5px 5px; position: relative;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.5px;
  color: var(--white); background: #C8373E; box-shadow: 0 6px 14px rgba(200, 55, 62, 0.25);
}
.manual-ico::before {
  content: ''; position: absolute; left: 9px; right: 9px; top: 11px; height: 14px;
  background:
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0 0 / 100% 2px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0 6px / 100% 2px no-repeat,
    linear-gradient(rgba(255,255,255,.85), rgba(255,255,255,.85)) 0 12px / 60% 2px no-repeat;
}
.manual-ico.form { background: var(--gold-600); color: var(--teal-950); box-shadow: 0 6px 14px rgba(197, 155, 39, 0.28); }
.manual-ico.form::before { background:
    linear-gradient(rgba(8,38,33,.7), rgba(8,38,33,.7)) 0 0 / 100% 2px no-repeat,
    linear-gradient(rgba(8,38,33,.7), rgba(8,38,33,.7)) 0 6px / 100% 2px no-repeat,
    linear-gradient(rgba(8,38,33,.7), rgba(8,38,33,.7)) 0 12px / 60% 2px no-repeat; }
.manual-ico.web { background: var(--teal-700); box-shadow: 0 6px 14px rgba(21, 91, 81, 0.28); }
.manual-text { min-width: 0; flex: 1; }
.manual-text strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--teal-900); line-height: 1.45; }
.manual-text small { display: block; margin-top: 2px; color: var(--ink-600); font-size: 0.8rem; }
.manual-go { flex: none; color: var(--gold-600); font-weight: 700; font-size: 1.1rem; }
.page-content .manual-card { color: inherit; }

.manual-viewer {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--teal-950);
}
.manual-viewer-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap;
  padding: 12px 18px; background: var(--teal-900); border-bottom: 3px solid var(--gold-500);
}
.manual-viewer-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; color: var(--white); line-height: 1.45; }
.manual-viewer-title small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.8rem; color: var(--sage-200); }
/* .page-content p ตั้งสีเข้มไว้ ต้องระบุซ้ำให้หัวกรอบเอกสารเป็นตัวอักษรสีขาว */
.page-content .manual-viewer-title { color: var(--white); }
.manual-viewer-bar .btn { padding: 8px 18px; font-size: 0.86rem; }
.page-content .manual-viewer-bar .btn-gold { color: var(--teal-950); }
.manual-viewer iframe { display: block; width: 100%; height: min(78vh, 820px); border: 0; background: var(--white); }

/* การ์ดบริการ (แบบฟอร์มออนไลน์) ในคอลัมน์ข้าง */
.unit-service {
  border-radius: var(--radius-lg); padding: 26px 24px; color: var(--white); text-align: center;
  background:
    radial-gradient(circle at 80% 0%, rgba(216, 178, 76, 0.35), transparent 55%),
    linear-gradient(160deg, var(--teal-800), var(--teal-950));
  border-bottom: 3px solid var(--gold-500); box-shadow: var(--shadow-sm);
}
.unit-service .unit-service-ico { font-size: 2rem; display: block; margin-bottom: 6px; }
.unit-service h4 { color: var(--white); font-size: 1.1rem; margin: 0 0 6px; }
.unit-service p { color: var(--sage-100); font-size: 0.88rem; margin: 0 0 16px; }
.unit-service .btn { width: 100%; }

/* แกลเลอรีแบบโมเสก — ภาพแนวตั้งกินสองแถว ภาพแนวนอนกว้างกินสองคอลัมน์
   (คลาส is-tall / is-wide ใส่ให้อัตโนมัติจากขนาดภาพจริงใน main.js) */
.page-gallery.is-mosaic .page-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 170px; grid-auto-flow: dense; gap: 12px;
}
.page-gallery.is-mosaic .pg-card { position: relative; height: 100%; border-radius: 14px; }
.page-gallery.is-mosaic .pg-card img { height: 100%; aspect-ratio: auto; transition: transform 0.6s ease; }
.page-gallery.is-mosaic .pg-card:hover img { transform: scale(1.06); }
.page-gallery.is-mosaic .pg-card.is-tall { grid-row: span 2; }
.page-gallery.is-mosaic .pg-card.is-wide { grid-column: span 2; }
.page-gallery.is-mosaic .pg-cap {
  position: absolute; inset: auto 0 0 0; padding: 30px 12px 10px; color: var(--white);
  background: linear-gradient(0deg, rgba(8, 38, 33, 0.9), rgba(8, 38, 33, 0));
  font-size: 0.82rem; opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.page-gallery.is-mosaic .pg-card:hover .pg-cap,
.page-gallery.is-mosaic .pg-card:focus-visible .pg-cap { opacity: 1; transform: none; }
@media (hover: none) { .page-gallery.is-mosaic .pg-cap { opacity: 1; transform: none; } }

/* หน้ารวมงานอาคารสถานที่: การ์ดหน่วยงานพร้อมภาพ */
.unit-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0 0 40px; }
.unit-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.unit-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--gold-500); }
.unit-card-photo { position: relative; aspect-ratio: 3 / 3.3; overflow: hidden; background: var(--teal-800); }
.unit-card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform 0.6s ease; }
.unit-card:hover .unit-card-photo img { transform: scale(1.07); }
.unit-card-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 38, 33, 0.78));
}
.unit-card-badge {
  position: absolute; z-index: 1; left: 50%; bottom: 16px; transform: translateX(-50%); white-space: nowrap;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600; color: var(--teal-950);
  background: var(--gold-500); padding: 4px 14px; border-radius: 999px;
}
.unit-card-body { padding: 18px 22px 22px; text-align: center; }
.unit-card-body h3 { margin: 0 0 6px; font-size: 1.25rem; color: var(--teal-900); }
.unit-card-body p { margin: 0 0 12px; font-size: 0.88rem; color: var(--ink-600); line-height: 1.65; }
.unit-card-go { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: var(--teal-700); }
.unit-card:hover .unit-card-go { color: var(--gold-700); }
.page-content .unit-card { color: inherit; }

@media (max-width: 1180px) {
  .unit-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 980px) {
  .unit-hero { padding: 30px 0 44px; }
  .unit-hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .unit-art { height: 340px; max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 640px) {
  .unit-art { height: 270px; }
  .unit-stats li { min-width: 0; flex: 1 1 40%; }
  .page-gallery.is-mosaic .page-gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; gap: 8px; }
  .manual-viewer iframe { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  .unit-art::before { animation: none; }
  .arch img, .unit-card-photo img, .page-gallery.is-mosaic .pg-card img { transition: none; }
}
