/* ==========================================================================
   DESIGN SYSTEM & THEME TOKENS (:root)
   สาขาวิชาวิทยาการคอมพิวเตอร์ มรภ.ศรีสะเกษ (CS SSKRU)
   Theme: Prestigious University Academic Style with CS SSKRU Brand Colors
   ========================================================================== */

:root {
  /* 🎨 1. พื้นหลังและโครงสร้างหลัก (Academic Light Surfaces) */
  --bg-main: #f8fafc;              /* พื้นหลังหลัก เทาขาวสะอาดตาสบายตา */
  --bg-secondary: #ffffff;         /* พื้นหลังส่วนสลับ ขาวบริสุทธิ์ */
  --bg-surface-subtle: #f1f5f9;    /* พื้นหลังบล็อกย่อย/สีเทาอ่อน */
  --bg-card: #ffffff;              /* พื้นหลังการ์ด ขาวคลีน */
  --bg-card-hover: #ffffff;        /* การ์ดเวลาเอาเมาส์ชี้ */
  --bg-card-glass: rgba(255, 255, 255, 0.95);
  --bg-badge: #fff7ed;

  /* 💼 2. สีหลักและสีไฮไลท์ (สีประจำสถาบัน: เหลืองทองสิริราชภัฏ + สีกรมท่ามหาวิทยาลัย) */
  --primary-navy: #0f2b5c;         /* สีกรมท่ามหาวิทยาลัย สง่างาม น่าเชื่อถือ */
  --primary-blue: #1a4480;         /* น้ำเงินสถาบันมาตรฐาน */
  --primary-hover: #0a1c3d;        /* น้ำเงินเข้มเวลา Hover */
  
  /* สีเหลืองทองเอกลักษณ์ (Academic Bright Yellow & Gold) */
  --accent-brand: #eab308;         /* สีเหลืองทองสว่างสดใส (Yellow 500) */
  --accent-brand-yellow: #facc15;  /* สีเหลืองสด (Yellow 400) */
  --accent-brand-dark: #a16207;    /* สีเหลืองทองเข้มสำหรับตัวหนังสือ (Amber/Yellow 700) */
  --accent-brand-hover: #ca8a04;   /* สีเหลืองทองเข้มเวลา Hover (Yellow 600) */
  --accent-brand-light: #fef9c3;   /* พื้นหลังเหลืองพาสเทลอ่อนละมุน (Yellow 100) */
  --accent-brand-border: #fde047;  /* เส้นขอบเหลืองทอง (Yellow 300) */
  --accent-gradient: linear-gradient(135deg, #facc15 0%, #eab308 100%);

  --accent-teal: #0d9488;          /* เขียวอมฟ้าสุขุม */
  --accent-success: #16a34a;       /* เขียวสำเร็จการศึกษา / แล็บ */

  /* 📝 3. สีข้อความ (Crisp Academic Typography) */
  --text-title: #0f172a;           /* หัวข้อสีน้ำเงินเข้มจัด/เกือบดำ คมชัด */
  --text-body: #334155;            /* เนื้อหาสีเทาเข้ม Slate 700 อ่านง่าย */
  --text-muted: #64748b;           /* คำอธิบายรอง (Slate 500) */
  --text-white: #ffffff;
  --text-link: #0f2b5c;

  /* 🔲 4. เส้นขอบและเงา (Refined University Elevation) */
  --border-subtle: #e2e8f0;        /* เส้นขอบบางเฉียบ */
  --border-light: #cbd5e1;         /* เส้นขอบระดับปานกลาง */
  --border-hover: #eab308;         /* เส้นขอบเมื่อเมาส์ชี้ */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 30px rgba(15, 43, 92, 0.12);
  --shadow-dropdown: 0 10px 30px rgba(0, 0, 0, 0.1);

  /* 📐 5. ฟอนต์และความโค้งมน (Typography & Radii) */
  --font-heading: 'Prompt', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 50px;
}

/* ==========================================================================
   GLOBAL BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-body);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  color: var(--text-title);
  line-height: 1.35;
  font-weight: 600;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
}

.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 80px 0;
  position: relative;
}

/* ==========================================================================
   TOP UTILITY BAR (สไตล์ chula.ac.th)
   ========================================================================== */
.top-bar {
  background-color: var(--primary-navy);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-family: var(--font-heading);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1001;
}

.top-bar .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 38px;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-tools a.top-tool-link {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.top-tools a.top-tool-link:hover {
  color: #facc15;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.lang-switch .lang-btn,
.lang-switch a {
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  user-select: none;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
}

.top-lang-switch .lang-btn.active,
.top-lang-switch a.active {
  color: #0f2b5c !important;
  background: #facc15;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.top-lang-switch .lang-btn:not(.active),
.top-lang-switch a:not(.active) {
  color: rgba(255, 255, 255, 0.85);
}

.top-lang-switch .lang-btn:not(.active):hover,
.top-lang-switch a:not(.active):hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Navbar Language Switcher (Top Right on Navbar) */
.nav-lang-switch {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 2px 4px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.nav-lang-switch .lang-btn {
  color: #475569;
  padding: 4px 9px;
  font-size: 0.76rem;
}

.nav-lang-switch .lang-btn.active {
  color: #ffffff !important;
  background: var(--primary-navy);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 43, 92, 0.25);
}

.nav-lang-switch .lang-btn:not(.active):hover {
  color: var(--primary-navy);
  background: rgba(15, 43, 92, 0.08);
}


/* ==========================================================================
   MAIN NAVBAR (ป้องกันข้อความตัดบรรทัด / จัดวางให้พอดีสวยงาม)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  height: 68px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-logo-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
}

.nav-brand-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--primary-navy);
  line-height: 1.2;
  white-space: nowrap;
}

.nav-brand-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-body);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  position: relative;
  white-space: nowrap;
  display: inline-block;
  transition: color 0.25s ease, background-color 0.25s ease;
  z-index: 1;
}

.nav-link:hover {
  color: var(--primary-navy);
}

.nav-link.active {
  color: var(--primary-navy);
  font-weight: 600;
}

/* Dropdown Navigation Menu */
.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-arrow {
  font-size: 0.7rem;
  margin-left: 4px;
  transition: transform 0.25s ease;
  display: inline-block;
  opacity: 0.7;
}

.nav-item-dropdown:hover .nav-arrow,
.nav-item-dropdown.open .nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  min-width: 245px;
  border-radius: 12px;
  padding: 8px 6px;
  box-shadow: 0 12px 35px rgba(15, 43, 92, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(15, 43, 92, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1050;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #ffffff;
  border-top: 1px solid rgba(15, 43, 92, 0.12);
  border-left: 1px solid rgba(15, 43, 92, 0.12);
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu,
.nav-item-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}

.dropdown-item i {
  color: var(--accent-pink);
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.dropdown-item:hover {
  background: #f8fafc;
  color: var(--primary-navy);
  padding-left: 20px;
}

.dropdown-item:hover i {
  transform: scale(1.2);
}

/* Sliding active indicator bar */
.nav-indicator {
  position: absolute;
  bottom: 0px;
  left: 0;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 3px;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), width 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.45);
  opacity: 0;
  transform: translateX(0);
}

.nav-cta {
  background: var(--accent-gradient);
  color: #0f2b5c !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(202, 138, 4, 0.3);
  transition: all 0.25s ease;
}

.nav-cta:hover {
  background: linear-gradient(135deg, #fde047 0%, #ca8a04 100%);
  color: #0a1c3d !important;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(202, 138, 4, 0.4);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--primary-navy);
  cursor: pointer;
}

/* ==========================================================================
   HERO / EDITORIAL SHOWCASE BANNER (สไตล์ chula.ac.th)
   ========================================================================== */
.hero {
  padding: 85px 0 115px;
  background-color: #0a1937;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: -15%;
  left: 0;
  width: 100%;
  height: 135%;
  background: linear-gradient(135deg, rgba(7, 21, 46, 0.90) 0%, rgba(15, 43, 92, 0.84) 50%, rgba(10, 25, 55, 0.92) 100%),
              url('../images/hero-bg.jpg') center center / cover no-repeat;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(10, 25, 55, 0.3) 0%, rgba(15, 43, 92, 0.45) 50%, rgba(10, 22, 48, 0.85) 100%);
  pointer-events: none;
  z-index: 1;
}

/* แสงออโรร่านุ่มนวลสบายตา (Soft Ambient Glow Orbs) */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.18;
  z-index: 1;
}

.hero-glow-1 {
  top: 10%;
  left: 8%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(234, 179, 8, 0.45) 0%, transparent 70%);
  animation: heroGlowFloat1 12s ease-in-out infinite alternate;
}

.hero-glow-2 {
  bottom: 8%;
  right: 10%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
  animation: heroGlowFloat2 15s ease-in-out infinite alternate;
}

@keyframes heroGlowFloat1 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(25px, -18px); }
}

