/* ===================================================================
   ฟอนต์ Prompt (หัวข้อ) + Sarabun (เนื้อความ) — โฮสต์ไว้ในเว็บเอง
   ดาวน์โหลดจากคลัง Google Fonts (สัญญาอนุญาต OFL) แปลงเป็น woff2
   ไม่ต้องพึ่ง Google Fonts จึงโหลดได้แม้เครือข่ายบล็อกภายนอก
   =================================================================== */
/* Noto Serif Thai (หัวข้อส่วนหัวหน้าแรก / ธีมเทศกาล) — เก็บไฟล์ในเว็บเอง ไม่ต้องรอ Google Fonts
   เป็นฟอนต์แปรผัน ไฟล์เดียวมีทุกน้ำหนัก 600–800 · แยกไฟล์ไทย/ละติน เบราว์เซอร์โหลดเฉพาะชุดที่หน้านั้นใช้จริง */
@font-face { font-family: 'Noto Serif Thai'; src: url('/fonts/NotoSerifThai-thai.woff2') format('woff2'); font-weight: 600 800; font-style: normal; font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Serif Thai'; src: url('/fonts/NotoSerifThai-latin.woff2') format('woff2'); font-weight: 600 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@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;

  /* สีตัวหนังสือหัวข้อ — แยกจาก --teal-900/800 ที่ใช้เป็น "พื้นหลัง"
     เพื่อให้โหมดมืดสลับเฉพาะสีตัวหนังสือได้ โดยพื้นหลังเขียวเข้มยังเหมือนเดิม */
  --ink-title: var(--teal-900);
  --ink-title-2: var(--teal-800);
  /* ตัวหนังสือที่วางบนพื้นเขียว/ทองประจำวิทยาลัย — ขาวเสมอ ทั้งโหมดสว่างและมืด */
  --on-brand: #FFFFFF;
  --header-bg: rgba(255, 255, 255, 0.94);

  /* ม่านสีคลุมภาพพื้นหลังเว็บ (site-bg.jpg) — โหมดมืดจะเปลี่ยนเป็นม่านเข้ม */
  --body-tint: #f4f8f6;
  --body-veil-0: rgba(247, 250, 249, 0.76);
  --body-veil-1: rgba(247, 250, 249, 0.94);
  --body-veil-2: rgba(247, 250, 249, 0.98);

  /* 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: 18px;     /* ปรับลง 10% จากเดิม 20px — เมนูและแถบหัวเว็บจะไม่ล้นจอ */
}

/* ===================================================================
   โหมดมืด — สลับด้วยปุ่ม 🌙/☀️ บนหัวเว็บ (เก็บค่าไว้ใน localStorage)
   เปลี่ยนเฉพาะ "พื้นหลัง/ตัวหนังสือ" ส่วนสีเขียว-ทองประจำวิทยาลัยคงเดิม
   =================================================================== */
:root[data-theme="dark"] {
  --white: #15211F;      /* พื้นการ์ด */
  --paper: #0E1817;      /* พื้นหน้าเว็บ */
  --border: #243632;

  --ink-900: #EAF2F0;
  --ink-700: #D2DEDB;
  --ink-600: #A7B8B4;
  --ink-400: #7E908C;

  --teal-050: #17241F;   /* พื้นอ่อนเดิม -> พื้นเข้มอ่อน */
  --sage-100: #D8E6E2;
  --sage-200: #C2D6D1;

  --gold-050: #241F10;
  --gold-100: #F3E7BE;

  --ink-title: #9FD9CB;  /* หัวข้อเป็นเขียวมิ้นต์สว่าง อ่านบนพื้นเข้มได้ */
  --ink-title-2: #86CCBC;
  --header-bg: rgba(16, 26, 24, 0.94);

  --body-tint: #0E1817;
  --body-veil-0: rgba(14, 24, 23, 0.86);
  --body-veil-1: rgba(14, 24, 23, 0.95);
  --body-veil-2: rgba(14, 24, 23, 0.98);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.30);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.52);
}
/* ภาพและใบปลิวสว่างจ้าเกินไปบนพื้นมืด — หรี่ลงนิดหน่อย สว่างกลับเมื่อชี้เมาส์ */
:root[data-theme="dark"] .news-thumb img,
:root[data-theme="dark"] .slider-track img,
:root[data-theme="dark"] .highlight-board img { filter: brightness(0.88); transition: filter 0.2s; }
:root[data-theme="dark"] .news-thumb img:hover,
:root[data-theme="dark"] .slider-track img:hover,
:root[data-theme="dark"] .highlight-board img:hover { filter: none; }

* { 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(--ink-title); 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(--on-brand); 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(--on-brand); }
.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: var(--header-bg); 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; min-width: 0; }
/* ชื่อวิทยาลัยต้องอยู่บรรทัดเดียว ห้ามตัดคำกลางชื่อ — ชื่อคณะอยู่บรรทัดรองลงมา */
.brand-text strong { font-family: var(--font-display); font-size: 1.28rem; color: var(--ink-title); font-weight: 600; white-space: nowrap; }
.brand-text em { font-style: normal; font-size: 0.82rem; color: var(--ink-600); font-weight: 400; letter-spacing: 0.2px; white-space: nowrap; }

.header-actions { display: flex; align-items: center; gap: 10px; }
/* โลโก้ ITA บนป้ายพื้นขาว (โลโก้สีน้ำเงินกลืนกับหัวเว็บสีเข้มของหน้าแรก) — partials/topbar.html */
.hdr-ita {
  flex: none; display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hdr-ita img { display: block; height: 32px; width: auto; }
.hdr-ita:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.hdr-ita:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }

/* ปุ่มกลม ๆ บนหัวเว็บ: สลับโหมดมืด และสลับภาษา */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--white);
  color: var(--ink-700); font-family: var(--font-display); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s ease; line-height: 1;
}
.icon-btn:hover { border-color: var(--teal-600); color: var(--ink-title); transform: translateY(-1px); }
.icon-btn .ib-ico { font-size: 1.02rem; }

/* ไอคอนดวงอาทิตย์/พระจันทร์ — โชว์ทีละอันตามโหมดที่ใช้อยู่ */
.icon-btn .ib-moon { display: inline; }
.icon-btn .ib-sun { display: none; }
:root[data-theme="dark"] .icon-btn .ib-moon { display: none; }
:root[data-theme="dark"] .icon-btn .ib-sun { display: inline; }

/* ===== 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: rgba(8, 38, 33, 0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid rgba(216, 178, 76, 0.35); position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 14px rgba(8,38,33,0.16); }
.mega-nav::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 40px;
  background: linear-gradient(180deg, rgba(8, 38, 33, 0.30), rgba(8, 38, 33, 0));
  pointer-events: none;
}
.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(--ink-title-2); }
.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; }

/* ===== ปุ่มเปลี่ยนภาษา / โหมดมืด — อยู่ในแถบเมนู (ย้ายมาจากหัวเว็บ) =====
   แถบเมนู (.mega-nav) เป็นพื้นเข้มทุกหน้าเสมอ (ต่างจาก .site-header ที่สว่างบนหน้าอื่น ๆ)
   จึงปรับสีปุ่ม .icon-btn ให้เป็นแบบขอบโปร่งบนพื้นเข้มแทนแคปซูลขาวเดิม */
.nav-actions {
  display: flex; align-items: center; gap: 8px; flex: none;
  margin-left: auto; padding: 0 8px 0 12px;
}
.nav-actions .icon-btn {
  height: 36px; min-width: 36px; padding: 0 10px;
  background: transparent; border-color: rgba(255, 255, 255, 0.28); color: var(--sage-100);
}
.nav-actions .icon-btn:hover { border-color: var(--gold-400); color: var(--gold-100); background: rgba(216, 178, 76, 0.12); transform: none; }

/* ตราบใดที่เมนูยังเป็นแนวนอน (≥1301px) ที่ว่างในแถบเมนูไม่พอให้ปุ่มมีตัวหนังสือ
   ต่อให้จอกว้างแค่ไหนก็ตาม — เหลือแค่ไอคอนเสมอ ประหยัดที่ให้รายการเมนูหลัก
   (ต่ำกว่า 1301px เมนูพับเป็น ☰ แล้วที่ว่างเหลือเฟือ ปุ่มจึงกลับมาโชว์ตัวหนังสือได้ตามด้านบน) */
@media (min-width: 1301px) {
  .nav-actions { gap: 6px; padding: 0 4px 0 8px; }
  .nav-actions .icon-btn { height: 32px; min-width: 32px; padding: 0 8px; }
  .nav-actions .ib-label { display: none; }
}

/* ===================================================================
   สไลด์ภาพประชาสัมพันธ์ / แสดงความยินดี (ข้อ 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(16px) brightness(0.5); transform: scale(1.2); /* เดิม 30px — ยิ่งเบลอมากยิ่งกินเครื่อง */
}
.slide-caption {
  position: absolute; inset: auto 0 0 0; padding: 12px 24px; color: var(--on-brand);
  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(--on-brand); 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(--on-brand); font-family: var(--font-display); margin-bottom: 6px; font-size: 1.1rem; }

/* ===== ฐานข้อมูล CINAHL — กล่องค้นหา BCN Chakriraj Discovery Service (หน้าแรก คอลัมน์กลาง) =====
   การ์ดขาว หัวแถบเขียวแบบเดิม · ซ้าย = ตรา + ช่องค้นหา · ขวา = สมุดเปิดพลิกหน้าวาดด้วย CSS (.cinahl-book) */
.cinahl-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1, var(--shadow-sm)); overflow: hidden;
}
.cinahl-card-head {
  margin: 0; padding: 14px 22px; background: var(--teal-800); color: var(--gold-100);
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; line-height: 1.4;
  border-bottom: 3px solid var(--gold-500);
}
.cinahl-card-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: center; gap: 12px;
  padding: 22px 26px; background: var(--paper);
}
.cinahl-main { display: flex; align-items: center; gap: 20px; }
.cinahl-logo { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.cinahl-form { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.cinahl-form > label { font-weight: 600; color: var(--ink-title); font-size: 0.95rem; }
.cinahl-row { display: flex; gap: 10px; }
.cinahl-row input[type="text"] {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 11px 14px;
  font-size: 1rem; background: var(--gold-050); color: var(--ink-900); font-family: var(--font-body);
}
.cinahl-row input[type="text"]:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; background: var(--white); }
.cinahl-go { flex: none; padding: 11px 26px; font-size: 1rem; border: none; border-radius: var(--radius-sm); cursor: pointer; }
.cinahl-options { display: flex; flex-wrap: wrap; gap: 18px; font-size: 0.92rem; color: var(--ink-700); }
.cinahl-options label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cinahl-options input { accent-color: var(--teal-700); width: 16px; height: 16px; }
.cinahl-card-foot { margin: 0; padding: 12px 22px; text-align: center; font-size: 0.92rem; color: var(--ink-600); border-top: 1px solid var(--border); }
.cinahl-guide-link { color: var(--gold-700); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.cinahl-guide-link:hover { color: var(--teal-700); }

/* ---------- สมุดเปิดพลิกหน้า ---------- */
.cinahl-art { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; }
.cinahl-glow { position: absolute; width: 260px; height: 200px; border-radius: 50%; background: radial-gradient(closest-side, rgba(216, 178, 76, 0.28), transparent); filter: blur(6px); }
.cinahl-book {
  position: relative; width: 210px; height: 136px; perspective: 900px;
  transform: rotateX(18deg) rotate(-4deg); transform-style: preserve-3d; animation: cbFloat 6s ease-in-out infinite;
}
.cb-cover {
  position: absolute; inset: -8px -10px -12px; border-radius: 10px;
  background: linear-gradient(135deg, #C59B27, #8A6A12); box-shadow: 0 26px 40px rgba(0, 0, 0, 0.45);
}
.cb-page, .cb-flip {
  position: absolute; top: 0; width: 50%; height: 100%;
  background:
    repeating-linear-gradient(180deg, transparent 0 14px, rgba(13, 59, 53, 0.16) 14px 15px) 18px 26px / calc(100% - 36px) calc(100% - 46px) no-repeat,
    linear-gradient(90deg, #FFFBEF, #F4EAD0);
}
.cb-page.is-left { left: 0; border-radius: 8px 2px 2px 8px; box-shadow: inset -12px 0 18px -10px rgba(0, 0, 0, 0.25); }
.cb-page.is-right { right: 0; border-radius: 2px 8px 8px 2px; box-shadow: inset 12px 0 18px -10px rgba(0, 0, 0, 0.25); }
.cb-page.is-left::before {
  content: 'CINAHL'; position: absolute; left: 18px; top: 8px; font-family: var(--font-display); font-weight: 700;
  font-size: 0.72rem; letter-spacing: 0.12em; color: #0F4439;
}
.cb-flip {
  left: 50%; border-radius: 2px 8px 8px 2px; transform-origin: left center; backface-visibility: visible;
  animation: cbFlip 4.8s cubic-bezier(0.45, 0.05, 0.35, 1) var(--d) infinite;
  box-shadow: inset 10px 0 16px -10px rgba(0, 0, 0, 0.2);
}
@keyframes cbFlip {
  0%, 18% { transform: rotateY(0deg); filter: brightness(1); }
  55% { filter: brightness(0.86); }
  82%, 100% { transform: rotateY(-180deg); filter: brightness(0.96); }
}
@keyframes cbFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.cinahl-spark {
  position: absolute; left: var(--x); top: var(--y); width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #FFF6D4 0%, #E7C566 45%, transparent 70%);
  animation: cbSpark 3.6s ease-in-out var(--d) infinite;
}
@keyframes cbSpark { 0%, 100% { opacity: 0.2; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .cinahl-book, .cb-flip, .cinahl-spark { animation: none; }
  .cb-flip { display: none; }
}
@media (max-width: 1200px) {
  .cinahl-card-body { grid-template-columns: minmax(0, 1fr); }
  .cinahl-art { order: -1; height: 180px; margin: -6px 0 6px; }
  .cinahl-book { width: 200px; height: 128px; }
}
@media (max-width: 640px) {
  .cinahl-card-body { padding: 18px 16px; }
  .cinahl-main { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cinahl-logo { width: 48px; height: 48px; }
  .cinahl-go { padding: 11px 18px; }
}

/* ===== 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;
  min-height: 420px;
}
/* กล่องรวมการ์ดหลักสูตร: ทุกแถวสูงเท่าการ์ดที่สูงที่สุด ภาพฝั่งขวาจึงขนาดเท่ากันทุกหลักสูตร */
.program-list { display: grid; grid-auto-rows: 1fr; gap: 28px; }
/* หลักสูตรรอง — ใช้คอลัมน์และความสูงเดียวกับหลักสูตรหลัก (ภาพเท่ากัน) ต่างกันแค่ตัวหนังสือเล็กลงเล็กน้อย */
.program-card-alt { margin-top: 0; }
.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(--ink-title-2); 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(--ink-title); 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(--on-brand);
  border-radius: var(--radius-lg); padding: 34px 38px; box-shadow: var(--shadow-sm);
}
.welcome-card h2 { color: var(--on-brand); 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(--ink-title);
  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(--on-brand); }

/* ช่องค้นหาอยู่ท้ายแถวเดียวกับแท็บ */
.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(--ink-title-2); 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(--ink-title-2); background: var(--teal-050); }
.pg-btn.active { background: var(--teal-800); border-color: var(--teal-800); color: var(--on-brand); 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 4px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--gold-600);
}
.director-mini h4 {
  font-family: var(--font-display); font-size: clamp(0.86rem, 1.1vw, 1.14rem);
  margin: 0 0 3px; color: var(--teal-950); font-weight: 700;
  line-height: 1.5; white-space: nowrap; letter-spacing: -0.005em;
}
/* ตำแหน่งยาว 44 ตัวอักษร — บังคับบรรทัดเดียวบนจอกว้าง (>1500px)
   จอแคบกว่านั้นปล่อยให้ตัดบรรทัดได้ ดีกว่าย่ออักษรจนอ่านไม่ออก */
.director-mini p {
  font-family: var(--font-display); font-size: 0.8rem; color: var(--teal-900); margin: 0;
  font-weight: 500; line-height: 1.6; white-space: nowrap;
}
@media (max-width: 1700px) {
  .director-mini p { font-size: 0.76rem; }
}
@media (max-width: 1500px) {
  .director-mini p { white-space: normal; font-size: 0.8rem; }
}
/* จอเล็ก: คอลัมน์ซ้ายกลายเป็นเต็มความกว้าง — ขยายชื่อกลับให้อ่านสบาย (ยังบรรทัดเดียว) */
@media (max-width: 980px) {
  .director-mini h4 { font-size: 1.15rem; }
  .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.9rem; font-weight: 400; font-family: var(--font-body); line-height: 1.45;
  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(--ink-title) !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(--ink-title); 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(--on-brand); 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(--ink-title-2); padding-left: 20px; }
.quick-link-list a.is-active { background: var(--teal-050); color: var(--ink-title-2); 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; }

/* ===== ยอดผู้เข้าชมเว็บไซต์ ===== */
.visit-counter { padding: 16px 18px 14px; }
.visit-counter-total {
  text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  color: var(--ink-title-2); background: var(--teal-050); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 12px; letter-spacing: 0.5px;
}
.visit-counter-list { list-style: none; margin: 0; padding: 0; }
.visit-counter-list li {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px;
  border-bottom: 1px dashed var(--border); font-size: 0.86rem;
}
.visit-counter-list li:last-child { border-bottom: none; }
.vc-icon { flex: none; font-size: 0.95rem; }
.vc-label { flex: 1; color: var(--ink-700); }
.vc-val { font-weight: 600; color: var(--ink-title); font-variant-numeric: tabular-nums; }
.visit-counter-foot { margin-top: 10px; font-size: 0.76rem; color: var(--ink-400); text-align: center; line-height: 1.5; }

/* ===== แอดมิน / 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(--on-brand); 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; }

/* ===== ปุ่ม CKR Connect (ศูนย์รวม Web App) — โทนเขียวเข้มของวิทยาลัย ขอบทอง ===== */
.connect-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 16px; padding: 20px 20px 20px 22px;
  border-radius: var(--radius-lg); text-decoration: none; color: #F7F1DF;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(216, 178, 76, 0.30) 0%, rgba(216, 178, 76, 0) 55%),
    linear-gradient(135deg, #17655A 0%, var(--teal-800) 48%, #082621 100%);
  border: 1px solid rgba(216, 178, 76, 0.45);
  box-shadow: 0 12px 28px rgba(8, 38, 33, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* แสงวิ่งผ่านตอนชี้เมาส์ */
.connect-card::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(246, 227, 166, 0.22) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 0.7s ease;
}
.connect-card:hover {
  transform: translateY(-2px); border-color: var(--gold-500);
  box-shadow: 0 18px 38px rgba(8, 38, 33, 0.36), 0 0 0 3px rgba(216, 178, 76, 0.16);
}
.connect-card:hover::after { transform: translateX(120%); }
.connect-card:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }

.connect-card-icon {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; color: #0D3B35;
  background: linear-gradient(135deg, #F6E3A6 0%, #D8B24C 55%, #C08F1F 100%);
  box-shadow: 0 6px 14px rgba(197, 155, 39, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.connect-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.connect-card-title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.3; letter-spacing: 0.2px;
}
.connect-card-title b { font-weight: 700; color: #F0CF73; }
.connect-card-text small {
  font-family: var(--font-display); font-weight: 400; font-size: 0.8rem; line-height: 1.45; opacity: 0.85;
  text-wrap: balance;
}
.connect-card-arrow {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  border: 1px solid rgba(216, 178, 76, 0.5); color: #F0CF73; transition: all 0.2s ease;
}
.connect-card:hover .connect-card-arrow { background: var(--gold-500); border-color: var(--gold-500); color: #0D3B35; transform: translateX(2px); }

@media (prefers-reduced-motion: reduce) {
  .connect-card, .connect-card::after, .connect-card-arrow { transition: none; }
  .connect-card:hover { transform: none; }
  .connect-card:hover::after { transform: translateX(-120%); }
}

/* ===== ระบบสารสนเทศ ===== */
.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(--on-brand); 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(--ink-title-2); }
.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(--ink-title-2); 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(--on-brand); }

.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(--on-brand); }
.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; }

/* ปฏิทินกิจกรรมหน้าแรก — ข้อมูลจาก CKR Connect (public/js/calendar.js) · --c = สีประเภทกิจกรรม */
.ckr-cal { padding: 0 22px 22px; }
.cal-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-month { flex: 1; margin: 0; text-align: center; font-family: var(--font-display, inherit); font-weight: 600; font-size: 1.05rem; color: var(--ink-900); }
.cal-nav, .cal-today {
  border: 1px solid var(--border); background: var(--white); color: var(--teal-800); cursor: pointer;
  font: inherit; transition: background 0.2s ease, border-color 0.2s ease;
}
.cal-nav { width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem; line-height: 1; }
.cal-today { order: -1; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 0.86rem; font-weight: 600; }
.cal-nav:hover, .cal-today:hover { border-color: var(--gold-500); background: var(--teal-050); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; transition: opacity 0.2s ease; }
.ckr-cal.is-loading .cal-grid { opacity: 0.45; }
.cal-dow { text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--ink-600); padding: 2px 0 4px; }
.cal-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 82px; min-width: 0;
  padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--white);
  font: inherit; text-align: left; color: var(--ink-900); cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cal-day:hover { border-color: var(--gold-500); }
.cal-day.is-out { opacity: 0.42; }
.cal-dow.is-weekend, .cal-day.is-weekend .cal-num { color: var(--gold-600); }
.cal-num { align-self: flex-start; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; font-size: 0.82rem; font-weight: 600; line-height: 24px; text-align: center; }
.cal-day.is-today .cal-num { background: var(--teal-800); color: var(--on-brand); }
.cal-day.is-sel { border-color: var(--gold-500); box-shadow: 0 0 0 2px rgba(216, 178, 76, 0.35); }
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip {
  display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  padding: 1px 5px; border-left: 3px solid var(--c); border-radius: 4px;
  background: color-mix(in srgb, var(--c) 14%, transparent); font-size: 0.72rem; line-height: 1.5;
}
.cal-more { font-size: 0.7rem; color: var(--ink-600); padding-left: 4px; }
.cal-dots { display: none; }
.cal-list { margin-top: 16px; }
.cal-list-head { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 600; font-size: 0.95rem; }
.cal-clear { margin-left: auto; border: 0; background: none; padding: 0; font: inherit; font-size: 0.84rem; font-weight: 500; color: var(--teal-700); cursor: pointer; text-decoration: underline; }
.cal-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal-list li { display: grid; gap: 1px; padding: 8px 12px; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 8%, var(--white)); }
.cal-list li strong { font-size: 0.92rem; font-weight: 600; }
.cal-list li span { font-size: 0.82rem; color: var(--ink-600); }
.cal-empty { margin: 0; padding: 14px; text-align: center; font-size: 0.88rem; color: var(--ink-600); border: 1px dashed var(--border); border-radius: 10px; }
@media (max-width: 640px) {
  .ckr-cal { padding: 0 14px 16px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 50px; padding: 4px 2px; align-items: center; border-radius: 8px; }
  .cal-num { align-self: center; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; gap: 3px; justify-content: center; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
}
@media (prefers-reduced-motion: reduce) {
  .cal-grid, .cal-day, .cal-nav, .cal-today { transition: none; }
}

/* ===== 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(--on-brand); 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(--on-brand); font-family: var(--font-display); font-size: 1.1rem; }
.footer-col h4 { color: var(--on-brand); 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(--on-brand); 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: 17.5px; }
}
@media (max-width: 1500px) {
  .trio-layout { grid-template-columns: 280px minmax(0, 1fr) 300px; gap: 24px; }
  :root { --gutter: 28px; --base-size: 17px; }
}
/* โน้ตบุ๊กจอ 1280-1400px: บีบระยะห่างในเมนูให้แคบลง เมนูจะได้อยู่แถวเดียว
   ไม่ตกลงมาอีกบรรทัด โดยไม่ต้องลดขนาดตัวหนังสือทั้งเว็บ */
@media (max-width: 1400px) {
  .mega-link { padding: 18px 4px 18px 14px; font-size: 0.95rem; }
}
@media (max-width: 1200px) {
  :root { --base-size: 16px; }
  .mega-link { padding: 16px 3px 16px 11px; font-size: 0.92rem; }
  .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; min-height: 0; }
  .program-list { grid-auto-rows: auto; }
  .program-visual { padding: 30px; min-height: 0; height: 260px; }
  .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: 15.5px; }
  .header-inner { padding: 12px 16px; gap: 10px; }
  .brand-text em { display: none; }
  /* จอมือถือแคบเกินกว่าจะใส่ชื่อเต็มในบรรทัดเดียว — ยอมให้ตัดที่ "ช่องว่าง"
     หน้าคำว่าจักรีรัช (ไม่ตัดกลางคำ) แทนการย่อฟอนต์จนอ่านไม่ออก */
  .brand-text strong {
    font-size: 0.84rem; white-space: normal; line-height: 1.25;
    word-break: normal; overflow-wrap: normal;
  }
  .brand { gap: 10px; }
  .brand-logo { height: 40px !important; }
  /* เหลือเฉพาะไอคอน ไม่งั้นหัวเว็บล้น */
  .icon-btn { height: 34px; min-width: 34px; padding: 0 7px; }
  .icon-btn .ib-label { display: none; }
  .brand-mark { width: 46px; height: 46px; font-size: 0.82rem; }
  .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(--on-brand); padding: 46px 0 40px; border-bottom: 3px solid var(--gold-500);
}
.page-hero .page-title { color: var(--on-brand); 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(--ink-title-2);
}

