/* ================================================================
   สไตล์ชีตเว็บไซต์โรงเรียนวัดบุญสัมพันธ์
   โทนสี : ฟ้า–เหลือง (สีประจำโรงเรียน)
   ฟอนต์ : Prompt (หัวข้อ) / Sarabun (เนื้อหา)
   ================================================================ */

/* ---------- ตัวแปรสีหลักของเว็บไซต์ : แก้ไขโทนสีทั้งเว็บได้ที่นี่จุดเดียว ---------- */
:root {
  --blue-dark:   #0d3b8c;   /* ฟ้าเข้ม : พื้นหลังส่วนหัว/ส่วนท้าย */
  --blue:        #1565c0;   /* ฟ้าหลัก : ปุ่ม ลิงก์ หัวข้อ */
  --blue-light:  #e9f2fc;   /* ฟ้าอ่อน : พื้นหลังบางส่วน */
  --yellow:      #ffc107;   /* เหลืองหลัก : เส้นคาด ปุ่มเด่น */
  --yellow-soft: #fff6db;   /* เหลืองอ่อน : พื้นหลังการ์ด */
  --badge-color: #0d3b8c;   /* สีป้ายวันที่แบบปฏิทิน : แก้ไขตรงนี้จุดเดียว
                               ตัวเลือกแนะนำ : #d9534f (แดง) / #0d3b8c (ฟ้าเข้ม) / #1565c0 (ฟ้าหลัก) */
  --text-dark:   #1f2937;   /* สีตัวอักษรหลัก */
  --text-muted:  #5b6675;   /* สีตัวอักษรรอง */
  --white:       #ffffff;
  --shadow: 0 4px 16px rgba(13, 59, 140, 0.10);  /* เงามาตรฐานของการ์ด */
  --radius: 12px;                                 /* ความโค้งมุมมาตรฐาน */

  /* ---------- ฟอนต์ (ตั้งค่าได้ที่เมนู "หน้าตาเว็บไซต์" ในระบบ Admin) ---------- */
  --font-head: 'Prompt', sans-serif;    /* ฟอนต์หัวข้อและเมนู */
  --font-body: 'Sarabun', sans-serif;   /* ฟอนต์เนื้อหา */
}

/* ---------- รีเซ็ตค่าพื้นฐาน ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);   /* ฟอนต์เนื้อหา */
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.7;
}

h1, h2, h3, .brand-text, .nav-link {
  font-family: var(--font-head);    /* ฟอนต์หัวข้อและเมนู */
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* กล่องเนื้อหากึ่งกลาง กว้างสุด 1200px */
.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

/* ระยะห่างมาตรฐานของแต่ละส่วน */
.section { padding: 56px 0; }

/* หัวข้อประจำส่วน : ข้อความบรรทัดบน / เส้นคั่น 2 ข้างมีไอคอนอยู่ตรงกลาง
   ความกว้างหัวข้อ = ความกว้างข้อความ (fit-content) เส้นคั่นจึงยาวเท่าข้อความพอดี */
.section-title {
  width: fit-content;
  margin: 0 auto 36px;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--blue-dark);
  text-align: center;
}
.section-title .title-text { display: block; }

.title-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.title-divider .title-line {
  flex: 1;                       /* เส้น 2 ข้างยืดเต็มความกว้างข้อความ */
  height: 3px;
  border-radius: 2px;
  background: var(--yellow);
}
.title-divider .title-icon {
  display: grid;
  place-items: center;           /* ไอคอนอยู่กึ่งกลางระหว่างเส้นพอดี */
}
.title-divider .title-icon svg { width: 22px; height: 22px; }
.section-title.align-left { margin-inline: 0; text-align: left; }

/* ================================================================
   ส่วนหัวเว็บไซต์ (Header)
   ================================================================ */
.site-header {
  background: var(--blue-dark);
  position: sticky;      /* ตรึงเมนูไว้ด้านบนเมื่อเลื่อนจอ */
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

.header-inner {
  width: min(1360px, 96%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;   /* โลโก้ชิดซ้าย เมนูชิดขวา */
  gap: 16px;
  min-height: 76px;
  padding: 8px 0;
}

/* โลโก้และชื่อโรงเรียน */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;            /* แสดงเฉพาะตัวโลโก้ ไม่มีกรอบวงกลมรอง */
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-en {
  color: var(--yellow);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: .3px;
}
.brand-th {
  color: var(--white);
  font-size: .82rem;
  font-weight: 400;
}

/* ---------- เมนูหลัก ---------- */
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  color: var(--white);
  background: none;
  border: 0;
  font-size: .92rem;
  font-weight: 500;
  border-radius: 8px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  background: rgba(255, 255, 255, .12);
  color: var(--yellow);
  text-decoration: none;
}
.caret { display: inline-grid; place-items: center; }
.caret svg { width: 13px; height: 13px; }

/* ---------- เมนูย่อย (Dropdown) ---------- */
.has-dropdown { position: relative; }

.dropdown {
  list-style: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 250px;
  background: var(--white);
  border-radius: 10px;
  border-top: 3px solid var(--yellow);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.dropdown-wide { min-width: 320px; }   /* เมนูย่อย E-SERVICE ที่ข้อความยาว */

/* แสดงเมนูย่อยเมื่อชี้เมาส์ (จอใหญ่) หรือเมื่อกดเปิด (คลาส .open จาก JavaScript) */
@media (hover: hover) {
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
  }
}
.has-dropdown.open .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 9px 18px;
  color: var(--text-dark);
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.dropdown a:hover {
  background: var(--blue-light);
  color: var(--blue-dark);
  text-decoration: none;
}

/* ---------- ปุ่มแฮมเบอร์เกอร์ (ซ่อนบนจอใหญ่) ---------- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
}
.hamburger span {
  width: 26px; height: 3px;
  border-radius: 2px;
  background: var(--white);
  transition: transform .25s, opacity .25s;
}
/* เปลี่ยนปุ่มเป็นรูปกากบาทเมื่อเมนูเปิดอยู่ */
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ================================================================
   1) แถบประกาศ (Typing Effect)
   ================================================================ */
.announce-bar {
  background: var(--yellow);
  color: var(--blue-dark);
  font-weight: 600;
  overflow: hidden;
}
.announce-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;      /* ข้อความประกาศอยู่กึ่งกลางแถบ */
  text-align: center;
  gap: 2px;
  padding: 10px 0;
  font-size: .95rem;
  min-height: 44px;
}

/* เคอร์เซอร์กะพริบท้ายข้อความพิมพ์ */
.typing-cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ================================================================
   2) สไลด์ภาพ (Image Slider)
   ================================================================ */
.slider {
  position: relative;
  overflow: hidden;
  background: var(--blue-light);
}

.slides {
  display: flex;
  transition: transform .6s ease;   /* ความนุ่มนวลตอนเลื่อนภาพ */
}
.slide { min-width: 100%; }
.slide img {
  width: 100%;
  height: clamp(220px, 42vw, 560px);   /* ความสูงสไลด์ปรับตามขนาดจอ */
  object-fit: cover;
}

/* ปุ่มเลื่อนซ้าย–ขวา */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(13, 59, 140, .55);
  color: var(--white);
  display: grid;
  place-items: center;
  transition: background .2s;
  z-index: 5;
}
.slider-btn svg { width: 20px; height: 20px; }
.slider-btn:hover { background: var(--yellow); color: var(--blue-dark); }
.slider-btn.prev { left: 16px; }
.slider-btn.next { right: 16px; }

/* จุดบอกตำแหน่งสไลด์ */
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.slider-dots button {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: transparent;
  padding: 0;
  transition: background .2s, transform .2s;
}
.slider-dots button.active {
  background: var(--yellow);
  border-color: var(--yellow);
  transform: scale(1.15);
}

/* ================================================================
   3) บล็อกสถิติ (Counter)
   ================================================================ */
.stats-section {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}
.stats-section .section-title { color: var(--white); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* จอใหญ่แถวละ 4 การ์ด */
  gap: 18px;
}

.stat-card {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  text-align: center;
  padding: 26px 12px;
  backdrop-filter: blur(2px);
}
/* การ์ดยอดนักเรียนทั้งหมด เน้นเป็นสีเหลือง */
.stat-main {
  background: var(--yellow);
  border-color: var(--yellow);
}
.stat-main .stat-number,
.stat-main .stat-label { color: var(--blue-dark); }

.stat-number {
  font-family: var(--font-head);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1.2;
}
.stat-label {
  color: var(--white);
  font-size: .95rem;
  margin-top: 6px;
}

/* ================================================================
   4) บล็อกบริการ 3 บล็อก
   ================================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* เรียง 3 บล็อกในแถวเดียว */
  gap: 22px;
}

.service-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 22px;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 26px rgba(13, 59, 140, .18);
  text-decoration: none;
}

.service-icon {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.service-icon svg { width: 34px; height: 34px; }

.service-card h3 {
  color: var(--blue-dark);
  font-size: 1.12rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.service-card p {
  color: var(--text-muted);
  font-size: .92rem;
}

/* ================================================================
   5) บล็อกกิจกรรม : ภาพแนวตั้งคล้าย A4 + Lightbox
   ================================================================ */
.activities-section { background: var(--blue-light); }

.activities-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);   /* จอใหญ่แถวละ 4 ภาพ */
  gap: 20px;
}

.activity-item {
  position: relative;            /* จุดอ้างอิงของป้ายวันที่บนภาพ */
  border: 0;
  padding: 0;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.activity-item:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .22);
}
.activity-item img {
  width: 100%;
  aspect-ratio: 210 / 297;   /* สัดส่วนกระดาษ A4 แนวตั้ง */
  object-fit: cover;
}

/* ================================================================
   ป้ายวันที่แบบปฏิทิน : เลขวันตัวใหญ่สีแดง + แถบชื่อเดือนพื้นแดง
   ใช้บนภาพกิจกรรม ภาพรางวัล (มุมซ้ายบนของภาพ) และหน้ารายการข่าว
   ================================================================ */
.date-badge {
  position: absolute;
  top: 8px; left: 8px;          /* ชิดมุมซ้ายบนของภาพ */
  z-index: 2;
  min-width: 56px;
  background: var(--white);
  border: 2px solid var(--badge-color);
  border-radius: 9px;
  overflow: hidden;
  text-align: center;
  font-family: var(--font-head);
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
}
.date-badge .d-day {
  display: block;
  color: var(--badge-color);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 7px 8px 5px;
}
.date-badge .d-month {
  display: block;
  background: var(--badge-color);
  color: var(--white);
  font-size: .68rem;
  font-weight: 500;
  padding: 4px 6px 5px;
  white-space: nowrap;
}

/* กล่องขยายภาพ (Lightbox) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: none;               /* ซ่อนไว้ก่อน เปิดด้วย JavaScript */
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.lightbox.show { display: flex; flex-direction: column; gap: 16px; }
.lightbox img {
  max-width: min(92vw, 700px);
  max-height: 78vh;             /* เผื่อพื้นที่ปุ่มคลังภาพด้านล่าง */
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: var(--white);
  font-size: 1.6rem;
  transition: background .2s;
}
.lightbox-close:hover { background: var(--yellow); color: var(--blue-dark); }

/* ปุ่มไปยังคลังภาพกิจกรรมบน Facebook (ใต้ภาพขยาย) */
.lightbox-album {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  padding: 11px 24px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
  transition: transform .2s ease, background .2s, color .2s;
}
.lightbox-album:hover {
  transform: scale(1.07);
  background: var(--white);
  text-decoration: none;
}
.lightbox-album svg { width: 18px; height: 18px; }
.lightbox-album[hidden] { display: none; }

