/* =========================================
   ภาควิชาการพยาบาลอายุรศาสตร์ - มหาวิทยาลัยมหิดล
   New Modern UI/UX Design
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* =========================================
   CSS Variables & Design Tokens
   ========================================= */
:root {
  /* Mahidol Brand Colors (Refined & Clean) -> Customized for MN_TH Orange Theme */
  --mu-blue: #f97316;          /* Vibrant Orange */
  --mu-blue-dark: #0c2340;     /* Deep Mahidol Navy Blue for highly legible text (not brown) */
  --mu-blue-mid: #ea580c;      /* Deep Orange */
  --mu-blue-light: #ffb300;    /* Vibrant Yellow-ish Orange */
  --mu-blue-pale: #fff7ed;     /* Soft orange-cream tint for card/badge backgrounds */
  --mu-gold: #ffb300;          /* Yellow-ish Orange */
  --mu-gold-light: #fde047;    /* Light Yellow */
  --mu-gold-dark: #ea580c;     /* Deep Orange */

  /* Neutral Palette */
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-50: #f4f5f7;
  --gray-100: #e8eaed;
  --gray-200: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Accent */
  --accent-teal: #0891b2;
  --accent-red: #dc2626;
  --accent-green: #16a34a;

  /* Typography */
  --font-thai: 'Sarabun', 'Athiti', sans-serif;
  --font-en: 'Inter', sans-serif;
  --font-base: var(--font-en);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(217, 119, 6, 0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 40px rgba(217, 119, 6, 0.15), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 60px rgba(217, 119, 6, 0.2);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* ---Layout--- */
  --container-max: 1200px;
  --navbar-height: 68px;
  --topbar-height: 40px;
}

/* =========================================
   Reset & Base
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  background-color: var(--off-white);
  color: var(--gray-700);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--mu-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--mu-blue-light); }

ul { list-style: none; }

/* =========================================
   Layout Container
   ========================================= */
.mn-wrapper {
  max-width: var(--container-max);
  margin: 0 auto;
  background: var(--white);
  box-shadow: var(--shadow-xl);
  min-height: 100vh;
  position: relative;
}

.container {
  max-width: 100%;
  padding: 0 var(--space-6);
}

/* =========================================
   TOP BAR
   ========================================= */
.topbar {
  background: var(--mu-blue);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
}

.topbar-links a {
  color: var(--white);
  font-size: 13px;
  font-family: var(--font-base);
  transition: color var(--transition-fast);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.topbar-links a:hover { color: var(--mu-gold); }

.topbar-links .sep {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  margin: 0 var(--space-1);
}

.topbar-social {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  transition: all var(--transition-fast);
}

.topbar-social a:hover {
  background: var(--mu-blue-dark);
  transform: translateY(-1px);
}

.topbar-social img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0);
}

.topbar-lang {
  display: flex;
  align-items: center;
}

.topbar-lang a {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--white);
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  font-weight: 500;
}

.topbar-lang a:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--mu-blue);
}

.topbar-lang img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

/* =========================================
   HEADER / BRANDING
   ========================================= */
.site-header {
  background: var(--mu-gold);
  padding: var(--space-6) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--mu-blue);
}

.header-logo {
  flex-shrink: 0;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.header-logo img {
  width: auto;
  height: 100%;
  max-width: 250px;
  object-fit: contain;
}

/* Placeholder สำหรับโลโก้ */
.logo-placeholder {
  display: none;
}

.logo-placeholder svg {
  opacity: 0.5;
}

.header-text {
  flex: 1;
}

.header-dept-name {
  font-size: clamp(18px, 2.5vw, 26px);
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  letter-spacing: 0.3px;
  text-align: end;
}

.header-faculty-name {
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--mu-blue-pale);
  margin-top: var(--space-1);
  font-weight: 500;
  text-align: end;
}


.header-head-img {
  /* ซ่อน head.jpg เดิมได้เลย */
  display: none;
}

/* =========================================
   NAVIGATION BAR (ฉบับปรับปรุงตัวล็อกบั๊กแตกแถวและระยะห่างบรรทัด)
   ========================================= */
.navbar {
  background: var(--mu-blue);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(16, 45, 94, 0.15);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 var(--space-4);
}