@keyframes heroGlowFloat2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-22px, 16px); }
}

.hero-content {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform, opacity;
  transition: transform 0.1s ease-out, opacity 0.1s ease-out;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef08a;
  padding: 7px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-badge-tag:hover {
  transform: translateY(-2px);
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hero-title .text-highlight {
  color: #fbbf24;
  position: relative;
  display: inline-block;
}

.hero-desc {
  font-size: 1.12rem;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 auto 2.25rem;
  max-width: 760px;
  line-height: 1.85;
  font-weight: 300;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
}

.stat-item {
  text-align: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover {
  transform: translateY(-3px);
}

.stat-item h4 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.stat-item p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ==========================================================================
   QUICK ACCESS OVERLAY BAR (สไตล์ chula.ac.th - 5 ช่องด่วนลอยตัว)
   ========================================================================== */
.quick-access-wrapper {
  margin-top: -50px;
  position: relative;
  z-index: 10;
  margin-bottom: 40px;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 35px rgba(15, 43, 92, 0.1);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.quick-access-card {
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-right: 1px solid var(--border-subtle);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.quick-access-card:last-child {
  border-right: none;
}

.quick-access-card:hover {
  background: var(--bg-surface-subtle);
  transform: translateY(-3px);
}

.quick-access-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-brand-light);
  color: var(--accent-brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  transition: all 0.25s ease;
}

.quick-access-card:hover .quick-access-icon {
  background: var(--accent-gradient);
  color: #0f2b5c;
  transform: scale(1.08);
}

.quick-access-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary-navy);
  margin-bottom: 4px;
  white-space: nowrap;
}

.quick-access-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   SECTION HEADERS (สไตล์ chula.ac.th)
   ========================================================================== */
.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem;
}

.section-subtitle {
  color: var(--accent-brand-dark);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 0.75rem;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  color: #0f2b5c !important;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(202, 138, 4, 0.35);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fde047 0%, #ca8a04 100%);
  color: #0a1c3d !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(202, 138, 4, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--primary-navy) !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.btn-navy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-navy);
  color: #ffffff !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 43, 92, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn-navy:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* ==========================================================================
   CARDS & GRID SYSTEM
   ========================================================================== */
.card-dark, .card-academic {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  position: relative;
}

.card-dark:hover, .card-academic:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
}

.grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

@media (max-width: 768px) {
  .grid-2x2 {
    grid-template-columns: 1fr;
  }
}

.lecturers-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
}