/* ================================================================
   บล็อกรางวัลและความภาคภูมิใจ : 3 ภาพต่อแถว + ข้อความประกอบใต้ภาพ
   ================================================================ */
.awards-section { background: var(--yellow-soft); }

.awards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* จอใหญ่แถวละ 3 ภาพ */
  gap: 22px;
}

.award-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.award-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .2);
}

/* ปุ่มครอบภาพ (กดเพื่อขยายดูภาพใหญ่) */
.award-item {
  position: relative;            /* จุดอ้างอิงของป้ายวันที่บนภาพ */
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
}
.award-item img {
  width: 100%;
  aspect-ratio: 4 / 3;      /* ภาพแนวนอนสัดส่วน 4:3 */
  object-fit: cover;
  display: block;
}

/* ข้อความประกอบใต้ภาพ */
.award-card figcaption {
  padding: 13px 16px 15px;
  text-align: center;
  font-size: .93rem;
  color: var(--text-dark);
  border-top: 3px solid var(--yellow);
  line-height: 1.55;
}

/* ================================================================
   6) บล็อกข่าวสาร
   ================================================================ */
.news-list { list-style: none; }
.news-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 4px;
  border-bottom: 1px dashed #ccd6e4;
}

/* ป้ายวันที่ในรายการข่าว : วางแบบปกติด้านซ้าย (ไม่ลอยทับเหมือนบนภาพ) */
.news-list .date-badge {
  position: static;
  flex: 0 0 auto;
  min-width: 52px;
  box-shadow: none;
}
.news-list .date-badge .d-day { font-size: 1.15rem; padding: 6px 6px 4px; }
.news-list a {
  flex: 1;
  color: var(--text-dark);
  font-size: .98rem;
  transition: color .15s;
}
.news-list a:hover { color: var(--blue); }
/* ไอคอนคลิปหนีบ : แสดงเมื่อข่าวมีไฟล์แนบเพิ่มเติมจากลิงก์ข่าว */
.news-clip {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--yellow-soft);
  color: var(--blue-dark);
  transition: background .2s, color .2s, transform .2s;
}
.news-clip svg { width: 16px; height: 16px; }
.news-clip:hover {
  background: var(--yellow);
  transform: scale(1.12);
  text-decoration: none;
}

.news-list time {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: .85rem;
  white-space: nowrap;
}

/* ================================================================
   7) บล็อกวิดีโอกิจกรรม
   ================================================================ */
.videos-section { background: var(--yellow-soft); }

.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);   /* 3 วิดีโอเรียงแถวเดียว */
  gap: 22px;
}

/* กรอบวิดีโอ สัดส่วน 16:9 รองรับทั้ง placeholder และ iframe YouTube */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--blue-dark);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* หน้าตากรอบวิดีโอตัวอย่าง ก่อนใส่วิดีโอจริง */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--white);
  text-align: center;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}
.video-placeholder .play-icon {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue-dark);
  display: grid;
  place-items: center;
}
.video-placeholder .play-icon svg { width: 26px; height: 26px; margin-left: 3px; }
.video-placeholder small { color: #cfe0f5; }

/* ================================================================
   9) ส่วนท้ายเว็บ (Footer)
   ================================================================ */
.site-footer {
  background: var(--blue-dark);
  color: #dbe6f5;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;   /* ชื่อโรงเรียน / ติดต่อเรา / สถิติการเข้าชม(ขวาสุด) */
  gap: 36px;
  padding: 44px 0 28px;
  align-items: start;
}

.footer-col h3 {
  color: var(--yellow);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.footer-col p { font-size: .92rem; margin-bottom: 6px; }

/* หัวข้อย่อย "ติดต่อเรา" ที่รวมอยู่ในบล็อกชื่อโรงเรียน */
.footer-sub-title { margin-top: 18px; }

/* กรอบแผนที่โรงเรียน (Google Maps) */
.map-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  aspect-ratio: 4 / 3;
  transition: transform .3s ease, box-shadow .3s ease;
}
.map-frame:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.footer-col a { color: var(--white); }
.footer-col a:hover { color: var(--yellow); }

/* ---------- 8) บล็อกสถิติการเข้าชม (คอลัมน์ขวาสุดของ Footer) ---------- */
.visitor-block {
  background: rgba(255, 255, 255, .07);            /* กล่องจางบนพื้นเข้ม ให้เด่นขึ้นเล็กน้อย */
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  padding: 20px 20px 14px;
}
.visitor-title {
  color: var(--yellow);
  font-size: 1.1rem;
  font-weight: 600;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--yellow);
}
/* วันที่เริ่มนับสถิติ (บรรทัดเล็กใต้ชื่อหัวข้อ) */
.visitor-since {
  display: block;
  font-family: var(--font-body);
  font-size: .76rem;
  font-weight: 400;
  color: #cfe0f5;
  margin-top: 2px;
}

.visitor-list { list-style: none; }

/* ป้ายชื่อสถิติพร้อมไอคอน SVG ประจำแถว */
.visitor-list .v-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.visitor-list .v-label svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--yellow);
}
.visitor-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  font-size: .9rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.visitor-list li:last-child { border-bottom: 0; }
.visitor-list strong { color: var(--yellow); font-weight: 600; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  text-align: center;
  padding: 16px 12px;
  font-size: .88rem;
}

/* ================================================================
   ปุ่มติดต่อลอย (Floating Contact)
   วางเหนือปุ่มเลื่อนขึ้นด้านบน มุมล่างขวาของจอ
   กดปุ่มหลัก = กางปุ่มช่องทางติดต่อขึ้นด้านบนทีละปุ่ม
   ================================================================ */
.contact-fab {
  position: fixed;
  right: 22px;
  bottom: 82px;              /* เหนือปุ่มเลื่อนขึ้นด้านบน */
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* รายการปุ่มช่องทางติดต่อ (ซ่อนไว้ก่อน) */
.cf-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cf-item {
  position: relative;
  width: 50px;
  height: 50px;
  border: 3px solid var(--white);      /* วงแหวนขาวเข้าชุดกับปุ่มหลัก */
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--white);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);

  /* สถานะซ่อน : ย่อหายลงไปหาปุ่มหลัก */
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.5);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .9, .3, 1.3),
              visibility .28s, box-shadow .2s;
}
.cf-item svg { width: 24px; height: 24px; }
.cf-item:hover {
  transform: translateY(0) scale(1.14);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .4);
  text-decoration: none;
}