.navbar-brand {
  color: var(--white); 
  font-size: 13px;
  font-family: var(--font-base);
  font-weight: 600;               
  letter-spacing: 0.3px;
  line-height: 1.2;
  margin-right: 10px;
}

@media (min-width: 961px) {
  .navbar-brand {
    display: block;
  }
}

/* Desktop Nav */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  
}

.nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  height: 100%;
  color: var(--white);
  font-family: var(--font-base);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--white);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.15);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 60%;
}

.nav-arrow {
  font-size: 10px;
  opacity: 0.8;
  transition: transform var(--transition-fast);
}

.nav-item:hover .nav-arrow {
  transform: rotate(180deg);
}
/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-base);
  border: 1px solid var(--gray-100);
  z-index: 1100;
}

.nav-item:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: var(--space-3) var(--space-5);
  color: var(--gray-700);
  font-size: 14.5px;
  font-family: var(--font-base);
  border-bottom: 1px solid var(--gray-50);
  transition: all var(--transition-fast);
  position: relative;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--mu-blue);
  transition: width var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--mu-blue-pale);
  color: var(--mu-blue);
  padding-left: calc(var(--space-5) + 8px);
}

.dropdown-item:hover::before {
  width: 4px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
  border: none;
  background: none;
}

.hamburger:hover { background: rgba(255,255,255,0.1); }

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0px);
  transition: all var(--transition-slow);
  pointer-events: none;
}

.mobile-menu.open {
  display: block;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  pointer-events: all;
}

.mobile-nav-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--mu-blue);
  overflow-y: auto;
  transition: right var(--transition-slow) cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}

.mobile-menu.open .mobile-nav-panel {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: var(--mu-blue);
}

.mobile-nav-title {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}

.mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
  line-height: 1;
}

.mobile-close:hover { background: rgba(255,255,255,0.2); }

.mobile-nav-list {
  padding: var(--space-4) 0;
  flex: 1;
}

.mobile-nav-item {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--space-4) var(--space-5);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14.5px;
  font-family: var(--font-base);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-nav-link span:last-child:not(:first-child) {
  margin-left: auto;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: rgba(255,255,255,0.08);
  color: var(--mu-gold-light);
}

.mobile-dropdown {
  display: none;
  background: rgba(0, 0, 0, 0.15);
}

.mobile-dropdown.open { display: block; }

.mobile-dropdown a {
  display: block;
  padding: var(--space-3) var(--space-5) var(--space-3) calc(var(--space-5) + 16px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-family: var(--font-base);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: all var(--transition-fast);
}

.mobile-dropdown a:hover {
  color: var(--mu-gold-light);
  background: rgba(255,255,255,0.05);
}

.mobile-dropdown a::before {
  content: '– ';
  opacity: 0.5;
}

/* =========================================
   MAIN CONTENT AREA
   ========================================= */
.main-content {
  padding: var(--space-8) var(--space-6);
  min-height: 400px;
}

/* =========================================
   HERO SLIDESHOW
   ========================================= */
.hero-slideshow {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  background: var(--gray-100);
  margin-bottom: var(--space-8);
}

.slideshow-container {
  position: relative;
  width: 100%;
  padding-bottom: 33%; /* aspect ratio */
  overflow: hidden;
}

.slide-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-item {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.slide-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



.slide-dots {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-2);
  z-index: 10;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
}

.slide-dot.active {
  background: var(--mu-gold);
  width: 24px;
  border-radius: 4px;
}

/* =========================================
   SECTION HEADERS
   ========================================= */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--gray-100);
}

.section-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(25, 68, 136, 0.3);
}

.section-icon svg {
  width: 20px;
  height: 20px;
  fill: white;
  stroke: white;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--mu-blue);
  font-family: var(--font-base);
}

.section-title span {
  color: var(--mu-gold);
}

/* =========================================
   NEWS CARD GRID
   ========================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.news-card {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  align-items: flex-start;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--mu-blue-pale);
}

.news-card-img {
  flex-shrink: 0;
  width: 110px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray-100);
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.news-card-body {
  flex: 1;
  min-width: 0;
}

.news-card-title {
  font-size: 14.5px;
  color: var(--gray-700);
  line-height: 1.5;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-fast);
  font-family: var(--font-base);
}

.news-card:hover .news-card-title {
  color: var(--mu-blue);
}

.news-card-title a {
  color: inherit;
  font-family: var(--font-base);
}

/* "Other >>" Button */
.btn-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  color: white;
  font-size: 14px;
  font-family: var(--font-base);
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(25, 68, 136, 0.3);
}

