:root {
  --primary: #f47920;
  --primary-dark: #dc5f09;
  --ink: #0c1830;
  --muted: #5c6678;
  --bg: #f6f8fc;
  --card: #ffffff;
  --stroke: #e6ecf6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans Thai", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand strong,
.kicker,
.hero-kicker {
  font-family: "Outfit", "Noto Sans Thai", sans-serif;
}

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(circle at 18% 10%, #f4792029, transparent 40%),
    radial-gradient(circle at 90% 84%, #0c183017, transparent 35%),
    linear-gradient(160deg, #f7f9ff 0%, #eef4ff 48%, #f8fbff 100%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
}

.glow-a {
  width: 240px;
  height: 240px;
  top: 8%;
  left: 6%;
  background: #f4792040;
}

.glow-b {
  width: 340px;
  height: 340px;
  right: 2%;
  bottom: 15%;
  background: #0e3f8f20;
}

.topbar {
  background: #0d1e3f;
  color: #d7e1ff;
  font-size: 0.85rem;
}

.topbar-items span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.96;
}

.topbar-links a {
  color: #fff;
  text-decoration: none;
  border: 1px solid #ffffff2e;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  transition: all 0.2s ease;
}

.topbar-links a:hover {
  background: #ffffff1b;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffffde;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: all 0.25s ease;
}

.header.scrolled {
  border-bottom-color: var(--stroke);
  box-shadow: 0 10px 30px #08102514;
}

.navbar {
  padding-block: 0.25rem;
  min-height: 82px;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: clamp(280px, 30vw, 500px);
  height: auto;
  max-height: 74px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  border: 0;
  background: transparent;
}

.nav-link {
  color: #1a2745;
  font-weight: 500;
  position: relative;
  margin-left: 0.35rem;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.3rem;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  background: var(--primary);
  transition: transform 0.25s ease;
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-link.active-page::after {
  transform: scaleX(1);
}

.btn {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.65rem 1.2rem;
}

.btn-main {
  background: linear-gradient(120deg, var(--primary), #ff8f32);
  color: #fff;
  border: 0;
}

.btn-main:hover {
  color: #fff;
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
}

.btn-soft {
  background: #fff;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.btn-soft:hover {
  border-color: #cad5eb;
  background: #f9fbff;
}

.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, #08142ad6 20%, #08142a8e 55%, #08142a4f 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero-kicker {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  background: #ffffff1f;
  border: 1px solid #ffffff2f;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
  margin: 0;
}

.hero p {
  max-width: 700px;
  margin-top: 1rem;
  color: #f2f5fc;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.3rem;
}

.hero-actions .btn-outline-light {
  border-width: 1px;
}

.hero-stats {
  margin-top: 1.7rem;
}

.page-hero {
  position: relative;
  padding: 5rem 0 3rem;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, #0f2142 0%, #173866 50%, #f47920 100%);
}

.page-hero h1 {
  color: #fff;
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.page-hero p {
  color: #e8eefc;
  margin-top: 0.75rem;
  max-width: 760px;
}

.breadcrumbs {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  color: #dbe5fb;
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.breadcrumbs a {
  color: #fff;
  text-decoration: none;
}

.content-panel {
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: #fff;
  padding: 1.25rem;
  box-shadow: 0 12px 30px #16284f0d;
}

.content-panel p:last-child {
  margin-bottom: 0;
}

.stat-box {
  padding: 1rem;
  border-radius: 14px;
  background: #ffffff14;
  border: 1px solid #ffffff2b;
  backdrop-filter: blur(6px);
}

.stat-box h3 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.stat-box p {
  margin: 0;
  font-size: 0.86rem;
  color: #dde6f7;
}

.section {
  padding: 5.2rem 0;
}

.section-title {
  margin-bottom: 1.6rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 2.45rem);
}

.about-media {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 18px 50px #17284a1f;
}

.about-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.floating-card {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  max-width: 260px;
  background: #ffffffea;
  border-radius: 14px;
  border: 1px solid #e1e9f8;
  padding: 0.85rem 1rem;
}

.floating-card span {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.floating-card strong {
  display: block;
  font-size: 1rem;
  margin-top: 0.25rem;
}

.about p {
  color: #3c475d;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.departments {
  background: linear-gradient(180deg, #f4f7fe 0%, #f9fbff 100%);
}

.dept-card {
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--stroke);
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #1e2c4d;
  min-height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dept-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px #10203f14;
}

.program-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.4rem;
  height: 100%;
  box-shadow: 0 12px 30px #0f234709;
}

.program-card h3 {
  margin-top: 0;
}

.program-card p {
  color: #445068;
}

.program-card ul {
  padding-left: 1.2rem;
  margin-bottom: 1rem;
  color: #2f3d5a;
}

.program-card a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 700;
}

.cta-strip {
  background: linear-gradient(120deg, #0e1f3e, #15305d);
  color: #fff;
  padding: 2.2rem 0;
}

.cta-strip .kicker {
  color: #ffb180;
}

.cta-strip h3 {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
}

.news-card {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 12px 30px #16284f10;
}

.news-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

img.is-fallback {
  object-fit: cover;
}

.news-list-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0.8rem;
}

.news-list-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 10px;
}

.news-list-item h3 {
  font-size: 1.07rem;
  margin: 0.1rem 0 0.35rem;
}

.news-list-item h3 a {
  color: inherit;
  text-decoration: none;
}

.news-list-item h3 a:hover {
  color: var(--primary-dark);
}

.news-list-item p {
  margin: 0;
  color: #475471;
}

.article-wrap {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.1rem;
  box-shadow: 0 14px 32px #13274c12;
}

.article-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 14px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 0.7rem;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #4c5872;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
}

.article-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  line-height: 1.25;
}