/* สีประจำแต่ละช่องทาง */
.cf-fb   { background: #1877f2; }
.cf-msg  { background: linear-gradient(45deg, #0695ff, #a334fa); }
.cf-line { background: #06c755; }
.cf-mail { background: #3f51b5; }
.cf-tel  { background: #f7941d; }

/* ป้ายชื่อช่องทาง (แสดงเมื่อชี้เมาส์) */
.cf-tip {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--blue-dark);
  color: var(--white);
  font-family: var(--font-body);
  font-size: .82rem;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.cf-item:hover .cf-tip { opacity: 1; }

/* ปุ่มหลัก */
.cf-toggle {
  width: 62px;
  height: 62px;
  border: 4px solid var(--white);      /* วงแหวนขาวล้อมรอบปุ่ม */
  border-radius: 50%;
  background: #1a8cff;                 /* ฟ้าสดแบบปุ่มแชท */
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(26, 140, 255, .45), 0 2px 8px rgba(0, 0, 0, .18);
  transition: background .25s, transform .25s, box-shadow .25s;
}
.cf-toggle:hover {
  background: #0b7ae8;
  transform: scale(1.08);
  box-shadow: 0 14px 30px rgba(26, 140, 255, .55), 0 3px 10px rgba(0, 0, 0, .22);
}
.cf-toggle svg { width: 32px; height: 32px; }

/* สลับไอคอนแชท / กากบาท */
.cf-ico-close { display: none; }
.contact-fab.open .cf-ico-chat  { display: none; }
.contact-fab.open .cf-ico-close { display: grid; }
.contact-fab.open .cf-toggle {
  background: var(--blue-dark);
  box-shadow: 0 8px 22px rgba(13, 59, 140, .45), 0 2px 8px rgba(0, 0, 0, .18);
  transform: rotate(90deg);
}
.contact-fab.open .cf-toggle svg { width: 26px; height: 26px; }
.contact-fab.open .cf-toggle:hover { transform: rotate(90deg) scale(1.08); }

/* สถานะเปิด : ปุ่มช่องทางกางขึ้นทีละปุ่มแบบไล่จังหวะ */
.contact-fab.open .cf-item {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.contact-fab.open .cf-item:nth-child(1) { transition-delay: .04s; }
.contact-fab.open .cf-item:nth-child(2) { transition-delay: .08s; }
.contact-fab.open .cf-item:nth-child(3) { transition-delay: .12s; }
.contact-fab.open .cf-item:nth-child(4) { transition-delay: .16s; }
.contact-fab.open .cf-item:nth-child(5) { transition-delay: .20s; }

/* ================================================================
   ปุ่มเลื่อนขึ้นไปด้านบน (Back to Top)
   ลอยมุมล่างขวาของจอ ซ่อนไว้ก่อน แสดงเมื่อเลื่อนจอลงมา (คลาส .show)
   ================================================================ */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 14px;          /* ทรงสี่เหลี่ยมมุมโค้ง (เดิมเป็นวงกลม) */
  background: var(--yellow);
  color: var(--blue-dark);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  display: grid;
  place-items: center;
  z-index: 1500;

  /* สถานะซ่อน : โปร่งใสและกดไม่ได้ */
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .3s, transform .3s, visibility .3s, background .2s;
}
.back-to-top svg { width: 24px; height: 24px; }

/* สถานะแสดงปุ่ม (JavaScript จะเพิ่มคลาส .show เมื่อเลื่อนจอลงมา) */
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--blue);
  color: var(--white);
}

/* ================================================================
   เอฟเฟกต์ Scroll Reveal : เนื้อหาค่อย ๆ ปรากฏเมื่อเลื่อนจอมาถึง
   - คลาส .reveal ถูกเพิ่มโดย JavaScript เท่านั้น
     (เบราว์เซอร์เก่าหรือปิด JavaScript = เนื้อหาแสดงปกติทั้งหมด)
   - จังหวะไล่ทีละชิ้นในแถวเดียวกัน กำหนดผ่าน transition-delay ใน script.js
   ================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);          /* เริ่มต้น : จางและอยู่ต่ำกว่าตำแหน่งจริงเล็กน้อย */
  transition: opacity .7s ease, transform .7s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}
.reveal-left  { transform: translateX(-34px); }   /* โผล่จากด้านซ้าย (ใช้กับรายการข่าว) */
.reveal-zoom  { transform: scale(.92); }          /* ขยายเข้ามา (ใช้กับภาพกิจกรรม/รางวัล) */

.reveal.revealed {
  opacity: 1;
  transform: none;                      /* ตำแหน่งและขนาดจริง */
}

/* ผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว : แสดงทันทีไม่ต้องมีเอฟเฟกต์ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ================================================================
   Responsive : ปรับการแสดงผลตามขนาดหน้าจอ
   ================================================================ */

/* ---------- จอแท็บเล็ตแนวนอน / โน้ตบุ๊กจอเล็ก (ไม่เกิน 1100px) ---------- */
@media (max-width: 1100px) {

  /* แสดงปุ่มแฮมเบอร์เกอร์ และเปลี่ยนเมนูเป็นแบบเลื่อนลงจากด้านบน */
  .hamburger { display: flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--blue-dark);
    box-shadow: 0 12px 24px rgba(0,0,0,.3);
    max-height: 0;                 /* เมนูซ่อนอยู่ (ความสูง 0) */
    overflow-y: auto;
    transition: max-height .35s ease;
  }
  .main-nav.open { max-height: min(78vh, 620px); }   /* เมนูเปิด */

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 14px;
  }
  .nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 13px 22px;
    border-radius: 0;
    font-size: 1rem;
    white-space: normal;
    text-align: left;
  }

  /* เมนูย่อยบนมือถือ : แสดงต่อท้ายในแนวตั้ง เปิด/ปิดด้วยการแตะ */
  .dropdown {
    position: static;
    min-width: 100%;
    box-shadow: none;
    border-radius: 0;
    border-top: 0;
    background: rgba(255,255,255,.06);
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;               /* ซ่อนไว้ก่อน */
    padding: 0;
  }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown a {
    color: #dbe6f5;
    padding: 11px 36px;
    font-size: .93rem;
  }
  .dropdown a:hover { background: rgba(255,255,255,.1); color: var(--yellow); }

  /* สถิติ : แถวละ 2 การ์ด */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Footer : เหลือ 2 คอลัมน์ (สถิติการเข้าชมตกลงมาแถวใหม่) */
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- จอแท็บเล็ต (ไม่เกิน 900px) ---------- */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: 1fr; }       /* บริการเรียงลงมา */
  .activities-grid { grid-template-columns: repeat(2, 1fr); }  /* กิจกรรมแถวละ 2 ภาพ */
  .awards-grid { grid-template-columns: 1fr; }          /* รางวัลเรียงลงมา */
  .levels-grid { grid-template-columns: 1fr; }           /* ระดับชั้นเรียงลงมา */
  .dept-doc .mission-grid { grid-template-columns: 1fr; }
  .dept-links-grid { grid-template-columns: 1fr; }
  .vid-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .subj-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .fac-grid { grid-template-columns: 1fr; }
  .uni-grid { grid-template-columns: 1fr; }
  .milestones { grid-template-columns: 1fr; gap: 30px; } /* เส้นทางสำคัญเรียงลงมา */
  .info-grid { grid-template-columns: 1fr; }             /* ข้อมูลทั่วไปเรียงลงมา */
  .community-grid { grid-template-columns: 1fr; }        /* สภาพชุมชนเรียงลงมา */
  .identity-grid { grid-template-columns: 1fr; }         /* สัญลักษณ์เรียงลงมา */
  .motto-grid { grid-template-columns: 1fr; }            /* เอกลักษณ์/คำขวัญเรียงลงมา */
  .history-card { flex-direction: column; align-items: center; text-align: left; }
  .videos-grid { grid-template-columns: 1fr; }          /* วิดีโอเรียงลงมา */
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- จอมือถือ (ไม่เกิน 560px) ---------- */
@media (max-width: 560px) {
  .brand-en { font-size: .9rem; }
  .brand-th { font-size: .72rem; }
  .brand-logo { width: 46px; height: 46px; }

  .section { padding: 40px 0; }
  .more-btn { font-size: .9rem; padding: 11px 24px; }
  /* หน้ารับสมัครเรียนบนมือถือ */
  .adm-nav-btn { font-size: .85rem; padding: 9px 16px 9px 10px; }
  .adm-block-head { padding: 16px; gap: 12px; }
  .adm-block-head h2 { font-size: 1.04rem; }
  .adm-body { padding: 18px 16px; }
  .adm-body .adm-sub { font-size: 1rem; }
  .adm-body .adm-docs li { padding-left: 42px; }
  .adm-body .adm-docs li:hover { transform: none; }
  .adm-actions { padding: 0 16px 20px; }
  .adm-btn { width: 100%; justify-content: center; }
  .adm-poster-tag { right: 8px; bottom: 8px; font-size: .78rem; padding: 6px 12px; }

  .vid-grid { grid-template-columns: 1fr; }
  .vid-card:hover { transform: none; }
  .vid-play { width: 52px; height: 52px; }
  .vid-play svg { width: 23px; height: 23px; }
  .video-viewer { padding: 8px; }
  .vv-bar { padding: 10px 8px 10px 14px; }
  .vv-title { font-size: .9rem; }
  .news-card { flex-direction: column; gap: 12px; padding: 16px; }
  .news-card:hover { transform: none; }
  .nc-title { font-size: .98rem; }
  .pg-btn { padding: 0 12px; font-size: .85rem; }
  .section-title { font-size: 1.4rem; }
  .title-divider .title-icon svg { width: 18px; height: 18px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-number { font-size: 1.8rem; }
  .stat-label { font-size: .85rem; }

  /* กิจกรรมบนมือถือ : แถวละ 2 ภาพ (ถ้าต้องการแถวละ 1 ภาพ เปลี่ยนเลข 2 เป็น 1) */
  .activities-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .news-list li { gap: 10px; }
  .news-list a { font-size: .92rem; }
  .news-list time { font-size: .78rem; }

  .slider-btn { width: 36px; height: 36px; }
  .slider-btn svg { width: 16px; height: 16px; }
  .announce-inner { font-size: .85rem; }
  .page-banner h1 { font-size: 1.5rem; }
  .float-note { display: none; }                        /* จอเล็ก : ซ่อนโน้ตลอยข้างแผ่น */
  .song-sheet { padding: 48px 18px 32px; }
  .song-stanza p { font-size: 1.02rem; }
  .song-finale p { font-size: 1.12rem; }
  .history-badge { flex-basis: 130px; width: 130px; }
  .exec-card { width: min(100%, 280px); }
  .exec-featured { width: min(100%, 300px); }
  .exec-tier { gap: 18px; margin-bottom: 26px; }

  /* ทำเนียบผู้บริหารบนมือถือ : ย่อเส้นไทม์ไลน์ การ์ดเรียงแนวตั้ง */
  .dir-timeline { padding-left: 44px; }
  .dir-timeline::before { left: 17px; }
  .dir-dot { left: -44px; top: 18px; width: 38px; height: 38px; font-size: .92rem; }
  .dir-card { flex-direction: column; text-align: center; gap: 12px; padding: 18px 14px; }
  .dir-info { align-items: center; }
  .dir-item:hover .dir-card { transform: none; }

  /* คณะกรรมการบนมือถือ : การ์ดย่อลงให้เรียงได้ 2 ใบต่อแถว */
  .board-grid { gap: 12px; }
  .board-card { width: calc(50% - 6px); padding: 16px 10px; }
  .board-photo { width: 76px; height: 76px; }
  .board-name { font-size: .9rem; }
  .board-role { font-size: .78rem; }
  .board-featured { width: min(100%, 250px); }
  .board-group-title span { font-size: .92rem; padding: 7px 20px; }

  /* กรอบเอกสารบนมือถือ : เต็มจอและปุ่มเล็กลง */
  .doc-viewer { padding: 8px; }
  .doc-panel { height: 94vh; }
  .doc-head { padding: 10px; flex-wrap: wrap; }
  .doc-head h3 { font-size: .92rem; width: 100%; }
  .doc-btn { font-size: .78rem; padding: 6px 10px; }

  /* หน้า SAR บนมือถือ : ป้ายปีอยู่บน กรอบเอกสารเตี้ยลง */
  .sar-latest-head { flex-direction: column; align-items: center; text-align: center; padding: 20px 16px; }
  .sar-year-badge { flex-basis: 108px; width: 108px; }
  .sar-year-badge .sy-num { font-size: 1.7rem; }
  .sar-btn-row { justify-content: center; }
  .sar-frame { height: 62vh; }
  .sar-item { gap: 12px; padding: 12px 14px; }
  .sar-item-year { min-width: 62px; font-size: .95rem; padding: 6px 8px; }
  .sar-item-title { font-size: .92rem; }
  .sar-item:hover { transform: none; }

  /* หน้ากลุ่มงานบนมือถือ */
  .subj-grid { grid-template-columns: 1fr; }

  /* หน้าตรวจสอบผลการเรียนบนมือถือ */
  .fac-map-zoom { right: 8px; bottom: 8px; font-size: .8rem; padding: 7px 13px; }

  /* กล่องซูมภาพบนมือถือ */
  .zv-bar { padding: 10px; gap: 8px; }
  .zv-title { font-size: .88rem; width: 100%; }
  .zv-btn { min-width: 36px; height: 36px; padding: 0 10px; font-size: .8rem; }
  .zv-level { min-width: 52px; font-size: .88rem; }
  .zv-hint { font-size: .78rem; padding: 8px 12px 12px; }
  .uni-zoom-tag { right: 8px; bottom: 8px; font-size: .78rem; padding: 6px 12px; }
  .uni-card:hover { transform: none; }
  .fac-card { padding: 12px; gap: 10px; }
  .fac-card:hover { transform: none; }
  .fac-no { min-width: 38px; height: 38px; font-size: .9rem; }

  .gr-head { padding: 14px 16px; gap: 10px; }
  .gr-head h2 { font-size: 1rem; }
  .gr-body { padding: 18px 16px; }
  .grade-form { padding: 20px 16px; }
  .gr-input-row input { flex-basis: 100%; font-size: .98rem; }
  .gr-submit { width: 100%; justify-content: center; }
  .gr-steps li { padding-left: 46px; }
  .gr-steps li::before { width: 32px; height: 32px; font-size: .92rem; }

  .dept-tabs { gap: 7px; }
  .dept-tab { font-size: .84rem; padding: 9px 15px; }
  .dept-tab .dt-icon svg { width: 15px; height: 15px; }
  .dept-doc { padding: 20px 16px; }
  .dept-doc h3 { font-size: 1.06rem; }
  .dept-pair-row { gap: 14px; }
  .dept-pair-row .dept-pair-col { flex-basis: 100%; }
  .dept-person { width: calc(50% - 9px); padding: 16px 10px; }
  .dp-photo { width: 72px; height: 72px; }
  .dp-featured { width: min(100%, 232px); }
  .dept-file { flex-direction: column; gap: 12px; }
  .dept-file:hover { transform: none; }

  /* ปุ่มเลื่อนขึ้นด้านบน : ย่อขนาดลงเล็กน้อยบนมือถือ */
  .back-to-top { width: 42px; height: 42px; right: 14px; bottom: 16px; }

  /* ปุ่มติดต่อลอยบนมือถือ : ย่อขนาดและเลื่อนตำแหน่งตามปุ่มเลื่อนขึ้น */
  .contact-fab { right: 14px; bottom: 68px; gap: 10px; }
  .cf-toggle { width: 54px; height: 54px; border-width: 3px; }
  .cf-toggle svg { width: 27px; height: 27px; }
  .contact-fab.open .cf-toggle svg { width: 22px; height: 22px; }
  .cf-item { width: 44px; height: 44px; border-width: 2px; }
  .cf-item svg { width: 21px; height: 21px; }
  .cf-tip { display: none; }        /* มือถือไม่มีการชี้เมาส์ จึงไม่ต้องมีป้ายชื่อ */
}

/* ================================================================
   หน้าใน (Inner Pages) เช่น หน้าประวัติโรงเรียน
   ================================================================ */

/* แถบชื่อหน้า + เส้นทางหน้า (Breadcrumb) */
.page-banner {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
  text-align: center;
  padding: 42px 0 36px;
  border-bottom: 4px solid var(--yellow);
}
.page-banner h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: .3px;
}
.breadcrumb {
  margin-top: 8px;
  font-size: .88rem;
  color: #cfe0f5;
}
.breadcrumb a { color: var(--white); }
.breadcrumb a:hover { color: var(--yellow); }
.crumb-sep { margin: 0 8px; color: var(--yellow); }
.crumb-current { color: var(--yellow); }