.btn-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(25, 68, 136, 0.4);
  color: white;
  background: linear-gradient(135deg, var(--mu-blue-light), var(--mu-blue));
}

.btn-more svg {
  width: 14px;
  height: 14px;
  fill: white;
}

.section-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
}

/* =========================================
   VIDEO SECTION
   ========================================= */
.video-section {
  margin-bottom: var(--space-8);
}

.video-list {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition-fast);
}

.video-item:last-child { border-bottom: none; }

.video-item:hover { background: var(--mu-blue-pale); }

.video-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(220,38,38,0.3);
}

.video-icon svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.video-title {
  font-size: 15px;
  color: var(--gray-700);
  font-family: var(--font-base);
  transition: color var(--transition-fast);
}

.video-item:hover .video-title { color: var(--mu-blue); }

/* =========================================
   PAGE TITLE BANNER
   ========================================= */
.page-title-banner {
  background: linear-gradient(135deg, var(--mu-blue) 0%, var(--mu-blue-light) 100%);
  padding: var(--space-6) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  border-bottom: 3px solid var(--mu-blue-mid);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-md);
}

.page-title-text {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  color: white;
  font-family: var(--font-base);
}

.page-title-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(200,168,75,0.4);
}

.page-title-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--mu-gold-light);
  stroke: var(--mu-gold-light);
}

.page-title-icon i {
  font-size: 20px;
  color: var(--mu-gold-light);
}

/* =========================================
   CONTENT STYLES (for body pages)
   ========================================= */
.content-body {
  font-family: var(--font-base);
  font-size: 16px;
  color: var(--gray-600);
  line-height: 1.85;
}

.content-body p {
  margin-bottom: var(--space-5);
  text-indent: 2.5em;
}

.content-body img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: var(--space-6) auto;
  max-width: 100%;
}

/* Section Heading inside content */
.content-heading {
  font-size: 20px;
  font-weight: 700;
  color: var(--mu-blue);
  font-family: var(--font-base);
  padding: var(--space-3) var(--space-5);
  background: var(--mu-blue-pale);
  border-left: 4px solid var(--mu-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-6) 0 var(--space-4);
}

/* =========================================
   TABLES (for department history etc.)
   ========================================= */
.dept-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-5) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.dept-table thead {
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  color: white;
}

.dept-table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-family: var(--font-base);
  font-size: 15px;
  font-weight: 600;
}

.dept-table tr:nth-child(even) td {
  background: var(--gray-50);
}

.dept-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--gray-100);
  font-family: var(--font-base);
  font-size: 15px;
  color: var(--gray-700);
  vertical-align: top;
  background: white;
}

.dept-table tr:hover td {
  background: var(--mu-blue-pale);
}

.dept-table td a {
  color: var(--mu-blue);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.dept-table td a:hover {
  color: var(--mu-gold-dark);
  text-decoration: underline;
}

/* =========================================
   ACTIVITIES ARCHIVE BUTTONS
   ========================================= */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  max-width: 700px;
  margin: 0 auto;
}

.archive-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: orange;
  color: white;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}

.archive-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--mu-blue);
  color: white;
}

.archive-btn svg {
  width: 16px;
  height: 16px;
  fill: rgba(255,255,255,0.6);
  flex-shrink: 0;
}

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--mu-blue);
  padding: var(--space-10) var(--space-6);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--mu-gold);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: start;
}

.footer-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-base);
  margin-bottom: var(--space-2);
}

.footer-info p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-base);
  line-height: 1.6;
  margin-bottom: var(--space-1);
}

.footer-info a {
  color: var(--mu-gold-light);
  transition: color var(--transition-fast);
  font-weight: 600;
}

.footer-info a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-base);
}

/* =========================================
   BREADCRUMB
   ========================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.breadcrumb a,
.breadcrumb span {
  font-size: 13px;
  color: var(--gray-400);
  font-family: var(--font-base);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover { color: var(--mu-blue); }

.breadcrumb .sep {
  color: var(--gray-200);
  font-size: 12px;
}

.breadcrumb .current {
  color: var(--mu-blue);
  font-weight: 500;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

/* =========================================
   RESPONSIVE — Tablet
   ========================================= */