.lecturers-grid .card-academic {
  flex: 0 1 calc(33.333% - 1.25rem);
  min-width: 300px;
  max-width: 380px;
}

/* ==========================================================================
   TAB NAVIGATION
   ========================================================================== */
.tab-nav-wrapper {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn-pill {
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-subtle);
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.tab-btn-pill:hover {
  background: var(--bg-surface-subtle);
  color: var(--accent-brand);
}

.tab-btn-pill.active {
  background: var(--primary-navy);
  color: #ffffff;
  border-color: var(--primary-navy);
  box-shadow: 0 4px 12px rgba(15, 43, 92, 0.2);
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-brand-light);
  color: var(--accent-brand);
  border: 1px solid var(--accent-brand-border);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-heading);
  white-space: nowrap;
}

.badge-navy {
  background: #eff6ff;
  color: var(--primary-navy);
  border: 1px solid #bfdbfe;
}

.code-pill {
  background: var(--bg-surface-subtle);
  color: var(--primary-navy);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   NEWS & MAGAZINE SECTION (สไตล์ chula.ac.th)
   ========================================================================== */
.news-magazine-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
}

.news-feature-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.news-feature-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.news-feature-img {
  height: 280px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f2b5c 0%, #1e40af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-feature-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.news-feature-card:hover .news-feature-img img {
  transform: scale(1.04);
}