.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(--ink-title-2);
  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(--ink-title);
  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(--ink-title-2); 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(--on-brand); 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(--on-brand); }
.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(--on-brand); 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); }
a.lb-btn { text-decoration: none; }
.lb-btn.lb-copy { width: auto; padding: 0 14px; gap: 7px; font-size: 0.88rem; }
.lb-btn.lb-copy > span[aria-hidden] { font-size: 1.05rem; }
.lb-btn.lb-copy.is-done { background: #2E8B57; border-color: #2E8B57; color: #fff; }
.lb-btn.lb-copy.is-fail { background: #B4452F; border-color: #B4452F; color: #fff; }

.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; }
/* เลื่อนดูภาพในชุดเดียวกัน (กล่อง data-gallery) — ปุ่ม ‹ › และตัวนับภาพ */
.lb-nav {
  position: absolute; top: 50%; z-index: 2; width: 54px; height: 54px; margin-top: -27px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.28); background: rgba(6,26,23,0.55); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; line-height: 1; padding-bottom: 4px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.lb-nav:hover { background: var(--gold-500); border-color: var(--gold-500); color: var(--teal-950); }
.lb-nav:active { transform: scale(0.94); }
.lb-nav.is-prev { left: 18px; }
.lb-nav.is-next { right: 18px; }
.lb-nav[hidden], .lb-count[hidden] { display: none; }
.lb-count {
  position: absolute; left: 50%; bottom: 14px; z-index: 2; transform: translateX(-50%);
  padding: 4px 14px; border-radius: 999px; background: rgba(6,26,23,0.65); color: #fff;
  font-family: var(--font-display); font-size: 0.84rem; letter-spacing: 0.04em; pointer-events: 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; }
  .lb-btn.lb-copy { width: 38px; padding: 0; }
  .lb-btn.lb-copy.is-done, .lb-btn.lb-copy.is-fail { width: auto; padding: 0 10px; }
  .lb-copy:not(.is-done):not(.is-fail) .lb-copy-label { display: none; }
  .lightbox-tools { flex-wrap: wrap; }
  .lb-nav { width: 44px; height: 44px; margin-top: -22px; font-size: 1.7rem; }
  .lb-nav.is-prev { left: 8px; }
  .lb-nav.is-next { right: 8px; }
}

/* ผังกว้างพิเศษ: ให้สูงพอดูรู้เรื่อง ไม่บีบจนอ่านไม่ออก */
.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(--ink-title-2); 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(--on-brand); }
.page-content .btn-gold,
.page-content .btn-gold:hover { color: var(--teal-950); }
.page-content .cta-card .btn { color: var(--on-brand); }
.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; display: flex; align-items: center; gap: 10px; }
/* จุดสัญญาณกระพริบหน้าหัวข้อ — บอกว่ามีข่าวใหม่ */
.hb-live {
  flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: #E0453A; animation: hb-live-pulse 1.8s ease-out infinite;
}
@keyframes hb-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 69, 58, .55); }
  70%  { box-shadow: 0 0 0 10px rgba(224, 69, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 69, 58, 0); }
}
/* แสงสีทองวิ่งผ่านตัวหนังสือเป็นระยะ */
.hb-shine {
  background: linear-gradient(100deg, currentColor 0 42%, var(--gold-500) 50%, currentColor 58% 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: hb-shine 4.5s ease-in-out 1s infinite;
}
@keyframes hb-shine {
  0%        { background-position: 100% 0; }
  35%, 100% { background-position: 0 0; }
}
/* ประกายทองวิ่งไปกลับบนเส้นใต้หัวข้อ */
.hb-head { position: relative; }
.hb-head::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 90px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-700), transparent);
  animation: hb-line 5s ease-in-out infinite alternate;
}
@keyframes hb-line { from { left: 0; } to { left: calc(100% - 90px); } }
@media (prefers-reduced-motion: reduce) {
  .hb-live, .hb-shine, .hb-head::after { animation: none; }
}
.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;
  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; }

/* กดลูกศร/ภาพย่อ = กระโดดไปภาพนั้นทันที แล้วเฟดภาพเข้ามาสั้น ๆ (ดู goTo ใน main.js) */
.hb-item.hb-enter { animation: hb-enter 0.28s ease-out; }
@keyframes hb-enter { from { opacity: 0.35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hb-item.hb-enter { animation: 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(16px) 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(--on-brand);
  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(--ink-title); 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; }

/* แถบภาพย่อใต้ภาพใหญ่ (Thumbnail slider) — กดเพื่อเลือกดูภาพ เลื่อนแถบซ้าย-ขวาได้ถ้าภาพเยอะ */
.hb-strip {
  display: flex; gap: 10px; margin-top: 14px; padding: 4px 2px 8px;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  scrollbar-color: var(--sage-200) transparent;
}
.hb-strip[hidden] { display: none; }
.hb-strip-thumb {
  flex: 0 0 auto; width: 92px; height: 92px; padding: 0; cursor: pointer; scroll-snap-align: center;
  border-radius: 12px; overflow: hidden; background: var(--teal-050);
  border: 2px solid transparent; outline: 1px solid var(--border);
  opacity: 0.55; filter: saturate(0.7); transition: opacity 0.2s, filter 0.2s, border-color 0.2s, transform 0.2s;
}
.hb-strip-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hb-strip-thumb:hover { opacity: 0.9; filter: none; transform: translateY(-2px); }
.hb-strip-thumb:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.hb-strip-thumb.is-active {
  opacity: 1; filter: none; border-color: var(--gold-500); outline-color: var(--gold-500);
  box-shadow: 0 6px 16px rgba(8, 38, 33, 0.18);
}
@media (max-width: 640px) {
  .hb-strip { gap: 8px; }
  .hb-strip-thumb { width: 64px; height: 64px; border-radius: 10px; }
}

.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(--on-brand); }
.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(--ink-title-2); 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(--ink-title); 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-years { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.mission-years[hidden] { display: none; }
.mission-year-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--white); color: var(--ink-900); font: inherit; font-size: 0.92rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mission-year-chip small { font-size: 0.78rem; color: var(--ink-600); background: var(--teal-050); padding: 1px 8px; border-radius: 999px; }
.mission-year-chip:hover { border-color: var(--gold-500); }
.mission-year-chip.active { background: var(--teal-800); border-color: var(--teal-800); color: #fff; font-weight: 600; }
.mission-year-chip.active small { background: rgba(255,255,255,0.18); color: #fff; }
:root[data-theme="dark"] .mission-year-chip small { background: rgba(255,255,255,0.08); }

/* #missionGrid = กลุ่มรายเดือน (mission-group) แต่ละกลุ่มมีหัวข้อเดือน + ตารางภาพ */
.mission-grid { display: grid; gap: 34px; }
.mission-grid-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.mission-month {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; padding: 12px 18px;
  font-size: 1.05rem; color: var(--ink-900); background: var(--white);
  border: 1px solid var(--border); border-left: 4px solid var(--gold-500); border-radius: var(--radius);
}
.mission-month small { margin-left: auto; font-size: 0.82rem; font-weight: 500; color: var(--ink-600); }
.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: auto; 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-items { 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 { gap: 26px; }
  .mission-grid-items { grid-template-columns: 1fr 1fr; gap: 12px; }
  .mission-month { font-size: 0.98rem; padding: 10px 14px; }
  .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: scroll; /* เดิม fixed — เบราว์เซอร์ต้องวาดพื้นหลังใหม่ทั้งจอทุกครั้งที่เลื่อน ทำให้กระตุก (ต.ค. 2569) */
}
@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(--ink-title); 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(--ink-title); 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(--on-brand); 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(--on-brand); 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(--on-brand); 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(--on-brand); 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(--on-brand); 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(--on-brand); }
.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(--ink-title); 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(--ink-title); 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(--on-brand); 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(--ink-title); 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(--ink-title); 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(--on-brand); }
.page-content .ita-hero-en { color: var(--gold-100); }
.page-content .ita-hero-year { color: var(--on-brand); }
.page-content .ita-year-btn { color: var(--on-brand); text-decoration: none; }
.page-content .ita-year-btn:hover { color: var(--on-brand); }
.page-content .ita-year-btn.is-current { color: var(--teal-950); }
.page-content .ita-org { color: var(--ink-title); }
.page-content .ita-indicator-title { color: var(--on-brand); }
.page-content .ita-item-list a { color: var(--teal-700); }
.page-content .ita-item-list a:hover { color: var(--ink-title); }
.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(--ink-title-2);
  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(--ink-title-2); }
.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(--ink-title); padding-left: 14px; }
.ita-item-head { color: var(--ink-title); 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(--ink-title-2); 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(--ink-title); }
.page-content .ita-item-head { color: var(--ink-title); }
.page-content .ita-subitem-link { color: var(--ink-700); }
.page-content .ita-subitem-link:hover { color: var(--ink-title-2); }

/* ===== เมนูหลักมี 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; }
}
/* หน้าภาษาอังกฤษ (/en/): ชื่อเมนูยาวกว่าภาษาไทยราว 30% — ย่อตัวอักษรอีกนิดให้ยังอยู่แถวเดียว */
@media (min-width: 1301px) {
  :root[lang="en"] .mega-link:not(.mega-home) { font-size: 0.82rem; padding-left: 9px; padding-right: 1px; }
  :root[lang="en"] .mega-item-plain .mega-link:not(.mega-home) { padding-right: 9px; }
}
@media (min-width: 1301px) and (max-width: 1440px) {
  :root[lang="en"] .mega-link:not(.mega-home) { font-size: 0.76rem; padding-left: 7px; }
  :root[lang="en"] .mega-item-plain .mega-link:not(.mega-home) { padding-right: 7px; }
}

/* ===== ปุ่มไอคอนกลับหน้าแรก (ตัวแรกในแถบเมนู) ===== */
.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: var(--body-tint);
  background-image:
    linear-gradient(180deg, var(--body-veil-0) 0%, var(--body-veil-1) 34%, var(--body-veil-2) 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: 1300px) {
  /* จุดพับเมนูขยับจาก 1180px เป็น 1300px — ต้องเผื่อที่ให้ .nav-actions
     (เปลี่ยนภาษา/โหมดมืด) ที่ย้ายมาอยู่ในแถบเมนูนี้ด้วย */
  .mega-toggle { display: flex; order: 1; }
  .mega-menu { display: none; width: 100%; flex-direction: column; order: 3; flex-basis: 100%; }
  .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; }
  .mega-nav-inner { flex-wrap: wrap; }
  .nav-actions { order: 2; margin-left: 0; padding: 0 6px; }
}

@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 { display: inline-flex; padding: 9px 14px !important; font-size: 0.82rem !important; }
  .header-actions { gap: 8px; flex: none; }
  .hdr-ita { padding: 4px 8px; border-radius: 10px; }
  .hdr-ita img { height: 24px; }
}
/* จอแคบ: โลโก้ ITA ซ้อนเหนือปุ่มสมัครเรียน ให้ชื่อวิทยาลัยมีที่พอ */
@media (max-width: 480px) {
  .header-actions { flex-direction: column; align-items: stretch; gap: 5px; }
  .hdr-ita { justify-content: center; padding: 3px 6px; border-radius: 8px; }
  .hdr-ita img { height: 20px; }
  .header-actions .btn { justify-content: center; padding: 7px 12px !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(--on-brand); 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(--ink-title-2); 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(--on-brand);
  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(--on-brand); }
.ext-card span { color: var(--sage-100); font-size: 0.9rem; }
.page-content .ext-card { color: var(--on-brand); }

.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(--on-brand); 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(--on-brand); 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(--on-brand); 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(--ink-title); 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(--on-brand); 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(--ink-title); 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(--on-brand); 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(--on-brand); }
.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(--on-brand); 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(--on-brand); 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(--on-brand);
  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(--ink-title); }
.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; }
}

/* ===================================================================
   หน้าแรก: หัวเว็บและเมนูโทนเข้ม (เฉพาะ body.home — หน้าอื่นยังเป็นพื้นขาวแบบเดิม)
   =================================================================== */
body.home {
  --hd-night: #04150F; --hd-night-2: #061C17; --hd-gold-300: #EBCF7E;
  --hd-foil: linear-gradient(135deg, #F6E3A6 0%, #D8B24C 42%, #A67F1D 100%);
}
body.home .site-header {
  background: linear-gradient(180deg, var(--hd-night), var(--hd-night-2));
  border-bottom: 1px solid rgba(216, 178, 76, 0.2); box-shadow: none; backdrop-filter: none;
}
body.home .brand-text strong { color: #FBF8F1; letter-spacing: 0; }
body.home .brand-text em { color: var(--hd-gold-300); opacity: 0.9; }
body.home .brand-logo { border-color: var(--gold-500); box-shadow: 0 0 0 1px var(--gold-500), 0 0 22px rgba(216, 178, 76, 0.35); }
body.home .header-actions .btn {
  background: var(--hd-foil); color: var(--teal-950); white-space: nowrap; font-weight: 600;
  box-shadow: 0 10px 26px rgba(216, 178, 76, 0.32);
}
body.home .hdr-ita { border-color: rgba(216, 178, 76, 0.6); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28); }
body.home .header-actions .btn:hover { background: var(--hd-foil); filter: brightness(1.06); }
body.home .mega-nav { background: rgba(8, 38, 33, 0.72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* ===================================================================
   Hero "แสงเทียนไนติงเกล" — หน้าแรก
   คอลลาจภาพบรรยากาศนักศึกษา ๔ ใบ ซ้อนเหลื่อมกัน ขอบมน เส้นทองบาง
   มีแสงอุ่นเรืองอยู่ข้างหลัง และประกายไฟลอยขึ้น

   หมายเหตุเรื่องมือถือ: ทุกเลเยอร์ตกแต่งตั้ง pointer-events:none และ
   บนจอแคบจะปิดแอนิเมชัน/ปิด canvas ทั้งหมด เพื่อให้เลื่อนนิ้วได้ลื่น ไม่ค้าง
   =================================================================== */
.candle-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #F3EBD8;
  display: flex; align-items: center;
  min-height: clamp(520px, 58vw, 780px);
  padding: clamp(34px, 4.2vw, 76px) 0 clamp(40px, 5vw, 92px);
  background: #04150F;
  touch-action: pan-y;
}
/* สไลด์ภาพพื้นหลัง — ภาพหลายใบซ้อนกัน สลับ fade เข้า/ออกด้วย opacity */
.ch-photo { position: absolute; inset: 0; z-index: -1; }
.ch-photo-layer {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 55%;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.6s ease;
}
.ch-photo-layer.is-active {
  opacity: 1;
  animation: chKen 18s ease-out forwards;
}
@keyframes chKen {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.2%, -1%, 0); }
}
.ch-spot {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(
    520px 380px at var(--spot-x, 68%) var(--spot-y, 42%),
    rgba(255, 196, 100, 0.18),
    transparent 62%
  );
  mix-blend-mode: screen;
  opacity: 0.85;
}
/* ม่านไล่สีทับภาพ ให้ตัวหนังสือด้านซ้ายอ่านง่าย ไม่ว่าจะเป็นภาพไหน */
.ch-scrim {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4,21,15,.94) 0%, rgba(13,59,53,.74) 40%, rgba(4,21,15,.28) 78%, rgba(4,21,15,.58) 100%),
    linear-gradient(0deg, #072019 0%, rgba(7,32,25,.92) 8%, rgba(7,32,25,.55) 22%, transparent 50%);
}
.candle-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 120px;
  background: linear-gradient(0deg, #072019 0%, rgba(7,32,25,.7) 40%, transparent 100%);
  pointer-events: none; z-index: 3;
}
/* แสงอุ่นเรืองหลังคอลลาจ */
.ch-glow {
  position: absolute; z-index: 0; pointer-events: none;
  right: -6%; top: 50%; transform: translateY(-50%);
  width: min(64%, 900px); aspect-ratio: 1 / 0.86;
  background: radial-gradient(48% 44% at 50% 50%, rgba(255, 196, 100, 0.30), rgba(255, 168, 52, 0.10) 56%, transparent 74%);
  /* เดิม filter: blur(22px) — ภาพไล่สีนุ่มอยู่แล้ว ไม่ต้องเบลอซ้ำ */
}
.ch-embers {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1; opacity: 0.95;
}

.ch-grid {
  position: relative; z-index: 2;
  display: block; width: 100%; max-width: 760px;
  margin: 0; padding-left: clamp(24px, 6vw, 96px); padding-right: 24px;
  box-sizing: border-box;
}