@media (max-width: 960px) {
  .header-dept-name{
    color:white;
  }
  .nav-menu {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .navbar-inner {
    justify-content: space-between;
  }

  /* Show dept name in nav on tablet+ */
  .navbar-brand {
    color: var(--white);
    font-size: 16px;
    font-family: var(--font-base);
    font-weight: 600;
    display: block;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

@media (max-width: 768px) {
  :root {
    --space-6: 16px;
  }

  .topbar { display: none; }

  .site-header {
    padding: var(--space-4) var(--space-4);
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .header-logo {
    width: 100%;
    height: 60px;
    justify-content: center;
  }

  .header-dept-name { font-size: 16px; color: rgb(255, 255, 255);}
  .header-faculty-name { font-size: 12px; }

  .main-content {
    padding: var(--space-5) var(--space-4);
  }

  .slideshow-container {
    padding-bottom: 55%;
  }

  .news-card {
    flex-direction: column;
  }

  .news-card-img {
    width: 100%;
    height: 160px;
  }

  .archive-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .page-title-banner {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  .page-title-text { font-size: 18px; }
}

@media (max-width: 480px) {
  .news-card-img { height: 130px; }
  .header-logo { width: 50px; height: 50px; }
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
#back-to-top {
  position: fixed;
  right: var(--space-6);
  bottom: var(--space-8);
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
  z-index: 999;
  border: none;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

#back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

#back-to-top svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* =========================================
   Staff Directory Styles
   ========================================= */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.staff-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.staff-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--mu-blue-pale);
}

.staff-img-container {
  position: relative;
  width: 100%;
  padding-top: 125%; /* 4:5 aspect ratio */
  overflow: hidden;
  background: var(--gray-50);
}

.staff-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.staff-info {
  padding: var(--space-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.staff-name-link {
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 700;
  color: var(--mu-blue);
  line-height: 1.4;
  margin-bottom: var(--space-1);
  display: block;
}

.staff-name-link:hover {
  color: var(--mu-blue-light);
}

.staff-position {
  display: inline-block;
  font-family: var(--font-base);
  font-size: 13px;
  color: var(--mu-blue-dark);
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(217, 119, 6, 0.35);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

.staff-contacts {
  border-top: 1px solid var(--gray-50);
  padding-top: var(--space-3);
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.staff-contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13.5px;
  color: var(--gray-600);
}

.staff-contact-item svg {
  flex-shrink: 0;
  fill: none;
  stroke: var(--mu-blue);
  stroke-width: 2;
  width: 15px;
  height: 15px;
}

.staff-contact-item a {
  color: var(--gray-600);
  transition: color var(--transition-fast);
}

.staff-contact-item a:hover {
  color: var(--mu-blue);
}

/* =========================================
   Course / Teaching Styles
   ========================================= */
.teaching-intro {
  background: linear-gradient(135deg, var(--mu-blue-pale), #f0f4ff);
  border: 1px solid #d1d9ec;
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  font-size: 15px;
  line-height: 1.8;
  color: var(--gray-700);
}

.teaching-intro p {
  text-indent: 0;
  margin-bottom: var(--space-3);
}
.teaching-intro p:last-child {
  margin-bottom: 0;
}

.course-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: var(--space-6);
  overflow-x: auto;
  padding-bottom: var(--space-2);
}

.course-tab-btn {
  background: none;
  border: none;
  font-family: var(--font-base);
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-500);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.course-tab-btn:hover {
  color: var(--mu-blue);
  background: var(--mu-blue-pale);
}

.course-tab-btn.active {
  color: var(--white);
  background: var(--mu-blue);
}

.course-tab-content {
  display: none;
}

.course-tab-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

.program-section {
  margin-bottom: var(--space-8);
}

.program-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--mu-blue-dark);
  margin-bottom: var(--space-4);
  border-left: 4px solid var(--mu-gold);
  padding-left: var(--space-3);
}

.course-list-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-850);
  margin-bottom: var(--space-3);
  margin-top: var(--space-4);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.course-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--mu-blue-pale);
}

.course-code-badge {
  background: var(--mu-blue-pale);
  color: var(--mu-blue);
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.course-name {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-700);
  line-height: 1.5;
}

/* =========================================
   Mobile Staff Card Layout Adjustments
   ========================================= */
@media (max-width: 600px) {
  .staff-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0;
  }
  .staff-img-container {
    width: 100px !important;
    height: 125px !important;
    padding-top: 0 !important;
    flex-shrink: 0 !important;
    margin: var(--space-3) !important;
    border-radius: var(--radius-md) !important;
  }
  .staff-img {
    position: absolute !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  .staff-info {
    padding: var(--space-3) var(--space-3) var(--space-3) 0 !important;
    gap: var(--space-1) !important;
  }
  .staff-name-link {
    font-size: 14.5px !important;
  }
  .staff-position {
    font-size: 11px !important;
    padding: 2px 6px !important;
    margin-bottom: var(--space-2) !important;
  }
  .staff-contacts {
    padding-top: var(--space-2) !important;
    gap: var(--space-1) !important;
  }
  .staff-contact-item {
    font-size: 11.5px !important;
    word-break: break-all;
  }
  .staff-contact-item svg {
    width: 13px !important;
    height: 13px !important;
  }
}

/* =========================================
   Research & Link Cards
   ========================================= */
.link-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, var(--mu-blue-pale), var(--white));
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 12px;
  transition: all 0.25s ease;
  text-decoration: none;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.12);
  border-color: var(--mu-blue);
}