.news-feature-content {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.news-feature-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.news-feature-desc {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.news-list-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-side-item {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.news-side-item:hover {
  background: var(--bg-surface-subtle);
  border-color: var(--border-light);
  transform: translateX(4px);
}

.news-side-thumb {
  width: 90px;
  height: 75px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-subtle);
  flex-shrink: 0;
  object-fit: cover;
}

.news-side-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--primary-navy);
  line-height: 1.4;
  margin-bottom: 4px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #ffffff;
}

.custom-table th, .custom-table td {
  padding: 12px 16px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.custom-table th {
  background: var(--bg-surface-subtle);
  color: var(--primary-navy);
  font-weight: 600;
  font-family: var(--font-heading);
}

.custom-table tr:hover {
  background: #f8fafc;
}

/* ==========================================================================
   MODAL BACKDROP
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   ACADEMIC FOOTER (สไตล์ chula.ac.th)
   ========================================================================== */
.academic-footer {
  background: var(--primary-navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 70px 0 0;
  border-top: 4px solid var(--accent-brand);
}

.academic-footer a {
  color: rgba(255, 255, 255, 0.75);
}

.academic-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-bottom {
  background: #081a38;
  padding: 24px 0;
  margin-top: 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1200px) {
  .nav-link {
    font-size: 0.82rem;
    padding: 0.4rem 0.5rem;
  }
  .nav-brand-title {
    font-size: 1rem;
  }
  .nav-brand-sub {
    font-size: 0.7rem;
  }
}

@media (max-width: 1060px) {
  .nav-indicator {
    display: none;
  }
  .nav-menu {
    position: fixed;
    top: 76px;
    left: -100%;
    width: 280px;
    height: calc(100vh - 76px);
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
    border-right: 1px solid var(--border-subtle);
    gap: 8px;
    z-index: 1000;
  }
  .nav-menu.show { left: 0; }
  .nav-toggle { display: block; }
  .nav-link {
    width: 100%;
    padding: 0.6rem 0.85rem;
  }
  .nav-link.active {
    background: var(--accent-brand-light);
    color: var(--primary-navy);
    border-left: 3px solid var(--accent-brand);
    border-radius: var(--radius-sm);
  }
  .nav-item-dropdown {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-dropdown-menu {
    position: static;
    transform: none !important;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--accent-pink);
    background: #f8fafc;
    width: calc(100% - 10px);
    min-width: 100%;
    padding: 4px 0 4px 8px;
    margin: 4px 0 6px 8px;
    border-radius: 6px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
  }
  .nav-dropdown-menu::before {
    display: none;
  }
  .nav-item-dropdown.open .nav-dropdown-menu,
  .nav-item-dropdown:hover .nav-dropdown-menu {
    display: block;
  }
  .dropdown-item {
    padding: 7px 10px;
    font-size: 0.84rem;
  }
  .quick-access-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .news-magazine-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .top-bar { display: block; height: 38px; }
  .top-bar .top-tools { justify-content: flex-end; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); max-width: 450px; }
}

@media (max-width: 640px) {
  .quick-access-grid {
    grid-template-columns: 1fr;
  }
  .quick-access-card {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-desc {
    font-size: 1rem;
  }
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

/* ==========================================================================
   ACADEMIC QUALITY & ACHIEVEMENTS SECTION (ธีมน้ำเงินหรูหราสง่างาม CS SSKRU)
   ========================================================================== */
#quality-reports {
  background: linear-gradient(135deg, #07152b 0%, #0f2b5c 50%, #153a75 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
  padding: 85px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#quality-reports::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: radial-gradient(circle at 15% 20%, rgba(59, 130, 246, 0.25) 0%, transparent 50%),
              radial-gradient(circle at 85% 80%, rgba(234, 179, 8, 0.12) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

#quality-reports .container {
  position: relative;
  z-index: 2;
}

#quality-reports .section-subtitle {
  color: #fde047;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
}

#quality-reports .section-title {
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#quality-reports .section-desc {
  color: rgba(255, 255, 255, 0.88);
}

#quality-reports .card-academic {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

#quality-reports .card-academic:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