/* ---------- การ์ดความเป็นมา : ตราปีก่อตั้ง + เนื้อหา ---------- */
.history-card {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}

/* ตราปีก่อตั้ง : วงกลมไล่สีน้ำเงิน ขอบเหลือง */
.history-badge {
  flex: 0 0 150px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-dark), var(--blue));
  border: 4px solid var(--yellow);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  font-family: var(--font-head);
  box-shadow: 0 10px 24px rgba(13, 59, 140, .3);
  transition: transform .3s ease;
}
.history-card:hover .history-badge { transform: scale(1.06) rotate(-3deg); }
.hb-label { font-size: .82rem; color: #cfe0f5; }
.hb-year  { font-size: 1.5rem; font-weight: 700; color: var(--yellow); line-height: 1.15; }
.hb-sub   { font-size: .78rem; color: #cfe0f5; }

.history-text p {
  font-size: 1.02rem;
  line-height: 1.95;
  text-indent: 2.2em;              /* ย่อหน้าแบบเอกสารไทย */
  margin-bottom: 10px;
}
.history-text p:last-child { margin-bottom: 0; }
.history-text strong { color: var(--blue-dark); }

/* ---------- เส้นทางสำคัญ (Milestones) ---------- */
.milestones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 26px;
}
.milestone {
  position: relative;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 34px 20px 22px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.milestone:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .2);
}
.milestone-year {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .98rem;
  padding: 6px 20px;
  border-radius: 30px;
  border: 2px solid var(--yellow);
  white-space: nowrap;
}
.milestone h3 {
  color: var(--blue-dark);
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.milestone p { color: var(--text-muted); font-size: .92rem; }

/* ---------- ข้อมูลทั่วไปของโรงเรียน ---------- */
.info-section { background: var(--blue-light); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.info-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.info-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 22px rgba(13, 59, 140, .16);
}
.info-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-light);
  color: var(--blue);
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, transform .2s;
}
.info-item:hover .info-icon {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: scale(1.1);
}
.info-icon svg { width: 21px; height: 21px; }
.info-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .88rem;
  color: var(--blue-dark);
}
.info-value { display: block; font-size: .95rem; color: var(--text-dark); word-break: break-word; }

/* ---------- เขตพื้นที่บริการ ---------- */
.service-area-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--yellow-soft);
  border: 1px solid #f0e2b0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  font-size: 1.02rem;
}
.sa-icon {
  flex: 0 0 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue-dark);
  display: grid;
  place-items: center;
}
.sa-icon svg { width: 22px; height: 22px; }
.service-area-card strong { color: var(--blue-dark); }

/* ---------- สภาพชุมชน ---------- */
.community-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.community-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.community-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .18);
}
.cc-num {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
}
.community-card p { line-height: 1.85; font-size: .97rem; }

/* ---------- อัตลักษณ์โรงเรียน : ตราสัญลักษณ์ / สีประจำ / อักษรย่อ ---------- */
.identity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.identity-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.identity-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .2);
}
.identity-card h3 {
  color: var(--blue-dark);
  font-size: 1.08rem;
  font-weight: 600;
}
.identity-card .id-note { color: var(--text-muted); font-size: .88rem; }

/* ตราสัญลักษณ์โรงเรียน */
.logo-showcase {
  width: 160px;
  height: 160px;
  object-fit: contain;            /* แสดงเฉพาะตัวโลโก้ ไม่มีกรอบวงกลมรอง */
  filter: drop-shadow(0 8px 16px rgba(13, 59, 140, .25));
  transition: transform .35s ease;
}
.identity-card:hover .logo-showcase { transform: scale(1.08) rotate(3deg); }

/* สีประจำโรงเรียน : วงกลมสีเหลืองและสีฟ้า */
.color-circles {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 150px;
}
.color-dot {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
  transition: transform .3s ease;
}
.dot-yellow { background: var(--yellow); }
.dot-blue   { background: var(--blue); }
.identity-card:hover .dot-yellow { transform: scale(1.12) translateX(-4px); }
.identity-card:hover .dot-blue   { transform: scale(1.12) translateX(4px); }
.color-dash { font-size: 1.6rem; font-weight: 700; color: var(--text-muted); }
.color-names {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--blue-dark);
}
.color-names .cn-yellow { color: #c79100; }
.color-names .cn-blue   { color: var(--blue); }

/* อักษรย่อของโรงเรียน */
.abbr-text {
  min-height: 150px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--blue-dark);
  background: linear-gradient(135deg, var(--blue-light), var(--yellow-soft));
  border-radius: var(--radius);
  width: 100%;
  letter-spacing: 2px;
  transition: transform .3s ease;
}
.identity-card:hover .abbr-text { transform: scale(1.06); }

/* ---------- เอกลักษณ์ อัตลักษณ์ และคำขวัญของโรงเรียน ---------- */
.motto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.motto-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.motto-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .2);
}
.motto-label {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.25rem;             /* ป้ายชื่อขนาดใหญ่เด่น */
  padding: 9px 32px;
  border-radius: 40px;
  transition: transform .25s ease;
}
.motto-card:hover .motto-label { transform: scale(1.08); }
.motto-text {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--blue-dark);
  line-height: 1.7;
}

/* ---------- หน้าเพลงมาร์ชโรงเรียน ---------- */
.song-section {
  background: linear-gradient(180deg, var(--blue-light), var(--yellow-soft));
}

/* กรอบครอบแผ่นเพลง : เป็นจุดอ้างอิงของโน้ตดนตรีลอย */
.song-wrap {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

/* แผ่นเนื้อเพลง */
.song-sheet {
  position: relative;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(13, 59, 140, .18);
  padding: 56px 36px 44px;
  text-align: center;
}

/* ตราโน้ตดนตรีวงกลมด้านบนแผ่น (คร่อมขอบบน) */
.song-emblem {
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--blue-dark), var(--blue));
  border: 3px solid var(--yellow);
  color: var(--yellow);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(13, 59, 140, .35);
}
.song-emblem svg { width: 28px; height: 28px; }

/* บทเพลงแต่ละบท */
.song-stanza p {
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 500;
  color: var(--text-dark);
  line-height: 2.15;
  transition: transform .2s ease, color .2s ease;
}
.song-stanza p:hover {
  transform: scale(1.06);       /* วรรคที่ชี้เมาส์ขยายเด่นขึ้น */
  color: var(--blue);
}

/* คำ "เหลืองฟ้า" แต้มสีประจำโรงเรียนจริง */
.w-yellow { color: #d9a400; font-weight: 700; }
.w-blue   { color: var(--blue); font-weight: 700; }

/* เส้นคั่นระหว่างบท : จุดสามจุดสีเหลือง */
.stanza-sep {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
}
.stanza-sep span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
}
.stanza-sep span:nth-child(2) { background: var(--blue); }

/* ท่อนจบ : เน้นตัวเด่นบนพื้นไล่สี */
.song-finale {
  margin-top: 26px;
  padding: 20px 16px;
  background: linear-gradient(135deg, var(--blue-light), var(--yellow-soft));
  border-radius: 12px;
}
.song-finale p {
  font-family: var(--font-head);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--blue-dark);
  line-height: 2;
}

/* โน้ตดนตรีลอยประดับรอบแผ่นเพลง (เคลื่อนไหวช้า ๆ) */
.float-note {
  position: absolute;
  color: var(--blue);
  opacity: .16;
  pointer-events: none;         /* ไม่บังการคลิก */
  animation: floatNote 6s ease-in-out infinite;
}
.float-note svg { width: 100%; height: 100%; }
.note-1 { width: 56px; height: 56px; top: 6%;  left: -74px;  animation-duration: 7s; }
.note-2 { width: 40px; height: 40px; top: 34%; right: -62px; animation-duration: 5.5s; animation-delay: 1.2s; }
.note-3 { width: 48px; height: 48px; top: 62%; left: -66px;  animation-duration: 6.5s; animation-delay: .6s; }
.note-4 { width: 34px; height: 34px; top: 86%; right: -52px; animation-duration: 5s;   animation-delay: 1.8s; }

@keyframes floatNote {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-16px) rotate(6deg); }
}

/* ---------- หน้าคณะผู้บริหารโรงเรียน : ผัง 3 ระดับ ---------- */
.exec-section {
  background: linear-gradient(180deg, var(--blue-light), #ffffff 45%);
}

/* แต่ละระดับ : เรียงการ์ดกึ่งกลาง ขึ้นแถวใหม่อัตโนมัติ */
.exec-tier {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-bottom: 34px;
}
.exec-tier:last-child { margin-bottom: 0; }

/* การ์ดผู้บริหาร */
.exec-card {
  width: 250px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.exec-card:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 16px 34px rgba(13, 59, 140, .24);
}

/* กรอบรูปถ่าย : พื้นไล่สีอ่อน ภาพชิดล่างเหมือนกรอบรูปทางการ */
.exec-photo {
  height: 270px;
  background: linear-gradient(180deg, #eaf2fc, #dbe8f8);
  border-bottom: 4px solid var(--yellow);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}
.exec-photo img {
  max-width: 88%;
  max-height: 96%;
  object-fit: contain;
  transition: transform .45s ease;
}
.exec-card:hover .exec-photo img { transform: scale(1.07); }

/* ไม่มีรูป : ภาพเงาบุคคล */
.exec-photo.no-photo { align-items: center; color: #b4c6de; }
.exec-photo.no-photo svg {
  width: 110px;
  height: 110px;
  transition: transform .3s ease, color .3s ease;
}
.exec-card:hover .exec-photo.no-photo svg { transform: scale(1.1); color: var(--blue); }

/* ข้อมูลใต้รูป */
.exec-info {
  padding: 16px 14px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  flex: 1;
}
.exec-name {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.45;
}
.exec-pos {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .82rem;
  padding: 4px 16px;
  border-radius: 30px;
}
.exec-standing { font-size: .88rem; color: var(--text-dark); }
.exec-duty {
  font-size: .85rem;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 12px;
  border-radius: 8px;
}

/* ระดับ 1 : ผู้อำนวยการ การ์ดเด่นขนาดใหญ่ ขอบเหลืองทอง */
.exec-featured {
  width: 300px;
  border: 2px solid var(--yellow);
  box-shadow: 0 14px 34px rgba(13, 59, 140, .22);
}
.exec-featured .exec-photo { height: 330px; }
.exec-featured .exec-name { font-size: 1.16rem; }
.exec-featured .exec-pos { font-size: .9rem; padding: 5px 20px; }

/* ---------- หน้าทำเนียบผู้บริหารโรงเรียน : ไทม์ไลน์แนวตั้ง ---------- */
.dir-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 40%); }

.dir-lead {
  text-align: center;
  color: var(--text-muted);
  margin: -18px 0 34px;
  font-size: .96rem;
}

/* เส้นไทม์ไลน์แนวตั้ง (เส้นประสีเหลืองกลางคอลัมน์ซ้าย) */
.dir-timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 62px;
}
.dir-timeline::before {
  content: "";
  position: absolute;
  left: 25px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: repeating-linear-gradient(var(--yellow) 0 10px, transparent 10px 18px);
}

.dir-item { position: relative; margin-bottom: 20px; }
.dir-item:last-child { margin-bottom: 0; }