.link-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-card-content {
  flex: 1;
}

.link-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--mu-blue-dark);
  font-family: 'Sarabun', sans-serif;
  line-height: 1.4;
}

.link-card-desc {
  font-size: 13px;
  color: var(--gray-500);
  font-family: 'Sarabun', sans-serif;
  margin-top: 4px;
  line-height: 1.4;
}

.link-card-arrow {
  color: var(--mu-blue);
  opacity: 0.8;
  display: flex;
  align-items: center;
}

/* =========================================
   NEW FONTAWESOME ICON & INTERACTIVE STYLES
   ========================================= */

/* 1. Subtle Icon Tilt for Navbar Links */
.nav-icon,
.dropdown-icon {
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.3s ease, color 0.2s ease;
}

.nav-link:hover .nav-icon,
.mobile-nav-link:hover .nav-icon {
  transform: rotate(12deg) scale(1.15);
  color: var(--mu-gold-light);
}

.dropdown-item:hover .dropdown-icon {
  transform: rotate(12deg) scale(1.15);
  color: var(--mu-blue);
}

/* 2. Page Title Banner Component */
.page-title-banner {
  background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 4px solid var(--mu-gold);
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.page-title-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 24px;
  color: #ffffff;
}

.page-title-text {
  font-size: clamp(18px, 2.2vw, 25px);
  font-weight: 700;
  color: white;
  font-family: var(--font-base);
}

/* 3. Feature Cards Grid (Home Highlights) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin: 32px 0 40px;
}

.feature-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--gray-700);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--mu-blue), var(--mu-gold));
  transition: width 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--mu-blue-pale);
}

.feature-card:hover::before {
  width: 8px;
}

.feature-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--mu-blue-pale);
  color: var(--mu-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 20px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, color 0.3s ease;
}

.feature-card:hover .feature-card-icon {
  transform: rotate(12deg) scale(1.15);
  background: linear-gradient(135deg, var(--mu-blue), var(--mu-blue-light));
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.feature-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  font-family: var(--font-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.feature-card-title .arrow {
  font-size: 14px;
  color: var(--mu-blue-light);
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-card-title .arrow {
  transform: translateX(4px);
  color: var(--mu-blue);
}

.feature-card-desc {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.55;
}

/* 4. Styled Content Box & Cards */
.content-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
  margin-bottom: 28px;
  border: 1px solid var(--gray-100);
  transition: box-shadow 0.3s ease;
}

.content-card:hover {
  box-shadow: var(--shadow-md);
}

/* 5. Custom Icon Bullet Lists */
.icon-bullet-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.icon-bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.icon-bullet-list li i {
  color: var(--mu-gold);
  font-size: 16px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* 6. Buttons with Tilting Icons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #1d4ed8, #0c2340);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 14.5px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-modern i {
  transition: transform 0.3s ease;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.btn-modern:hover i {
  transform: translateX(4px);
}
