/* =============================================
   FIT RMUTI Website - Main CSS
   ============================================= */
:root {
  --orange: #e8651a;
  --orange-dark: #c45010;
  --gray: #6e6e6e;
  --gray-dark: #4a4a4a;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Noto Sans Thai', 'Sarabun', sans-serif; background: #f4f4f4; color: #333; font-size: 15px; }

/* TOP BAR */
.topbar { background: #6e6e6e; color: #ddd; font-size: 0.78rem; padding: 0.35rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.topbar a { color: #ddd; text-decoration: none; }
.topbar a:hover { color: var(--orange); }
.topbar-left { display: flex; gap: 1.5rem; align-items: center; }
.topbar-right { display: flex; gap: 1rem; align-items: center; }
.topbar-social { display: flex; gap: 0.4rem; }
.topbar-social a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; background: rgba(255,255,255,0.1); color: #ddd; text-decoration: none; font-size: 0.75rem; font-weight: 700; transition: background 0.2s; }
.topbar-social a:hover { background: var(--orange); color: #fff; }

/* HEADER */
header { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 999; }
.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo-area { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.logo-badge { width: 52px; height: 52px; background: linear-gradient(135deg, var(--orange), #f07830); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.1rem; color: #fff; flex-shrink: 0; }
.logo-text .line1 { font-size: 0.95rem; font-weight: 800; color: #333; line-height: 1.3; }
.logo-text .line2 { font-size: 0.68rem; color: #999; }

/* NAV */
nav.main-nav { display: flex; align-items: center; }
nav.main-nav > ul { list-style: none; display: flex; }
nav.main-nav > ul > li { position: relative; }
nav.main-nav > ul > li > a { display: flex; align-items: center; gap: 4px; padding: 0 0.9rem; height: 72px; color: #444; text-decoration: none; font-size: 0.82rem; font-weight: 600; transition: color 0.2s; border-bottom: 3px solid transparent; white-space: nowrap; }
nav.main-nav > ul > li > a:hover, nav.main-nav > ul > li:hover > a { color: var(--orange); border-bottom-color: var(--orange); background: rgba(232,101,26,0.04); }
.caret { font-size: 0.55rem; opacity: 0.4; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 240px; box-shadow: 0 8px 30px rgba(0,0,0,0.12); border-top: 3px solid var(--orange); border-radius: 0 0 8px 8px; padding: 1rem; grid-template-columns: 1fr; gap: 1rem; z-index: 1000; }
nav.main-nav > ul > li:hover .dropdown { display: grid; }
.dropdown-col ul { list-style: none; }
.dropdown-col ul li { margin-bottom: 0.25rem; }
.dropdown-col ul li a { font-size: 0.8rem; color: #555; text-decoration: none; padding: 0.25rem 0; display: block; transition: all 0.15s; }
.dropdown-col ul li a:hover { color: var(--orange); padding-left: 5px; }
.nav-apply { margin-left: 0.8rem; background: var(--orange); color: #fff !important; border-radius: 7px; padding: 0.5rem 1.2rem; font-size: 0.8rem; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background 0.2s; border-bottom: none !important; }
.nav-apply:hover { background: var(--orange-dark) !important; }

/* HERO SLIDER */
.hero-slider { position: relative; background: #777; height: 440px; overflow: hidden; }
.slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; transition: opacity 0.8s; }
.slide.active { opacity: 1; }
.slide-bg { position: absolute; inset: 0; }
.slide-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.42); }
.slide-content { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 0 2rem; width: 100%; }
.slide-tag { display: inline-block; background: var(--orange); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.8rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.slide-title { font-size: clamp(1.4rem, 3vw, 2.3rem); font-weight: 800; color: #fff; line-height: 1.35; max-width: 580px; margin-bottom: 1.2rem; }
.slide-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--orange); color: #fff; font-weight: 700; font-size: 0.85rem; padding: 0.65rem 1.8rem; border-radius: 6px; text-decoration: none; transition: background 0.2s; }
.slide-btn:hover { background: var(--orange-dark); }
.slider-nav { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); display: flex; gap: 0.6rem; z-index: 10; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.35); cursor: pointer; transition: all 0.3s; border: none; padding: 0; }
.dot.active { background: var(--orange); transform: scale(1.3); }
.slider-counter { position: absolute; bottom: 1rem; right: 2rem; z-index: 10; color: rgba(255,255,255,0.5); font-size: 0.75rem; }

/* MAIN */
.main-wrap { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; display: grid; grid-template-columns: 1fr 310px; gap: 2rem; }
.block-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--orange); }
.block-title { font-size: 0.95rem; font-weight: 800; color: #333; display: flex; align-items: center; gap: 8px; }
.block-title::before { content: ''; display: block; width: 4px; height: 18px; background: var(--orange); border-radius: 2px; }
.see-all { font-size: 0.78rem; color: var(--orange); text-decoration: none; font-weight: 600; }
.see-all:hover { text-decoration: underline; }
.cat-filter { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cat-btn { font-size: 0.72rem; font-weight: 600; padding: 0.28rem 0.8rem; border: 1px solid #ddd; border-radius: 20px; background: #fff; color: #666; cursor: pointer; transition: all 0.2s; }
.cat-btn.active, .cat-btn:hover { background: var(--orange); color: #fff; border-color: var(--orange); }

/* NEWS GRID */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.news-card { background: #fff; border-radius: 8px; overflow: hidden; text-decoration: none; color: inherit; border: 1px solid #e8e8e8; transition: box-shadow 0.25s, transform 0.25s; display: flex; flex-direction: column; }
.news-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.1); transform: translateY(-2px); }
.nc-img { height: 155px; overflow: hidden; position: relative; background: #e0e0e0; flex-shrink: 0; }
.nc-img img { width: 100%; height: 100%; object-fit: cover; }
.nc-img-bg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: rgba(255,255,255,0.5); }
.nc-tag { position: absolute; top: 8px; left: 8px; background: var(--orange); color: #fff; font-size: 0.6rem; font-weight: 700; padding: 0.18rem 0.55rem; border-radius: 3px; text-transform: uppercase; }
.nc-body { padding: 0.85rem; flex: 1; display: flex; flex-direction: column; }
.nc-date { font-size: 0.65rem; color: #aaa; margin-bottom: 0.35rem; }
.nc-title { font-size: 0.82rem; font-weight: 700; color: #333; line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc-footer { margin-top: 0.55rem; padding-top: 0.5rem; border-top: 1px solid #f0f0f0; }
.nc-read { font-size: 0.7rem; color: var(--orange); font-weight: 600; }
.news-card.wide { grid-column: span 2; flex-direction: row; }
.news-card.wide .nc-img { width: 260px; height: auto; flex-shrink: 0; border-radius: 0; }
.news-card.wide .nc-title { font-size: 0.95rem; -webkit-line-clamp: 4; }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.quick-access { background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid #e8e8e8; }
.qa-head { background: linear-gradient(135deg, var(--orange), #f07830); padding: 0.75rem 1rem; font-size: 0.83rem; font-weight: 800; color: #fff; }
.qa-list { list-style: none; }
.qa-list li { border-bottom: 1px solid #f5f5f5; }
.qa-list li a { display: flex; align-items: center; gap: 8px; padding: 0.6rem 1rem; font-size: 0.78rem; color: #444; text-decoration: none; transition: background 0.15s; }
.qa-list li a:hover { background: #fff8f5; color: var(--orange); }
.qa-ico { font-size: 0.95rem; flex-shrink: 0; }
.qa-arr { margin-left: auto; color: #ccc; font-size: 0.65rem; }
.ann-block { background: #fff; border-radius: 8px; border: 1px solid #e8e8e8; overflow: hidden; }
.ann-head { background: #6e6e6e; padding: 0.75rem 1rem; font-size: 0.83rem; font-weight: 800; color: #fff; }
.ann-tabs { display: flex; background: #fafafa; border-bottom: 1px solid #ebebeb; }
.ann-tab { flex: 1; text-align: center; padding: 0.45rem; font-size: 0.72rem; font-weight: 600; cursor: pointer; color: #999; border-bottom: 2px solid transparent; transition: all 0.2s; }
.ann-tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.ann-list { list-style: none; }
.ann-list li { border-bottom: 1px solid #f5f5f5; }
.ann-list li a { display: flex; align-items: flex-start; gap: 8px; padding: 0.6rem 1rem; text-decoration: none; color: #444; font-size: 0.75rem; line-height: 1.4; transition: background 0.15s; }
.ann-list li a:hover { background: #fff8f5; color: var(--orange); }
.ann-date { font-size: 0.62rem; color: #fff; background: #bbb; border-radius: 3px; padding: 0.1rem 0.4rem; flex-shrink: 0; margin-top: 2px; white-space: nowrap; }

/* DEPARTMENTS */
.depts-section { background: #fff; padding: 2.5rem 1.5rem; border-top: 1px solid #e8e8e8; }
.depts-inner { max-width: 1200px; margin: 0 auto; }
.depts-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-top: 1.5rem; }
.dept-card { border: 1px solid #e8e8e8; border-radius: 8px; padding: 1.2rem 0.8rem; text-align: center; text-decoration: none; color: inherit; transition: all 0.25s; background: #fafafa; }
.dept-card:hover { border-color: var(--orange); background: #fff; box-shadow: 0 4px 16px rgba(232,101,26,0.12); transform: translateY(-2px); }
.dept-emoji { font-size: 1.8rem; margin-bottom: 0.5rem; display: block; }
.dept-name { font-size: 0.8rem; font-weight: 700; color: #333; line-height: 1.4; margin-bottom: 0.25rem; }
.dept-code { font-size: 0.62rem; color: var(--orange); font-weight: 700; text-transform: uppercase; }

/* STATS */
.stats-bar { background: linear-gradient(135deg, var(--orange), #f07830); padding: 2rem 1.5rem; }
.stats-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.stat-item { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 900; color: #fff; line-height: 1; }
.stat-label { font-size: 0.78rem; color: rgba(255,255,255,0.85); margin-top: 0.3rem; }

/* CARD */
.card { background: #fff; border-radius: 10px; border: 1px solid #e8e8e8; }

/* BADGE */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.65rem; font-weight: 700; }

/* FORM */
.form-control { width: 100%; padding: 0.6rem 0.8rem; border: 1.5px solid #e0e0e0; border-radius: 7px; font-size: 0.82rem; font-family: inherit; transition: border 0.2s; outline: none; }
.form-control:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,101,26,0.1); }

/* FOOTER */
footer { background: #6e6e6e; color: rgba(255,255,255,0.65); padding: 2.5rem 1.5rem 0; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.fb-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 1rem; }
.fb-badge { width: 42px; height: 42px; background: var(--orange); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; font-size: 0.82rem; flex-shrink: 0; }
.fb-name { font-size: 0.85rem; font-weight: 700; color: #fff; line-height: 1.4; }
.footer-brand p { font-size: 0.73rem; line-height: 1.9; margin-bottom: 0.3rem; }
.footer-contact { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.footer-contact span { font-size: 0.72rem; color: rgba(255,255,255,0.45); }
.footer-col h4 { font-size: 0.72rem; font-weight: 800; color: var(--orange); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.9rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { font-size: 0.73rem; color: rgba(255,255,255,0.45); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: var(--orange); }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding: 1.2rem 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.footer-bottom p { font-size: 0.68rem; color: rgba(255,255,255,0.25); }

/* HAMBURGER */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.hamburger span { display: block; width: 22px; height: 2px; background: #555; margin: 5px 0; border-radius: 2px; transition: 0.3s; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .main-wrap { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .news-card.wide { flex-direction: column; }
  .news-card.wide .nc-img { width: 100%; height: 200px; }
  .depts-grid { grid-template-columns: repeat(2,1fr); }
  .stats-inner { grid-template-columns: repeat(2,1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  nav.main-nav { display: none; }
  nav.main-nav.open { display: flex; position: fixed; top: 72px; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 998; flex-direction: column; }
  nav.main-nav.open > ul { background: #fff; flex-direction: column; padding: 1rem 0; gap: 0; width: 280px; height: 100%; overflow-y: auto; }
  nav.main-nav.open > ul > li > a { height: auto; padding: 0.9rem 1.5rem; border-bottom: 1px solid #f0f0f0; border-left: none; }
  .dropdown { display: none !important; }
  .nav-apply { display: none; }
  .hamburger { display: block; }
}
@media (max-width: 580px) {
  .depts-grid { grid-template-columns: repeat(2,1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .topbar { flex-direction: column; align-items: flex-start; padding: 0.4rem 1rem; }
}