/* จุดลำดับที่บนเส้นไทม์ไลน์ */
.dir-dot {
  position: absolute;
  left: -62px;
  top: 26px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(13, 59, 140, .16);
  transition: transform .25s ease, background .25s, color .25s;
  z-index: 2;
}
.dir-item:hover .dir-dot {
  transform: scale(1.12);
  background: var(--yellow);
}

/* การ์ดข้อมูลผู้บริหาร */
.dir-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dir-item:hover .dir-card {
  transform: translateX(8px) scale(1.015);
  box-shadow: 0 14px 30px rgba(13, 59, 140, .2);
}

/* รูปถ่ายในการ์ด */
.dir-photo {
  flex: 0 0 78px;
  height: 78px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #eaf2fc, #dbe8f8);
  border: 3px solid var(--blue-light);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform .3s ease, border-color .3s;
}
.dir-item:hover .dir-photo { transform: scale(1.07); border-color: var(--yellow); }
.dir-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.dir-photo.no-photo { align-items: center; color: #b4c6de; }
.dir-photo.no-photo svg { width: 40px; height: 40px; }

.dir-info { flex: 1; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.dir-name {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.4;
}
.dir-pos {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-size: .84rem;
  font-weight: 500;
  padding: 3px 14px;
  border-radius: 30px;
}
.dir-term { font-size: .9rem; color: var(--text-muted); }

/* ป้ายผู้บริหารคนปัจจุบัน */
.dir-badge-now {
  display: inline-block;
  background: var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .76rem;
  padding: 3px 14px;
  border-radius: 30px;
}

/* รายการของผู้บริหารคนปัจจุบัน : เน้นพิเศษ */
.dir-now .dir-card {
  border: 2px solid var(--yellow);
  border-left-width: 5px;
  background: linear-gradient(135deg, #ffffff, var(--yellow-soft));
  box-shadow: 0 10px 26px rgba(13, 59, 140, .18);
}
.dir-now .dir-dot { background: var(--yellow); }
.dir-now .dir-photo { flex-basis: 92px; height: 92px; border-color: var(--yellow); }
.dir-now .dir-name { font-size: 1.18rem; }

/* ---------- หน้าคณะกรรมการสถานศึกษา ---------- */
.board-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 35%); }

.board-group { margin-bottom: 40px; }
.board-group:last-child { margin-bottom: 0; }

/* หัวข้อกลุ่มกรรมการ : แถบสีน้ำเงินมุมโค้งกึ่งกลาง */
.board-group-title {
  text-align: center;
  margin-bottom: 24px;
}
.board-group-title span {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  padding: 8px 30px;
  border-radius: 40px;
  box-shadow: 0 6px 16px rgba(13, 59, 140, .2);
}

/* ตารางการ์ดกรรมการ */
.board-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.board-card {
  width: 192px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 14px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.board-card:hover {
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 16px 32px rgba(13, 59, 140, .22);
}

/* รูปถ่ายวงกลม */
.board-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #eaf2fc, #dbe8f8);
  border: 3px solid var(--blue-light);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform .3s ease, border-color .3s;
}
.board-card:hover .board-photo { transform: scale(1.08); border-color: var(--yellow); }
.board-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.board-photo.no-photo { align-items: center; color: #b4c6de; }
.board-photo.no-photo svg { width: 46px; height: 46px; transition: color .3s; }
.board-card:hover .board-photo.no-photo svg { color: var(--blue); }

.board-name {
  font-family: var(--font-head);
  font-size: .98rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.45;
}
.board-role {
  font-size: .84rem;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 14px;
  border-radius: 30px;
  line-height: 1.5;
}

/* การ์ดเด่น : ประธานกรรมการ และ กรรมการและเลขานุการ */
.board-featured {
  width: 250px;
  border: 2px solid var(--yellow);
  background: linear-gradient(135deg, #ffffff, var(--yellow-soft));
  box-shadow: 0 12px 30px rgba(13, 59, 140, .2);
  padding: 26px 18px 24px;
}
.board-featured .board-photo { width: 132px; height: 132px; border-color: var(--yellow); }
.board-featured .board-photo.no-photo svg { width: 60px; height: 60px; }
.board-featured .board-name { font-size: 1.12rem; }
.board-featured .board-role {
  background: var(--blue-dark);
  color: var(--yellow);
  font-weight: 500;
}

/* ---------- หน้าระดับชั้นเปิดสอน ---------- */
.levels-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 40%); }

.levels-lead {
  text-align: center;
  color: var(--text-muted);
  margin: -18px 0 32px;
  font-size: .96rem;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.level-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .28s ease, box-shadow .28s ease;
}
.level-card.has-doc { cursor: pointer; }
.level-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 18px 38px rgba(13, 59, 140, .24);
}
.level-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ภาพประกอบระดับชั้น */
.level-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--blue-light);
  border-bottom: 4px solid var(--yellow);
}
.level-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.level-card:hover .level-photo img { transform: scale(1.09); }

/* ตัวเลขลำดับระดับชั้นมุมซ้ายบนของภาพ */
.level-num {
  position: absolute;
  top: 10px; left: 10px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  border: 2px solid var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  transition: transform .25s ease;
}
.level-card:hover .level-num { transform: scale(1.12); }

.level-body {
  padding: 18px 18px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  flex: 1;
}
.level-title {
  font-family: var(--font-head);
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--blue-dark);
}
.level-sub {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-size: .88rem;
  font-weight: 500;
  padding: 4px 18px;
  border-radius: 30px;
}
.level-desc {
  font-size: .92rem;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: left;
}

/* ปุ่มเปิดเอกสารในบล็อก */
.level-doc-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
  padding: 10px 20px;
  border-radius: 10px;
  transition: transform .2s ease, background .2s, color .2s;
}
.level-doc-btn svg { width: 17px; height: 17px; }
.level-card:hover .level-doc-btn {
  transform: scale(1.06);
  background: var(--blue-dark);
  color: var(--yellow);
}

/* ---------- กรอบแสดงเอกสาร (Document Viewer) ---------- */
.doc-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 20px;
}
.doc-viewer.show { display: flex; }

.doc-panel {
  width: min(1000px, 100%);
  height: min(90vh, 100%);
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

.doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  background: var(--blue-dark);
  color: var(--white);
}
.doc-head h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--yellow);
  line-height: 1.4;
}
.doc-actions { display: flex; align-items: center; gap: 8px; }
.doc-btn {
  background: rgba(255,255,255,.14);
  color: var(--white);
  font-size: .84rem;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.doc-btn:hover { background: var(--yellow); color: var(--blue-dark); text-decoration: none; }
.doc-close {
  width: 38px; height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  transition: background .2s, color .2s;
}
.doc-close:hover { background: var(--yellow); color: var(--blue-dark); }

.doc-body { flex: 1; background: #f1f4f9; overflow: auto; }
.doc-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.doc-body img { width: 100%; height: auto; display: block; }

/* ---------- หน้ารายงานผลการประเมินตนเอง (SAR) ---------- */
.sar-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 35%); }

/* กล่องเล่มหลัก (ปีล่าสุด) */
.sar-latest {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(13, 59, 140, .16);
  overflow: hidden;
}
.sar-latest-head {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 26px 26px 22px;
}

/* ป้ายปีการศึกษา */
.sar-year-badge {
  flex: 0 0 132px;
  aspect-ratio: 1;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--blue-dark), var(--blue));
  border: 3px solid var(--yellow);
  color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: var(--font-head);
  box-shadow: 0 10px 24px rgba(13, 59, 140, .28);
  transition: transform .3s ease;
}
.sar-latest:hover .sar-year-badge { transform: scale(1.05) rotate(-3deg); }
.sar-year-badge .sy-label { font-size: .8rem; color: #cfe0f5; }
.sar-year-badge .sy-num { font-size: 2rem; font-weight: 700; color: var(--yellow); line-height: 1.1; }

.sar-latest-info { flex: 1; }
.sar-latest-info h3 {
  font-family: var(--font-head);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.55;
  margin-bottom: 8px;
}
.sar-latest-info p { color: var(--text-muted); font-size: .95rem; line-height: 1.85; }

.sar-btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  padding: 10px 20px;
  border-radius: 10px;
  transition: transform .2s ease, background .2s, color .2s;
}
.sar-btn svg { width: 17px; height: 17px; }
.sar-btn:hover { transform: scale(1.05); text-decoration: none; }
.sar-btn-main { background: var(--yellow); }
.sar-btn-main:hover { background: var(--blue-dark); color: var(--yellow); }
.sar-btn:not(.sar-btn-main):hover { background: var(--blue-dark); color: var(--white); }

/* กรอบอ่านเอกสารในหน้าเว็บ */
.sar-frame {
  height: min(78vh, 760px);
  background: #f1f4f9;
  border-top: 1px solid #e3e9f2;
}
.sar-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- รายการรายงานย้อนหลัง ---------- */
.sar-older { margin-top: 48px; }

.sar-list { display: flex; flex-direction: column; gap: 12px; }

.sar-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  color: var(--text-dark);
  transition: transform .22s ease, box-shadow .22s ease, background .22s;
}
.sar-item:hover {
  transform: translateX(8px);
  background: var(--blue-light);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .18);
  text-decoration: none;
}

.sar-item-year {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: center;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 8px 12px;
  border-radius: 10px;
  transition: transform .22s ease;
}
.sar-item:hover .sar-item-year { transform: scale(1.07); }

.sar-item-body { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sar-item-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--blue-dark);
  line-height: 1.5;
}
.sar-item-note { font-size: .85rem; color: var(--text-muted); }

.sar-item-arrow {
  flex: 0 0 auto;
  color: var(--blue);
  display: grid;
  place-items: center;
  transition: transform .22s ease;
}
.sar-item-arrow svg { width: 20px; height: 20px; }
.sar-item:hover .sar-item-arrow { transform: translateX(4px); }

/* ---------- หน้าอาคารสถานที่ ---------- */
.fac-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

/* ภาพแผนผังโรงเรียน (กดเพื่อดูภาพขยาย) */
.fac-map {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease;
}
.fac-map:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 38px rgba(13, 59, 140, .22);
}
.fac-map img { width: 100%; height: auto; display: block; }

/* ป้ายบอกให้กดดูภาพขยาย */
.fac-map-zoom {
  position: absolute;
  right: 14px; bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 59, 140, .88);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .88rem;
  padding: 9px 18px;
  border-radius: 30px;
  transition: background .25s, transform .25s;
}
.fac-map-zoom svg { width: 17px; height: 17px; }
.fac-map:hover .fac-map-zoom {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: scale(1.06);
}

.fac-note {
  text-align: center;
  color: var(--text-muted);
  font-size: .94rem;
  margin: 16px 0 8px;
}

/* รายการอาคารและสถานที่ */
.fac-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.fac-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  transition: transform .22s ease, box-shadow .22s ease, background .22s;
}
.fac-card.has-photo { cursor: pointer; }
.fac-card:hover {
  transform: translateX(6px);
  background: var(--blue-light);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .18);
}

/* หมายเลขบนผัง (วงกลมแดงแบบเดียวกับในภาพผัง) */
.fac-no {
  flex: 0 0 auto;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 22px;
  background: #d9534f;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .98rem;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(217, 83, 79, .35);
  transition: transform .22s ease;
}
.fac-card:hover .fac-no { transform: scale(1.1); }

.fac-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.fac-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  color: var(--blue-dark);
  line-height: 1.5;
}
.fac-desc { font-size: .88rem; color: var(--text-muted); line-height: 1.65; }