/* ---- คอลลาจภาพนักศึกษา ---- */
.ch-collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, clamp(44px, 5.1vw, 76px));
  gap: clamp(9px, 0.95vw, 15px);
}
.cg {
  margin: 0; position: relative; overflow: hidden;
  border-radius: clamp(14px, 1.5vw, 22px);
  background: #0A2C25;
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(246, 227, 166, 0.26) inset,
    0 0 34px rgba(255, 186, 80, 0.12);
  opacity: 0; transform: translateY(22px) scale(0.985);
  animation: cgIn 0.85s cubic-bezier(0.22, 0.9, 0.3, 1) forwards;
}
.cg img { width: 100%; height: 100%; display: block; object-fit: cover; }
/* เฉดบาง ๆ บนภาพ ให้โทนทั้งชุดกลมกลืนกับพื้นเขียว-ทอง */
.cg::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 32, 25, 0.18) 0%, transparent 26%, transparent 62%, rgba(7, 32, 25, 0.42) 100%),
    radial-gradient(76% 62% at 50% 92%, rgba(255, 176, 62, 0.16), transparent 72%);
}
@keyframes cgIn { to { opacity: 1; transform: none; } }

.cg-1 { grid-column: 1 / 4; grid-row: 1 / 7; animation-delay: 0.05s; }
.cg-2 { grid-column: 4 / 7; grid-row: 1 / 4; animation-delay: 0.16s; }
.cg-3 { grid-column: 4 / 7; grid-row: 4 / 7; animation-delay: 0.27s; }
.cg-4 {
  position: absolute; z-index: 3;
  left: -11%; bottom: -15%; width: 40%; aspect-ratio: 4 / 3;
  transform: translateY(22px) rotate(-3.2deg) scale(0.985);
  animation-name: cgIn4; animation-delay: 0.38s;
}
@keyframes cgIn4 { to { opacity: 1; transform: rotate(-3.2deg); } }
.cg-1 img { object-position: 50% 34%; }
.cg-2 img { object-position: 50% 36%; }
.cg-3 img { object-position: 52% 52%; }
.cg-4 img { object-position: 50% 44%; }

/* ---- ตัวอักษร ---- */
.ch-eyebrow {
  margin: 0 0 12px; font-family: 'Noto Serif Thai', Georgia, serif; font-weight: 600;
  font-style: normal; letter-spacing: 0.08em; color: #DCC89A;
  font-size: clamp(15px, 1.4vw, 21px);
}
.ch-title { margin: 0; line-height: 1.16; font-family: 'Noto Serif Thai', var(--font-display), sans-serif; }
/* หมายเหตุ: ตัวอักษรไล่เฉดทองใช้ background-clip:text — กล่องพื้นหลังต้องสูงพอ
   ไม่งั้นวรรณยุกต์ไทย (ไม้โท/ไม้ตรี) ที่ลอยเหนือบรรทัดจะถูกตัดหายไป
   จึงต้องมี line-height หลวม ๆ + padding บน-ล่าง อย่าลดลง */