.article-body {
  color: #2f3d58;
  line-height: 1.85;
}

.article-body h2 {
  margin-top: 1.7rem;
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
}

.article-note {
  border-left: 4px solid var(--primary);
  background: #fff6ef;
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  margin: 1.2rem 0;
}

.article-side {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 14px 26px #15284b0f;
}

.article-side h3 {
  margin-top: 0.25rem;
  font-size: 1.12rem;
}

.related-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  padding: 0.55rem 0;
  border-top: 1px dashed #dbe4f5;
}

.related-item:first-of-type {
  border-top: 0;
  padding-top: 0.2rem;
}

.related-item img {
  width: 100%;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
}

.related-item p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.news-content {
  padding: 1rem;
}

.news-content .tag {
  display: inline-block;
  border: 1px solid #f6d4bb;
  background: #fff3ea;
  color: #b4531a;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
}

.news-content h3 {
  font-size: 1rem;
  line-height: 1.4;
  margin-top: 0.6rem;
  margin-bottom: 0.65rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-content a {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.notice-board {
  margin-top: 1.4rem;
}

.notice-item {
  background: #fff;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  height: 100%;
  padding: 1rem;
}

.notice-item h4 {
  font-size: 1rem;
  margin: 0 0 0.45rem;
}

.notice-item p {
  margin: 0;
  color: #475471;
}

.contact {
  background: #f3f7ff;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.8rem;
}

.contact-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.5rem;
  align-items: start;
}

.contact-list i {
  color: var(--primary-dark);
  font-size: 1.05rem;
  margin-top: 2px;
}

.contact-map {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #dce4f3;
  box-shadow: 0 14px 34px #18294815;
}

.contact-map iframe {
  border: 0;
  width: 100%;
  min-height: 360px;
}

.footer {
  background: #09152d;
  color: #d2dbf3;
  font-size: 0.9rem;
  padding: 1.1rem 0;
}

.footer p {
  margin: 0;
}

@media (max-width: 991.98px) {
  .navbar {
    min-height: 74px;
  }

  .brand-logo {
    width: clamp(240px, 40vw, 380px);
    max-height: 62px;
  }

  .navbar-collapse {
    margin-top: 0.8rem;
    padding: 0.8rem;
    border: 1px solid var(--stroke);
    border-radius: 14px;
    background: #fff;
  }

  .hero {
    min-height: 72vh;
  }

  .section {
    padding: 4.2rem 0;
  }

  .page-hero {
    padding: 4rem 0 2.5rem;
  }

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

  .news-list-item img {
    height: 220px;
  }

  .related-item {
    grid-template-columns: 1fr;
  }

  .related-item img {
    height: 140px;
  }
}

@media (max-width: 767.98px) {
  .brand-logo {
    width: min(84vw, 320px);
    max-height: 56px;
  }

  .topbar .container {
    justify-content: center;
  }

  .topbar-links {
    width: 100%;
    justify-content: center;
  }

  .hero-content {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .hero-stats .stat-box {
    padding: 0.8rem;
  }

  .floating-card {
    max-width: 72%;
  }
}