/* ไอคอนกล้อง : บอกว่ารายการนี้มีภาพจริงให้กดดู */
.fac-cam {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--yellow-soft);
  color: var(--blue-dark);
  display: grid;
  place-items: center;
  transition: background .22s, transform .22s;
}
.fac-cam svg { width: 18px; height: 18px; }
.fac-card:hover .fac-cam { background: var(--yellow); transform: scale(1.1); }

/* ---------- ปุ่ม "ดูทั้งหมด" ใต้บล็อกบนหน้าแรก ---------- */
.section-more { text-align: center; margin-top: 28px; }
.more-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .98rem;
  padding: 13px 32px;
  border-radius: 40px;
  box-shadow: 0 8px 20px rgba(13, 59, 140, .25);
  transition: transform .22s ease, background .22s, color .22s, box-shadow .22s;
}
.more-btn svg { width: 17px; height: 17px; transition: transform .22s ease; }
.more-btn:hover {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .3);
  text-decoration: none;
}
.more-btn:hover svg { transform: translateX(4px); }

/* ---------- หน้ารับสมัครเรียน ---------- */
.adm-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 26%); }
.adm-wrap { max-width: 980px; }

/* แถบลิงก์ข้ามไปแต่ละประกาศ */
.adm-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}
.adm-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  background: var(--white);
  border: 2px solid #dbe6f5;
  border-radius: 40px;
  padding: 10px 22px 10px 12px;
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .92rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
  transition: border-color .22s, transform .22s, background .22s, color .22s;
}
.adm-nav-no {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: background .22s, color .22s;
}
.adm-nav-btn:hover {
  border-color: var(--yellow);
  transform: translateY(-3px);
  text-decoration: none;
}
.adm-nav-btn:hover .adm-nav-no { background: var(--yellow); color: var(--blue-dark); }

/* บล็อกประกาศ */
.adm-block {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(13, 59, 140, .14);
  overflow: hidden;
  margin-bottom: 34px;
  scroll-margin-top: 90px;      /* เผื่อระยะให้แถบหัวเว็บเวลากดลิงก์ข้าม */
}
.adm-block:last-child { margin-bottom: 0; }

.adm-block-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
}
.adm-block-head h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--yellow);
  line-height: 1.6;
}
.adm-block-sub { margin-top: 4px; font-size: .95rem; color: #dbe8f8; }
.adm-block-no {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  display: grid;
  place-items: center;
}

/* ภาพประกาศ / โปสเตอร์ */
.adm-poster {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-bottom: 4px solid var(--yellow);
  background: var(--blue-light);
  cursor: pointer;
  overflow: hidden;
}
.adm-poster img { width: 100%; height: auto; display: block; transition: transform .5s ease; }
.adm-poster:hover img { transform: scale(1.03); }
.adm-poster-tag {
  position: absolute;
  right: 14px; bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(13, 59, 140, .88);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .85rem;
  padding: 8px 16px;
  border-radius: 30px;
  transition: background .25s, color .25s, transform .25s;
}
.adm-poster-tag svg { width: 16px; height: 16px; }
.adm-poster:hover .adm-poster-tag { background: var(--yellow); color: var(--blue-dark); transform: scale(1.05); }

/* เนื้อหาประกาศ */
.adm-body { padding: 26px 28px; }
.adm-body p { line-height: 1.9; margin-bottom: 10px; }

.adm-body .adm-head { text-align: center; margin-bottom: 22px; }
.adm-body .adm-head h3 {
  font-size: 1.24rem;
  color: var(--blue-dark);
  line-height: 1.5;
}
.adm-body .adm-term {
  display: inline-block;
  margin-top: 8px;
  background: var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  padding: 6px 22px;
  border-radius: 30px;
}

/* หัวข้อย่อยในประกาศ */
.adm-body .adm-sub {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin: 26px 0 12px;
  padding-left: 13px;
  border-left: 5px solid var(--yellow);
}

/* ป้ายระดับชั้นที่เปิดรับ */
.adm-body .adm-levels { display: flex; flex-wrap: wrap; gap: 10px; }
.adm-body .adm-chip {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue-dark);
  border: 1.5px solid #cfdcee;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  padding: 8px 20px;
  border-radius: 30px;
  transition: background .2s, color .2s, transform .2s;
}
.adm-body .adm-chip:hover {
  background: var(--blue-dark);
  color: var(--yellow);
  transform: translateY(-3px);
}

/* การ์ดกำหนดการรับสมัคร */
.adm-body .adm-sched {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.adm-body .adm-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.adm-body .adm-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(13, 59, 140, .18);
}
.adm-body .adm-card h5 {
  font-family: var(--font-head);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--blue-dark);
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #ccd6e4;
}
.adm-body .adm-card dl { margin: 0; }
.adm-body .adm-card dt {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .88rem;
  color: var(--blue);
  margin-top: 10px;
}
.adm-body .adm-card dt:first-child { margin-top: 0; }
.adm-body .adm-card dd { font-size: .94rem; line-height: 1.75; margin: 2px 0 0; }

/* รายการเอกสารประกอบการสมัคร */
.adm-body .adm-docs { counter-reset: doc; list-style: none; }
.adm-body .adm-docs li {
  counter-increment: doc;
  position: relative;
  padding: 10px 14px 10px 46px;
  margin-bottom: 8px;
  background: var(--blue-light);
  border-radius: 10px;
  font-size: .95rem;
  line-height: 1.8;
  transition: transform .2s ease, background .2s;
}
.adm-body .adm-docs li:hover { transform: translateX(6px); background: var(--yellow-soft); }
.adm-body .adm-docs li::before {
  content: counter(doc);
  position: absolute;
  left: 12px; top: 11px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .82rem;
  display: grid;
  place-items: center;
}

/* ขั้นตอนและข้อปฏิบัติ */
.adm-body .adm-steps { counter-reset: st; list-style: none; }
.adm-body .adm-steps li {
  counter-increment: st;
  position: relative;
  padding: 12px 16px 12px 52px;
  margin-bottom: 10px;
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  border-radius: 10px;
  font-size: .96rem;
  line-height: 1.85;
}
.adm-body .adm-steps li::before {
  content: counter(st);
  position: absolute;
  left: 12px; top: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* กล่องหมายเหตุ */
.adm-body .adm-note {
  margin-top: 16px;
  padding: 16px 20px;
  background: #fff9e6;
  border: 1px solid #f0e2b0;
  border-left: 5px solid var(--yellow);
  border-radius: 10px;
}
.adm-body .adm-note strong {
  display: block;
  font-family: var(--font-head);
  color: var(--blue-dark);
  margin-bottom: 8px;
}
.adm-body .adm-note ul { list-style: none; }
.adm-body .adm-note li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  font-size: .93rem;
  line-height: 1.8;
}
.adm-body .adm-note li::before {
  content: "";
  position: absolute;
  left: 2px; top: 11px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

/* เขตพื้นที่บริการ และกล่องติดต่อ */
.adm-body .adm-area {
  background: var(--blue-light);
  border-radius: 10px;
  padding: 14px 18px;
  font-weight: 500;
  color: var(--blue-dark);
}
.adm-body .adm-contact {
  margin-top: 22px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--blue-light), var(--yellow-soft));
  border-radius: var(--radius);
  text-align: center;
}
.adm-body .adm-contact p { margin-bottom: 6px; }
.adm-body .adm-contact p:last-child { margin-bottom: 0; }
.adm-body .adm-contact strong { color: var(--blue-dark); }

/* ปุ่มไฟล์แนบ / ลิงก์ */
.adm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 28px 26px;
}
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  padding: 11px 22px;
  border-radius: 10px;
  transition: background .2s, color .2s, transform .2s;
}
.adm-btn svg { width: 17px; height: 17px; }
.adm-btn:hover { background: var(--blue-dark); color: var(--white); transform: scale(1.04); text-decoration: none; }
.adm-btn-main { background: var(--yellow); }
.adm-btn-main:hover { background: var(--blue-dark); color: var(--yellow); }

/* ---------- หน้ารวมวิดีโอกิจกรรม ---------- */
.vid-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

.vid-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.vid-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.vid-card:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: 0 18px 36px rgba(13, 59, 140, .22);
}

/* ภาพปกวิดีโอ */
.vid-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0d1b33;
  cursor: pointer;
}
.vid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease, opacity .3s;
}
.vid-card:hover .vid-thumb img { transform: scale(1.07); opacity: .82; }

/* ปุ่มเล่นกลางภาพ */
.vid-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 62px; height: 62px;
  border-radius: 50%;
  background: rgba(217, 83, 79, .95);
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  transition: transform .25s ease, background .25s;
}
.vid-play svg { width: 28px; height: 28px; margin-left: 3px; }
.vid-card:hover .vid-play { transform: translate(-50%, -50%) scale(1.14); background: #c9302c; }

/* การ์ดที่ยังไม่มีวิดีโอ */
.vid-thumb.no-video {
  background: linear-gradient(135deg, var(--blue-light), #dbe8f8);
  cursor: default;
}
.vid-thumb.no-video .vid-play { background: rgba(13, 59, 140, .25); box-shadow: none; }
.vid-empty:hover { transform: none; box-shadow: var(--shadow); }

.vid-body {
  padding: 15px 18px 17px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.vid-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.6;
}
.vid-note { font-size: .88rem; color: var(--text-muted); }

/* ปุ่มเปิดใน YouTube */
.vid-yt {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .86rem;
  padding: 7px 15px;
  border-radius: 8px;
  transition: background .2s, color .2s, transform .2s;
}
.vid-yt svg { width: 17px; height: 17px; color: #ff0000; transition: color .2s; }
.vid-yt:hover {
  background: #ff0000;
  color: var(--white);
  transform: scale(1.05);
  text-decoration: none;
}
.vid-yt:hover svg { color: var(--white); }

/* ---------- กรอบเล่นวิดีโอ (Video Player) ---------- */
.video-viewer {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 40, .94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2600;
  padding: 20px;
}
.video-viewer.show { display: flex; }

.vv-panel {
  width: min(1000px, 100%);
  background: var(--blue-dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.vv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 10px 12px 20px;
}
.vv-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--yellow);
  line-height: 1.5;
}
.vv-close {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  color: var(--white);
  display: grid;
  place-items: center;
  transition: background .2s, color .2s, transform .2s;
}
.vv-close svg { width: 20px; height: 20px; }
.vv-close:hover { background: var(--yellow); color: var(--blue-dark); transform: scale(1.08); }

.vv-stage { aspect-ratio: 16 / 9; background: #000; }
.vv-stage iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- หน้ารวมข่าวประชาสัมพันธ์ ---------- */
.news-page-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

.news-page-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
}

.news-card {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  transition: transform .22s ease, box-shadow .22s ease, background .22s;
}
.news-card:hover {
  transform: translateX(7px);
  background: var(--blue-light);
  box-shadow: 0 14px 30px rgba(13, 59, 140, .18);
}

/* ป้ายวันที่ในการ์ดข่าว (วางแบบปกติ ไม่ลอยทับ) */
.news-card .date-badge {
  position: static;
  flex: 0 0 auto;
  min-width: 58px;
  box-shadow: none;
  transition: transform .22s ease;
}
.news-card:hover .date-badge { transform: scale(1.08); }

.nc-body { flex: 1; }
.nc-title {
  font-family: var(--font-head);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.6;
  margin-bottom: 8px;
}
.nc-title a { color: inherit; }
.nc-title a:hover { color: var(--blue); text-decoration: none; }

.nc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: .88rem;
}
.nc-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.nc-date svg { width: 15px; height: 15px; }

.nc-file, .nc-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 600;
  padding: 6px 15px;
  border-radius: 8px;
  transition: background .2s, color .2s, transform .2s;
}
.nc-file svg, .nc-link svg { width: 15px; height: 15px; }
.nc-file {
  background: var(--yellow-soft);
  color: var(--blue-dark);
}
.nc-file:hover { background: var(--yellow); transform: scale(1.05); text-decoration: none; }
.nc-link {
  background: var(--blue-light);
  color: var(--blue-dark);
}
.nc-link:hover { background: var(--blue-dark); color: var(--yellow); transform: scale(1.05); text-decoration: none; }
.nc-link:hover svg { transform: translateX(2px); }