.ch-foil {
  display: block; font-weight: 800; font-size: clamp(29px, 3.5vw, 52px); letter-spacing: -0.01em;
  line-height: 1.42; padding: 0.16em 0 0.12em;
  background: linear-gradient(110deg, #FBF0C8 0%, #E7C566 28%, #FFF6D4 42%, #B98F22 58%, #F8E7AC 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: chFoil 7s ease-in-out infinite;
}
@keyframes chFoil {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.ch-sub {
  display: block; margin-top: 4px; font-weight: 600; color: #EFE6CF;
  font-size: clamp(21px, 2.5vw, 35px); text-shadow: 0 6px 22px rgba(2, 12, 9, 0.6);
}
.ch-vision {
  position: relative; margin: clamp(18px, 2vw, 26px) 0 0; padding-top: clamp(16px, 1.8vw, 24px);
  font-family: 'Noto Serif Thai', var(--font-display), sans-serif; font-weight: 600;
  font-size: clamp(16px, 1.45vw, 23px); line-height: 1.75; color: #F1E2B4;
  text-shadow: 0 4px 18px rgba(2, 12, 9, 0.65);
}
.ch-vision::before {
  content: ''; position: absolute; top: 0; left: 0; width: 96px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #E7C566, rgba(231, 197, 102, 0));
}
.ch-lead {
  margin: clamp(12px, 1.3vw, 18px) 0 0;
  color: #A9C0B7; font-size: clamp(14px, 1.05vw, 16px); line-height: 1.8;
}
.ch-nowrap { white-space: nowrap; }

.ch-text > * {
  animation: chRise 0.85s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
.ch-text > .ch-eyebrow { animation-delay: 0.08s; }
.ch-text > .ch-title { animation-delay: 0.18s; }
.ch-text > .ch-vision { animation-delay: 0.32s; }
.ch-text > .ch-lead { animation-delay: 0.44s; }
.ch-text > .ch-cta { animation-delay: 0.56s; }
@keyframes chRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.ch-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: clamp(22px, 2.4vw, 32px); }
.ch-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px; border-radius: 999px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ch-btn-foil {
  color: #08231C; border: 1px solid rgba(246, 227, 166, 0.5);
  background: linear-gradient(135deg, #F6E3A6 0%, #D8B24C 44%, #A67F1D 100%);
  box-shadow: 0 14px 30px rgba(216, 178, 76, 0.26);
}
.ch-btn-foil:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(216, 178, 76, 0.36); }
.ch-btn-ghost { color: #EFE6CF; border: 1px solid rgba(216, 178, 76, 0.45); background: rgba(4, 21, 15, 0.42); }
.ch-btn-ghost:hover { background: rgba(216, 178, 76, 0.18); transform: translateY(-2px); }

.ch-scroll {
  position: absolute; left: 50%; bottom: 28px; z-index: 4;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(243, 235, 216, 0.78); text-decoration: none;
  font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.06em;
  animation: chScrollIn 1s ease 1.1s both;
}
.ch-scroll-mouse {
  width: 22px; height: 34px; border: 1.5px solid rgba(246, 227, 166, 0.55);
  border-radius: 12px; position: relative;
}
.ch-scroll-mouse::after {
  content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 8px;
  margin-left: -1.5px; border-radius: 2px; background: var(--gold-500);
  animation: chScrollDot 1.5s ease-in-out infinite;
}
.ch-scroll:hover { color: #F6E3A6; }
@keyframes chScrollDot {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0; transform: translateY(10px); }
}
@keyframes chScrollIn { from { opacity: 0; } to { opacity: 1; } }

/* ---- จอกลาง / มือถือ: คอลลาจขึ้นก่อน แล้วตามด้วยข้อความ ---- */
@media (max-width: 980px) {
  .candle-hero { padding: clamp(26px, 5vw, 40px) 0 clamp(32px, 6vw, 48px); }
  .ch-grid { max-width: none; padding-left: var(--gutter); padding-right: var(--gutter); text-align: center; }
  .ch-collage { order: -1; grid-template-rows: repeat(6, clamp(34px, 8.4vw, 60px)); }
  .cg-4 { left: -3%; right: auto; bottom: -9%; width: 43%; }
  .ch-glow { right: -18%; width: 96%; }
  .ch-vision { margin-inline: auto; max-width: 36ch; }
  .ch-vision::before { left: 50%; transform: translateX(-50%); }
  .ch-lead { margin-inline: auto; max-width: 40ch; }
  .ch-cta { justify-content: center; }
}

/* ---- มือถือ: ปิดแอนิเมชันและเลเยอร์หนัก ๆ ให้เลื่อนนิ้วได้ลื่น ไม่ค้าง ---- */
@media (max-width: 900px) {
  .ch-embers, .ch-spot { display: none; }
  .ch-glow { filter: none; opacity: 0.85; }
  .ch-photo-layer, .ch-photo-layer.is-active { animation: none; transform: none; }
  .ch-foil { animation: none; background-position: 0 50%; }
  .ch-text > * { animation: none; }
  .ch-scroll { bottom: 16px; }
  .ch-scroll-label { display: none; }
  /* ยกคอลลาจขึ้นเป็นเลเยอร์ของตัวเอง วาดครั้งเดียวแล้วเลื่อนทั้งเลเยอร์ */
  .ch-collage { contain: layout paint; transform: translateZ(0); }
  .cg { animation: none; opacity: 1; transform: none; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(246, 227, 166, 0.24) inset; }
  .cg-4 { transform: rotate(-3.2deg); }
}
@media (max-width: 560px) {
  .ch-collage { grid-template-rows: repeat(6, 9.2vw); gap: 7px; }
  .cg { border-radius: 13px; }
  .cg-4 { width: 46%; left: -2%; bottom: -8%; }
  .ch-btn { padding: 13px 22px; font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cg { animation: none; opacity: 1; transform: none; }
  .cg-4 { transform: rotate(-3.2deg); }
  .ch-btn:hover { transform: none; }
  .ch-photo-layer, .ch-photo-layer.is-active, .ch-foil, .ch-text > *, .ch-scroll, .ch-scroll-mouse::after {
    animation: none;
  }
  .ch-photo-layer.is-active { transform: none; }
  .ch-text > * { opacity: 1; transform: none; }
}

/* ---- รอยต่อจากส่วนหัวลงมาสู่เนื้อหา: ไล่เฉดเขียวเข้มจางลงทีละระดับ
       จนกลืนไปกับพื้นหน้าเว็บ ไม่ให้เห็นเป็นเส้นตัดขวาง ---- */
body.home .promo-section {
  padding-top: clamp(58px, 8vw, 124px);
  margin-top: -1px;
  background: linear-gradient(180deg,
    #072019 0%,
    #072019 3%,
    rgba(9, 38, 30, 0.96) 11%,
    rgba(13, 55, 45, 0.82) 26%,
    rgba(20, 76, 63, 0.52) 44%,
    rgba(35, 104, 87, 0.24) 64%,
    rgba(60, 130, 110, 0.08) 82%,
    transparent 100%);
}

/* ===================================================================
   ยกระดับหน้าตา "หน้าเนื้อหาภายใน" (/page/<slug>)
   — โครงสร้างและเมนูทุกอย่างอยู่ที่เดิม ปรับเฉพาะงานออกแบบ
   — บล็อกนี้วางไว้ท้ายไฟล์เพื่อทับกฎเดิม ถ้าจะย้อนกลับ ลบทั้งบล็อกได้เลย
   =================================================================== */

/* ---------- แถบหัวเรื่อง: ไล่เฉดเขียวมรกต + แสงทอง + ลายน้ำตราวิทยาลัย ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(40px, 4.2vw, 66px) 0 clamp(34px, 3.2vw, 50px);
  border-bottom: none;
  background:
    radial-gradient(68% 150% at 86% 16%, rgba(255, 190, 84, 0.20), transparent 62%),
    radial-gradient(62% 130% at 2% 96%, rgba(24, 102, 84, 0.60), transparent 72%),
    linear-gradient(135deg, #0F4439 0%, #0B3129 50%, #082621 100%);
}
/* ลายน้ำตราวิทยาลัยจาง ๆ มุมขวา */
.page-hero::before {
  content: '';
  position: absolute; right: -3%; top: 50%; transform: translateY(-50%);
  width: clamp(200px, 22vw, 330px); aspect-ratio: 1;
  background: url('/images/logo/logockr.png') center / contain no-repeat;
  opacity: 0.09; pointer-events: none;
}
/* เส้นทองไล่เฉดที่ขอบล่าง แทนเส้นทึบเดิม */
.page-hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, rgba(216, 178, 76, 0) 0%, #C59B27 16%, #F6E3A6 50%, #C59B27 84%, rgba(216, 178, 76, 0) 100%);
}
.page-hero > .wrap { position: relative; z-index: 1; }
.page-hero .page-title {
  font-family: var(--font-display);
  font-weight: 600; letter-spacing: -0.01em;
  text-shadow: 0 6px 26px rgba(2, 12, 9, 0.45);
}
.page-hero .gold-rule {
  width: 92px; height: 4px; border-radius: 3px;
  background: linear-gradient(90deg, #F6E3A6, #D8B24C 45%, rgba(166, 127, 29, 0));
  box-shadow: 0 2px 12px rgba(216, 178, 76, 0.45);
}

/* เส้นทางหน้าเว็บ: ทำเป็นแถบโปร่งอ่านง่ายขึ้น */
.page-hero .breadcrumb {
  gap: 8px; margin-bottom: 18px;
  font-size: 0.84rem;
}
.page-hero .breadcrumb a {
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(246, 227, 166, 0.22);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.page-hero .breadcrumb a:hover {
  background: rgba(216, 178, 76, 0.22); border-color: rgba(246, 227, 166, 0.6);
  color: var(--gold-100); text-decoration: none;
}
.page-hero .breadcrumb .crumb-group { opacity: 0.85; }
.page-hero .breadcrumb .crumb-current {
  padding: 4px 12px; border-radius: 999px;
  background: rgba(216, 178, 76, 0.16);
  border: 1px solid rgba(246, 227, 166, 0.3);
}

/* ---------- ตัวเนื้อหา: ไล่เฉดจากหัวเรื่องลงมาให้กลืน ---------- */
.page-body {
  position: relative;
  padding: clamp(38px, 4vw, 62px) 0 clamp(56px, 6vw, 96px);
  background: linear-gradient(180deg, rgba(11, 49, 41, 0.10) 0%, rgba(11, 49, 41, 0.04) 14%, transparent 32%);
}

/* ---------- การ์ดเนื้อหา ---------- */
.page-content {
  position: relative;
  border-radius: 26px;
  border: 1px solid rgba(216, 178, 76, 0.26);
  padding: clamp(34px, 3.2vw, 58px) clamp(24px, 3.4vw, 60px);
  box-shadow: 0 28px 64px rgba(8, 38, 33, 0.11), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
/* แถบทองบางด้านบนการ์ด */
.page-content::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0; height: 4px;
  border-radius: 26px 26px 0 0; pointer-events: none;
  background: linear-gradient(90deg, #C59B27, #F6E3A6 38%, #D8B24C 68%, #A67F1D 100%);
}

/* หัวข้อ: แท่งทองไล่เฉดแทนเส้นทึบ */
.page-content h2 {
  position: relative;
  border-left: none; padding-left: 22px;
  font-size: clamp(1.32rem, 1.7vw, 1.62rem); letter-spacing: -0.01em;
  margin: clamp(34px, 3.4vw, 48px) 0 18px;
}
.page-content h2::before {
  content: '';
  position: absolute; left: 0; top: 0.16em; bottom: 0.16em; width: 6px; border-radius: 4px;
  background: linear-gradient(180deg, #F6E3A6, #D8B24C 45%, #A67F1D);
  box-shadow: 0 3px 10px rgba(216, 178, 76, 0.5);
}
.page-content > h3 {
  position: relative; padding-left: 18px;
  color: var(--ink-title-2); font-weight: 600;
}
.page-content > h3::before {
  content: '';
  position: absolute; left: 0; top: 0.62em; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-600); box-shadow: 0 0 0 3px rgba(216, 178, 76, 0.18);
}

/* ---------- กล่องคำคม (ปรัชญา) ---------- */
.quote-block {
  position: relative;
  border-left: none; border-radius: 22px;
  border: 1px solid rgba(216, 178, 76, 0.28);
  background: linear-gradient(135deg, #F3F9F7 0%, #E9F2EF 52%, #FBF6E7 100%);
  padding: clamp(26px, 2.6vw, 36px) clamp(24px, 3vw, 40px) clamp(26px, 2.6vw, 36px) clamp(46px, 4.6vw, 70px);
  box-shadow: 0 14px 34px rgba(8, 38, 33, 0.07);
  line-height: 1.9;
}
.quote-block::before {
  content: '\201C';
  position: absolute; left: clamp(14px, 1.5vw, 22px); top: 2px;
  font-family: Georgia, 'Times New Roman', serif; font-size: clamp(56px, 6vw, 84px); line-height: 1;
  color: rgba(197, 155, 39, 0.38); pointer-events: none;
}

/* ---------- ปณิธาน ---------- */
.motto {
  position: relative;
  border: none; border-radius: 22px;
  background: linear-gradient(135deg, #FDF9EC 0%, #F7EFCB 52%, #FCF7E8 100%);
  box-shadow: 0 16px 38px rgba(197, 155, 39, 0.18), 0 0 0 1px rgba(216, 178, 76, 0.45) inset;
  padding: clamp(30px, 3vw, 42px) clamp(22px, 2.6vw, 34px) clamp(26px, 2.6vw, 34px);
  font-weight: 500; letter-spacing: 0.01em; line-height: 1.6;
}
.motto::before {
  content: '\25C6 \25C6 \25C6';
  position: absolute; left: 0; right: 0; top: clamp(12px, 1.2vw, 16px);
  text-align: center; font-size: 0.6rem; letter-spacing: 0.8em;
  color: rgba(166, 127, 29, 0.55);
}

/* ---------- วิสัยทัศน์: ทำเป็นแผ่นป้ายเข้ม ให้เด่นออกมา ---------- */
.vision-text {
  position: relative; overflow: hidden;
  margin: 0 0 22px;
  padding: clamp(24px, 2.6vw, 34px) clamp(26px, 3vw, 40px);
  border-radius: 22px;
  color: #F7EFCB;
  background:
    radial-gradient(58% 120% at 84% 12%, rgba(255, 186, 76, 0.20), transparent 66%),
    linear-gradient(135deg, #0F4439 0%, #0B3129 58%, #082621 100%);
  box-shadow: 0 20px 44px rgba(8, 38, 33, 0.24);
  font-size: clamp(1.06rem, 1.3vw, 1.32rem); line-height: 1.7;
}
.vision-text::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, #F6E3A6, #D8B24C 50%, #A67F1D);
}

/* ---------- นิยาม ---------- */
.def-list { display: grid; gap: 6px; }
.def-list dt {
  font-size: 1.02rem; color: var(--ink-title); margin-top: 20px;
}
.def-list dd {
  margin: 10px 0 0; padding: 15px 20px;
  border-left: 3px solid var(--gold-500);
  background: linear-gradient(135deg, var(--teal-050), rgba(251, 246, 231, 0.7));
  border-radius: 0 16px 16px 0;
  color: var(--ink-700);
}

/* ---------- พันธกิจ ---------- */
.mission-list { gap: 16px; }
.mission-list > li {
  border-radius: 20px; padding: 20px 26px;
  border: 1px solid rgba(216, 178, 76, 0.22);
  background: linear-gradient(135deg, #FFFFFF 0%, #F6FAF9 100%);
  box-shadow: 0 8px 22px rgba(8, 38, 33, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.mission-list > li:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(8, 38, 33, 0.13);
  border-color: rgba(216, 178, 76, 0.6);
}
.mission-no {
  background: linear-gradient(145deg, #17655A 0%, #0D3B35 70%);
  color: #F7EFCB; font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(8, 38, 33, 0.3), 0 0 0 3px rgba(216, 178, 76, 0.28);
}
.mission-link {
  padding: 7px 16px; border-radius: 999px;
  border: 1px solid rgba(216, 178, 76, 0.45);
  background: rgba(251, 246, 231, 0.8);
  color: var(--gold-700); font-weight: 500;
  transition: all 0.18s ease;
}
.mission-link:hover {
  background: var(--gold-600); color: var(--teal-950);
  border-color: var(--gold-600); text-decoration: none;
  box-shadow: 0 8px 18px rgba(197, 155, 39, 0.35);
}

/* ---------- ปุ่มท้ายบทความ ---------- */
.page-links {
  margin-top: clamp(34px, 3.4vw, 48px); padding-top: 28px;
  border-top: 1px solid rgba(216, 178, 76, 0.28);
}
.page-links .btn-gold {
  background: linear-gradient(135deg, #F6E3A6 0%, #D8B24C 44%, #A67F1D 100%);
  color: var(--teal-950); border-color: rgba(246, 227, 166, 0.6);
}

/* ---------- ไทม์ไลน์ประวัติ ---------- */
.page-content .timeline > li::before {
  background: linear-gradient(145deg, #F6E3A6, #C59B27);
  box-shadow: 0 0 0 2px rgba(216, 178, 76, 0.55), 0 3px 8px rgba(197, 155, 39, 0.35);
}
.page-content .tl-year {
  background: linear-gradient(135deg, #FBF6E7, #F7EFCB);
  border: 1px solid rgba(216, 178, 76, 0.45);
  box-shadow: 0 3px 10px rgba(197, 155, 39, 0.16);
}

/* ---------- การ์ดค่านิยม / การ์ดลิงก์ ---------- */
.page-content .value-card,
.page-content .info-card {
  border-radius: 20px;
  border-color: rgba(216, 178, 76, 0.22);
  box-shadow: 0 8px 22px rgba(8, 38, 33, 0.05);
}
.page-content .value-card:hover,
.page-content .info-card:hover {
  box-shadow: 0 18px 38px rgba(8, 38, 33, 0.13);
  border-color: rgba(216, 178, 76, 0.6);
}
.page-content .value-letter {
  background: linear-gradient(145deg, #17655A 0%, #0D3B35 70%);
  box-shadow: 0 6px 16px rgba(8, 38, 33, 0.3), 0 0 0 3px rgba(216, 178, 76, 0.26);
}

/* ---------- เมนูข้าง + การ์ดด้านขวา ---------- */
.page-side .sidebar-card {
  border-radius: 22px;
  border-color: rgba(216, 178, 76, 0.24);
  box-shadow: 0 18px 42px rgba(8, 38, 33, 0.09);
}
.page-side .sidebar-title {
  position: relative;
  padding: 15px 20px;
  border-bottom: none;
  background:
    radial-gradient(70% 160% at 88% 10%, rgba(255, 190, 84, 0.18), transparent 66%),
    linear-gradient(135deg, #0F4439 0%, #0B3129 70%);
  letter-spacing: 0.01em;
}
.page-side .sidebar-title::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, #C59B27, #F6E3A6 42%, #A67F1D 100%);
}
/* เมนูข้างแบบทางการ: ข้อความล้วน เส้นคั่นบาง ลูกศรเล็กด้านขวา หน้าปัจจุบันมีแถบทองด้านซ้าย */
.page-side .quick-link-list { padding: 6px 0; }
.page-side .quick-link-list li { border-bottom: 1px solid var(--border); }
.page-side .quick-link-list li:last-child { border-bottom: none; }
.page-side .quick-link-list a {
  /* block (ไม่ใช่ flex) — ข้อความบางรายการมี <span class="keep-name"> ข้างใน ถ้าเป็น flex จะถูกแยกเป็นคอลัมน์ */
  position: relative; display: block;
  padding: 13px 44px 13px 22px; border-radius: 0;
  color: var(--ink-700); font-size: 0.93rem; line-height: 1.5;
  transition: background 0.18s ease, color 0.18s ease;
}
.page-side .quick-link-list a::before {
  content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  margin: 0; border-radius: 0 3px 3px 0; background: var(--gold-600);
  transform: scaleY(0); transition: transform 0.2s ease;
}
.page-side .quick-link-list a::after {
  content: ''; position: absolute; right: 22px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-top: 1.6px solid currentColor; border-right: 1.6px solid currentColor;
  transform: rotate(45deg); opacity: 0.3; transition: opacity 0.18s ease, transform 0.18s ease;
}
.page-side .quick-link-list a:hover { padding-left: 22px; background: var(--teal-050); color: var(--ink-title-2); }
.page-side .quick-link-list a:hover::after { opacity: 0.75; transform: translateX(3px) rotate(45deg); }.page-side .quick-link-list a.is-active {
  padding-left: 22px; border-right: none; box-shadow: none;
  background: linear-gradient(90deg, var(--gold-050), transparent 85%);
  color: var(--ink-title-2); font-weight: 600;
}
.page-side .quick-link-list a.is-active::before { transform: scaleY(1); }
.page-side .quick-link-list a.is-active::after { opacity: 0.6; }
/* ในเมนูข้าง ข้อความต้องไหลต่อกันเป็นประโยคเดียว — ไม่บังคับให้ชื่อหน่วยงานขึ้นบรรทัดใหม่ทั้งก้อน */
.page-side .quick-link-list .keep-name-long { white-space: normal; }
/* หน้า ITA: แถบข้างยาวเกินจอ ไม่ตรึงไว้ ให้เลื่อนไปพร้อมหน้า (เห็นเมนูด้านล่างได้ทันทีที่เลื่อนลง) */
.page-side:has(.side-integrity) { position: static; }
/* หน้า ITA: ช่องทางการติดต่อ / ข้อร้องเรียน ในแถบข้าง — ไอคอนหน้าข้อความ บรรทัดที่สองเยื้องตรงกับข้อความ */
.page-side .side-integrity .quick-link-list a { display: flex; align-items: flex-start; gap: 10px; }
.page-side .side-integrity .ib-icon { width: 1.4em; font-size: 1rem; line-height: 1.5; }

/* การ์ดติดต่อวิทยาลัย: ไอคอนเส้นในกรอบวงกลม + ข้อความ */
.side-contact-list { list-style: none; margin: 0; padding: 8px 20px 14px; }
.side-contact-list li {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
  font-size: 0.9rem; line-height: 1.55; color: var(--ink-700);
}
.side-contact-list li + li { border-top: 1px solid var(--border); }
.side-contact-list .sc-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; margin-top: -3px;
  background: var(--teal-050); color: var(--teal-700); font-size: 0.95rem;
}
.side-contact-list .sc-ico svg { width: 16px; height: 16px; }
.side-contact-list a { color: var(--teal-700); text-decoration: none; }
.side-contact-list a:hover { color: var(--gold-700); text-decoration: underline; }

/* ประกาศ "หน้านี้อยู่ระหว่างการปรับปรุง" — ใช้ซ้ำได้ทุกหน้า: <div class="page-wip" role="status"> */
.page-wip {
  display: flex; align-items: flex-start; gap: 20px;
  margin: 0 0 32px; padding: 26px 28px;
  background: linear-gradient(135deg, var(--gold-050), var(--white) 70%);
  border: 1px solid rgba(216, 178, 76, 0.45); border-left: 4px solid var(--gold-600);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.page-wip-ico {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--teal-800); color: var(--gold-100); font-size: 1.5rem;
}
.page-wip-ico svg { width: 26px; height: 26px; }
.page-content .page-wip h2 { margin: 2px 0 8px; padding: 0; border: 0; font-size: 1.22rem; color: var(--ink-title-2); }
.page-content .page-wip h2::before, .page-content .page-wip h2::after { content: none; }
.page-wip p { margin: 0; color: var(--ink-600); line-height: 1.75; }
.page-wip-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.page-wip-actions .btn { padding: 10px 22px; font-size: 0.92rem; }
.btn-line { border-color: var(--teal-700); color: var(--teal-700); background: transparent; }
.btn-line:hover { background: var(--teal-050); transform: translateY(-2px); }
@media (max-width: 560px) {
  .page-wip { flex-direction: column; gap: 14px; padding: 22px 20px; }
}

/* การ์ด Facebook ในหน้าย่อย: พื้นขาวแบบเดียวกับหน้าแรก (สีแบรนด์อยู่ที่วงกลมไอคอน — ดู .fb-card ในบล็อกรอบ A) */
.page-side .fb-card { border-radius: 20px; }

.page-side .cta-card {
  position: relative; overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #F6E3A6 0%, #D8B24C 48%, #C08F1F 100%);
  box-shadow: 0 18px 42px rgba(197, 155, 39, 0.32);
}
.page-side .cta-card::before {
  content: '';
  position: absolute; inset: 7px; border-radius: 17px; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
}
.page-side .cta-card h4,
.page-side .cta-card p { position: relative; }
.page-side .cta-card .btn {
  position: relative;
  background: linear-gradient(135deg, #0F4439, #082621 70%);
  box-shadow: 0 10px 24px rgba(8, 38, 33, 0.28);
}
.page-side .cta-card .btn:hover { background: linear-gradient(135deg, #17655A, #0D3B35 70%); }

/* ---------- จอแคบ ---------- */
@media (max-width: 1100px) {
  .page-hero::before { opacity: 0.06; right: -12%; }
}
@media (max-width: 640px) {
  .page-hero::before { display: none; }
  .page-content { border-radius: 20px; }
  .page-content::before { border-radius: 20px 20px 0 0; }
  .quote-block { border-radius: 18px; padding-left: 42px; }
  .quote-block::before { font-size: 48px; left: 12px; }
  .mission-list > li { border-radius: 16px; padding: 16px 18px; }
  .page-side .sidebar-card { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .mission-list > li:hover,
  .page-content .value-card:hover,
  .page-content .info-card:hover { transform: none; }
}

/* กฎเดิม .page-content p (สองคลาส) แรงกว่า .vision-text / .motto (คลาสเดียว)
   จึงต้องระบุ .page-content นำหน้า ไม่งั้นสีตัวอักษรจะโดนทับจนอ่านไม่ออก */
.page-content .vision-text { color: #F7EFCB; }
.page-content .motto { color: var(--ink-title-2); }

/* ===================================================================
   ชื่อวิทยาลัย / คณะ / กระทรวง อยู่บรรทัดเดียว ไม่ตัดกลางชื่อ
   <span class="keep-name"> ถูกใส่ให้อัตโนมัติจาก main.js (initKeepNames)
   keep-name-wrap = ชื่อยาวกว่ากล่องทั้งกล่อง ยอมให้ตัดบรรทัดแทนการล้นจอ
   =================================================================== */
.keep-name { white-space: nowrap; }
.keep-name.keep-name-wrap { white-space: normal; }

/* ชื่อท้ายเว็บ: ขนาดตัวอักษรตามความกว้างคอลัมน์ ช่องแคบก็ยังอยู่บรรทัดเดียว */
.footer-col:first-child { container-type: inline-size; }
.footer-brand strong { white-space: nowrap; font-size: clamp(0.9rem, calc((100cqw - 74px) / 16), 1.1rem); }
@container (max-width: 330px) {
  .footer-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-brand strong { font-size: clamp(0.8rem, calc(100cqw / 16), 1.1rem); }
  .footer-col p { font-size: 0.82rem; }
}

/* หัวเว็บบนมือถือ (ภาษาไทย): ชื่อเต็มบรรทัดเดียว ย่อตัวอักษรตามความกว้างจอ
   จอเล็กกว่า 350px ยังยอมให้ขึ้นสองบรรทัด ไม่งั้นตัวหนังสือเล็กเกินอ่าน */
@media (min-width: 350px) and (max-width: 640px) {
  .brand { gap: 8px; }
  .brand-logo { width: 40px !important; height: 40px !important; }
  .header-actions .btn { padding: 8px 11px !important; font-size: 0.78rem !important; }
  :root[lang="th"] .brand-text strong {
    white-space: nowrap; line-height: 1.3;
    font-size: clamp(0.72rem, calc((100vw - 168px) / 15.8), 0.98rem);
  }
}

/* ===================================================================
   ค่อย ๆ ปรากฏเมื่อเลื่อนมาถึง — main.js (initReveal) ใส่ .reveal ให้เอง
   ปรากฏครบแล้วคลาสจะถูกถอดออก การ์ดจึงกลับไปใช้เอฟเฟกต์ hover ตามปกติ
   ผู้ใช้ที่ตั้ง "ลดการเคลื่อนไหว" ในเครื่องจะไม่เห็นแอนิเมชันเลย
   =================================================================== */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal .gold-rule { width: 0; }
.reveal.is-visible .gold-rule { width: 72px; transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s; }
@media print { .reveal { opacity: 1; transform: none; } .reveal .gold-rule { width: 72px; } }

/* การ์ดลอยขึ้นเล็กน้อยเมื่อเอาเมาส์ชี้ */
.sidebar-card, .media-card, .program-card, .info-card, .staff-card, .value-card, .ext-card, .unit-card, .exec-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sidebar-card:hover, .media-card:hover, .program-card:hover, .info-card:hover, .staff-card:hover,
.value-card:hover, .ext-card:hover, .unit-card:hover, .exec-card:hover {
  transform: translateY(-4px); box-shadow: 0 20px 44px rgba(8, 38, 33, 0.13);
}
@media (prefers-reduced-motion: reduce) {
  .sidebar-card:hover, .media-card:hover, .program-card:hover, .info-card:hover, .staff-card:hover,
  .value-card:hover, .ext-card:hover, .unit-card:hover, .exec-card:hover { transform: none; }
}

/* ข้อความหลายบรรทัดไม่ให้เหลือคำสั้น ๆ ค้างบรรทัดสุดท้าย (เช่น "…พันธ / กิจ") */
.quick-link-list a, .service-list a, .sys-banner, .news-title, .section-title, .hb-title { text-wrap: pretty; }

/* การ์ดผู้อำนวยการหน้าแรก: สลับรูปแบบค่อย ๆ จางเข้า-ออก (main.js -> initDirectorSlides)
   รูปแรก (.is-active) แสดงอยู่เสมอเมื่อไม่มี JavaScript หรือผู้ใช้ตั้ง "ลดการเคลื่อนไหว" */
.director-slides { position: relative; }
.director-slides .director-mini-img {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
}
.director-slides .director-mini-img.is-active { opacity: 1; }
.director-slides-dots { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: 7px; z-index: 2; }
.director-slides-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); box-shadow: 0 0 0 1px rgba(8, 38, 33, 0.25); transition: background 0.3s, transform 0.3s; }
.director-slides-dots span.is-active { background: #fff; transform: scale(1.25); }
@media (prefers-reduced-motion: reduce) { .director-slides .director-mini-img { transition: none; } }

.director-slides-arrow { position: absolute; top: 45%; transform: translateY(-50%); z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.85); color: #0f5c4d; font-size: 26px; line-height: 1; padding: 0 0 3px; cursor: pointer; box-shadow: 0 2px 8px rgba(8, 38, 33, 0.3); opacity: 0.85; transition: opacity 0.2s, background 0.2s; }
.director-slides-arrow:hover, .director-slides-arrow:focus-visible { opacity: 1; background: #fff; }
.director-slides-arrow.is-prev { left: 8px; }
.director-slides-arrow.is-next { right: 8px; }

/* ===================================================================
   ลูกเล่นภาพ — แถบความคืบหน้า ปุ่มกลับขึ้นบน การ์ด/ข่าว และหน้าเนื้อหา
   ปิดทั้งหมดเมื่อผู้ใช้ตั้ง "ลดการเคลื่อนไหว"
   =================================================================== */
::selection { background: var(--gold-100); color: var(--teal-950); }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 400;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--gold-500), var(--gold-600), #F7EFCB);
  pointer-events: none;
}

.mega-nav.is-compact { box-shadow: 0 10px 28px rgba(8, 38, 33, 0.28); }
.mega-nav.is-compact::after { opacity: 0.45; }
.mega-link { position: relative; }
.mega-item:not(.mega-item-home) .mega-link::after {
  content: ''; position: absolute; left: 20px; right: 8px; bottom: 8px; height: 2px;
  border-radius: 2px; background: var(--gold-500);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mega-item:hover .mega-link::after,
.mega-item.open .mega-link::after { transform: scaleX(1); }

.hb-thumb img { transition: transform 0.7s ease; }
.hb-thumb:hover img { transform: scale(1.03); }

.program-visual.has-photo .program-photo { transition: transform 1.1s ease; }
.program-card:hover .program-visual.has-photo .program-photo { transform: scale(1.07); }

.news-item {
  animation: newsIn 0.42s ease both;
  border-left: 3px solid transparent;
}
.news-item:nth-child(1) { animation-delay: 0.02s; }
.news-item:nth-child(2) { animation-delay: 0.06s; }
.news-item:nth-child(3) { animation-delay: 0.10s; }
.news-item:nth-child(4) { animation-delay: 0.14s; }
.news-item:nth-child(5) { animation-delay: 0.18s; }
.news-item:nth-child(6) { animation-delay: 0.22s; }
.news-item:nth-child(7) { animation-delay: 0.26s; }
@keyframes newsIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.news-item:hover { border-left-color: var(--gold-500); }
.news-badge-new { animation: badgePulse 1.8s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 178, 76, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(216, 178, 76, 0); }
}

.cta-card { position: relative; overflow: hidden; }
.cta-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: ctaShine 4.5s ease-in-out infinite;
}
@keyframes ctaShine {
  0%, 55% { transform: translateX(-120%); }
  80%, 100% { transform: translateX(120%); }
}

.page-hero {
  position: relative;
  background:
    radial-gradient(circle at 88% 0%, rgba(216, 178, 76, 0.22), transparent 42%),
    linear-gradient(135deg, var(--teal-950), var(--teal-800));
  overflow: hidden;
  border-bottom: 0;
}
.page-hero::before {
  content: ''; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-500), var(--gold-100), var(--gold-500), transparent);
}

.lift-top {
  position: fixed; right: 22px; bottom: 28px; z-index: 120;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--teal-800); color: var(--on-brand); text-decoration: none;
  border: 1px solid rgba(216, 178, 76, 0.55);
  box-shadow: 0 12px 28px rgba(8, 38, 33, 0.28);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}
.lift-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
.lift-top:hover { background: var(--gold-500); color: var(--teal-950); }

.brand-logo { transition: transform 0.35s ease; }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.04); }

@media (max-width: 980px) {
  .mega-item:not(.mega-item-home) .mega-link::after { display: none; }
  .lift-top { right: 14px; bottom: 18px; width: 44px; height: 44px; }
}
@media (hover: none) {
  .hb-thumb:hover img, .program-card:hover .program-visual.has-photo .program-photo { transform: none; }
  .cta-card::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress, .news-item, .news-badge-new, .cta-card::after, .ch-scroll { animation: none; }
  .news-item { opacity: 1; transform: none; }
  .hb-thumb img, .program-visual.has-photo .program-photo, .brand-logo { transition: none; }
  .brand:hover .brand-logo { transform: none; }
}

/* ===================================================================
   การ์ดวิทยาลัยพยาบาลคุณธรรม (หน้าแรก คอลัมน์กลาง — เต็มความกว้าง)
   + กล่อง "ช่องทางการติดต่อ / ข้อร้องเรียน" (.ib-complaint) — หน้าแรกอยู่คอลัมน์ขวาใต้ CKR Connect
     และใช้ซ้ำในแถบข้างของหน้า ITA · รายการ #menuIntegrity แก้ได้ที่ /admin
   =================================================================== */
.integrity-board { display: block; }
/* การ์ดวิทยาลัยพยาบาลคุณธรรม — ดูบล็อก "การ์ดวิทยาลัยพยาบาลคุณธรรม (ออกแบบใหม่)" ท้ายไฟล์ */
.ib-complaint {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(8, 38, 33, 0.075); overflow: hidden;
}
.ib-title {
  margin: 0; padding: 13px 20px; font-size: 1.02rem;
  background: var(--teal-900); color: var(--on-brand); border-bottom: 3px solid var(--gold-500);
}
.ib-list { list-style: none; margin: 0; padding: 8px 10px 10px; }
.ib-list li + li { border-top: 1px dashed var(--border); }
.ib-list a {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--ink-title-2); text-decoration: none; font-size: 0.93rem; line-height: 1.45;
}
.ib-list a:hover { background: var(--teal-050); color: var(--ink-title); }
.ib-icon { flex: 0 0 auto; width: 1.5em; text-align: center; font-size: 1.05rem; line-height: 1.4; }
/* คอลัมน์ขวาของหน้าแรกแคบกว่า — ตัวอักษรเล็กลงนิดให้แต่ละรายการไม่ยาวเกิน 2 บรรทัด */
.col-right .ib-list a { font-size: 0.9rem; padding: 9px 8px; }

/* ===================================================================
   หน้าโครงสร้างองค์กร (content/pages/org-structure.html) — ผังฝังจาก Canva
   ผังเป็นสัดส่วน 16:9 · หน้าที่มีผังจะใช้ความกว้างเต็ม ย้ายเมนูข้างไปไว้ใต้ผัง
   =================================================================== */
.page-layout:has(.canva-board) { grid-template-columns: 1fr; }
.page-layout:has(.canva-board) .page-side { position: static; flex-direction: row; flex-wrap: wrap; }
.page-layout:has(.canva-board) .page-side > * { flex: 1 1 280px; }
.page-content:has(.canva-board) { padding: 28px; }

.canva-frame {
  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-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.canva-help {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin: 18px 0 0;
}
.canva-help-tip { font-size: 0.92rem; color: var(--ink-600); }

@media (max-width: 640px) {
  .page-content:has(.canva-board) { padding: 16px; }
  .canva-help { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ===================================================================
   วิดีโอพื้นหลังส่วนหัว — ซ้อนบนภาพนิ่ง จางเข้ามาเมื่อเล่นได้จริง (initHeroVideo ใน main.js)
   =================================================================== */
.ch-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%;
  opacity: 0; transition: opacity 1.4s ease; pointer-events: none;
  filter: saturate(1.05) contrast(1.02);
}
.candle-hero.has-video .ch-video { opacity: 1; }
/* ช่วงธีมวันพยาบาล: วิดีโอหรี่ลงเป็นฉากหลังนุ่ม ๆ ให้ตะเกียงเป็นจุดเด่น */
html.fest-nursesday .candle-hero.has-video .ch-video { opacity: 1; }
@media (max-width: 900px) { .ch-video { display: none; } }

/* ===================================================================
   ธีมวันพยาบาลแห่งชาติ (html.fest-nursesday — ดูสคริปต์ใน <head>)
   .fest-only = แสดงเฉพาะช่วงธีม / .fest-hide = ซ่อนช่วงธีม
   =================================================================== */
html:not(.fest-nursesday) .fest-only { display: none !important; }
html.fest-nursesday .fest-hide { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* พระนามห้ามตัดขึ้นบรรทัดใหม่กลางคำ */
html:lang(th) .fest-ribbon .nw, html:lang(th) .fest-body .nw { white-space: nowrap; }

/* แถบริบบิ้นบนสุด (ทุกหน้า) */
.fest-ribbon {
  position: relative; overflow: hidden; color: #FBF1D0;
  background: linear-gradient(90deg, #04150F 0%, #0D3B35 35%, #0D3B35 65%, #04150F 100%);
  border-bottom: 1px solid rgba(216, 178, 76, 0.55);
}
.fest-ribbon::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px 60px at 50% 50%, rgba(255, 200, 110, 0.22), transparent 70%);
}
.fest-ribbon-inner { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding-top: 7px; padding-bottom: 7px; }
.fest-ribbon-lamp { width: 44px; height: 30px; flex: 0 0 auto; filter: drop-shadow(0 0 6px rgba(255, 190, 90, 0.55)); }
.fest-ribbon-text { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 14px; row-gap: 0; line-height: 1.45; text-align: center; }
.fest-ribbon-text strong { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em; color: #F6E3A6; }
.fest-ribbon-text span { font-size: 0.86rem; color: rgba(251, 241, 208, 0.82); }
@media (max-width: 640px) {
  .fest-ribbon-lamp { width: 36px; height: 24px; }
  .fest-ribbon-text strong { font-size: 0.88rem; }
  .fest-ribbon-text span { font-size: 0.76rem; }
}

/* ตะเกียงเรืองแสงในส่วนหัว (จอกว้าง) */
.ch-lamp {
  position: absolute; z-index: 2; pointer-events: none;
  right: clamp(16px, 5vw, 96px); top: 30%; width: clamp(220px, 24vw, 360px);
  transform: translateY(-46%);
  animation: chLampFloat 7s ease-in-out infinite;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 28px rgba(255, 190, 90, 0.18));
}
/* เงามืดนุ่ม ๆ หลังตะเกียง ให้ตะเกียงเด่นขึ้นจากภาพ/วิดีโอด้านหลัง */
.ch-lamp::before {
  content: ''; position: absolute; inset: -38% -26%; z-index: -1;
  background: radial-gradient(closest-side, rgba(4, 21, 15, 0.9), rgba(4, 21, 15, 0.55) 55%, transparent 100%);
}
.ch-lamp svg { display: block; width: 100%; height: auto; overflow: visible; }
.ch-lamp-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: chFlicker 2.4s ease-in-out infinite; }
.ch-lamp-glow { transform-box: fill-box; transform-origin: 50% 50%; animation: chGlow 3.2s ease-in-out infinite; }
@keyframes chLampFloat { 0%, 100% { transform: translateY(-46%); } 50% { transform: translateY(-50%); } }
@keyframes chFlicker {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  20% { transform: scale(0.96, 1.05) skewX(-2deg); }
  45% { transform: scale(1.03, 0.95) skewX(2deg); }
  70% { transform: scale(0.98, 1.07) skewX(-1deg); }
}
@keyframes chGlow { 0%, 100% { opacity: 0.85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.12); } }
@media (max-width: 1100px) { .ch-lamp { width: 200px; right: 16px; } }
@media (max-width: 900px) { .ch-lamp { display: none !important; } }
html.fest-nursesday .ch-eyebrow { font-family: var(--font-display); font-style: normal; letter-spacing: 0.02em; color: #F6E3A6; }

/* แถบรำลึกวันพยาบาล (ต่อจากส่วนหัว) */
.fest-tribute {
  position: relative; overflow: hidden; color: #EFE6CF;
  background:
    radial-gradient(700px 360px at 85% 30%, rgba(255, 190, 90, 0.14), transparent 70%),
    linear-gradient(180deg, #072019 0%, #0B2D26 100%);
  padding: clamp(40px, 5vw, 72px) 0 clamp(44px, 5vw, 80px);
  border-bottom: 1px solid rgba(216, 178, 76, 0.3);
}
.fest-tribute-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.fest-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-family: var(--font-display); font-weight: 600; color: #E7C566; letter-spacing: 0.02em; }
.fest-kicker svg { width: 42px; height: 28px; flex: 0 0 auto; filter: drop-shadow(0 0 6px rgba(255, 190, 90, 0.5)); }
.fest-title {
  margin: 0 0 16px; font-family: 'Noto Serif Thai', var(--font-display), serif; font-weight: 700;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem); line-height: 1.4; padding: 0.1em 0;
  background: linear-gradient(110deg, #FBF0C8 0%, #E7C566 35%, #FFF6D4 55%, #C9A035 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fest-body { margin: 0 0 24px; color: rgba(239, 230, 207, 0.86); line-height: 1.8; max-width: 34em; }
.fest-photos { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; aspect-ratio: 16 / 10; }
.fest-photo { position: relative; margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid rgba(216, 178, 76, 0.35); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); }
.fest-photo.is-main { grid-row: 1 / 3; }
.fest-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.2s ease; }
.fest-photo:hover img { transform: scale(1.05); }
.fest-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px;
  font-family: var(--font-display); font-size: 0.85rem; color: #FBF1D0;
  background: linear-gradient(0deg, rgba(4, 21, 15, 0.85), transparent);
}
@media (max-width: 900px) {
  .fest-tribute-inner { grid-template-columns: 1fr; }
  .fest-photos { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) {
  .fest-photos { grid-template-columns: 1fr 1fr; grid-template-rows: 1.4fr 1fr; aspect-ratio: 3 / 4; }
  .fest-photo.is-main { grid-row: auto; grid-column: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-lamp, .ch-lamp-flame, .ch-lamp-glow { animation: none; }
  .fest-photo img { transition: none; }
}

/* ===================================================================
   เปลี่ยนหน้าแบบลื่น (View Transitions ข้ามหน้า)
   1) ทั่วไป: เส้นทองเฉียงกวาดเปิดหน้าใหม่จากซ้ายไปขวา หน้าเดิมหรี่ลงเล็กน้อย
      (เส้นทอง = พื้นของ image-pair ที่โผล่ตรงรอยต่อ — หน้าเดิมกับหน้าใหม่ถูกตัดขอบห่างกัน 10px)
   2) กดย้อนกลับ (vt-back): กวาดจากขวาไปซ้าย
   3) กดเมนูข้างไปหน้าในหมวดเดียวกัน (vt-sib): หน้านิ่ง เปลี่ยนเฉพาะหัวเรื่องกับเนื้อหา
      แถบไฮไลต์ในเมนูข้างเลื่อนไปหาหน้าที่เลือก · vt-up = หน้าใหม่อยู่เหนือหน้าเดิมในเมนู เนื้อหาเข้าจากด้านบน
   คลาส vt-* บน <html> ใส่โดย public/js/vt-nav.js · แถบเมนูล่างบนมือถือค้างอยู่กับที่ (app-tabbar)
   เบราว์เซอร์ที่ยังไม่รองรับ = เปลี่ยนหน้าแบบปกติ · ผู้ใช้ที่ตั้ง "ลดการเคลื่อนไหว" = ไม่มีแอนิเมชัน
   =================================================================== */
@view-transition { navigation: auto; }
:root { --vt-sweep: 0.7s; --vt-ease: cubic-bezier(0.72, 0, 0.28, 1); }
@media (max-width: 640px) { :root { --vt-sweep: 0.54s; } }

::view-transition-image-pair(root) {
  background: linear-gradient(100deg, #9C7616 0%, #E9C766 30%, #FFF3CC 50%, #E2BD59 70%, #A67F1D 100%);
}
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: vtSweepOld var(--vt-sweep) var(--vt-ease) both; }
::view-transition-new(root) { animation: vtSweepNew var(--vt-sweep) var(--vt-ease) both; }
html.vt-back::view-transition-old(root) { animation-name: vtSweepOldBack; }
html.vt-back::view-transition-new(root) { animation-name: vtSweepNewBack; }
/* ขอบเฉียง: ด้านบนนำหน้าด้านล่าง 14% ของความกว้างจอ */
@keyframes vtSweepNew {
  from { clip-path: polygon(0 0, 0 0, -14% 100%, 0 100%); }
  to { clip-path: polygon(0 0, 114% 0, 100% 100%, 0 100%); }
}
@keyframes vtSweepOld {
  from { clip-path: polygon(10px 0, 100% 0, 100% 100%, calc(-14% + 10px) 100%); filter: brightness(1); }
  to { clip-path: polygon(calc(114% + 10px) 0, 100% 0, 100% 100%, calc(100% + 10px) 100%); filter: brightness(0.8); }
}
@keyframes vtSweepNewBack {
  from { clip-path: polygon(100% 0, 100% 0, 114% 100%, 100% 100%); }
  to { clip-path: polygon(100% 0, -14% 0, 0 100%, 100% 100%); }
}
@keyframes vtSweepOldBack {
  from { clip-path: polygon(calc(100% - 10px) 0, 0 0, 0 100%, calc(114% - 10px) 100%); filter: brightness(1); }
  to { clip-path: polygon(calc(-14% - 10px) 0, 0 0, 0 100%, -10px 100%); filter: brightness(0.8); }
}

/* หน้าในหมวดเดียวกัน */
html.vt-sib .page-title { view-transition-name: vt-title; }
html.vt-sib .page-content { view-transition-name: vt-content; }
html.vt-sib .page-side a.vt-cur { view-transition-name: vt-side; }
html.vt-sib::view-transition-old(root), html.vt-sib::view-transition-new(root) { animation: none; }
html.vt-sib::view-transition-image-pair(root) { background: none; }
html.vt-sib::view-transition-group(vt-title),
html.vt-sib::view-transition-group(vt-content) { animation-duration: 0.46s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
html.vt-sib::view-transition-group(vt-side) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.34, 1.3, 0.5, 1); }
html.vt-sib::view-transition-old(vt-title), html.vt-sib::view-transition-new(vt-title),
html.vt-sib::view-transition-old(vt-content), html.vt-sib::view-transition-new(vt-content) { mix-blend-mode: normal; }
html.vt-sib::view-transition-old(vt-title), html.vt-sib::view-transition-old(vt-content) { animation: vtLiftOut 0.2s ease-in both; }
html.vt-sib::view-transition-new(vt-title) { animation: vtRiseIn 0.46s cubic-bezier(0.2, 0.8, 0.2, 1) 0.06s both; }
html.vt-sib::view-transition-new(vt-content) { animation: vtRiseIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both; }
html.vt-sib.vt-up::view-transition-old(vt-title), html.vt-sib.vt-up::view-transition-old(vt-content) { animation-name: vtDropOut; }
html.vt-sib.vt-up::view-transition-new(vt-title), html.vt-sib.vt-up::view-transition-new(vt-content) { animation-name: vtDropIn; }
@keyframes vtLiftOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vtRiseIn { from { opacity: 0; transform: translateY(24px); } }
@keyframes vtDropOut { to { opacity: 0; transform: translateY(12px); } }
@keyframes vtDropIn { from { opacity: 0; transform: translateY(-24px); } }

/* วงรีไฮไลต์ของแถบเมนูล่าง (มือถือ) เลื่อนตามไปหน้าใหม่ — ชื่อ app-pill ใส่ที่ .app-tab-pill */
::view-transition-group(app-pill) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.34, 1.3, 0.5, 1); }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ===================================================================
   ยกระดับหน้าตา รอบ A + B (ก.ย. 2569)
   ไอคอนเส้นชุดเดียว · หัวการ์ดเบา · ข่าวมีป้ายหมวด/วันที่ · การ์ดโซเชียลโทนเดียวกับเว็บ
   ลายประจำยาม · ท้ายเว็บ · การเคลื่อนไหวที่สั้นลง · ตัวนับผู้เข้าชมแบบย่อ
   =================================================================== */
:root {
  /* เงา 2 ระดับที่ใช้กับการ์ดหลักทั้งหน้าแรก */
  --shadow-1: 0 1px 2px rgba(8, 38, 33, 0.05), 0 8px 24px rgba(8, 38, 33, 0.06);
  --shadow-2: 0 2px 6px rgba(8, 38, 33, 0.07), 0 18px 40px rgba(8, 38, 33, 0.12);
  /* ลายประจำยามสีทอง (กระเบื้อง 48px) — ใช้เป็นพื้นหลังจาง ๆ */
  --prajam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23D8B24C' stroke-width='1.1' stroke-linejoin='round'%3E%3Cpath d='M24 4 44 24 24 44 4 24Z'/%3E%3Cpath d='M24 11c4.2 4.6 4.2 8.4 0 13c-4.2-4.6-4.2-8.4 0-13Z'/%3E%3Cpath d='M24 37c4.2-4.6 4.2-8.4 0-13c-4.2 4.6-4.2 8.4 0 13Z'/%3E%3Cpath d='M11 24c4.6-4.2 8.4-4.2 13 0c-4.6 4.2-8.4 4.2-13 0Z'/%3E%3Cpath d='M37 24c-4.6-4.2-8.4-4.2-13 0c4.6 4.2 8.4 4.2 13 0Z'/%3E%3Ccircle cx='24' cy='24' r='2'/%3E%3Cpath d='M0 0 4 4M48 0 44 4M0 48 4 44M48 48 44 44'/%3E%3C/g%3E%3C/svg%3E");
  --icon-ink: var(--teal-700);
}
:root[data-theme="dark"] {
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.35), 0 18px 40px rgba(0, 0, 0, 0.4);
  --icon-ink: #86CCBC;
}

/* ---------- 1) ไอคอนเส้น (public/js/icons.js + /images/icons.svg) ---------- */
svg.ico {
  width: 1.15em; height: 1.15em; display: inline-block; vertical-align: -0.2em; flex: none;
  stroke-width: 1.75; overflow: visible;
}
.sys-banner-card .sys-banner-icon { color: var(--icon-ink); font-size: 1.12rem; }
.sys-banner-card .sys-banner:hover .sys-banner-icon { color: var(--gold-700); }
.info-icon { color: var(--icon-ink); line-height: 1; }
.info-icon .ico { width: 1.05em; height: 1.05em; stroke-width: 1.5; }
.contact-list .ci { color: var(--icon-ink); display: inline-flex; }
.ib-icon { color: var(--icon-ink); }
.ib-icon .ico { vertical-align: -0.25em; }
.duty-ico { color: #F6E3A6; }
.unit-service .unit-service-ico { color: var(--icon-ink); }
.icon-btn .ib-ico .ico { width: 18px; height: 18px; vertical-align: -3px; }
.program-visual .cap-icon .ico { width: 1em; height: 1em; stroke-width: 1; color: #F6E3A6; }
.footer-social a .ico { width: 18px; height: 18px; }
.ft-ico { color: var(--gold-500); margin-right: 10px; display: inline-flex; }
.ft-ico .ico { width: 17px; height: 17px; vertical-align: -3px; }
.footer-links li { display: flex; align-items: flex-start; }

/* ---------- 2) หัวการ์ดเมนูหน้าแรก: เบา มีเส้นทองนำหน้า แทนแถบเขียวทึบ ---------- */
body.home .sidebar-card { box-shadow: var(--shadow-1); border-color: rgba(13, 59, 53, 0.09); }
body.home .sidebar-title {
  background: transparent; color: var(--ink-title);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 13px; font-size: 1.02rem; font-weight: 600; letter-spacing: 0.01em; gap: 10px;
}
body.home .sidebar-title::before {
  content: ''; flex: none; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--gold-500), var(--gold-700));
}
body.home .news-panel, body.home .highlight-board { box-shadow: var(--shadow-1); }

/* ---------- 3) รายการข่าว: ป้ายหมวด/วันที่ด้านซ้าย + สีประจำหมวด ---------- */
.tone-pr { --tone-bg: #E3F1EE; --tone-fg: #0D5A4E; }
.tone-job { --tone-bg: #FBF1D6; --tone-fg: #7A5A12; }
.tone-buy { --tone-bg: #E6F1FB; --tone-fg: #0C447C; }
.tone-student { --tone-bg: #EEEDFE; --tone-fg: #3C3489; }
.tone-admit { --tone-bg: #FBEAF0; --tone-fg: #72243E; }
:root[data-theme="dark"] .tone-pr { --tone-bg: rgba(134, 204, 188, 0.14); --tone-fg: #9FD9CB; }
:root[data-theme="dark"] .tone-job { --tone-bg: rgba(231, 197, 102, 0.14); --tone-fg: #F3DB94; }
:root[data-theme="dark"] .tone-buy { --tone-bg: rgba(133, 183, 235, 0.14); --tone-fg: #A9CDF2; }
:root[data-theme="dark"] .tone-student { --tone-bg: rgba(175, 169, 236, 0.16); --tone-fg: #C9C5F4; }
:root[data-theme="dark"] .tone-admit { --tone-bg: rgba(237, 147, 177, 0.14); --tone-fg: #F2B8CB; }

.news-list .news-item { display: flex; align-items: flex-start; justify-content: flex-start; gap: 14px; }
/* ชี้เมาส์ที่ข่าว: เปลี่ยนแค่สีพื้นกับขอบทองซ้าย — ขนาดและตำแหน่งตัวอักษรคงที่ ไม่ขยับ (เดิมเพิ่ม padding ทำให้ข้อความเลื่อน อ่านแล้วเวียนหัว)
   ระยะขอบซ้าย-ขวาเผื่อไว้ตั้งแต่แรก แทนการเพิ่มตอนชี้ */
.news-list .news-item,
.news-list .news-item:hover {
  padding-left: 10px; padding-right: 10px; margin-left: -10px; margin-right: -10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.news-list .news-item:hover { background: linear-gradient(90deg, var(--teal-050), transparent); border-left-color: var(--gold-500); }
.news-mark {
  flex: none; width: 46px; height: 46px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: var(--tone-bg, var(--teal-050)); color: var(--tone-fg, var(--teal-800));
}
.news-mark .ico { width: 22px; height: 22px; }
.news-mark.is-date b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.news-mark.is-date small { font-size: 0.68rem; margin-top: 3px; font-weight: 500; }
.news-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.news-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.news-list .news-cat { background: var(--tone-bg, var(--teal-050)); color: var(--tone-fg, var(--teal-800)); font-size: 0.74rem; padding: 3px 11px; }
.news-list .news-title { font-size: 1rem; line-height: 1.65; }
.news-list .news-title-link { color: var(--ink-900); }
@media (max-width: 900px) {
  .news-list .news-item { display: flex; gap: 12px; }
  .news-mark { width: 40px; height: 40px; border-radius: 10px; }
  .news-mark .ico { width: 19px; height: 19px; }
}

/* ---------- 4) การ์ด Facebook / LINE: พื้นโทนเดียวกับเว็บ สีแบรนด์เฉพาะวงกลมไอคอน ---------- */
.fb-card {
  background: var(--white); color: var(--ink-title); border: 1px solid rgba(13, 59, 53, 0.1);
  box-shadow: var(--shadow-1); padding: 16px 18px; gap: 14px;
}
.fb-card:hover { box-shadow: var(--shadow-2); border-color: var(--gold-500); }
.fb-card-icon { width: 44px; height: 44px; color: #fff; background: #1877F2; }
.fb-card-icon .ico { width: 24px; height: 24px; stroke-width: 1.6; }
.fb-card--line .fb-card-icon { background: #06C755; }
.fb-card-text { color: var(--ink-title); font-size: 0.95rem; }
.fb-card-text small { color: var(--ink-600); opacity: 1; }

/* ---------- 5) ตัวนับผู้เข้าชม: 3 ตัวเลขเรียงแถว ---------- */
.vc-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 12px 16px; }
.vc-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 6px; text-align: center; }
.vc-stat + .vc-stat { border-left: 1px solid var(--border); }
.vc-num { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink-title); font-variant-numeric: tabular-nums; }
.vc-stat.is-total .vc-num { color: var(--gold-700); }
:root[data-theme="dark"] .vc-stat.is-total .vc-num { color: #E7C566; }
.vc-cap { font-size: 0.78rem; color: var(--ink-600); }

/* ---------- 6) ลายประจำยาม: พื้นส่วนหลักสูตร ---------- */
#programs { position: relative; isolation: isolate; }
#programs::before {
  content: ''; position: absolute; inset: -40px 0 0; z-index: -1; pointer-events: none;
  background: var(--prajam) 0 0 / 48px 48px;
  opacity: 0.07;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 70%, transparent);
}

/* ---------- 7) ท้ายเว็บ: แถบลายประจำยาม + ตราวิทยาลัยจาง ๆ ---------- */
.site-footer { position: relative; overflow: hidden; isolation: isolate; padding-top: 88px; }
.footer-pattern {
  position: absolute; left: 0; right: 0; top: 0; height: 30px; pointer-events: none;
  background: var(--prajam) 0 -9px / 30px 30px;
  opacity: 0.55;
  border-bottom: 1px solid rgba(216, 178, 76, 0.45);
}
.site-footer::before {
  content: ''; position: absolute; inset: 30px 0 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 420px at 85% 0%, rgba(216, 178, 76, 0.1), transparent 70%);
}
.footer-crest {
  position: absolute; z-index: -1; pointer-events: none;
  right: -60px; bottom: -70px; width: 360px; height: auto;
  opacity: 0.05; filter: grayscale(1) brightness(2.2);
}
.footer-social a { color: var(--sage-100); }
@media (max-width: 640px) { .footer-crest { width: 240px; right: -50px; bottom: -40px; } }

/* ---------- 8) การเคลื่อนไหว: สั้นและนุ่มขึ้น เนื้อหาไม่จางค้างระหว่างเลื่อน ---------- */
.reveal {
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.news-item { animation-duration: 0.3s; }

/* ===================================================================
   การ์ดวิทยาลัยพยาบาลคุณธรรม (ออกแบบใหม่)
   ดอกบัวลายเส้นสีทอง + ปุ่มกระจกขอบทอง + น้องพยาบาลกระโดดโผล่มาโบกมือ (initNursePeek ใน main.js)
   =================================================================== */
.ib-moral {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 16px;
  min-height: 200px; padding: 28px 30px 26px;
  border-radius: var(--radius-lg); text-decoration: none; color: #F3EBD8;
  background:
    radial-gradient(120% 70% at 100% 100%, rgba(255, 196, 100, 0.2), transparent 60%),
    radial-gradient(90% 60% at 0% 0%, rgba(23, 101, 90, 0.55), transparent 70%),
    linear-gradient(160deg, #0F4439 0%, #0A2E27 55%, #061C17 100%);
  border: 1px solid rgba(216, 178, 76, 0.35);
  box-shadow: var(--shadow-2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
/* ลายประจำยามจาง ๆ มุมขวาบน */
.ib-moral::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--prajam) 0 0 / 34px 34px; opacity: 0.08;
  -webkit-mask-image: radial-gradient(80% 70% at 100% 0%, #000, transparent 75%);
  mask-image: radial-gradient(80% 70% at 100% 0%, #000, transparent 75%);
}
.ib-moral:hover { transform: translateY(-2px); border-color: rgba(231, 197, 102, 0.7); }
.ib-moral:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 3px; }

.ib-moral-text { position: relative; z-index: 2; display: flex; flex-direction: column; line-height: 1.2; }
.ib-moral-text small { font-family: var(--font-display); font-size: 1rem; color: #EFE3C2; font-weight: 500; letter-spacing: 0.02em; }
.ib-moral-text strong {
  font-family: 'Noto Serif Thai', var(--font-display), serif; font-size: 2.5rem; font-weight: 800; line-height: 1.45;
  padding: 0.05em 0; letter-spacing: -0.01em;
  background: linear-gradient(110deg, #FBF0C8 0%, #E7C566 35%, #FFF6D4 55%, #C9A035 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ib-moral-text em { font-style: normal; font-size: 0.84rem; color: rgba(239, 227, 194, 0.78); margin-top: 2px; }

/* ปุ่มกระจกขอบทอง + ลูกศรในวงกลมทอง */
.ib-moral-cta {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; color: #F6E3A6;
  background: rgba(4, 21, 15, 0.38); border: 1px solid rgba(231, 197, 102, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.ib-moral-cta-arrow {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: #0B2D26; background: linear-gradient(135deg, #F6E3A6, #C59B27);
  box-shadow: 0 4px 10px rgba(197, 155, 39, 0.35);
  transition: transform 0.2s ease;
}
.ib-moral-cta-arrow .ico { width: 16px; height: 16px; stroke-width: 2.2; }
.ib-moral:hover .ib-moral-cta { background: rgba(231, 197, 102, 0.16); border-color: #E7C566; color: #FFF6D8; }
.ib-moral:hover .ib-moral-cta-arrow { transform: translateX(3px); }

/* ดอกบัวสีทอง มุมขวาล่าง */
.ib-moral-lotus {
  position: absolute; z-index: 0; pointer-events: none;
  right: -8px; bottom: -6px; width: 40%; max-width: 230px; height: auto;
  filter: drop-shadow(0 0 18px rgba(255, 196, 100, 0.25));
}

/* ---------- น้องพยาบาล ---------- */
.nurse-peek {
  position: absolute; z-index: 1; pointer-events: none;
  /* การ์ดเต็มความกว้างคอลัมน์กลาง: ข้อความอยู่ซ้าย น้องพยาบาลยืนหน้าดอกบัวทางขวา */
  right: 32%; bottom: -2px; width: 20%; max-width: 112px;
  transform: translateY(105%);
}
.nurse-peek svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35)); }
.nurse-peek.is-in { animation: nursePop 0.95s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.nurse-peek.is-hop { animation: nurseHop 0.7s ease-in-out; transform: translateY(0); }
.nurse-arm { transform-box: fill-box; transform-origin: 8% 92%; }
.nurse-peek.is-waving .nurse-arm { animation: nurseWave 1.5s ease-in-out; }
.nurse-eyes { transform-box: fill-box; transform-origin: 50% 50%; animation: nurseBlink 4.6s infinite; }
@keyframes nursePop {
  0% { transform: translateY(105%); }
  55% { transform: translateY(-9%); }
  75% { transform: translateY(3%); }
  100% { transform: translateY(0); }
}
@keyframes nurseHop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12%); }
  70% { transform: translateY(2%); }
}
@keyframes nurseWave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-20deg); }
  32% { transform: rotate(14deg); }
  49% { transform: rotate(-20deg); }
  66% { transform: rotate(14deg); }
  83% { transform: rotate(-8deg); }
}
@keyframes nurseBlink {
  0%, 94%, 100% { transform: scaleY(1); }
  96.5% { transform: scaleY(0.1); }
}

/* มือถือ: การ์ดกว้างแต่เตี้ย — ข้อความซ้าย น้องพยาบาลกับดอกบัวอยู่ฝั่งขวา */
@media (max-width: 640px) {
  .ib-moral { min-height: 170px; padding: 20px; gap: 12px; }
  .ib-moral-text strong { font-size: 2.1rem; }
  .ib-moral-lotus { width: 42%; max-width: 150px; }
  .nurse-peek { right: 30%; width: 26%; max-width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  .nurse-peek, .nurse-peek.is-in, .nurse-peek.is-hop { animation: none; transform: none; }
  .nurse-peek.is-waving .nurse-arm, .nurse-eyes { animation: none; }
}

/* ===================================================================
   มือถือแบบแอป: แถบเมนูลัดด้านล่าง + ปุ่มติดตั้งแอป (แบบเดียวกับ CKR Connect)
   ดู partials/footer.html (.app-tabbar) และ initAppTabbar / initInstallApp ใน main.js
   =================================================================== */
.app-tabbar { display: none; }
.install-btn[hidden] { display: none !important; }
.install-btn .ico { width: 17px; height: 17px; }

@media (max-width: 900px) {
  .app-tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 130;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--white);
    background: color-mix(in srgb, var(--white) 90%, transparent);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(8, 38, 33, 0.08);
    view-transition-name: app-tabbar; /* ค้างอยู่กับที่ตอนเปลี่ยนหน้า ไม่กระพริบ */
  }
  .app-tabbar > a, .app-tabbar > button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 4px 0 2px; margin: 0; border: 0; background: none; border-radius: 14px;
    font: inherit; font-family: var(--font-display); font-size: 0.7rem; font-weight: 500; line-height: 1.2;
    color: var(--ink-600); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  /* วงรีหลังไอคอนของปุ่มที่เลือก (แบบแอปมือถือทั่วไป) */
  .app-tab-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 52px; height: 30px; border-radius: 999px; transition: background-color 0.2s ease, transform 0.2s ease;
  }
  .app-tab-ico .ico { width: 22px; height: 22px; stroke-width: 1.8; }
  .app-tabbar [aria-current="page"], .app-tabbar [aria-expanded="true"] { color: var(--ink-title); font-weight: 600; }
  .app-tabbar [aria-current="page"] .app-tab-ico, .app-tabbar [aria-expanded="true"] .app-tab-ico {
    background: var(--teal-050); color: var(--teal-700);
    box-shadow: inset 0 0 0 1px rgba(216, 178, 76, 0.45);
  }
  :root[data-theme="dark"] .app-tabbar [aria-current="page"] .app-tab-ico,
  :root[data-theme="dark"] .app-tabbar [aria-expanded="true"] .app-tab-ico { background: rgba(134, 204, 188, 0.14); color: #9FD9CB; }
  .app-tabbar > a:active .app-tab-ico, .app-tabbar > button:active .app-tab-ico { transform: scale(0.92); }
  .app-tabbar > a:focus-visible, .app-tabbar > button:focus-visible { outline: 2px solid var(--gold-500); outline-offset: -2px; }

  /* เผื่อที่ให้แถบด้านล่าง ไม่ให้บังท้ายเว็บ / ปุ่มลอยย้ายขึ้นไปเหนือแถบ */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .lift-top { left: 14px; right: auto; bottom: calc(78px + env(safe-area-inset-bottom)); }
  body.lb-open .app-tabbar { display: none; }

  /* เมนูหลักที่เปิดจากแถบด้านล่าง: ยาวเกินจอให้เลื่อนในเมนูได้ */
  .mega-menu.open { max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow-y: auto; overscroll-behavior: contain; }

  /* ปุ่มติดตั้งแอปบนแถบเมนูด้านบน */
  .install-btn { border-color: rgba(216, 178, 76, 0.6); color: var(--gold-100); background: rgba(216, 178, 76, 0.16); }
}

/* เปิดจากแอปที่ติดตั้งแล้ว (เต็มจอ ไม่มีแถบเบราว์เซอร์) — เว้นที่ให้ติ่งกล้อง/แถบสถานะด้านบน */
html.is-app body { padding-top: env(safe-area-inset-top); }

/* กล่องแนะนำวิธีติดตั้งบน iPhone / iPad */
.install-guide {
  width: min(360px, calc(100vw - 32px)); border: 0; border-radius: 22px; padding: 26px 22px 22px;
  background: var(--white); color: var(--ink-900); text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
.install-guide::backdrop { background: rgba(4, 21, 15, 0.6); }
.install-guide img { border-radius: 16px; box-shadow: var(--shadow-1); }
.install-guide h2 { font-size: 1.15rem; margin: 14px 0 12px; color: var(--ink-title); }
.install-guide ol { text-align: left; margin: 0; padding-left: 1.3em; line-height: 1.8; font-size: 0.95rem; }
.install-guide ol .ico { width: 18px; height: 18px; vertical-align: -3px; color: var(--teal-700); }
.install-guide-close {
  position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--teal-050); color: var(--ink-700); cursor: pointer; display: grid; place-items: center;
}
.install-guide-close .ico { width: 18px; height: 18px; }

/* ===================================================================
   หน้าแรกบนมือถือ/แท็บเล็ต (คอลัมน์เดียว ≤ 980px): จัดลำดับการ์ดใหม่ข้ามคอลัมน์
   1) การ์ด ผอ.  2) วิทยาลัยพยาบาลคุณธรรม  3) Facebook / LINE / CKR Connect / ช่องทางการติดต่อ-ข้อร้องเรียน
   4) ส่วนที่เหลือของคอลัมน์กลาง (ภาพประชาสัมพันธ์ ข่าว ฯลฯ)  5) การ์ดที่เหลือของคอลัมน์ซ้าย  6) การ์ดที่เหลือของคอลัมน์ขวา
   ใช้ display: contents ให้การ์ดในแต่ละคอลัมน์มาเรียงในกล่องเดียวกัน แล้วกำหนด order
   =================================================================== */
@media (max-width: 980px) {
  .trio-layout { display: flex; flex-direction: column; gap: 24px; }
  .col-left, .col-center, .col-right { display: contents; }
  .col-left > * { order: 5; }
  .col-center > * { order: 4; }
  .col-right > * { order: 6; }
  .col-left > .director-mini { order: 1; }
  .col-center > .integrity-board { order: 2; }
  .col-right > .fb-card, .col-right > .connect-card, .col-right > .ib-complaint { order: 3; }
}

/* ===================================================================
   แถบข้างของหน้าย่อยเมื่อย้ายลงไปใต้เนื้อหา (แท็บเล็ต ≤ 1100px และหน้าที่มีผังเต็มจอ เช่นโครงสร้างองค์กร)
   เดิมเรียงเป็นแถวแล้วการ์ดถูกยืดสูงเท่าเมนู (Facebook / สมัครเรียน กลายเป็นก้อนสีใหญ่)
   ตอนนี้: เมนูอยู่ซ้าย · Facebook + สมัครเรียน ซ้อนกันทางขวา สูงตามเนื้อหาจริง · มือถือเรียงลงมาทีละใบ
   =================================================================== */
@media (max-width: 1100px) {
  .page-side { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; align-content: start; gap: 20px; }
  .page-side > * { flex: none; min-width: 0; }
  .page-side > .sidebar-card { grid-row: span 2; }
}
.page-layout:has(.canva-board) .page-side {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; align-content: start; gap: 20px;
}
.page-layout:has(.canva-board) .page-side > * { flex: none; min-width: 0; }
.page-layout:has(.canva-board) .page-side > .sidebar-card { grid-row: span 2; }
@media (max-width: 640px) {
  .page-side, .page-layout:has(.canva-board) .page-side { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .page-side > .sidebar-card, .page-layout:has(.canva-board) .page-side > .sidebar-card { grid-row: auto; }
}

/* ===================================================================
   ทรานสิชันรอบ ก.ย. 2569 (การเปลี่ยนหน้าอยู่ที่ "เปลี่ยนหน้าแบบลื่น" ด้านบน)
   A) รูปขยายออกจากรูปที่กด · B) เมนูพับแบบลิ้นชัก · C) วงรีไฮไลต์แถบเมนูล่าง · D) โครงข่าวระหว่างโหลด
   ผู้ใช้ที่ตั้ง "ลดการเคลื่อนไหว" ในเครื่อง = ไม่มีแอนิเมชัน (ท้ายบล็อก)
   =================================================================== */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- A) lightbox: พื้นหลังค่อย ๆ หรี่ ส่วนรูปบินออกจากรูปที่กด และบินกลับตอนปิด (main.js: initLightbox) ----------
   พื้นหลังย้ายไปอยู่ที่ ::before เพื่อให้รูปทึบเต็มตั้งแต่เฟรมแรกขณะบิน (เดิมทั้งกล่องจางเข้าพร้อมกัน) */
.lightbox, .lightbox.open { background: none; opacity: 1; }
.lightbox { transition: visibility 0s linear 0.45s; }
.lightbox:not(.open) { pointer-events: none; }
.lightbox.open { transition: none; }
.lightbox::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(6, 26, 23, 0.94); opacity: 0; transition: opacity 0.32s ease;
}
.lightbox.open::before { opacity: 1; }
.lightbox-bar, .lightbox-foot { opacity: 0; transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lightbox-bar { transform: translateY(-10px); }
.lightbox-foot { transform: translateY(10px); }
.lightbox.open .lightbox-bar, .lightbox.open .lightbox-foot { opacity: 1; transform: none; transition-delay: 0.12s; }

/* ---------- B) เมนูพับ (จอ ≤ 1300px และปุ่ม "เมนู" ของแถบล่างบนมือถือ): ลิ้นชักลอยทับหน้าเว็บ ----------
   เดิม: เมนูดันเนื้อหาทั้งหน้าลง และโผล่/หายทันที
   ตอนนี้: ไหลลงทับเนื้อหา พื้นหลังหรี่ (กดที่พื้นหลังเพื่อปิด) · รายการไล่ลงมาทีละบรรทัด · เมนูย่อยกาง/หุบนุ่ม ๆ
   ความสูงไม่เกินจอ (--menu-max คำนวณใน main.js ตอนเปิด) ยาวกว่านั้นเลื่อนในเมนูได้ */
.menu-scrim { display: none; }
@media (max-width: 1300px) {
  .mega-nav-inner { position: relative; }
  .mega-menu, .mega-menu.open {
    display: flex; position: absolute; left: 0; right: 0; top: 100%; z-index: 2;
    max-height: var(--menu-max, calc(100dvh - 150px)); overflow-y: auto; overscroll-behavior: contain;
    background: var(--teal-950); border-top: 1px solid rgba(216, 178, 76, 0.4);
    border-radius: 0 0 20px 20px; box-shadow: 0 26px 50px rgba(4, 21, 15, 0.38);
    padding-bottom: 10px;
  }
  .mega-menu {
    visibility: hidden; opacity: 0; clip-path: inset(0 0 100% 0);
    transition: clip-path 0.26s cubic-bezier(0.4, 0, 1, 1), opacity 0.18s ease 0.08s, visibility 0s linear 0.26s;
  }
  .mega-menu.open {
    visibility: visible; opacity: 1; clip-path: inset(0 -40px -70px -40px);
    transition: clip-path 0.46s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.14s ease, visibility 0s;
  }
  .mega-menu.open > .mega-item { animation: menuItemIn 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .mega-menu.open > .mega-item:nth-child(2) { animation-delay: 0.03s; }
  .mega-menu.open > .mega-item:nth-child(3) { animation-delay: 0.06s; }
  .mega-menu.open > .mega-item:nth-child(4) { animation-delay: 0.09s; }
  .mega-menu.open > .mega-item:nth-child(5) { animation-delay: 0.12s; }
  .mega-menu.open > .mega-item:nth-child(6) { animation-delay: 0.15s; }
  .mega-menu.open > .mega-item:nth-child(7) { animation-delay: 0.18s; }
  .mega-menu.open > .mega-item:nth-child(8) { animation-delay: 0.21s; }
  .mega-menu.open > .mega-item:nth-child(9) { animation-delay: 0.24s; }
  .mega-menu.open > .mega-item:nth-child(n+10) { animation-delay: 0.27s; }
  .menu-scrim {
    display: block; position: fixed; inset: 0; z-index: 99; touch-action: none;
    background: rgba(4, 21, 15, 0.45); opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  html.menu-open .menu-scrim { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }

  /* เมนูย่อย: กาง/หุบตามความสูงจริง (grid 0fr → 1fr) แทนการโผล่ทันที */
  .mega-panel, .mega-panel-wide {
    display: grid; grid-template-rows: 0fr; visibility: hidden; padding-top: 0; padding-bottom: 0;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s;
  }
  .mega-panel > ul { min-height: 0; overflow: hidden; }
  .mega-item.open .mega-panel {
    display: grid; grid-template-rows: 1fr; visibility: visible; padding-top: 4px; padding-bottom: 10px;
    transition: grid-template-rows 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), padding 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
  }
}
@keyframes menuItemIn { from { opacity: 0; transform: translateY(-10px); } }

/* ---------- C) แถบเมนูล่าง (มือถือ): วงรีไฮไลต์อันเดียวเลื่อนไปหาปุ่มที่เลือก (main.js: initAppTabbar) ---------- */
@media (max-width: 900px) {
  .app-tabbar > a, .app-tabbar > button { position: relative; z-index: 1; }
  .app-tab-pill {
    position: absolute; left: 0; top: 0; width: 52px; height: 30px; border-radius: 999px; pointer-events: none;
    background: rgba(13, 59, 53, 0.08); box-shadow: inset 0 0 0 1px rgba(216, 178, 76, 0.5);
    opacity: 0; transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
    transition: transform 0.46s cubic-bezier(0.34, 1.3, 0.5, 1), opacity 0.2s ease;
  }
  .app-tab-pill.is-on { opacity: 1; view-transition-name: app-pill; }
  .app-tab-pill.no-anim { transition: none; }
  .app-tabbar.has-pill [aria-current="page"] .app-tab-ico,
  .app-tabbar.has-pill [aria-expanded="true"] .app-tab-ico,
  :root[data-theme="dark"] .app-tabbar.has-pill [aria-current="page"] .app-tab-ico,
  :root[data-theme="dark"] .app-tabbar.has-pill [aria-expanded="true"] .app-tab-ico { background: transparent; box-shadow: none; }
  :root[data-theme="dark"] .app-tab-pill { background: rgba(134, 204, 188, 0.14); }
  .app-tabbar [aria-current="page"] .app-tab-ico .ico,
  .app-tabbar [aria-expanded="true"] .app-tab-ico .ico { animation: tabPop 0.42s cubic-bezier(0.34, 1.5, 0.5, 1); }
}
@keyframes tabPop { 40% { transform: scale(1.14); } }

/* ---------- D) โครงข่าวระหว่างโหลด (main.js: loadNews) ----------
   แทนข้อความ "กำลังโหลดข่าว..." — ขนาดใกล้ข่าวจริง กล่องข่าวจึงไม่กระตุกตอนข่าวมาถึง */
.news-skel { pointer-events: none; }
.news-skel .news-main { gap: 10px; padding-top: 5px; }
.skel { position: relative; overflow: hidden; display: block; background: rgba(13, 59, 53, 0.07); }
.skel-line { height: 12px; border-radius: 6px; }
.skel-line.is-title { height: 16px; }
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: skelShine 1.4s ease-in-out infinite;
}
:root[data-theme="dark"] .skel { background: rgba(255, 255, 255, 0.07); }
:root[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }
@keyframes skelShine { to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox::before, .lightbox-bar, .lightbox-foot,
  .mega-menu, .mega-menu.open, .mega-panel, .mega-item.open .mega-panel,
  .menu-scrim, html.menu-open .menu-scrim, .app-tab-pill { transition: none; }
  .mega-menu.open > .mega-item, .app-tabbar .app-tab-ico .ico, .skel::after { animation: none; }
}

/* ===================================================================
   สไลด์ประชาสัมพันธ์หน้าแรก — แบบการ์ดลอย (ต.ค. 2569)
   ภาพเต็มกรอบไม่มีอะไรทับ · ชื่อสไลด์ ปุ่มขยาย/ดูรายละเอียด ลูกศร และจุดบอกลำดับ อยู่ในแถบใต้ภาพ
   =================================================================== */
body.home .promo-section { padding-top: clamp(26px, 3.2vw, 46px); padding-bottom: 6px; }
.slider {
  max-width: 1160px; overflow: hidden; border: 0; border-radius: 22px;
  background: var(--surface, #fff);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 24px 60px rgba(4, 30, 24, 0.28), 0 4px 14px rgba(4, 30, 24, 0.12);
}
.slider-viewport { border-radius: 22px 22px 0 0; background: #0b2a24; }
.slide-inner { border: 0; padding: 0; margin: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.slide-inner:focus-visible { outline: 3px solid var(--gold-500); outline-offset: -3px; }
.slide img { transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.slide > a:hover img, .slide-inner:hover img { transform: scale(1.012); }

.slider-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px 14px 24px; min-height: 66px;
  border-top: 3px solid var(--gold-500);
  background: linear-gradient(180deg, #fff, #f6faf8);
}
.slider-info { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.slider-title {
  margin: 0; min-width: 0; color: var(--teal-900, #0d3b35);
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slider-title small { display: inline; margin-left: 10px; font-family: var(--font-body); font-weight: 400; font-size: .86rem; color: var(--muted, #5b6f6a); }
.slider-action {
  flex: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(13, 59, 53, .16);
  background: #fff; color: var(--teal-800, #11524a); font: 500 .86rem/1 var(--font-body); text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.slider-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.slider-action:hover { background: var(--teal-800, #11524a); border-color: var(--teal-800, #11524a); color: #fff; }

.slider-controls { flex: none; display: flex; align-items: center; gap: 12px; }
.slider-arrow, .slider-arrow.prev, .slider-arrow.next {
  position: static; transform: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(13, 59, 53, .16); background: #fff; color: var(--teal-800, #11524a);
  backdrop-filter: none; box-shadow: 0 2px 6px rgba(8, 38, 33, .06);
}
.slider-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.slider-arrow:hover { background: var(--teal-800, #11524a); border-color: var(--teal-800, #11524a); color: #fff; }
.slider-arrow[hidden] { display: none; }
.slider-dots { position: static; gap: 7px; }
.slider-dots button { width: 8px; height: 8px; background: rgba(13, 59, 53, .2); }
.slider-dots button:hover { background: rgba(13, 59, 53, .4); }
.slider-dots button.active { width: 26px; background: var(--gold-500); }
.slider-count { min-width: 3.2em; text-align: center; font: 500 .84rem/1 var(--font-body); color: var(--muted, #5b6f6a); font-variant-numeric: tabular-nums; }
.slider-count[hidden] { display: none; }
.slider:has(.slider-empty) .slider-bar { display: none; }

:root[data-theme="dark"] .slider { background: #10231f; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
:root[data-theme="dark"] .slider-bar { background: #12302a; }
:root[data-theme="dark"] .slider-title { color: #eef6f3; }
:root[data-theme="dark"] .slider-title small, :root[data-theme="dark"] .slider-count { color: #a9c3bb; }
:root[data-theme="dark"] .slider-action, :root[data-theme="dark"] .slider-arrow { background: #173a33; color: #e6f2ee; border-color: rgba(255,255,255,.14); }
:root[data-theme="dark"] .slider-action:hover, :root[data-theme="dark"] .slider-arrow:hover { background: var(--gold-500); color: #0b2a24; border-color: var(--gold-500); }
:root[data-theme="dark"] .slider-dots button { background: rgba(255,255,255,.25); }
:root[data-theme="dark"] .slider-dots button.active { background: var(--gold-500); }

@media (max-width: 640px) {
  .slider, .slider-viewport { border-radius: 16px 16px 0 0; }
  .slider { border-radius: 16px; border-width: 0; }
  .slider-bar { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .slider-info { flex-basis: 100%; justify-content: space-between; }
  .slider-title { font-size: .98rem; }
  .slider-title small { display: block; margin: 2px 0 0; }
  .slider-controls { width: 100%; justify-content: space-between; }
  .slider-arrow, .slider-arrow.prev, .slider-arrow.next { width: 38px; height: 38px; }
  .slider-count { display: none; }
}
@media (prefers-reduced-motion: reduce) { .slide img { transition: none; } }


/* SAP-CKR คุณลักษณะบัณฑิต (หน้าอัตลักษณ์บัณฑิต) */
.sap-grid { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sap-item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  padding: 20px 14px 18px; background: var(--white); border: 1px solid var(--border); border-top: 4px solid var(--sap, var(--gold-500));
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.sap-letter {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; margin-bottom: 6px;
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: #fff; background: var(--sap, var(--gold-600));
}
.sap-en { font-family: var(--font-display); font-weight: 600; color: var(--ink-title); }
.sap-th { color: var(--ink-600); font-size: 0.95rem; line-height: 1.5; }
.sap-1 { --sap: #D9576B; } .sap-2 { --sap: #7B5EC9; } .sap-3 { --sap: #178D9C; }
.sap-4 { --sap: #A8763A; } .sap-5 { --sap: #D08A2E; } .sap-6 { --sap: #5E8A5A; }
@media (max-width: 640px) { .sap-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

/* การ์ดวิดีโอ YouTube (หน้าคลังเอกสาร) — ใช้ภาพปกจาก YouTube แล้วเปิดลิงก์ในแท็บใหม่ */
.video-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 14px; }
.video-card { display: block; text-decoration: none; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s; }
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.video-thumb { position: relative; display: block; aspect-ratio: 16/9; background: var(--teal-800); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-play { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; background: rgba(13,59,53,0.82); color: #fff; font-size: 1.3rem; padding-left: 4px; }
.video-meta { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px 14px; }
.video-meta strong { font-family: var(--font-display); color: var(--ink-title); font-weight: 500; }
.video-meta small { color: var(--ink-600); }
@media (max-width: 640px) { .video-cards { grid-template-columns: 1fr; } }

/* ===================================================================
   หน้าแรกแบบ B (ต.ค. 2569) — แถบทางลัด · ตัวเลข · พันธกิจ · ชีวิตในจักรีรัช
   สลับพื้นหลังเป็นช่วง ๆ (เขียวเข้ม / ขาว / ครีม) ให้หน้ามีจังหวะ ไม่เป็นการ์ดขาวยาวตลอด
   =================================================================== */
body.home .ch-scroll { display: none; }  /* แถบทางลัดทำหน้าที่ชวนเลื่อนแทนแล้ว */

/* หัวข้อแต่ละช่วงของหน้าแรก: ฟอนต์มีเชิงแบบเดียวกับส่วนหัว */
body.home .section-head .section-title {
  font-family: 'Noto Serif Thai', var(--font-display), serif; font-weight: 700;
  font-size: clamp(1.9rem, 2.9vw, 2.7rem); line-height: 1.3; letter-spacing: 0.005em;
}
body.home .section-head .gold-rule { width: 84px; border-radius: 2px; background: linear-gradient(90deg, var(--gold-600), var(--gold-500)); }

/* ---------- แถบทางลัด ---------- */
.quick-bar { position: relative; z-index: 5; margin-top: clamp(-64px, -4.4vw, -40px); background: linear-gradient(180deg, transparent 0 50%, #072019 50%); }
body.home .quick-bar + .fest-tribute + .promo-section, body.home .quick-bar ~ .promo-section { padding-top: clamp(30px, 3.4vw, 50px); }
.quick-bar-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.qb-item {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 16px 18px; border-radius: 18px; text-decoration: none;
  background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.qb-item:hover { transform: translateY(-4px); border-color: var(--gold-500); box-shadow: var(--shadow-lg); }
.qb-item:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.qb-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--teal-900); color: var(--gold-500);
}
.qb-icon .ico { width: 25px; height: 25px; }
.qb-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.qb-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink-title); }
.qb-text small { font-size: 0.8rem; color: var(--ink-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qb-gold { background: linear-gradient(135deg, #F1D27A, #C59B27); border-color: transparent; }
/* ปุ่ม ITA ใช้โลโก้จริงบนพื้นขาว (คงพื้นขาวแม้โหมดมืด) */
.qb-ita .qb-icon { width: 72px; background: #fff; border: 1px solid var(--border); }
.qb-ita .qb-icon img { display: block; width: 58px; height: auto; }
.qb-gold .qb-icon { background: var(--teal-950); }
.qb-gold .qb-text strong { color: var(--teal-950); }
.qb-gold .qb-text small { color: rgba(8, 38, 33, 0.78); }

/* ---------- วิทยาลัยในตัวเลข ---------- */
.stats-band {
  margin-top: clamp(30px, 4vw, 54px); color: var(--on-brand);
  background: radial-gradient(900px 300px at 85% 0%, rgba(216, 178, 76, 0.18), transparent 70%), linear-gradient(135deg, var(--teal-900), var(--teal-950));
  border-top: 3px solid var(--gold-600); border-bottom: 3px solid var(--gold-600);
}
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 30px 0; }
.stat { display: flex; align-items: center; gap: 16px; padding: 8px 26px; min-width: 0; color: inherit; text-decoration: none; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, 0.14); }
.stat-num {
  font-family: 'Noto Serif Thai', var(--font-display), serif; font-weight: 800;
  font-size: clamp(2.6rem, 3.8vw, 3.6rem); line-height: 1; color: var(--gold-500);
  font-variant-numeric: tabular-nums; min-width: 1.4ch;
}
.stat-text { display: flex; flex-direction: column; font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; line-height: 1.35; min-width: 0; }
.stat-text small { font-family: var(--font-body); font-weight: 400; font-size: 0.82rem; color: rgba(255, 255, 255, 0.72); margin-top: 2px; }
.stat-ico { flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; border: 1.5px solid var(--gold-500); color: var(--gold-500); }
.stat-ico .ico { width: 34px; height: 34px; }
.stat-link { transition: background 0.2s; border-radius: 14px; }
.stat-link:hover { background: rgba(255, 255, 255, 0.06); }
.stat-link:hover .stat-text { color: #FFF6D8; }

/* ---------- เมนูข้างยาว: แสดงบางส่วน + ปุ่มดูทั้งหมด (initClampLists ใน main.js) ---------- */
[data-clamp="7"].is-clamped > :nth-child(n+8),
[data-clamp="8"].is-clamped > :nth-child(n+9) { display: none; }
.clamp-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: calc(100% - 28px); margin: 2px 14px 14px; padding: 10px 12px;
  border: 1px dashed var(--sage-200); border-radius: 12px; background: var(--teal-050);
  font-family: var(--font-display); font-size: 0.9rem; font-weight: 500; color: var(--teal-700); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.clamp-toggle:hover { background: var(--gold-050); border-color: var(--gold-500); }
:root[data-theme="dark"] .clamp-toggle { color: var(--ink-title); border-color: var(--border); }

/* ---------- พันธกิจ 5 ด้าน ---------- */
.missions-band { background: linear-gradient(180deg, var(--gold-050), var(--paper)); padding: clamp(50px, 6vw, 86px) 0 clamp(40px, 5vw, 70px); }
.mb-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.mb-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px;
  padding: 26px 22px 20px; border-radius: 20px; text-decoration: none; color: inherit;
  background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.mb-card:hover { transform: translateY(-6px); border-color: var(--gold-500); box-shadow: var(--shadow); }
.mb-no {
  position: absolute; top: 4px; right: 16px; font-family: 'Noto Serif Thai', serif; font-weight: 800;
  font-size: 4rem; line-height: 1; color: var(--gold-100); pointer-events: none;
}
:root[data-theme="dark"] .mb-no { color: rgba(231, 197, 102, 0.12); }
.mb-icon { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--teal-900); color: var(--gold-500); margin-bottom: 6px; }
.mb-icon .ico { width: 29px; height: 29px; }
.mb-card strong { position: relative; font-family: var(--font-display); font-weight: 600; font-size: 1.14rem; color: var(--ink-title); }
.mb-desc { position: relative; font-size: 0.9rem; color: var(--ink-600); line-height: 1.5; }
.mb-count { margin-top: auto; padding-top: 10px; font-family: var(--font-display); font-weight: 500; font-size: 0.86rem; color: var(--gold-700); }
.mb-count::after { content: ' \2192'; }
.mb-more { text-align: center; margin: 26px 0 0; font-family: var(--font-display); }
.mb-more a { color: var(--teal-700); }
:root[data-theme="dark"] .mb-more a { color: var(--ink-title); }

/* ---------- ชีวิตในจักรีรัช ---------- */
.life-band {
  color: var(--on-brand); padding: clamp(56px, 7vw, 100px) 0;
  background: radial-gradient(1000px 420px at 15% 0%, rgba(216, 178, 76, 0.16), transparent 65%), linear-gradient(160deg, var(--teal-900), var(--teal-950) 70%);
}
.life-band .section-title { color: #FFF6D8; }
.life-band .eyebrow-label { color: var(--gold-500); }
/* แถบภาพเลื่อน 2 แถว (แถวล่างเลื่อนสวนทาง) — main.js (initLifeMarquee) เติมอัลบั้มจากคลังภาพกิจกรรม
   แล้วต่อภาพซ้ำให้ยาวพอ จึงเลื่อนวนได้ไม่สะดุด (เลื่อนไปครึ่งหนึ่งของแถว = กลับมาตำแหน่งเดิมพอดี) */
.life-band .section-head { margin-bottom: clamp(24px, 3vw, 36px); }
.life-marquee {
  position: relative; display: grid; gap: 14px; overflow: hidden;
}
/* ขอบจางซ้าย-ขวา: ใช้แถบไล่สีวางทับ แทน mask-image (mask ต้องวาดใหม่ทุกเฟรมขณะภาพเลื่อน) */
.life-marquee::before, .life-marquee::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 6%; z-index: 2; pointer-events: none;
}
.life-marquee::before { left: 0; background: linear-gradient(90deg, var(--teal-950), transparent); }
.life-marquee::after { right: 0; background: linear-gradient(270deg, var(--teal-950), transparent); }
/* หยุดเลื่อนเมื่อแถบอยู่นอกจอ (initLifeMarquee ใส่คลาส is-off) */
.life-marquee.is-off .lm-track { animation-play-state: paused; }
.lm-row { overflow: hidden; }
.lm-track { display: flex; gap: 14px; width: max-content; }
.lm-track.is-moving { animation: lm-slide var(--lm-dur, 60s) linear infinite; will-change: transform; }
.lm-row.is-rev .lm-track.is-moving { animation-direction: reverse; }
.lm-row:hover .lm-track, .lm-row:focus-within .lm-track { animation-play-state: paused; }
@keyframes lm-slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.lm-item {
  position: relative; flex: none; width: clamp(240px, 23vw, 340px); aspect-ratio: 3 / 2; padding: 0; border: 0;
  border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.06); cursor: zoom-in; color: #fff; text-align: left;
}
.lm-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.lm-item:hover img, .lm-item:focus-visible img { transform: scale(1.06); }
.lm-item:focus-visible { outline: 3px solid var(--gold-500); outline-offset: -3px; }
.lm-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 11px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(4, 21, 15, 0.9));
}
.lm-cap b {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem; line-height: 1.4;
}
.lm-cap small { display: block; margin-top: 2px; font-size: 0.78rem; color: rgba(255, 246, 216, 0.78); }
/* กำลังโหลดรูปในอัลบั้ม */
.lm-item.is-loading::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.35); border-top-color: var(--gold-500); border-radius: 50%;
  animation: lm-spin 0.8s linear infinite;
}
@keyframes lm-spin { to { transform: rotate(360deg); } }
.btn-ghost-light { color: #FFF6D8; border: 1px solid rgba(255, 246, 216, 0.5); background: transparent; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--gold-500); }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1180px) {
  .quick-bar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 18px; }
  .stat:nth-child(3) { border-left: 0; }
}
@media (max-width: 640px) {
  .quick-bar { margin-top: -30px; }
  .quick-bar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .qb-item:last-child { grid-column: span 2; }
  .qb-item { padding: 12px; gap: 10px; border-radius: 14px; }
  .qb-icon { width: 40px; height: 40px; border-radius: 12px; }
  .qb-icon .ico { width: 21px; height: 21px; }
  .qb-ita .qb-icon { width: 60px; }
  .qb-ita .qb-icon img { width: 48px; }
  .qb-text strong { font-size: 0.95rem; }
  .qb-text small { font-size: 0.74rem; }
  .stats-grid { padding: 22px 0; }
  .stat { padding: 6px 10px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .stat-text { font-size: 0.95rem; }
  .mb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mb-card { padding: 20px 16px 16px; }
  .mb-card:last-child { grid-column: span 2; }
  .mb-no { font-size: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .qb-item, .mb-card, .lm-item img { transition: none; }
  .qb-item:hover, .mb-card:hover { transform: none; }
  .lm-item:hover img { transform: none; }
  /* ไม่เลื่อนเอง — ปัดดูเองได้ */
  .lm-row { overflow-x: auto; scrollbar-width: none; }
  .lm-track.is-moving { animation: none; }
}

/* ป้ายชื่อผู้อำนวยการเป็นพื้นทอง — ตัวหนังสือต้องเป็นเขียวเข้มเสมอ แม้โหมดมืด (--ink-title ในโหมดมืดเป็นสีอ่อน) */
.director-mini h4, .director-mini p { color: var(--teal-950); }
.director-mini p { font-weight: 600; }

/* ===================================================================
   CKR Connect — ปุ่มบนหัวเว็บ (ทุกหน้า) + แถบใต้สไลด์หน้าแรก (ต.ค. 2569)
   =================================================================== */
.btn-connect {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 9px 18px 9px 12px; border-radius: 999px; text-decoration: none;
  font-family: var(--font-display); font-size: 0.92rem; font-weight: 600;
  color: var(--teal-800); border: 1.5px solid var(--gold-600); background: transparent;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.btn-connect b { color: var(--gold-700); font-weight: 700; }
.btn-connect-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--teal-900); color: var(--gold-500); }
.btn-connect-ico .ico { width: 16px; height: 16px; }
.btn-connect:hover { background: var(--gold-050); transform: translateY(-1px); }
:root[data-theme="dark"] .btn-connect { color: var(--ink-900); }
:root[data-theme="dark"] .btn-connect b { color: var(--gold-500); }
body.home .btn-connect { color: #F3EBD8; border-color: rgba(216, 178, 76, 0.75); }
body.home .btn-connect b { color: var(--gold-500); }
body.home .btn-connect:hover { background: rgba(216, 178, 76, 0.14); }
@media (max-width: 640px) {
  .btn-connect { padding: 6px; gap: 0; }
  .btn-connect > span:last-child { display: none; }
}

.connect-band { padding: clamp(26px, 3vw, 42px) 0 0; }
.cb-inner {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: clamp(20px, 3vw, 44px); align-items: center;
  padding: clamp(22px, 2.6vw, 34px) clamp(22px, 3vw, 40px); border-radius: 26px; color: var(--on-brand);
  background: radial-gradient(700px 260px at 0% 0%, rgba(216, 178, 76, 0.22), transparent 70%), linear-gradient(135deg, var(--teal-900), var(--teal-950));
  border: 1px solid rgba(216, 178, 76, 0.45); box-shadow: var(--shadow-lg);
}
.cb-intro { display: flex; align-items: center; gap: 18px; min-width: 0; }
.cb-logo { flex: none; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 20px; background: linear-gradient(135deg, #F1D27A, #C59B27); box-shadow: 0 10px 26px rgba(197, 155, 39, 0.35); }
.cb-logo svg { width: 46px; height: 46px; }
.cb-title { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 2.3vw, 2.1rem); font-weight: 700; color: #fff; line-height: 1.2; }
.cb-title b { color: var(--gold-500); }
.cb-sub { margin: 4px 0 12px; font-family: var(--font-display); font-size: 1rem; color: #E6EFEC; line-height: 1.5; }
.cb-sub small { font-family: var(--font-body); font-size: 0.82rem; color: rgba(255, 255, 255, 0.68); }
.cb-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 999px; text-decoration: none;
  background: var(--gold-500); color: var(--teal-950); font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  transition: transform 0.2s, filter 0.2s;
}
.cb-btn .ico { width: 16px; height: 16px; }
.cb-btn:hover { transform: translateX(3px); filter: brightness(1.06); }
.cb-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cb-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0;
  padding: 16px; border-radius: 18px; text-decoration: none; color: #fff;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.cb-tile:hover { background: rgba(216, 178, 76, 0.14); border-color: var(--gold-500); transform: translateY(-3px); }
.cb-tile-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: rgba(216, 178, 76, 0.16); color: var(--gold-500); margin-bottom: 4px; }
.cb-tile-ico .ico { width: 24px; height: 24px; }
.cb-tile strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.cb-tile small { font-size: 0.78rem; color: rgba(255, 255, 255, 0.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 1100px) { .cb-inner { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cb-logo { width: 60px; height: 60px; border-radius: 16px; }
  .cb-logo svg { width: 38px; height: 38px; }
  .cb-tile { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { .cb-tile, .cb-btn, .btn-connect { transition: none; } .cb-tile:hover, .cb-btn:hover { transform: none; } }

/* เมนู CKR Connect ในแถบเมนูหลัก (แทนเมนู "ภาพกิจกรรม") — ไอคอนทองกับ Connect สีทอง ให้ต่างจากเมนูอื่น */
.nav-connect { display: inline-flex; align-items: center; gap: 7px; }
.nav-connect b { color: var(--gold-500); font-weight: 700; }
.nav-connect-ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: rgba(216, 178, 76, 0.2); color: var(--gold-500); }
.nav-connect-ico .ico { width: 14px; height: 14px; }
.mega-item:hover .nav-connect b { color: var(--gold-500); }

/* ===================================================================
   บอร์ดภาพประชาสัมพันธ์: กดภาพ → หน้าต่างภาพใหญ่ + ปุ่มลิงก์ตามภาพ (main.js · initHighlightGallery)
   อยู่ใต้ lightbox (z-index 999) — ปุ่ม "ขยายภาพ" เปิด lightbox ทับหน้าต่างนี้ได้
   =================================================================== */
/* ป้ายบนภาพ: ภาพที่มีลิงก์แสดงตลอด · ภาพที่ไม่มีลิงก์ขึ้นเมื่อชี้ */
.hb-link-tag.is-on { opacity: 1; transform: none; background: linear-gradient(135deg, #F1D27A, #C59B27); color: var(--teal-950); font-weight: 600; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.45); }

body.pv-open { overflow: hidden; }
/* ปุ่มแชทลอย (สคริปต์ภายนอก) ทับปุ่มลิงก์บนมือถือ — ซ่อนขณะเปิดภาพใหญ่ */
body.pv-open #min-widget { visibility: hidden !important; }
.pv {
  position: fixed; inset: 0; z-index: 990; display: grid; place-items: center; padding: clamp(8px, 1.4vw, 18px);
  background: rgba(4, 20, 16, 0.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.22s ease;
}
.pv[hidden] { display: none; }
.pv.open { opacity: 1; }
.pv-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); width: min(1720px, 100%); height: min(calc(100vh - 2 * clamp(8px, 1.4vw, 18px)), 1400px);
  border-radius: 24px; overflow: hidden; background: var(--white);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  transform: translateY(14px) scale(0.97); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.pv.open .pv-shell { transform: none; }

/* ฝั่งภาพ */
.pv-stage { position: relative; display: grid; place-items: center; min-height: 0; height: 100%; overflow: hidden; background: #0B1D19; touch-action: pan-y; }
.pv-blur { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(40px) brightness(0.45) saturate(1.2); }
.pv-img {
  position: absolute; inset: 0; margin: auto; z-index: 1; display: block; max-width: calc(100% - 24px); max-height: calc(100% - 24px); width: auto; height: auto;
  border-radius: 10px; cursor: zoom-in; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.7); user-select: none;
}
.pv-shell.is-next .pv-img { animation: pv-in-next 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pv-shell.is-prev .pv-img { animation: pv-in-prev 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pv-shell.is-next .pv-side > *, .pv-shell.is-prev .pv-side > * { animation: pv-fade 0.35s ease both; }
@keyframes pv-in-next { from { opacity: 0; transform: translateX(40px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pv-in-prev { from { opacity: 0; transform: translateX(-40px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pv-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pv-nav {
  position: absolute; z-index: 2; top: 50%; width: 46px; height: 46px; margin-top: -23px; display: grid; place-items: center;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); transition: background 0.2s, transform 0.2s;
}
.pv-nav.is-prev { left: 14px; }
.pv-nav.is-next { right: 14px; }
.pv-nav .ico { width: 24px; height: 24px; }
.pv-nav:hover { background: var(--gold-500); color: var(--teal-950); transform: scale(1.06); }
.pv-nav[hidden] { display: none; }

/* ฝั่งข้อมูลและลิงก์ */
.pv-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 20px 22px 22px; }
.pv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-count { font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--gold-700); letter-spacing: 0.04em; }
.pv-x {
  display: grid; place-items: center; width: 38px; height: 38px; margin-left: auto; border: 0; border-radius: 50%; cursor: pointer;
  color: var(--ink-600); background: color-mix(in srgb, var(--ink-600) 10%, transparent); transition: background 0.2s, color 0.2s;
}
.pv-x .ico { width: 20px; height: 20px; }
.pv-x:hover { color: var(--ink-title); background: color-mix(in srgb, var(--ink-600) 18%, transparent); }
.pv-title { margin: 0; font-size: 1.22rem; line-height: 1.4; color: var(--ink-title); }
.pv-label { margin: 6px 0 0; font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--ink-600); }
.pv-links { display: grid; gap: 10px; }
.pv-link {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; text-decoration: none;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink-title);
  background: color-mix(in srgb, var(--teal-500) 7%, var(--white)); border: 1px solid color-mix(in srgb, var(--teal-500) 22%, var(--border));
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, box-shadow 0.2s;
  animation: pv-fade 0.4s ease both; animation-delay: calc(0.08s + var(--k, 0) * 0.06s);
}
.pv-link > .ico:last-child { width: 18px; height: 18px; margin-left: auto; flex: none; opacity: 0.6; transition: transform 0.2s, opacity 0.2s; }
.pv-link:hover { transform: translateY(-2px); border-color: var(--gold-500); box-shadow: 0 14px 26px -16px rgba(8, 38, 33, 0.55); }
.pv-link:hover > .ico:last-child { opacity: 1; transform: translateX(3px); }
.pv-link:focus-visible, .pv-zoom:focus-visible, .pv-x:focus-visible, .pv-nav:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.pv-link-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--teal-600); background: color-mix(in srgb, var(--teal-500) 14%, transparent); }
.pv-link-ico .ico { width: 22px; height: 22px; }
.pv-link-txt { min-width: 0; line-height: 1.35; }
.pv-link.is-main { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--teal-700), var(--teal-950)); box-shadow: 0 16px 28px -16px rgba(8, 38, 33, 0.8); }
.pv-link.is-main .pv-link-ico { color: var(--teal-950); background: linear-gradient(135deg, #F1D27A, #C59B27); }
.pv-link.is-main:hover { border-color: transparent; }
.pv-nolink { margin: 4px 0 0; padding: 14px; border-radius: 14px; font-size: 0.9rem; color: var(--ink-600); background: color-mix(in srgb, var(--ink-600) 7%, transparent); }
.pv-nolink[hidden], .pv-label[hidden], .pv-glabel[hidden], .pv-gallery[hidden] { display: none; }
/* เรื่องที่มีหลายรูป: แถบรูปย่อให้เลือก */
.pv-glabel { margin: 6px 0 0; font-family: var(--font-display); font-size: 0.82rem; font-weight: 600; color: var(--ink-600); }
.pv-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 260px; overflow-y: auto; padding: 3px; margin: -3px; }
.pv-pic {
  position: relative; aspect-ratio: 3 / 4; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--ink-600) 10%, transparent); opacity: 0.72; transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
}
.pv-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pv-pic:hover { opacity: 1; transform: translateY(-2px); }
.pv-pic.is-on { opacity: 1; border-color: var(--gold-500); box-shadow: 0 8px 18px -10px rgba(8, 38, 33, 0.6); }
.pv-pic:focus-visible { outline: 3px solid var(--gold-500); outline-offset: 2px; }
.pv-img.is-swap-next { animation: pv-in-next 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pv-img.is-swap-prev { animation: pv-in-prev 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pv-zoom {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: auto; padding: 11px 14px; border-radius: 14px; cursor: pointer;
  font: inherit; font-size: 0.9rem; color: var(--ink-title); background: transparent; border: 1px dashed color-mix(in srgb, var(--ink-600) 35%, transparent);
  transition: border-color 0.2s, background 0.2s;
}
.pv-zoom .ico { width: 18px; height: 18px; }
.pv-zoom:hover { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-500) 8%, transparent); }

/* จอแคบ: ภาพบน ลิงก์ล่าง เต็มจอ */
@media (max-width: 860px) {
  .pv { padding: 0; place-items: stretch; }
  .pv-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
  .pv-img { max-width: calc(100% - 24px); max-height: calc(100% - 24px); }
  .pv-stage { min-height: 56vh; }
  .pv-nav { width: 40px; height: 40px; margin-top: -20px; }
  .pv-nav.is-prev { left: 8px; }
  .pv-nav.is-next { right: 8px; }
  .pv-side { max-height: 40vh; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); gap: 10px; border-top: 1px solid var(--border); }
  .pv-title { font-size: 1.04rem; }
  .pv-gallery { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; scroll-snap-type: x proximity; }
  .pv-pic { flex: 0 0 60px; scroll-snap-align: start; }
  .pv-zoom { margin-top: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .pv, .pv-shell, .pv-link { transition: none; animation: none !important; }
  .pv-shell.is-next .pv-img, .pv-shell.is-prev .pv-img, .pv-shell.is-next .pv-side > *, .pv-shell.is-prev .pv-side > * , .pv-img.is-swap-next, .pv-img.is-swap-prev { animation: none; }
}

/* ===== ย่อเมนูให้อยู่แถวเดียว (initNavFit ใน main.js) =====
   สคริปต์วัดว่าเมนูตกบรรทัดไหม แล้วใส่ data-fit="1".."5" ทีละขั้นจนพอดี
   ใช้ zoom ย่อทั้งตัวหนังสือและระยะห่างไปพร้อมกัน (เมนูย่อยที่กางลงมาไม่ถูกย่อ) */
.mega-nav[data-fit="1"] .mega-link, .mega-nav[data-fit="1"] .mega-caret { zoom: 0.95; }
.mega-nav[data-fit="2"] .mega-link, .mega-nav[data-fit="2"] .mega-caret { zoom: 0.9; }
.mega-nav[data-fit="3"] .mega-link, .mega-nav[data-fit="3"] .mega-caret { zoom: 0.85; }
.mega-nav[data-fit="4"] .mega-link, .mega-nav[data-fit="4"] .mega-caret { zoom: 0.8; }
.mega-nav[data-fit="5"] .mega-link, .mega-nav[data-fit="5"] .mega-caret { zoom: 0.75; }
.mega-nav[data-fit="4"] .nav-connect-ico, .mega-nav[data-fit="5"] .nav-connect-ico { display: none; }

/* ===== หน้าดาวน์โหลด (content/pages/downloads.html) — การ์ดไฟล์พร้อมภาพตัวอย่างและปุ่มดาวน์โหลด ===== */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; margin: 18px 0 14px; }
.dl-card {
  margin: 0; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.dl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--gold-500); }
/* พื้นลายตารางหมากรุกอ่อน ๆ บอกว่าไฟล์พื้นหลังโปร่งใส (พื้นขาวเสมอ แม้โหมดมืด — โลโก้ออกแบบมาบนพื้นสว่าง) */
.dl-thumb {
  display: flex; align-items: center; justify-content: center; padding: 22px; aspect-ratio: 4 / 3;
  background-color: #FFFFFF;
  background-image: linear-gradient(45deg, #EEF2F1 25%, transparent 25%, transparent 75%, #EEF2F1 75%), linear-gradient(45deg, #EEF2F1 25%, transparent 25%, transparent 75%, #EEF2F1 75%);
  background-size: 18px 18px; background-position: 0 0, 9px 9px; border-bottom: 1px solid var(--border);
}
.dl-thumb img { width: auto; height: 100%; max-width: 100%; object-fit: contain; margin: 0; border-radius: 0; box-shadow: none; }
.dl-card figcaption { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; flex: 1; }
.dl-card h3 { margin: 0; font-size: 1.05rem; }
.dl-card figcaption p { margin: 0; font-size: 0.88rem; color: var(--ink-600); line-height: 1.5; }
.dl-meta { font-size: 0.78rem; color: var(--ink-600); letter-spacing: 0.02em; margin: 4px 0 12px; }
.dl-btn { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; }
.dl-ico { display: inline-flex; }
.dl-ico .ico { width: 18px; height: 18px; }
.dl-note { font-size: 0.88rem; color: var(--ink-600); }

/* ===================================================================
   ลดงานวาดหน้าจอให้เลื่อนลื่นขึ้น (ต.ค. 2569)
   - แถบเมนูที่ติดด้านบน: เลิกเบลอฉากหลัง (backdrop-filter คำนวณใหม่ทุกเฟรมตอนเลื่อนผ่านคลิป/ภาพ) ใช้พื้นทึบแทน
   - ส่วนหัวตอนคลิปเล่น: หยุดภาพนิ่งซูมช้าและแสงตามเมาส์ (มองไม่เห็นใต้คลิปอยู่แล้ว)
   =================================================================== */
.mega-nav, body.home .mega-nav { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(8, 38, 33, 0.97); }
.candle-hero.has-video .ch-photo-layer { animation: none; }
.candle-hero.has-video .ch-spot { display: none; }

/* ===================================================================
   หน้างานเทคโนโลยีสารสนเทศ (public/content/pages/it.html)
   ปุ่มขอใช้บริการ + รายการระบบสารสนเทศ (#menuSystems ชุดเดียวกับหน้าแรก)
   =================================================================== */
.it-lead { font-size: 1.02rem; margin: 0 0 4px; }
.it-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.it-action, .it-connect {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--white); color: var(--ink-900); text-decoration: none;
  transition: border-color 0.2s, background-color 0.2s;
}
.it-action:hover { border-color: var(--teal-600); background: var(--teal-050); }
.it-action-ico {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 10px; background: var(--teal-900); color: var(--gold-500); font-size: 1.3rem;
}
.it-action-text, .it-connect-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.45; }
.it-action-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink-title); }
.it-action-text small, .it-connect-text small { font-size: 0.86rem; color: var(--ink-600); }
.it-tag {
  align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 4px; font-style: normal;
  font-size: 0.76rem; background: var(--gold-050); color: var(--gold-700); border: 1px solid var(--gold-100);
}
.it-action-text small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.it-group { margin: 22px 0 0; font-size: 0.98rem; color: var(--ink-600); font-weight: 600; }
.it-group + .it-actions { margin-top: 10px; }
.it-action.is-maint { opacity: 0.6; cursor: default; }
.it-action.is-maint:hover { border-color: var(--border); background: var(--white); }
.it-action.is-maint .it-action-ico { background: var(--ink-400); color: var(--white); }
.it-action-go { flex: none; color: var(--ink-400); transition: transform 0.2s, color 0.2s; }
.it-action:hover .it-action-go { color: var(--teal-700); transform: translate(2px, -2px); }

.it-connect { margin: 14px 0 10px; background: var(--teal-900); border-color: var(--teal-900); color: #F7F1DF; }
.it-connect-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: #FFFFFF; }
.it-connect-text strong b { color: var(--gold-500); font-weight: 600; }
.it-connect-text small { color: var(--sage-200); }
.it-connect .it-action-go { color: var(--gold-500); }
.it-connect:hover .it-action-go { transform: translateX(4px); }

.it-systems { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0 0 8px; padding: 0; }
.it-systems .sys-banner {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white);
  color: var(--ink-700); text-decoration: none; font-size: 0.93rem; line-height: 1.4;
  transition: border-color 0.2s, color 0.2s;
}
.it-systems .sys-banner:hover { border-color: var(--teal-600); color: var(--ink-title); }
.it-systems .sys-banner-icon {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 8px; background: var(--teal-050); color: var(--teal-700); font-size: 1.05rem;
}
.it-more { margin-top: 18px; font-size: 0.92rem; }
/* ดาวน์โหลดโปรแกรม (หน้างานเทคโนฯ) */
.it-dl-lead { margin: 0 0 10px; font-size: 0.92rem; color: var(--ink-600); }
.it-dl { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); overflow: hidden; }
.it-dl li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; }
.it-dl li:nth-child(even) { background: var(--teal-050); }
.it-dl li + li { border-top: 1px solid var(--border); }
.it-dl img { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.it-dl div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.5; }
.it-dl strong { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--ink-title); }
.it-dl span { font-size: 0.93rem; color: var(--ink-700); }
.it-dl small { font-size: 0.82rem; color: var(--ink-400); }
.it-dl p { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 0.88rem; }
.it-dl p a { color: var(--teal-700); text-decoration: none; }
.it-dl p a::before { content: "› "; }
.it-dl p a.is-main { font-weight: 600; }
.it-dl p a:hover { text-decoration: underline; }
.it-dl-note { margin: 8px 0 0; font-size: 0.82rem; color: var(--ink-400); }
@media (prefers-reduced-motion: reduce) {
  .it-action-go { transition: none; }
  .it-action:hover .it-action-go, .it-connect:hover .it-action-go { transform: none; }
}

/* ===================================================================
   คลิปแนะนำ CKR Connect: ปุ่มใต้การ์ดหน้าแรก + หน้าต่างวิดีโอ + วิดีโอในหน้างาน IT
   =================================================================== */
/* คลิปแนะนำ CKR Connect ใต้กล่อง CKR Connect: ภาพตัวอย่าง + ปุ่มเล่นทองตรงกลาง (แบบการ์ดวิดีโอ) */
.connect-video {
  display: block; width: 100%; margin: -6px 0 6px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--white); overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: inherit;
  box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.connect-video:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(4, 38, 33, .18); }
.cv-thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #0B2622; overflow: hidden; }
.cv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.connect-video:hover .cv-thumb img { transform: scale(1.04); }
.cv-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(4, 22, 19, .45)); }
.cv-play {
  position: absolute; left: 50%; top: 50%; z-index: 1; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(145deg, #F3D892, #C9962B); color: #0B2622;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 0 0 rgba(226, 189, 107, .55); animation: cvPulse 2.2s ease-out infinite; transition: transform .2s;
}
.cv-play svg { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }
.connect-video:hover .cv-play { transform: scale(1.1); }
@keyframes cvPulse { 0% { box-shadow: 0 8px 22px rgba(0,0,0,.35), 0 0 0 0 rgba(226,189,107,.55); } 70%, 100% { box-shadow: 0 8px 22px rgba(0,0,0,.35), 0 0 0 16px rgba(226,189,107,0); } }
@media (prefers-reduced-motion: reduce) { .cv-play { animation: none; } }
.cv-dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: .78rem; font-weight: 600; }
.cv-cap { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; }
.cv-cap b { color: var(--teal-700); font-size: .95rem; }
.cv-cap small { color: var(--ink-400); font-size: .8rem; }
.connect-video-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: -8px; margin-bottom: 4px; padding: 10px 14px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent;
  font: inherit; font-size: 0.92rem; color: var(--teal-700); cursor: pointer; text-align: left;
}
.connect-video-btn small { margin-left: auto; color: var(--ink-400); font-size: 0.8rem; }
.connect-video-btn:hover { border-style: solid; border-color: var(--teal-600); background: var(--teal-050); }
.video-pop { width: min(1100px, 94vw); padding: 0; border: 0; border-radius: 14px; background: #000; overflow: visible; }
.video-pop::backdrop { background: rgba(4, 21, 15, 0.82); }
.video-pop video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; background: #000; }
.video-pop-x {
  position: absolute; top: -46px; right: 0; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.video-pop-x:hover { background: rgba(255,255,255,.28); }
.it-video { margin: 14px 0 6px; }
.it-video video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: #0B2C27; }
.it-video figcaption { margin-top: 6px; font-size: 0.86rem; color: var(--ink-600); }

/* ===================================================================
   การ์ดผู้อำนวยการแบบพรีเมียม — กรอบทองไล่เฉด (ขอบ 2px ด้วย background 2 ชั้น), เส้นทองบางรอบรูป,
   ป้ายชื่อทองเมทัลลิก (ไล่แสงบน-ล่าง + ขอบสว่างด้านบน), ตัวหนังสือเขียวเข้มพร้อมเงาขาวบาง ๆ ให้คมบนพื้นทอง
   ใช้เหมือนกันทั้งโหมดสว่าง/มืด (ทองกับเขียวเข้มเป็นสีประจำวิทยาลัย)
   =================================================================== */
/* กรอบทองรอบการ์ดและมุมประดับเอาออกแล้ว (ดูแน่นเกินไป) — คงไว้เฉพาะกรอบรูปและป้ายชื่อทอง */
.director-mini-img-wrap {
  border: 0;
  box-shadow: 0 0 0 1px rgba(197, 155, 39, .9), 0 0 0 5px var(--white), 0 0 0 6px rgba(197, 155, 39, .45), 0 14px 26px -14px rgba(8, 38, 33, .5);
}
.director-info {
  border: 1px solid #A67F1D;
  background: linear-gradient(180deg, #F6E3A1 0%, #E2C062 38%, #D1A53A 62%, #B98C22 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -1px 0 rgba(120, 86, 10, .35), 0 10px 22px -10px rgba(120, 86, 10, .6);
}
/* เส้นคั่นบาง ๆ ระหว่างชื่อกับตำแหน่ง */
.director-mini h4 { color: #062019; text-shadow: 0 1px 0 rgba(255, 246, 214, .55); }
.director-mini h4::after {
  content: ""; display: block; width: 56px; height: 1.5px; margin: 5px auto 4px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(8, 38, 33, .55), transparent);
}
.director-mini p { color: #0D3B35; text-shadow: 0 1px 0 rgba(255, 246, 214, .45); letter-spacing: .005em; }
/* ชื่อยาวราว 17 เท่าของขนาดอักษร — ย่ออักษรตามความกว้างป้ายจริง (container query) ไม่ให้ตกขอบบนจอ/หน้าต่างแคบ
   เบราว์เซอร์เก่าที่ไม่รู้จัก cqi: ปล่อยตัดบรรทัดแทน */
.director-info { container-type: inline-size; }
.director-mini h4 { font-size: min(clamp(0.86rem, 1.1vw, 1.14rem), 100cqi / 18.5); }
@media (max-width: 980px) {
  .director-mini h4 { font-size: min(1.15rem, 100cqi / 18.5); }
}
@supports not (font-size: 1cqi) {
  .director-mini h4 { white-space: normal; }
}