/* ---------- แบ่งหน้า (Pagination) ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}
.pg-btn, .pg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  height: 42px;
  padding: 0 16px;
  background: var(--white);
  border: 1.5px solid #dbe6f5;
  border-radius: 10px;
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.pg-num { padding: 0; }
.pg-btn svg, .pg-num svg { width: 16px; height: 16px; }
.pg-btn:hover, .pg-num:hover {
  border-color: var(--yellow);
  transform: translateY(-2px);
  text-decoration: none;
}
.pg-num.active {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--yellow);
}
.pg-info {
  text-align: center;
  color: var(--text-muted);
  font-size: .88rem;
  margin-top: 12px;
}

/* ---------- หน้ารวมรางวัลและความภาคภูมิใจ ---------- */
.awd-section { background: linear-gradient(180deg, var(--yellow-soft), #ffffff 32%); }

/* การ์ดรางวัลในหน้ารวม : เต็มความสูงเท่ากันทุกใบ */
.awd-section .awards-grid { align-items: stretch; }
.awd-section .award-card { display: flex; flex-direction: column; }
.awd-section .award-card figcaption { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ---------- หน้ารวมกิจกรรมโรงเรียน (แยกตามปีการศึกษา) ---------- */
.act-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

.act-lead {
  text-align: center;
  color: var(--text-muted);
  font-size: .96rem;
  margin-bottom: 26px;
}
.act-count {
  text-align: center;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 20px;
}

/* ป้าย "ปัจจุบัน" บนแท็บปีการศึกษา */
.dept-tab .tab-now {
  background: var(--yellow);
  color: var(--blue-dark);
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  margin-left: 6px;
}
.dept-tab.active .tab-now { background: var(--white); }

/* ---------- หน้าระเบียบการแต่งกายและทรงผมนักเรียน ---------- */
.uni-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

.uni-lead {
  text-align: center;
  color: var(--text-muted);
  font-size: .96rem;
  margin-bottom: 26px;
}

.uni-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.uni-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.uni-card:not(.uni-empty) { cursor: pointer; }
.uni-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 18px 36px rgba(13, 59, 140, .22);
}

/* ภาพเครื่องแบบ (สัดส่วน 3:2 ตามไฟล์ต้นฉบับ) */
.uni-photo {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--blue-light);
  border-bottom: 4px solid var(--yellow);
}
.uni-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.uni-card:hover .uni-photo img { transform: scale(1.05); }

/* ป้ายบอกให้กดดูภาพขนาดจริง */
.uni-zoom-tag {
  position: absolute;
  right: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(13, 59, 140, .88);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .85rem;
  padding: 8px 16px;
  border-radius: 30px;
  transition: background .25s, color .25s, transform .25s;
}
.uni-zoom-tag svg { width: 16px; height: 16px; }
.uni-card:hover .uni-zoom-tag {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: scale(1.06);
}

/* การ์ดที่ยังไม่มีภาพ */
.uni-photo.no-photo {
  display: grid;
  place-items: center;
  color: #b4c6de;
  border-bottom-color: #dbe6f5;
}
.uni-photo.no-photo svg { width: 64px; height: 64px; }
.uni-empty { opacity: .9; }

.uni-body {
  display: block;
  padding: 16px 18px 18px;
  text-align: center;
}
.uni-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.04rem;
  color: var(--blue-dark);
  line-height: 1.55;
}
.uni-desc {
  display: block;
  margin-top: 5px;
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---------- กล่องขยายภาพแบบซูมได้ (Zoom Viewer) ---------- */
.zoom-viewer {
  position: fixed;
  inset: 0;
  background: rgba(8, 20, 40, .94);
  display: none;
  flex-direction: column;
  z-index: 2600;
}
.zoom-viewer.show { display: flex; }

/* แถบเครื่องมือด้านบน */
.zv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(13, 59, 140, .96);
  color: var(--white);
  flex-wrap: wrap;
}
.zv-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  color: var(--yellow);
  line-height: 1.5;
}
.zv-tools { display: flex; align-items: center; gap: 8px; }

.zv-btn {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  color: var(--white);
  font-family: var(--font-head);
  font-size: .88rem;
  transition: background .2s, color .2s, transform .2s;
}
.zv-btn svg { width: 20px; height: 20px; }
.zv-btn:hover:not(:disabled) { background: var(--yellow); color: var(--blue-dark); transform: scale(1.06); }
.zv-btn:disabled { opacity: .35; cursor: not-allowed; }   /* ย่อ/ขยายจนสุดแล้ว */
.zv-level {
  min-width: 62px;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--yellow);
}

/* พื้นที่แสดงภาพ */
.zv-stage {
  flex: 1;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: zoom-in;
  touch-action: none;      /* ให้สองนิ้วซูมได้โดยหน้าไม่เลื่อน */
}
.zv-stage.zoomed { cursor: grab; }
.zv-stage.dragging { cursor: grabbing; }
.zv-stage img {
  max-width: 96%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform .12s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}
.zv-stage.dragging img { transition: none; }

.zv-hint {
  text-align: center;
  color: #b9c9e2;
  font-size: .85rem;
  padding: 10px 16px 14px;
}

/* ---------- หน้าระบบตรวจสอบผลการเรียนออนไลน์ ---------- */
.grade-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 40%); }

.grade-wrap {
  max-width: 860px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.grade-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.grade-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(13, 59, 140, .18);
}

/* หัวบล็อก */
.gr-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: var(--white);
}
.gr-head h2 {
  font-size: 1.14rem;
  font-weight: 600;
  color: var(--yellow);
  line-height: 1.5;
}
.gr-icon {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .16);
  color: var(--yellow);
  display: grid;
  place-items: center;
  transition: transform .3s ease, background .3s;
}
.grade-card:hover .gr-icon { transform: scale(1.1) rotate(-6deg); background: var(--yellow); color: var(--blue-dark); }
.gr-icon svg { width: 22px; height: 22px; }

.gr-body { padding: 24px 26px; }
.gr-body p { line-height: 1.9; margin-bottom: 10px; }
.gr-body strong { color: var(--blue-dark); }

/* รายการหัวข้อย่อยในบล็อกประกาศ */
.gr-list { list-style: none; margin: 14px 0; }
.gr-list li {
  position: relative;
  padding: 12px 16px 12px 42px;
  margin-bottom: 10px;
  background: var(--blue-light);
  border-radius: 12px;
  line-height: 1.85;
  transition: transform .2s ease, background .2s;
}
.gr-list li:hover { transform: translateX(6px); background: var(--yellow-soft); }
.gr-list li::before {
  content: "";
  position: absolute;
  left: 16px; top: 21px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--yellow);
  border: 3px solid var(--blue-dark);
}
.gr-note {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  border-radius: 8px;
  font-weight: 500;
  color: var(--blue-dark);
}

/* ---------- ฟอร์มตรวจสอบผลการเรียน ---------- */
.grade-form { padding: 26px; text-align: center; }
.gr-label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 12px;
}
.gr-input-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.gr-input-row input {
  flex: 1 1 340px;
  max-width: 460px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 1.05rem;
  letter-spacing: 1px;
  padding: 14px 18px;
  border: 2px solid #cfdcee;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.gr-input-row input:focus {
  outline: 0;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(21, 101, 192, .15);
}
.gr-submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--yellow);
  color: var(--blue-dark);
  border: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 34px;
  border-radius: 12px;
  transition: background .2s, color .2s, transform .2s, box-shadow .2s;
}
.gr-submit svg { width: 19px; height: 19px; }
.gr-submit:hover {
  background: var(--blue-dark);
  color: var(--yellow);
  transform: scale(1.05);
  box-shadow: 0 10px 22px rgba(13, 59, 140, .3);
}
.gr-hint { margin-top: 14px; font-size: .9rem; color: var(--text-muted); line-height: 1.8; }
.gr-error {
  margin-top: 12px;
  color: #c62828;
  font-weight: 500;
  font-size: .92rem;
}

/* ---------- คำแนะนำการใช้งาน (ขั้นตอนมีหมายเลข) ---------- */
.gr-steps { counter-reset: gstep; list-style: none; }
.gr-steps li {
  counter-increment: gstep;
  position: relative;
  padding: 4px 0 16px 56px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #dde6f2;
}
.gr-steps li:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.gr-steps li::before {
  content: counter(gstep);
  position: absolute;
  left: 0; top: 2px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: transform .25s ease;
}
.gr-steps li:hover::before { transform: scale(1.12); background: var(--yellow); color: var(--blue-dark); }
.gr-steps h4 {
  font-family: var(--font-head);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.gr-steps p { color: var(--text-muted); line-height: 1.85; }

/* ---------- หน้ารวมกลุ่มสาระการเรียนรู้ ---------- */
.subj-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 35%); }

.subj-lead {
  text-align: center;
  color: var(--text-muted);
  margin: -18px 0 32px;
  font-size: .96rem;
}

.subj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.subj-card {
  position: relative;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px 22px;
  text-align: center;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.subj-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 18px 36px rgba(13, 59, 140, .24);
  text-decoration: none;
}

/* หมายเลขกลุ่มสาระมุมซ้ายบน */
.sj-num {
  position: absolute;
  top: 12px; left: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: .9rem;
  display: grid;
  place-items: center;
  transition: background .25s, color .25s;
}
.subj-card:hover .sj-num { background: var(--blue-dark); color: var(--yellow); }

.sj-icon {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: grid;
  place-items: center;
  transition: background .3s, color .3s, transform .3s;
}
.sj-icon svg { width: 28px; height: 28px; }
.subj-card:hover .sj-icon {
  background: var(--yellow);
  color: var(--blue-dark);
  transform: scale(1.12) rotate(-5deg);
}

.sj-name {
  font-family: var(--font-head);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.5;
}
.sj-sub {
  font-size: .85rem;
  color: var(--text-muted);
  background: var(--yellow-soft);
  padding: 4px 14px;
  border-radius: 30px;
  line-height: 1.6;
}
.sj-go {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
}
.sj-go svg { width: 15px; height: 15px; transition: transform .22s ease; }
.subj-card:hover .sj-go svg { transform: translateX(4px); }

/* ปุ่มกลับไปหน้ารวมกลุ่มสาระ */
.subj-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1.5px solid #dbe6f5;
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .9rem;
  padding: 9px 20px;
  border-radius: 30px;
  margin-bottom: 22px;
  transition: background .2s, color .2s, transform .2s, border-color .2s;
}
.subj-back svg { width: 16px; height: 16px; }
.subj-back:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--yellow);
  transform: translateX(-4px);
  text-decoration: none;
}

/* ---------- หน้ากลุ่มงานภายใน (แท็บสลับเนื้อหา) ---------- */
.dept-section { background: linear-gradient(180deg, var(--blue-light), #ffffff 30%); }

/* แถบแท็บหัวข้อ */
.dept-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}
.dept-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--white);
  border: 2px solid #dbe6f5;
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .95rem;
  padding: 11px 22px;
  border-radius: 40px;
  box-shadow: var(--shadow);
  transition: background .22s, color .22s, border-color .22s, transform .22s;
}
.dept-tab .dt-icon { display: grid; place-items: center; }
.dept-tab .dt-icon svg { width: 18px; height: 18px; }
.dept-tab:hover { transform: translateY(-3px); border-color: var(--yellow); }
.dept-tab.active {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: var(--yellow);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(13, 59, 140, .28);
}

/* แผงเนื้อหาแต่ละแท็บ */
.dept-panel { display: none; }
.dept-panel.active { display: block; }

/* เอฟเฟกต์เนื้อหาปรากฏเมื่อสลับแท็บ */
.panel-in { animation: panelFade .45s ease both; }
@keyframes panelFade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- แท็บโครงสร้างการทำงาน ---------- */
.dept-doc {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 5px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.dept-doc h3 {
  font-size: 1.22rem;
  color: var(--blue-dark);
  margin: 26px 0 16px;
  padding-left: 14px;
  border-left: 5px solid var(--yellow);
}
.dept-doc h3:first-child { margin-top: 0; }
.dept-doc p { margin-bottom: 10px; line-height: 1.9; }

/* ผังสายการบริหารงาน */
.dept-doc .flow { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dept-doc .flow-box {
  width: min(100%, 560px);
  background: linear-gradient(135deg, var(--blue-light), #ffffff);
  border: 2px solid var(--blue);
  border-radius: 14px;
  padding: 16px 22px;
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dept-doc .flow-box:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 26px rgba(13, 59, 140, .2);
}
.dept-doc .flow-box strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.06rem;
  color: var(--blue-dark);
  margin-bottom: 4px;
}
.dept-doc .flow-box span { font-size: .92rem; color: var(--text-muted); line-height: 1.7; }
.dept-doc .flow-arrow { color: var(--yellow); font-size: 1.7rem; line-height: 1; font-weight: 700; }

/* การ์ดกลุ่มภารกิจ */
.dept-doc .mission-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.dept-doc .mission-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-top: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dept-doc .mission-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(13, 59, 140, .18);
}
.dept-doc .mission-card h4 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #ccd6e4;
}
.dept-doc .mission-card ul { list-style: none; }
.dept-doc .mission-card li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  font-size: .93rem;
  line-height: 1.75;
}
.dept-doc .mission-card li::before {
  content: "";
  position: absolute;
  left: 2px; top: 11px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--yellow);
}

/* ขั้นตอนการทำงาน */
.dept-doc .work-steps { counter-reset: step; list-style: none; }
.dept-doc .work-steps li {
  counter-increment: step;
  position: relative;
  padding: 12px 14px 12px 56px;
  margin-bottom: 10px;
  background: var(--blue-light);
  border-radius: 12px;
  font-size: .96rem;
  line-height: 1.75;
  transition: transform .2s ease, background .2s;
}
.dept-doc .work-steps li:hover { transform: translateX(6px); background: var(--yellow-soft); }
.dept-doc .work-steps li::before {
  content: counter(step);
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* ---------- แท็บบุคลากร ---------- */
.dept-people-group { margin-bottom: 34px; }
.dept-people-group:last-child { margin-bottom: 0; }
.dept-group-title { text-align: center; margin-bottom: 20px; }
.dept-group-title span {
  display: inline-block;
  background: var(--blue-dark);
  color: var(--yellow);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  padding: 8px 28px;
  border-radius: 40px;
  box-shadow: 0 6px 16px rgba(13, 59, 140, .2);
}

.dept-people-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}
.dept-person {
  width: 186px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 14px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dept-person:hover {
  transform: translateY(-7px) scale(1.04);
  box-shadow: 0 16px 32px rgba(13, 59, 140, .22);
}
.dp-photo {
  width: 92px; height: 92px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #eaf2fc, #dbe8f8);
  border: 3px solid var(--blue-light);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform .3s ease, border-color .3s;
}
.dept-person:hover .dp-photo { transform: scale(1.08); border-color: var(--yellow); }
.dp-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.dp-photo.no-photo { align-items: center; color: #b4c6de; }
.dp-photo.no-photo svg { width: 44px; height: 44px; }
.dp-name {
  font-family: var(--font-head);
  font-size: .96rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.45;
}
.dp-pos {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: .82rem;
  padding: 3px 14px;
  border-radius: 30px;
}
.dp-standing { font-size: .84rem; color: var(--text-muted); }

/* การ์ดระดับผู้บริหาร : เน้นพิเศษ */
.dp-featured {
  width: 232px;
  border: 2px solid var(--yellow);
  background: linear-gradient(135deg, #ffffff, var(--yellow-soft));
}
.dp-featured .dp-photo { width: 118px; height: 118px; border-color: var(--yellow); }
.dp-featured .dp-name { font-size: 1.06rem; }
.dp-featured .dp-pos { background: var(--blue-dark); color: var(--yellow); }

/* แถวคู่ : รองประธานกรรมการ + กรรมการและเลขานุการ (แยกกลุ่มแต่อยู่แถวเดียวกัน) */
.dept-pair-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 26px;
  margin-bottom: 34px;
}
.dept-pair-row .dept-pair-col { flex: 1 1 300px; max-width: 520px; }
.dept-pair-row .dept-people-group { margin-bottom: 0; }

/* ---------- แท็บเว็บไซต์ ---------- */
.dept-links-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.dept-link-card {
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.dept-link-card:hover {
  transform: translateY(-7px) scale(1.02);
  box-shadow: 0 16px 32px rgba(13, 59, 140, .22);
  text-decoration: none;
}
.dl-photo { aspect-ratio: 16 / 9; overflow: hidden; background: var(--blue-light); border-bottom: 3px solid var(--yellow); }
.dl-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.dept-link-card:hover .dl-photo img { transform: scale(1.08); }
.dl-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.dl-body h4 {
  font-family: var(--font-head);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--blue-dark);
  line-height: 1.5;
}
.dl-body p { font-size: .9rem; color: var(--text-muted); line-height: 1.75; }
.dl-go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
}
.dl-go svg { width: 15px; height: 15px; transition: transform .22s ease; }
.dept-link-card:hover .dl-go svg { transform: translateX(4px); }

/* ---------- แท็บเอกสารแนบดาวน์โหลด ---------- */
.dept-files { display: flex; flex-direction: column; gap: 14px; }
.dept-file {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid #e3e9f2;
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  transition: transform .22s ease, box-shadow .22s ease;
}
.dept-file:hover {
  transform: translateX(6px);
  box-shadow: 0 14px 28px rgba(13, 59, 140, .18);
}
.df-icon {
  flex: 0 0 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--blue-light);
  color: var(--blue);
  display: grid;
  place-items: center;
  transition: background .25s, color .25s, transform .25s;
}
.dept-file:hover .df-icon { background: var(--yellow); color: var(--blue-dark); transform: scale(1.1); }
.df-icon svg { width: 22px; height: 22px; }
.df-body { flex: 1; }
.df-body h4 {
  font-family: var(--font-head);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 5px;
  line-height: 1.5;
}
.df-body p { font-size: .92rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 10px; }
.df-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.df-btn {
  display: inline-flex;
  align-items: center;
  background: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .87rem;
  padding: 8px 18px;
  border-radius: 9px;
  transition: transform .2s ease, background .2s, color .2s;
}
.df-btn:hover { transform: scale(1.05); background: var(--blue-dark); color: var(--white); text-decoration: none; }
.df-btn-main { background: var(--yellow); }
.df-btn-main:hover { background: var(--blue-dark); color: var(--yellow); }

/* ================================================================
   ลูกเล่น Hover Zoom : องค์ประกอบขยาย/ขยับตอบสนองเมื่อนำเมาส์ไปชี้
   (บนมือถือไม่มีเมาส์ เอฟเฟกต์เหล่านี้จะไม่รบกวนการใช้งาน)
   ================================================================ */

/* โลโก้ส่วนหัว : ขยายพร้อมเอียงเล็กน้อย */
.brand-logo { transition: transform .3s ease; }
.brand:hover .brand-logo { transform: scale(1.1) rotate(-4deg); }

/* เมนูหลัก : ขยายเล็กน้อย / เมนูย่อยขยับเข้าขวา */
.nav-link { transition: background .2s, color .2s, transform .2s; }
.nav-link:hover { transform: scale(1.06); }
.dropdown a { transition: background .15s, color .15s, transform .2s; }
.dropdown a:hover { transform: translateX(5px); }

/* การ์ดสถิตินักเรียน : ลอยขึ้นและขยาย */
.stat-card { transition: transform .25s ease, box-shadow .25s ease, background .25s; }
.stat-card:hover {
  transform: translateY(-5px) scale(1.04);
  background: rgba(255, 255, 255, .17);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
}
.stat-main:hover { background: var(--yellow); }

/* การ์ดบริการ : ยกสูงขึ้น ขยาย และไอคอนพองตัวเปลี่ยนเป็นสีเหลือง */
.service-card:hover { transform: translateY(-6px) scale(1.03); }
.service-icon { transition: transform .3s ease, background .3s, color .3s; }
.service-card:hover .service-icon {
  transform: scale(1.15);
  background: var(--yellow);
  color: var(--blue-dark);
}

/* ภาพกิจกรรมและภาพรางวัล : ภาพค่อย ๆ ซูมเข้าภายในกรอบ + ป้ายวันที่พองตัว */
.activity-item img, .award-item img { transition: transform .5s ease; }
.activity-item:hover img { transform: scale(1.09); }
.award-card:hover .award-item img { transform: scale(1.09); }

.date-badge { transition: transform .25s ease; }
.activity-item:hover .date-badge,
.award-card:hover .date-badge { transform: scale(1.12); }

/* รายการข่าว : แถวเลื่อนออกทางขวา พื้นหลังฟ้าอ่อน ป้ายวันที่พองตัว */
.news-list li { transition: background .2s, transform .2s; border-radius: 8px; }
.news-list li:hover {
  background: var(--blue-light);
  transform: translateX(8px);
}
.news-list .date-badge { transition: transform .2s ease; }
.news-list li:hover .date-badge { transform: scale(1.1); }
.news-list li:hover a { color: var(--blue); }

/* กรอบวิดีโอ : ลอยขึ้น ขยาย และปุ่มเล่นพองตัว */
.video-frame { transition: transform .3s ease, box-shadow .3s ease; }
.video-frame:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 14px 30px rgba(13, 59, 140, .28);
}
.video-placeholder .play-icon { transition: transform .3s ease; }
.video-frame:hover .play-icon { transform: scale(1.18); }

/* ปุ่มเลื่อนสไลด์ / จุดบอกตำแหน่ง / ปุ่มขึ้นด้านบน : ขยายเมื่อชี้ */
.slider-btn { transition: background .2s, transform .2s; }
.slider-btn:hover { transform: translateY(-50%) scale(1.15); }
.slider-dots button:hover { transform: scale(1.35); }
.back-to-top.show:hover { transform: translateY(0) scale(1.12); }

/* บล็อกสถิติผู้เข้าชม : แถวสว่างขึ้นและขยับเข้าเล็กน้อย */
.visitor-list li { transition: background .2s, padding-left .2s; border-radius: 6px; }
.visitor-list li:hover {
  background: rgba(255, 255, 255, .09);
  padding-left: 8px;
}

/* ---------- ลดการเคลื่อนไหว สำหรับผู้ใช้ที่ตั้งค่า Reduce Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
