/* ธีม Modern — ทำตามวิดีโอต้นแบบเว็บมหาวิทยาลัย (American University concept) แต่เปลี่ยนพื้นแดงเป็นน้ำเงิน (เหมาะกับคณะ): น้ำเงิน/ครีม/ดำ/เขียวอมฟ้า,
   หัวข้อบางตัวใหญ่, การ์ดเส้นกรอบบาง ป้าย /หมวด ปุ่มวงกลมลูกศร, ภาพไทล์เหลื่อม, แผง/ภาพขยายตามการเลื่อน, ตัวเลขนับขึ้น, ลายเส้นสีแดง */
:root {
  --blue: #173a66; --navy: #0e2747; --crimson: #b3202a; --cream: #f5eee7; --teal: #0e2747; --teal-2: #173a66; --black: #060606;
  --ink: #111; --mute: #57524b; --line: #111;
  --font: "Inter", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Cormorant Garamond", "Noto Serif Thai", Georgia, "Times New Roman", serif;
  --gut: 28px; --top: 84px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 400 1rem/1.7 var(--font); color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }
.m-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.m-skip { position: fixed; left: 12px; top: -80px; z-index: 200; background: #fff; color: #111; padding: 8px 16px; border-radius: 8px; }
.m-skip:focus { top: 12px; }
.m-wrap { width: min(1240px, 100% - var(--gut) * 2); margin-inline: auto; }
.m-sec { position: relative; padding: clamp(72px, 9vw, 130px) 0; }
section[id] { scroll-margin-top: 20px; }

/* ---------- พื้นของแต่ละส่วน ---------- */
.c-blue { background: var(--blue); color: #fff; }
.c-cream { background: var(--cream); }
.c-black { background: var(--black); color: #fff; }
.c-navy { background: var(--teal); color: #fff; }

/* ---------- ตัวอักษร ---------- */
.m-h2 { font-weight: 300; font-size: clamp(1.9rem, 1.1rem + 2.3vw, 3rem); line-height: 1.1; letter-spacing: -.025em; text-wrap: balance; }
html:lang(en) .m-h2, html:lang(en) .m-hero-title { text-transform: uppercase; }
.m-statement { font-size: clamp(1.3rem, .85rem + 1.25vw, 2rem); line-height: 1.4; letter-spacing: -.015em; max-width: 22em; }
.m-lab { font-size: .9rem; letter-spacing: .04em; font-weight: 400; }
html:lang(en) .m-lab, html:lang(en) .m-small { text-transform: uppercase; }
.m-red { color: #8fb0ff; }
.m-small { font-size: 1rem; line-height: 1.65; max-width: 46em; opacity: .92; font-weight: 400; }
html:lang(en) .m-small { font-size: .85rem; letter-spacing: .01em; }
.m-count { font-size: .875rem; color: var(--mute); margin: 14px 0 12px; min-height: 1.4em; }
.m-serif { font: 300 clamp(2rem, 1.1rem + 2.5vw, 3.2rem)/1.12 var(--serif); letter-spacing: -.01em; }
.m-serif span { display: block; padding-left: 1.4em; }
.m-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 36px; }
.m-head-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 24px; margin-bottom: 40px; }
.m-head-split .m-small { justify-self: end; max-width: 30em; color: var(--mute); opacity: 1; }
.m-sample { font-size: .8rem; padding: 1px 10px; border: 1px dashed currentColor; border-radius: 99px; opacity: .6; white-space: nowrap; }

/* ---------- ปุ่ม / ป้าย / วงกลมลูกศร ---------- */
.m-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid currentColor; border-radius: 99px; font-size: .9375rem; font-weight: 400; background: transparent; text-decoration: none; line-height: 1; white-space: nowrap; }
.m-tag { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 6px; background: rgba(17, 17, 17, .08); font-size: .875rem; font-weight: 400; line-height: 1.35; white-space: nowrap; cursor: default; }
.c-blue .m-tag, .c-navy .m-tag, .c-black .m-tag { background: rgba(255, 255, 255, .16); color: #fff; }
.m-card:hover .m-tag { background: rgba(255, 255, 255, .18); }
.m-tag.hot { background: var(--crimson); color: #fff; }
.m-pill.link::after { content: "\2197"; margin-left: 2px; font-size: .95em; }
.m-pill.link { min-height: 44px; padding: 0 20px; transition: background-color .25s, color .25s; }
.m-pill.link:hover { background: #fff; color: #111; }
.c-cream .m-pill.link:hover, .m-sec:not([class*="c-"]) .m-pill.link:hover { background: #111; color: #fff; }
.m-circ { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid currentColor; border-radius: 50%; flex: none; }
.m-circ svg { width: 14px; height: 14px; }
.m-circ-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; transition: background-color .2s, color .2s; }
.m-circ-btn svg { width: 18px; height: 18px; }
.m-circ-btn:hover { background: #fff; color: #111; }
.m-bar .m-circ-btn:hover { background: #111; color: #fff; }
.m-circ-btn .i-play, .m-circ-btn[data-paused="true"] .i-pause { display: none; }
.m-circ-btn[data-paused="true"] .i-play { display: block; fill: currentColor; }

/* ---------- แถบด้านบน ---------- */
.m-top { position: fixed; z-index: 60; top: 0; left: 0; right: 0; padding: 12px 14px 0; pointer-events: none; }
.m-tab { pointer-events: auto; display: flex; align-items: center; gap: 18px; width: min(1360px, 100%); min-height: 62px; margin: 0 auto; padding: 0 12px 0 16px; border-radius: 20px; color: var(--ink);
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(17, 17, 17, .08); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 14px 38px rgba(4, 18, 60, .28), 0 2px 6px rgba(4, 18, 60, .12);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s, box-shadow .3s; }
.m-top.hide .m-tab { transform: translateY(-150%); opacity: 0; pointer-events: none; }
.m-top:focus-within .m-tab { transform: none !important; opacity: 1 !important; pointer-events: auto !important; }
.m-top.scrolled .m-tab { box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 18px 46px rgba(4, 18, 60, .34), 0 2px 8px rgba(4, 18, 60, .16); }
.m-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.m-logo img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px rgba(17, 17, 17, .1); }
.m-logo-t { display: flex; flex-direction: column; line-height: 1.1; }
.m-logo-t b { font: 600 1.05rem var(--font); letter-spacing: .12em; color: var(--blue); }
.m-logo-t small { font-size: .72rem; color: var(--mute); font-weight: 400; }
.m-nav { flex: 1; min-width: 0; }
.m-nav > ul { display: flex; gap: 4px; justify-content: center; flex-wrap: nowrap; }
.m-nav > ul > li { position: relative; }
.m-nav a, .m-nav button { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 11px; border: 0; background: none; color: inherit; text-decoration: none; font-size: .9rem; font-weight: 400; white-space: nowrap; border-radius: 99px; transition: background-color .2s; }
html:lang(en) .m-nav > ul > li > a, html:lang(en) .m-nav > ul > li > button { text-transform: uppercase; font-size: .8rem; letter-spacing: .02em; }
.m-nav a:hover, .m-nav button:hover, .m-nav .open > button { background: #111; color: #fff; }
.m-nav button svg { width: 10px; height: 10px; }
.m-sub { display: none; position: absolute; left: 0; top: calc(100% + 12px); min-width: 280px; padding: 10px; background: #fff; color: var(--ink); border: 1px solid rgba(17, 17, 17, .1); border-radius: 16px; box-shadow: 0 24px 50px rgba(4, 18, 60, .28); z-index: 5; }
.m-sub::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.m-nav .open > .m-sub { display: block; }
@media (hover: hover) and (min-width: 1381px) { .m-nav li:hover > .m-sub { display: block; } .m-nav li:hover > button { background: #111; color: #fff; } }
.m-sub li > a { display: flex; width: 100%; min-height: 36px; padding: 6px 12px; border-radius: 8px; color: var(--ink); font-size: .92rem; white-space: normal; }
.m-sub li > a:hover { background: var(--cream); color: var(--ink); }
.m-sub .grp > span { display: block; padding: 8px 12px 2px; font-size: .8rem; color: var(--mute); letter-spacing: .04em; font-weight: 400; }
.m-sub .grp ul { padding-left: 10px; }
.m-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.m-lang { display: inline-flex; border: 1px solid rgba(17, 17, 17, .22); border-radius: 99px; overflow: hidden; }
.m-lang button { min-height: 34px; padding: 0 12px; border: 0; background: transparent; color: var(--ink); font-size: .8rem; font-weight: 500; letter-spacing: .04em; }
.m-lang button[aria-pressed="true"] { background: #111; color: #fff; }
.m-ico { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid rgba(17, 17, 17, .22); border-radius: 50%; background: transparent; color: var(--ink); text-decoration: none; transition: background-color .2s, color .2s, border-color .2s, transform .2s; }
.m-ico svg { width: 18px; height: 18px; }
.m-ico:hover { background: #111; color: #fff; border-color: #111; }
.m-staff { background: var(--blue); color: #fff; border-color: var(--blue); }
.m-staff:hover { background: #0e2747; border-color: #0e2747; transform: scale(1.06); }
.m-burger { display: none; }

/* ---------- 1) hero: กรอบน้ำเงิน + ภาพในกรอบโค้ง + ป้ายชื่อเว้ามุมล่างซ้าย (ตามต้นแบบ) ---------- */
.m-hero { --strip: 172px; position: relative; display: flex; height: 100vh; height: 100svh; min-height: 660px; padding: 78px 10px 10px; background: var(--blue); color: #fff; }
.m-frame { position: relative; flex: 1; min-width: 0; border-radius: 22px; overflow: hidden; background: #0a1a3d; }
.m-slides { position: absolute; inset: 0; }
.m-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility 0s linear .8s; }
.m-slide.on { opacity: 1; visibility: visible; transition-delay: 0s; }
.m-slide::before { content: ""; position: absolute; inset: -40px; background: var(--bg) center / cover no-repeat; filter: blur(34px) saturate(1.2) brightness(.62); }
.m-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 16, 40, .55) 0, transparent 38%); pointer-events: none; }
.m-slide a { position: absolute; z-index: 1; left: 0; right: 0; top: 16px; bottom: var(--strip); display: grid; place-items: center; }
.m-slide img { width: min(calc(100% - 32px), 1600px, calc((100vh - 88px - var(--strip) - 16px) * 1.7997)); width: min(calc(100% - 32px), 1600px, calc((max(100svh, 660px) - 88px - var(--strip) - 16px) * 1.7997)); aspect-ratio: 1600 / 889; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
/* ป้ายชื่อภาควิชา: เว้ามุมล่างซ้ายของกรอบภาพ (ไม่บังโปสเตอร์ เพราะอยู่ในแถบใต้โปสเตอร์) */
.m-notch { position: absolute; z-index: 4; left: 0; bottom: 0; width: min(520px, 52%); height: var(--strip); display: flex; flex-direction: column; justify-content: center; padding: 16px 36px 18px 30px; background: var(--blue); border-top-right-radius: 30px; }
.m-notch::after { content: ""; position: absolute; left: 100%; bottom: 0; width: 30px; height: 30px; background: radial-gradient(circle at 100% 0, transparent 29.5px, var(--blue) 30.5px); }
.m-hero-title { font-weight: 300; font-size: clamp(1.7rem, 1rem + 1.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.015em; color: #fff; }
.m-line { display: block; }
.m-line.sub { font-size: .46em; line-height: 1.4; font-weight: 300; letter-spacing: 0; color: rgba(255, 255, 255, .85); }
.m-line.sub.first { margin-top: .6em; }
html:lang(en) .m-line.sub { font-size: .4em; letter-spacing: .03em; }
.js-anim .m-notch { transform: translateY(105%); }
.js-anim .m-hero.ready .m-notch { transform: none; transition: transform 1.1s cubic-bezier(.2, .8, .2, 1) .55s; }
.m-hero-bar { position: absolute; z-index: 3; left: min(520px, 52%); right: 0; bottom: 0; height: var(--strip); padding: 0 28px 0 40px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; text-align: right; }
.m-hero-info { min-width: 0; max-width: 100%; }
.m-hero-kicker { display: block; font-size: .9rem; letter-spacing: .04em; opacity: .9; margin-bottom: 2px; }
html:lang(en) .m-hero-kicker { text-transform: uppercase; }
.m-slide-title { font-size: clamp(1.35rem, 1rem + 1vw, 1.75rem); font-weight: 500; line-height: 1.3; letter-spacing: -.01em; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-hero-ctl { display: flex; align-items: center; gap: 8px; }
.m-dots { display: flex; gap: 6px; padding: 0 8px 0 0; }
.m-dot { width: 22px; height: 40px; padding: 0; border: 0; background: transparent; display: grid; place-items: center; color: #fff; }
.m-dot::before { content: ""; width: 100%; height: 2px; background: currentColor; opacity: .35; transition: opacity .3s; }
.m-dot[aria-current="true"]::before { opacity: 1; height: 3px; }

/* ---------- 2) about ---------- */
.m-about-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 24px; align-items: start; }
.m-about-head .m-lab { padding-top: .8em; }
.m-about-head .m-small { margin-top: 28px; }
.m-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: clamp(48px, 6vw, 90px); }
.m-tile { display: flex; }
.m-tile:nth-child(1) { grid-column: 1 / span 2; }
.m-tile-in { position: relative; display: block; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #0e2747; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); aspect-ratio: 4 / 3; text-align: left; flex: 1; }
.m-tile:nth-child(1) .m-tile-in { aspect-ratio: 16 / 9; }
.m-tile:nth-child(2) .m-tile-in { aspect-ratio: auto; min-height: 100%; }
.m-tile-in img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.m-tile-in:hover img { transform: scale(1.06); }
.m-tile-in figcaption, .m-tile-in .cap { position: absolute; left: 14px; bottom: 12px; right: 14px; font-size: 1rem; font-weight: 400; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.m-tile-in::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .45), transparent 45%); pointer-events: none; }
.m-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; translate: -50% -50%; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--blue); z-index: 2; transition: transform .3s; }
.m-play svg { width: 26px; height: 26px; fill: currentColor; stroke: none; margin-left: 3px; }
.m-tile-in:hover .m-play { transform: scale(1.1); }
.m-tile-in iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }

/* ---------- 3) hub + slider + การ์ดเส้นกรอบ ---------- */
.m-tabs { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.m-tabbtn { padding: 0 0 6px; border: 0; background: none; font: 400 clamp(1.05rem, .95rem + .4vw, 1.3rem) var(--font); color: #6a645c; transition: color .25s; }
.m-tabbtn:hover, .m-tabbtn[aria-selected="true"], .m-tabbtn[aria-pressed="true"] { color: #111; }
.m-tabbtn[aria-selected="true"], .m-tabbtn[aria-pressed="true"] { box-shadow: inset 0 -2px 0 currentColor; }
.c-black .m-tabbtn[aria-selected="true"] { color: #fff; }
#hub .m-tabs { margin-bottom: 28px; }
.m-slider { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; padding: 2px 2px 6px; cursor: grab; overscroll-behavior-x: contain; }
.m-slider::-webkit-scrollbar { display: none; }
.m-slider.drag { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.m-slider > * { flex: 0 0 clamp(250px, 27vw, 340px); scroll-snap-align: start; }
.m-slider-wrap { margin-right: calc((100vw - min(1240px, 100vw - var(--gut) * 2)) / -2); }
.m-card { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 22px; min-height: 230px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; background: transparent; transition: color .35s; }
.m-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: #000; clip-path: circle(0 at var(--x, 50%) var(--y, 50%)); transition: clip-path .6s cubic-bezier(.2, .7, .2, 1); }
.m-card:hover, .m-card:focus-visible { color: #fff; }
.m-card:hover::before, .m-card:focus-visible::before { clip-path: circle(160% at var(--x, 50%) var(--y, 50%)); }
.m-card-t { font-size: 1.4rem; line-height: 1.35; font-weight: 400; max-width: 15em; }
.m-card-x { font-size: .95rem; opacity: .68; line-height: 1.5; margin-top: -10px; display: block; }
.m-card-f { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.m-card.big { min-height: 250px; }
.m-card.has-img { min-height: 340px; }
.m-card-img { display: block; margin: -20px -20px 4px; height: 150px; overflow: hidden; background: #e9e2d9; }
.m-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.m-card:hover .m-card-img img { transform: scale(1.06); }
.m-card-img.thumb { background: #fff; }
.m-card-img.thumb img { object-fit: contain; }
.m-card.staff .m-card-t, .m-card.feat .m-card-t { font-weight: 400; }

/* ---------- 4) หลักสูตร (bento บนแผงเขียวอมฟ้า) ---------- */
.m-faculty { padding: 0; background: #fff; }
.m-panel { --p: 1; margin-inline: calc((1 - var(--p)) * 42px); border-radius: calc((1 - var(--p)) * 38px); padding: clamp(70px, 9vw, 130px) 0; overflow: hidden; }
.m-panel .m-h2 { margin: 14px 0 12px; max-width: 14em; }
.m-bento { display: grid; gap: 20px; margin-top: 50px; }
.m-bb-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }
.m-bb-photo { grid-column: 1 / span 7; grid-row: 1; border-radius: 10px; overflow: hidden; min-height: 330px; background: var(--teal-2); }
.m-bb-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.m-bb-photo:hover img { transform: scale(1.04); }
.m-bb-text { grid-column: 8 / span 5; grid-row: 1; display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 10px; background: var(--teal-2); }
.m-bb-row.flip .m-bb-photo { grid-column: 6 / span 7; }
.m-bb-row.flip .m-bb-text { grid-column: 1 / span 5; }
.m-bb-text h3 { font-weight: 400; font-size: clamp(1.3rem, 1rem + 1vw, 1.9rem); line-height: 1.25; }
.m-bb-text ul { display: grid; gap: 4px; font-size: .95rem; opacity: .78; line-height: 1.55; margin-top: 4px; }
.m-bb-text li::before { content: "– "; }
.m-bb-text > .m-tag { align-self: flex-start; }
.m-bb-act a.m-pill.link { background: #fff; color: #111; border-color: #fff; }
.m-bb-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: auto; padding-top: 12px; }
.m-bb-act a.m-pill.link:hover { background: #fff; color: var(--teal); }
.m-bb-act .m-und { font-size: .95rem; font-weight: 400; }

/* ---------- 5) ตัวเลข + หัวหน้าภาควิชา ---------- */
.m-stats { padding: clamp(70px, 8vw, 110px) 0; }
.m-stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.m-stat { padding: 0 clamp(14px, 3vw, 44px); border-left: 1px solid #c9c3bb; }
.m-stat:first-child { padding-left: 0; border-left: 0; }
.m-num { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 300 clamp(3rem, 2rem + 3.6vw, 5rem)/1 var(--serif); color: var(--crimson); letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.m-stat p { font-size: 1rem; color: var(--mute); max-width: 17em; margin-top: 10px; line-height: 1.55; }
.m-head-card { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 36px; margin-top: clamp(50px, 6vw, 84px); padding-top: clamp(34px, 4vw, 54px); border-top: 1px solid #c9c3bb; }
.m-head-card img { width: 200px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 10px; }
.m-head-card .m-lab { color: var(--crimson); }
.m-head-card h3 { font-weight: 400; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.3rem); margin: 8px 0 4px; letter-spacing: -.01em; }
.m-head-card p { font-size: 1rem; color: var(--mute); }
.m-head-card a { display: inline-block; margin-top: 16px; font-size: 1rem; font-weight: 400; }

/* ---------- 6) บริการวิชาการ (พื้นดำ + ลายเส้นแดง + ภาพขยาย) ---------- */
.m-campus { overflow: hidden; padding-bottom: clamp(60px, 8vw, 110px); }
.m-campus .m-wrap { position: relative; z-index: 2; }
.m-svc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.m-svc-text { display: grid; gap: 22px; align-content: start; }
.m-svc-p { font-size: 1.1rem; line-height: 1.8; color: rgba(255, 255, 255, .9); max-width: 30em; }
.m-svc-lab { color: rgba(255, 255, 255, .78); margin-bottom: 6px; }
.m-svc-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 4px; border-top: 1px solid rgba(255, 255, 255, .22); color: #fff; text-decoration: none; font-size: 1.2rem; font-weight: 400; line-height: 1.4; transition: padding .3s, background-color .3s; }
.m-svc-row:last-child { border-bottom: 1px solid rgba(255, 255, 255, .22); }
.m-svc-row:hover { padding-left: 16px; background: rgba(255, 255, 255, .05); }
.m-svc-row .m-ic { background: rgba(143, 176, 255, .16); color: #8fb0ff; }
.m-svc-row:hover .m-ic { background: rgba(255, 255, 255, .2); color: #fff; }
.m-svc-row .m-circ { transition: background-color .25s, color .25s; }
.m-svc-row:hover .m-circ { background: #fff; color: #000; }
.m-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.m-svc-photo { position: relative; z-index: 2; margin-top: clamp(56px, 7vw, 100px); }
.m-bigphoto { --p: 1; position: relative; z-index: 2; width: min(calc(100% - var(--gut) * 2), calc(1200px * (.8 + .2 * var(--p)))); margin: 0 auto; border-radius: calc(12px + (1 - var(--p)) * 24px); overflow: hidden; aspect-ratio: 2 / 1; background: #222; }
.m-bigphoto img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }

/* ---------- 7) ข่าว ---------- */
.m-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; }
.m-bar .m-tabs { flex: 1 1 auto; }
.m-find { display: block; width: min(260px, 100%); }
.m-find input { width: 100%; height: 40px; padding: 0 18px; border: 1px solid var(--line); border-radius: 99px; background: transparent; font-size: .975rem; }
.m-find input::placeholder { color: var(--mute); }
.m-arrows { display: flex; gap: 8px; }
.m-news { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 29%, 360px); gap: 24px; align-items: start; }
.m-news.no-side { grid-template-columns: minmax(0, 1fr); }
.m-news-main { display: grid; gap: 24px; min-width: 0; }
.m-ncard { display: flex; flex-direction: column; gap: 14px; text-decoration: none; color: inherit; }
.m-news .m-ncard:not(.m-side-item) { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: transform .35s, box-shadow .35s; }
.m-news .m-ncard:not(.m-side-item):hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, .1); }
.m-ncard-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #e8e2db; }
.m-ncard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.m-ncard:hover .m-ncard-img img { transform: scale(1.05); }
.m-badge { position: absolute; right: 10px; top: 10px; z-index: 2; padding: 2px 12px; border-radius: 99px; background: #fff; font-size: .85rem; font-weight: 500; }
.m-ncard h3 { font-weight: 400; font-size: 1.3rem; line-height: 1.4; }
.m-ncard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.m-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .85rem; color: var(--mute); }
html:lang(en) .m-meta { text-transform: uppercase; }
.m-ncard p { font-size: .95rem; color: var(--mute); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-news-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
/* ข่าวเด่น: ข้อความซ้าย ภาพใหญ่ขวา */
.m-feat { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 26px !important; align-items: stretch; }
.m-feat-text { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.m-feat h3 { font-size: clamp(1.3rem, 1rem + .9vw, 1.7rem); line-height: 1.35; }
.m-feat p { -webkit-line-clamp: 4; }
.m-feat .m-circ { margin-top: auto; }
.m-feat .m-ncard-img { align-self: center; }
/* แถบข่าวล่าสุด */
.m-news-side { background: #fff; border: 1px solid var(--line); border-top: 8px solid #111; border-radius: 4px 4px 10px 10px; padding: 6px 18px 8px; }
.m-side-h { font-weight: 600; font-size: 1.3rem; padding: 14px 0 10px; letter-spacing: -.01em; }
html:lang(en) .m-side-h { text-transform: uppercase; font-family: var(--serif); font-weight: 600; font-size: 1.6rem; }
.m-news-side li + li { border-top: 1px solid rgba(17, 17, 17, .14); }
.m-side-item { display: grid !important; grid-template-columns: minmax(0, 1fr) 104px; gap: 14px !important; align-items: start; padding: 14px 0; }
.m-side-item h3 { font-size: 1.05rem; line-height: 1.45; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-side-text { display: block; min-width: 0; }
.m-side-img { display: block; width: 104px; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #e8e2db; }
.m-side-img img { width: 100%; height: 100%; object-fit: cover; }
.m-empty { padding: 40px 0; color: var(--mute); }

/* ---------- 8) งานวิจัย (พื้นดำ ตัวเซอริฟ การ์ดขาวเคลื่อนสวนกัน) ---------- */
.m-rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.m-rcard { display: flex; flex-direction: column; gap: 14px; color: inherit; text-decoration: none; }
.m-rcard .m-ncard-img { border-radius: 12px; }
.m-rcard h3 { font-weight: 500; font-size: clamp(1.2rem, 1rem + .6vw, 1.55rem); line-height: 1.35; }
.m-rcard p { font-size: .95rem; color: var(--mute); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-rcard:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.m-res-areas { margin-top: clamp(40px, 5vw, 70px); padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 18px; }
.m-res-areas .m-lab { color: var(--mute); }
.m-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.m-chips li { padding: 5px 14px; border: 1px solid rgba(17, 17, 17, .28); border-radius: 99px; font-size: .95rem; font-weight: 400; }
.m-res-areas .m-pills { margin-top: 6px; }
.m-res-areas .m-pill.link:hover { background: #111; color: #fff; }

/* ---------- 9) กิจกรรม ---------- */
.m-events { overflow: visible; z-index: 2; }
.m-events .m-wrap { position: relative; z-index: 1; }
.m-lab-dot { display: inline-flex; align-items: center; gap: 10px; }
.m-lab-dot::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--crimson); }
.m-ev-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.m-evt { display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; transition: transform .35s, box-shadow .35s; }
.m-evt:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, .1); }
.m-evt-cap { font-size: 1.15rem; line-height: 1.4; font-weight: 400; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html:lang(en) .m-evt-cap { text-transform: uppercase; font-size: 1rem; letter-spacing: .01em; }
.m-evt-img { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: #d9d2c8; }
.m-evt-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.m-evt:hover .m-evt-img img { transform: scale(1.06); }
.m-evt-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 20, 60, .78) 0%, rgba(6, 20, 60, .25) 38%, transparent 62%); pointer-events: none; }
.m-evt-date { position: absolute; right: 14px; bottom: 10px; z-index: 2; color: #fff; font: 500 clamp(2.1rem, 1.5rem + 1.7vw, 3rem)/1 var(--font); letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-shadow: 0 2px 14px rgba(0, 0, 0, .4); }
.m-evt-img .m-tag { position: absolute; left: 12px; bottom: 14px; z-index: 2; background: rgba(255, 255, 255, .92); color: #111; }
.m-evt-img .m-tag.hot { background: var(--crimson); color: #fff; }
.m-evt-meta { font-size: .9rem; color: var(--mute); line-height: 1.5; }
.m-evt.all { background: #e7dfd5; border-color: transparent; }
.m-evt.all .m-evt-img { display: grid; place-items: center; align-content: center; gap: 14px; background: transparent; text-align: center; padding: 18px; }
.m-evt.all .m-evt-img::after { display: none; }
.m-evt.all .m-circ { width: 52px; height: 52px; }
.m-evt.all .m-circ svg { width: 22px; height: 22px; }
.m-evt.all .m-evt-meta { color: #4b463f; }
.m-burst { position: absolute; width: 360px; height: 360px; pointer-events: none; background-image: radial-gradient(circle at 50% 50%, #c8283a 0 4px, transparent 5px), repeating-conic-gradient(from 0deg at 50% 50%, rgba(200, 40, 58, .9) 0deg .5deg, transparent .5deg 5deg); -webkit-mask-image: radial-gradient(circle closest-side, #000 0, #000 12%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 0, #000 12%, transparent 100%); }
.m-burst-bl { left: -150px; bottom: -150px; }
.m-burst-tl { left: -150px; top: -150px; }
@media (max-width: 1000px) { .m-ev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- 10) เอกสาร ---------- */
#documents { overflow: hidden; z-index: 1; }
#documents .m-wrap { position: relative; z-index: 1; }

/* ---------- 11) ติดต่อ ---------- */
.m-ct-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(30px, 6vw, 90px); align-items: center; }
.m-ct-photo { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 5 / 4.4; background: #ddd; }
.m-ct-photo img { width: 100%; height: 100%; object-fit: cover; }
.m-ct-photo span { position: absolute; left: 14px; bottom: 12px; color: #fff; font-size: 1rem; font-weight: 400; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.m-ct-info .m-lab { margin-bottom: 10px; }
.m-ct-lead { margin: 16px 0 28px; font-size: 1rem; color: var(--mute); max-width: 32em; }
.m-ct-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid #cfc8bf; font-size: 1.075rem; align-items: baseline; }
.m-ct-row:last-of-type { border-bottom: 1px solid #cfc8bf; }
.m-ct-row dt { font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); font-weight: 500; }
.m-ct-row dd { margin: 0; overflow-wrap: anywhere; }
.m-ct-row a { text-decoration: underline; text-underline-offset: 4px; }
.m-ct-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.m-ct-act .m-pill.link { color: #111; }

/* ---------- ท้ายเว็บ ---------- */
.m-foot { padding: clamp(56px, 7vw, 90px) 0 0; font-size: .9375rem; }
.m-foot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 32px; padding-bottom: 54px; }
.m-foot h3 { font-weight: 400; font-size: 1.05rem; margin-bottom: 14px; }
.m-foot li a { display: inline-block; padding: 3px 0; color: #9c9c9c; text-decoration: none; font-size: .9rem; transition: color .2s; }
.m-foot li a:hover { color: #fff; }
.m-foot-pills { display: grid; gap: 10px; align-content: start; }
.m-foot-pills .m-pill { justify-content: center; min-height: 40px; padding: 0 34px; font-size: .82rem; letter-spacing: .04em; border-color: rgba(255, 255, 255, .8); transition: background-color .25s, color .25s; }
.m-foot-pills .m-pill:hover { background: #fff; color: #000; }
.m-foot-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 30px; padding: 22px 0 30px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: .82rem; color: #9c9c9c; }
.m-foot-bar a { color: #ddd; }
.m-foot-bar .m-logo { color: #fff; }
.m-foot .m-logo-t b { color: #fff; }
.m-foot .m-logo-t small { color: rgba(255, 255, 255, .8); }
.m-foot .m-logo img { width: 48px; height: 48px; padding: 3px; background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .95); }
.m-socials { display: flex; gap: 8px; }
.m-socials a { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.m-socials a svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.m-socials a:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.m-socials .so-line { background: #06c755; }
.m-socials .so-fb { background: #1877f2; }

/* ---------- ค้นหา / toast ---------- */
.m-search { position: fixed; inset: 0; z-index: 100; background: rgba(6, 6, 6, .96); color: #fff; padding: 90px 0 40px; overflow: auto; }
.m-search[hidden] { display: none; }
.m-search-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.m-search h2 { font-weight: 300; font-size: 1.4rem; }
.m-search input { width: 100%; height: 58px; padding: 0 24px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; background: transparent; color: #fff; font-size: 1.1rem; }
.m-results { margin-top: 22px; display: grid; gap: 4px; }
.m-results p { font-size: .84rem; opacity: .7; }
.m-results a { display: flex; gap: 14px; align-items: baseline; padding: 12px 6px; border-bottom: 1px solid rgba(255, 255, 255, .15); text-decoration: none; }
.m-results a:hover { background: rgba(255, 255, 255, .07); }
.m-results b { font-weight: 300; font-size: 1.05rem; }
.m-results small { opacity: .6; }
.m-toast { position: fixed; left: 50%; bottom: 26px; translate: -50% 0; z-index: 120; max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 12px; background: #111; color: #fff; font-size: .84rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.m-toast[hidden] { display: none; }

/* ---------- แอนิเมชันเข้าจอ ---------- */
.js-anim .m-rise { opacity: 0; transform: translateY(36px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--d, 0) * 90ms); }
.js-anim .m-rise.in { opacity: 1; transform: none; }
.js-anim .m-blur { opacity: 0; filter: blur(12px); transform: translateY(18px); transition: opacity 1s ease, filter 1s ease, transform 1s cubic-bezier(.2, .8, .2, 1); }
.js-anim .m-blur.in { opacity: 1; filter: none; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1380px) {
  .m-burger { display: inline-grid; }
  .m-nav { position: fixed; inset: 0; z-index: 70; display: none; padding: 104px 24px 40px; overflow: auto; background: var(--blue); color: #fff; }
  body.menu-open .m-nav { display: block; }
  body.menu-open { overflow: hidden; }
  body.menu-open .m-top { z-index: 80; }
  .m-nav > ul { flex-direction: column; justify-content: flex-start; gap: 0; }
  .m-nav > ul > li { border-bottom: 1px solid rgba(255, 255, 255, .22); }
  .m-nav > ul > li > a, .m-nav > ul > li > button { width: 100%; min-height: 56px; padding: 0 4px; font-size: 1.3rem; font-weight: 300; justify-content: space-between; border-radius: 0; }
  html:lang(en) .m-nav > ul > li > a, html:lang(en) .m-nav > ul > li > button { font-size: 1.05rem; }
  .m-sub { position: static; min-width: 0; padding: 0 0 12px 8px; background: transparent; color: #fff; box-shadow: none; }
  .m-sub li > a { color: #fff; }
  .m-sub li > a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .m-nav a:hover, .m-nav button:hover, .m-nav .open > button { background: transparent; color: #fff; }
  .m-sub .grp > span { color: rgba(255, 255, 255, .7); }
  .m-tab { gap: 12px; }
  .m-tools { margin-left: auto; }
  .m-logo-t small { display: none; }
}
@media (max-width: 900px) {
  .m-about-head, .m-ct-grid { grid-template-columns: minmax(0, 1fr); }
  .m-hero { --strip: 0px; display: block; height: auto; min-height: 0; padding: 74px 8px 8px; }
  .m-frame { border-radius: 16px; }
  .m-slides { position: relative; inset: auto; aspect-ratio: 1600 / 889; }
  .m-slide a { inset: 0; }
  .m-slide img { width: 100%; border-radius: 0; box-shadow: none; }
  .m-notch { position: relative; width: auto; height: auto; padding: 18px 18px 20px; border-radius: 0; }
  .m-notch::after { display: none; }
  .m-hero-bar { position: relative; left: auto; height: auto; padding: 14px 18px 18px; align-items: flex-start; text-align: left; background: #0e2747; }
  .m-slide-title { font-size: 1.25rem; }
  .m-hero-ctl { flex-wrap: wrap; width: 100%; }
  .m-dots { flex: 1 1 100%; padding: 0 0 4px; }
  .m-dot { flex: 1 1 0; width: auto; min-width: 0; }
  .m-head-split { grid-template-columns: minmax(0, 1fr); }
  .m-head-split .m-small { justify-self: start; }
  .m-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-tile:nth-child(1) { grid-column: 1 / -1; }
  .m-tile:nth-child(n+2) .m-tile-in { aspect-ratio: 4 / 5; min-height: 0; }
  .m-bb-photo, .m-bb-text, .m-bb-row.flip .m-bb-photo, .m-bb-row.flip .m-bb-text { grid-column: 1 / -1; grid-row: auto; }
  .m-bb-photo { min-height: 240px; }
  .m-news { grid-template-columns: minmax(0, 1fr); }
  .m-feat { grid-template-columns: minmax(0, 1fr) !important; }
  .m-feat .m-ncard-img { order: -1; }
  .m-foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-foot-pills { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .m-svc-grid { grid-template-columns: minmax(0, 1fr); }
    .m-head-card { grid-template-columns: 130px minmax(0, 1fr); gap: 22px; }
  .m-head-card img { width: 130px; }
}
@media (max-width: 640px) {
  :root { --gut: 18px; --top: 76px; }
  .m-top { padding: 8px 8px 0; }
  .m-tab { min-height: 56px; padding: 0 8px 0 12px; border-radius: 16px; }
  .m-stat-row { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .m-stat, .m-stat:first-child { padding: 0 0 0 0; border-left: 0; border-top: 1px solid #c9c3bb; padding-top: 18px; }
  .m-stat:first-child { border-top: 0; padding-top: 0; }
  .m-rgrid { grid-template-columns: minmax(0, 1fr); }
  .m-ev-tiles { grid-template-columns: minmax(0, 1fr); }
  .m-ct-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .m-foot-pills { grid-template-columns: minmax(0, 1fr); }
  .m-tools .m-lang { display: none; }
  .m-nav .m-navlang { display: flex; }
  .m-slider > * { flex-basis: 78%; }
  .m-news-pair { grid-template-columns: minmax(0, 1fr); }
  .m-bar .m-arrows { display: none; }
  .m-find { width: 100%; }
}
.m-navlang { display: none; padding: 22px 4px; }
.m-navlang .m-lang { border-color: rgba(255, 255, 255, .55); }
.m-navlang .m-lang button { color: #fff; }
.m-navlang .m-lang button[aria-pressed="true"] { background: #fff; color: var(--blue); }
@media (max-width: 1380px) { .m-navlang { display: flex; align-items: center; justify-content: space-between; color: #fff; } .m-tools .m-lang { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- ไอคอนเส้นบาง (ช่วยให้อ่านเร็วขึ้น) ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.m-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: rgba(23, 58, 102, .1); color: var(--blue); flex: none; transition: background-color .3s, color .3s; }
.m-ic .i { width: 21px; height: 21px; vertical-align: 0; }
.m-ic.sm { width: 32px; height: 32px; }
.m-ic.sm .i { width: 16px; height: 16px; }
.m-card-head { display: flex; align-items: flex-start; gap: 12px; }
.m-card-head .m-card-t { flex: 1; min-width: 0; padding-top: 2px; }
.m-card:hover .m-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.m-chips li { display: inline-flex; align-items: center; gap: 8px; }
.m-chips .i { width: 18px; height: 18px; color: var(--crimson); vertical-align: 0; }
.m-stat .m-ic { margin-bottom: 14px; width: 48px; height: 48px; }
.m-stat .m-ic .i { width: 24px; height: 24px; }
.m-ct-row dt { display: flex; align-items: center; gap: 10px; }
.m-ct-row { grid-template-columns: 190px minmax(0, 1fr); }
.m-meta .i, .m-evt-meta .i { width: 1.05em; height: 1.05em; margin-right: 4px; vertical-align: -.18em; }
.m-meta time { display: inline-flex; align-items: center; }
.m-tag .i { width: 1em; height: 1em; margin-right: 6px; vertical-align: -.15em; }
.m-evt-img .m-tag .i { margin-right: 5px; }
.m-foot li a .i { width: 1.1em; height: 1.1em; margin-right: 8px; vertical-align: -.2em; color: #8fb0ff; }
.m-ev-tiles .m-evt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.m-ev-tiles .m-evt-meta span { display: inline-flex; align-items: center; }

/* ---------- เปิดหน้าแรก: ภาพโปสเตอร์ขยายออกจากกรอบเล็ก (เหมือนต้นแบบ) ---------- */
.js-anim .m-frame { clip-path: inset(16% 24% 16% 24% round 28px); transition: transform 1.8s cubic-bezier(.2, .8, .2, 1), clip-path 1.6s cubic-bezier(.2, .8, .2, 1); }
.js-anim .m-hero.ready .m-frame { clip-path: inset(0 0 0 0 round 0); }

/* ---------- เลื่อนทั้ง section: ส่วนถัดไปเลื่อนทับส่วนก่อนหน้า (เดสก์ท็อป) ----------
   JS ใส่คลาส js-stack ที่ <html> และตั้งค่า top ของแต่ละส่วน (ส่วนสูงกว่าจอจะค้างที่ท้ายส่วนแล้วให้ส่วนถัดไปทับ)
   --cover (0–1) = สัดส่วนที่ส่วนนี้ถูกทับ ใช้หรี่แสงและย่อเล็กน้อย */
.js-stack body { background: #0b0f1a; }
.js-stack main > section { position: sticky; top: 0; }
.js-stack main > section:not([class*="c-"]):not(.m-hero) { background: #fff; }
.js-stack main > section + section { border-radius: 30px 30px 0 0; box-shadow: 0 -26px 70px rgba(0, 0, 0, .22); }
.m-veil { position: absolute; inset: 0; z-index: 30; background: #05070d; opacity: 0; pointer-events: none; border-radius: inherit; }
.js-stack .m-hero .m-slide a { z-index: 1; }

/* ---------- ส่วนข่าว: หัวข้อทั้งหมดเป็นตัวกึ่งหนา (semi-bold 600) ---------- */
#news .m-h2, .m-ncard h3, .m-feat h3, .m-side-item h3, .m-side-h { font-weight: 600; }
#news .m-h2 { letter-spacing: -.02em; }
.m-side-item h3 { font-size: 1.05rem; }

/* ฟอนต์เซอริฟ (Cormorant) ไม่มีอักษรไทย → ภาษาไทยใช้ฟอนต์หลัก (IBM Plex Sans Thai) น้ำหนักบาง; อังกฤษใช้เซอริฟตามเดิม */
html:lang(th) .m-serif { font-family: var(--font); font-weight: 300; letter-spacing: -.02em; line-height: 1.18; }
html:lang(th) .m-side-h { font-family: var(--font); }

/* ---------- แถบเมนูบนสุด: ตอนอยู่บนสุดเป็นส่วนหนึ่งของกรอบน้ำเงิน (โลโก้ป้ายขาว ลิงก์ตัวขาว) เลื่อนแล้วเปลี่ยนเป็นแถบขาวลอย ---------- */
.m-top { transition: padding .3s; }
.m-tab { transition: transform .4s cubic-bezier(.2, .8, .2, 1), opacity .3s, box-shadow .3s, background-color .3s, border-color .3s; }
.m-top:not(.scrolled) { padding: 8px 10px 0; }
.m-top:not(.scrolled) .m-tab { width: 100%; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; box-shadow: none; color: #fff; padding-left: 0; }
.m-top:not(.scrolled) .m-logo { background: #fff; padding: 7px 18px 7px 10px; border-radius: 16px; }
.m-top:not(.scrolled) .m-nav a:hover, .m-top:not(.scrolled) .m-nav button:hover, .m-top:not(.scrolled) .m-nav .open > button { background: rgba(255, 255, 255, .18); color: #fff; }
@media (hover: hover) and (min-width: 1381px) { .m-top:not(.scrolled) .m-nav li:hover > button { background: rgba(255, 255, 255, .18); color: #fff; } }
.m-top:not(.scrolled) .m-nav .m-sub a { color: var(--ink); }
.m-top:not(.scrolled) .m-nav .m-sub a:hover { background: var(--cream); color: var(--ink); }
.m-top:not(.scrolled) .m-lang { border-color: rgba(255, 255, 255, .6); }
.m-top:not(.scrolled) .m-lang button { color: #fff; }
.m-top:not(.scrolled) .m-lang button[aria-pressed="true"] { background: #fff; color: var(--blue); }
.m-top:not(.scrolled) .m-ico { border-color: rgba(255, 255, 255, .55); color: #fff; }
.m-top:not(.scrolled) .m-ico:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .8); color: #fff; }
.m-top:not(.scrolled) .m-staff { background: #fff; color: var(--blue); border-color: #fff; }
.m-top:not(.scrolled) .m-staff:hover { background: #fff; transform: scale(1.06); }

@media (max-width: 900px) { .m-rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .m-rgrid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- เดสก์ท็อป: ป้ายโลโก้ "เชื่อม" กับภาพ (ตามต้นแบบ) ----------
   กรอบภาพขยายขึ้นไปถึงขอบบน ส่วนซ้ายบน (ป้ายโลโก้) เป็นภาพเดียวกับกรอบ ส่วนขวาบนถูกเว้าด้วยแถบเมนูสีน้ำเงิน มีมุมโค้งเชื่อมต่อกัน */
.m-navnotch { display: none; }
@media (min-width: 901px) {
  .m-hero { --nav: 62px; --tabw: 300px; padding-top: 8px; }
  .m-slide a { top: calc(var(--nav) + 12px); }
  .m-slide img { width: min(calc(100% - 32px), 1600px, calc((100vh - 264px) * 1.7997)); width: min(calc(100% - 32px), 1600px, calc((max(100svh, 660px) - 264px) * 1.7997)); }
  .m-slide::after { background: radial-gradient(ellipse 520px 220px at 0 0, rgba(6, 16, 40, .62), transparent 70%), linear-gradient(to top, rgba(6, 16, 40, .55) 0, transparent 38%); }
  .m-navnotch { display: block; position: absolute; z-index: 5; top: 0; left: var(--tabw); right: 0; height: var(--nav); background: var(--blue); border-bottom-left-radius: 20px; pointer-events: none; }
  .m-navnotch::before { content: ""; position: absolute; right: 100%; top: 0; width: 20px; height: 20px; background: radial-gradient(circle at 0 100%, transparent 19.5px, var(--blue) 20.5px); }
  .m-navnotch::after { content: ""; position: absolute; right: 0; top: 100%; width: 22px; height: 22px; background: radial-gradient(circle at 0 100%, transparent 21.5px, var(--blue) 22.5px); }
  .m-top:not(.scrolled) .m-logo { background: transparent; padding: 0 0 0 20px; border-radius: 0; }
  .m-top:not(.scrolled) .m-logo-t b { color: #fff; }
  .m-top:not(.scrolled) .m-logo-t small { color: rgba(255, 255, 255, .88); }
  .m-top:not(.scrolled) .m-logo img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
}

.m-tabbtn[aria-selected="true"], .m-tabbtn[aria-pressed="true"] { font-weight: 500; }
.m-head-split .m-small { color: var(--mute); opacity: 1; }
.m-meta, .m-count, .m-evt-meta { color: var(--mute); }
.c-black .m-small, .c-navy .m-small { opacity: .92; }

/* ไอคอนแบรนด์จริง (LINE / Facebook) */
.i.brand { fill: currentColor; stroke: none; }
.m-ic.so-line { background: rgba(6, 199, 85, .14); color: #06c755; }
.m-ic.so-fb { background: rgba(24, 119, 242, .14); color: #1877f2; }

/* ---------- มือถือ / แท็บเล็ต เพิ่มเติม ---------- */
@media (max-width: 900px) { .m-burst { display: none; } }
@media (max-width: 640px) {
  .m-ct-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .m-ev-tiles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; margin-inline: calc(var(--gut) * -1); padding: 4px var(--gut) 10px; scrollbar-width: none; }
  .m-ev-tiles::-webkit-scrollbar { display: none; }
  .m-ev-tiles > * { flex: 0 0 80%; scroll-snap-align: start; }
  .m-card.big .m-card-t { font-size: 1.15rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .m-head-card { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; }
  .m-head-card img { width: 104px; }
  .m-head-card h3 { font-size: 1.35rem; text-wrap: balance; }
}

/* ---------- แท็บเล็ต (641–900px): hero ชื่อซ้าย/ตัวควบคุมขวา, หลักสูตร 2 คอลัมน์ ---------- */
@media (min-width: 641px) and (max-width: 900px) {
  .m-frame { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .m-slides { grid-column: 1 / -1; }
  .m-notch { grid-column: 1; }
  .m-hero-bar { grid-column: 2; align-items: flex-end; justify-content: center; text-align: right; background: var(--blue); padding: 18px 22px; }
  .m-hero-ctl { width: auto; justify-content: flex-end; }
  .m-hero-ctl { flex-wrap: nowrap; gap: 6px; }
  .m-dots { flex: 0 1 auto; gap: 3px; padding: 0 6px 0 0; }
  .m-dot { flex: 0 0 14px; width: 14px; }
  .m-hero-ctl .m-circ-btn { width: 38px; height: 38px; }
  .m-bb-photo, .m-bb-text { grid-row: 1; }
  .m-bb-photo { grid-column: 1 / span 6; min-height: 300px; }
  .m-bb-text { grid-column: 7 / span 6; }
  .m-bb-row.flip .m-bb-photo { grid-column: 7 / span 6; grid-row: 1; }
  .m-bb-row.flip .m-bb-text { grid-column: 1 / span 6; grid-row: 1; }
}

/* ---------- ปรับท้าย: ลายรัศมีไม่ล้นไปทับส่วนถัดไป / ชื่อเอกสารไม่ยาวเกิน 4 บรรทัด ---------- */
.m-events { overflow: hidden; }
.m-card.big .m-card-t { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.m-und { display: inline-flex; align-items: center; min-height: 36px; }
.m-tabbtn { min-height: 36px; }

/* ---------- แกลเลอรี: ไทล์กดได้ + ป้ายคำบรรยายชัด + lightbox ---------- */
.m-tile-in { cursor: pointer; text-align: left; font: inherit; color: inherit; }
.m-tile-in:focus-visible { outline: 3px solid var(--crimson); outline-offset: 3px; }
.m-tile-in::after { background: linear-gradient(to top, rgba(6, 16, 40, .78), rgba(6, 16, 40, .15) 48%, transparent 70%); }
.m-tile-in figcaption, .m-tile-in .cap { z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 16px 14px; font-size: 1.05rem; font-weight: 500; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); transform: translateY(0); }
.m-tile-in .zoom { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid rgba(255, 255, 255, .85); border-radius: 50%; opacity: 0; transform: translateY(6px) scale(.9); transition: opacity .25s, transform .25s, background-color .25s, color .25s; }
.m-tile-in .zoom svg { width: 18px; height: 18px; }
.m-tile-in:hover .zoom, .m-tile-in:focus-visible .zoom { opacity: 1; transform: none; background: #fff; color: #111; }
@media (hover: none) { .m-tile-in .zoom { opacity: 1; transform: none; } }
body.lb-open { overflow: hidden; }
.m-lb { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; padding: 24px 76px; }
.m-lb[hidden] { display: none; }
.m-lb-bg { position: absolute; inset: 0; border: 0; padding: 0; background: rgba(5, 10, 24, .92); cursor: zoom-out; }
.m-lb-fig { position: relative; z-index: 1; margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 14px; color: #fff; }
.m-lb-fig img { width: 100%; max-height: calc(100vh - 210px); max-height: calc(100svh - 210px); object-fit: contain; border-radius: 12px; background: #0b1530; }
.m-lb-fig figcaption { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.m-lb-text { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.m-lb-text b { font-size: 1.35rem; font-weight: 500; }
.m-lb-text p { font-size: 1rem; line-height: 1.6; color: rgba(255, 255, 255, .85); max-width: 46em; }
.m-lb-text .m-pill { margin-top: 6px; color: #fff; border-color: rgba(255, 255, 255, .8); }
.m-lb-text .m-pill:hover { background: #fff; color: #111; }
.m-lb-count { font-size: .9rem; color: rgba(255, 255, 255, .7); white-space: nowrap; padding-top: 6px; }
.m-lb .m-circ-btn { position: absolute; z-index: 2; color: #fff; background: rgba(255, 255, 255, .08); }
.m-lb .m-circ-btn:hover { background: #fff; color: #111; }
.m-lb-x { top: 16px; right: 16px; }
.m-lb-prev, .m-lb-next { top: 50%; translate: 0 -50%; }
.m-lb-prev { left: 16px; }
.m-lb-next { right: 16px; }
.js-anim .m-lb:not([hidden]) .m-lb-fig { animation: lbIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes lbIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .m-lb { padding: 64px 12px 16px; align-items: start; }
  .m-lb-fig img { max-height: calc(100svh - 300px); }
  .m-lb-prev, .m-lb-next { top: auto; bottom: 16px; translate: none; }
  .m-lb-prev { left: 12px; }
  .m-lb-next { right: 12px; }
  .m-lb-fig figcaption { flex-direction: column; gap: 6px; padding-bottom: 56px; }
}

/* ---------- หัวข้อ/ชื่อเรื่องทุกที่เป็น semi-bold (600) — ผู้ใช้สั่ง "บางเกินอ่านไม่ชัด" ---------- */
.m-h2, .m-hero-title, .m-serif, .m-card-t, .m-bb-text h3, .m-head-card h3, .m-ncard h3, .m-feat h3, .m-side-item h3, .m-side-h,
.m-rcard h3, .m-evt-cap, .m-ecard h3, .m-foot h3, .m-lb-text b, .m-svc-row, .m-slide-title, .m-search h2, .m-results b, .m-bb-text h3,
html:lang(th) .m-serif, html:lang(en) .m-side-h { font-weight: 600 !important; }
.m-line.sub { font-weight: 400 !important; }
.m-statement { font-weight: 500 !important; }
.m-tabbtn[aria-selected="true"], .m-tabbtn[aria-pressed="true"] { font-weight: 600; }
.m-h2 { letter-spacing: -.015em; }
/* lightbox: ไม่ขยายภาพเกินขนาดจริงของไฟล์ (กันภาพแตก) */
.m-lb-fig { width: min(1100px, 100%); }
.m-lb-fig img { width: auto; max-width: 100%; margin-inline: auto; }

/* ---------- ตัวเลขสถิติ: ตัวหนา ใหญ่ ชัด (ฟอนต์หลักของเว็บ ไม่ใช้เซอริฟบาง) + คำอธิบายเข้มอ่านง่าย ---------- */
.m-stat { border-left-color: #b9b1a6; }
.m-stat .m-ic { background: var(--navy); color: #fff; }
.m-num { font: 700 clamp(3.6rem, 2.2rem + 4.6vw, 6.25rem)/1 var(--font) !important; color: var(--crimson); letter-spacing: -.03em; font-variant-numeric: tabular-nums lining-nums; align-items: baseline; margin-top: 4px; }
.m-stat p { font-size: clamp(1.05rem, .98rem + .3vw, 1.25rem); font-weight: 500; color: #1d1b18; max-width: 20em; margin-top: 12px; line-height: 1.5; }

/* ---------- การ์ดหัวหน้าภาควิชา: ภาพบนวงกลม ยืนบนขอบการ์ด + ข้อความเด่น ---------- */
.m-head-card { position: relative; display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); align-items: stretch; gap: 0; margin-top: clamp(48px, 6vw, 80px); padding: 0; border-top: 0; border-radius: 24px; overflow: hidden; background: linear-gradient(100deg, #f5eee7 0%, #f5eee7 55%, #eadfd2 100%); }
.m-head-card::before { content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; pointer-events: none; background-image: repeating-conic-gradient(from 0deg at 50% 50%, rgba(179, 32, 42, .22) 0deg .6deg, transparent .6deg 6deg); -webkit-mask-image: radial-gradient(circle closest-side, #000 0, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 0, transparent 100%); }
.m-hc-photo { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 340px; padding-top: 26px; }
.m-hc-photo::before { content: ""; position: absolute; left: 50%; bottom: 30px; width: 280px; height: 280px; translate: -50% 0; border-radius: 50%; background: #d9e2ef; box-shadow: 0 0 0 14px rgba(217, 226, 239, .55); }
.m-hc-photo::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 330px; height: 330px; translate: -50% 0; border-radius: 50%; border: 2px solid var(--crimson); border-color: var(--crimson) transparent transparent var(--crimson); rotate: -25deg; opacity: .85; }
.m-head-card img { position: relative; z-index: 1; width: 270px; max-width: none; height: auto; aspect-ratio: auto; border-radius: 0; mix-blend-mode: multiply; object-fit: initial; }
.m-hc-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 10px; padding: 40px clamp(24px, 4vw, 64px) 40px 12px; }
.m-hc-lab { display: inline-flex; align-items: center; gap: 12px; font-size: 1rem; font-weight: 600; letter-spacing: .02em; color: var(--crimson); }
.m-hc-lab .m-ic { background: var(--navy); color: #fff; }
.m-head-card h3 { font-size: clamp(1.9rem, 1.3rem + 1.9vw, 3rem); line-height: 1.15; letter-spacing: -.015em; margin: 4px 0 0; color: var(--navy); }
.m-hc-role { font-size: 1.15rem; font-weight: 500; color: #3a352f; }
.m-hc-body .m-pill { margin-top: 16px; }
.m-hc-body .m-pill:hover { background: #111; color: #fff; }
@media (max-width: 900px) {
  .m-head-card { grid-template-columns: minmax(0, 1fr); }
  .m-hc-photo { min-height: 300px; }
  .m-hc-body { padding: 8px 24px 32px; align-items: center; text-align: center; }
}
@media (max-width: 640px) {
  .m-head-card { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .m-head-card img { width: 230px; }
  .m-hc-photo::before { width: 240px; height: 240px; }
  .m-hc-photo::after { width: 285px; height: 285px; }
  .m-hc-photo { min-height: 270px; }
}

/* ---------- บริการวิชาการ: พื้นฟ้าอ่อน (แทนพื้นดำ) ---------- */
.c-sky { background: #e6edf6; color: var(--ink); }
.m-campus.c-sky .m-svc-p { color: #2e2a25; }
.m-campus.c-sky .m-svc-lab { color: var(--mute); }
.m-campus.c-sky .m-svc-row { color: var(--ink); border-top-color: rgba(14, 39, 71, .25); }
.m-campus.c-sky .m-svc-row:last-child { border-bottom-color: rgba(14, 39, 71, .25); }
.m-campus.c-sky .m-svc-row:hover { background: rgba(255, 255, 255, .6); }
.m-campus.c-sky .m-svc-row .m-ic { background: var(--navy); color: #fff; }
.m-campus.c-sky .m-svc-row:hover .m-ic { background: var(--crimson); color: #fff; }
.m-campus.c-sky .m-svc-row:hover .m-circ { background: var(--navy); color: #fff; border-color: var(--navy); }
.m-campus.c-sky :focus-visible { outline-color: var(--crimson); }
.m-campus.c-sky .m-bigphoto { box-shadow: 0 22px 50px rgba(14, 39, 71, .25); }

/* ---------- หัวข้อส่วน: คำอธิบายอยู่ใต้หัวข้อ ชิดซ้าย (ไม่ลอยไปขวาสุด) ---------- */
.m-head-split { display: block; margin-bottom: 36px; }
.m-head-split .m-small { justify-self: auto; max-width: 58em; margin-top: 14px; color: var(--mute); opacity: 1; text-wrap: balance; }
.m-head-card .m-hc-body a.m-pill { display: inline-flex; align-items: center; margin-top: 16px; font-size: .975rem; font-weight: 500; }
.m-hc-photo::before { width: 250px; height: 250px; }
.m-hc-photo::after { width: 290px; height: 290px; }

/* ---------- ท้ายเว็บ: พื้นน้ำเงิน (CI) ---------- */
.m-foot.c-navy { background: var(--navy); }
.m-foot li a { color: #c7d3e6; }
.m-foot li a:hover { color: #fff; }
.m-foot-bar { color: #b4c3da; border-top-color: rgba(255, 255, 255, .2); }
.m-foot-bar a { color: #e3ebf7; }
.m-foot .m-logo-t small { color: rgba(255, 255, 255, .85); }
.m-foot-pills .m-pill { border-color: rgba(255, 255, 255, .85); }
.m-foot .i, .m-foot li a .i { color: #9db8ea; }

.m-news-more { display: flex; justify-content: center; margin-top: 36px; }


/* ---------- ตัวเลขสถิติ: สีน้ำเงิน (ผู้ใช้สั่ง) ---------- */
.m-num { color: var(--blue); }

/* ---------- การ์ดหัวหน้าภาควิชา: ภาพเต็ม (ไม่ตัดพื้นหลัง) กรอบมน; วงกลมเป็นวงเต็มซ่อนอยู่หลังภาพ ---------- */
.m-hc-photo { align-items: center; min-height: 360px; padding: 34px 24px; }
.m-hc-photo::before { left: calc(50% - 150px); right: auto; bottom: 14px; top: auto; width: 210px; height: 210px; translate: none; border-radius: 50%; background: #d3deee; box-shadow: none; z-index: 0; }
.m-hc-photo::after { left: calc(50% + 62px); right: auto; top: 18px; bottom: auto; width: 118px; height: 118px; translate: none; rotate: 0deg; border-radius: 50%; border: 3px solid var(--crimson); opacity: 1; z-index: 0; }
.m-head-card img { width: 232px; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 0; border-radius: 20px; mix-blend-mode: normal; background: #fff; box-shadow: 0 18px 40px rgba(14, 39, 71, .24); z-index: 1; }
@media (max-width: 640px) { .m-hc-photo { min-height: 330px; } .m-head-card img { width: 212px; } .m-hc-photo::before { left: calc(50% - 138px); width: 190px; height: 190px; } .m-hc-photo::after { left: calc(50% + 56px); width: 104px; height: 104px; } }

/* ---------- hero: เว้นช่องว่างระหว่างโปสเตอร์กับแถบชื่อด้านล่าง (เดิมขอบชนกัน) ---------- */
@media (min-width: 901px) {
  .m-slide a { bottom: calc(var(--strip) + 26px); }
  .m-slide img { width: min(calc(100% - 32px), 1600px, calc((100vh - 292px) * 1.7997)); width: min(calc(100% - 32px), 1600px, calc((max(100svh, 660px) - 292px) * 1.7997)); }
  .m-notch { padding-top: 14px; }
}


/* ---------- ป้ายชื่อใน hero: 2 บรรทัด (ภาควิชา... / คณะ... มหาวิทยาลัย...) ---------- */
.m-hero-title { font-size: clamp(1.55rem, .9rem + 1.5vw, 2.3rem); line-height: 1.2; }
.m-line.sub { margin-top: .5em; font-size: .52em; line-height: 1.4; }
html:lang(en) .m-line.sub { font-size: .44em; }
@media (min-width: 901px) {
  .m-hero { --strip: 148px; }
  .m-notch { width: min(640px, 58%); padding: 14px 40px 16px 32px; }
  .m-hero-bar { left: min(640px, 58%); padding-left: 28px; }
}
@media (min-width: 1101px) { .m-hero-title .m-line:first-child { white-space: nowrap; } }


/* ---------- อ่านง่าย: ภาษาอังกฤษใช้ตัวพิมพ์ใหญ่เฉพาะหัวข้อ/ป้ายสั้น — ย่อหน้ายาวและคำอธิบายเป็นตัวพิมพ์ปกติ ---------- */
html:lang(en) .m-statement { text-transform: none; font-size: clamp(1.4rem, .9rem + 1.5vw, 2.15rem); line-height: 1.45; letter-spacing: -.005em; }
html:lang(en) .m-small, html:lang(en) .m-hero-cap, html:lang(en) .m-evt-cap, html:lang(en) .m-ct-lead, html:lang(en) .n-sub { text-transform: none; letter-spacing: 0; }
html:lang(en) .m-small { font-size: 1rem; }
html:lang(en) .m-evt-cap { font-size: 1.15rem; }
html:lang(en) .m-about-head .m-lab { padding-top: .5em; }
.m-hc-photo::after { left: calc(50% + 34px); top: 20px; width: 92px; height: 92px; }
@media (max-width: 640px) { .m-hc-photo::after { left: calc(50% + 30px); width: 84px; height: 84px; } }


/* ---------- โปสเตอร์ไม่ถูกตัดขอบ: แสดงครบทุกสัดส่วน (contain) บนพื้นอ่อน — ผู้ใช้ห้ามครอปโปสเตอร์ที่มีตัวหนังสือ ---------- */
.m-ncard-img, .m-side-img { background: #dfe6f1; }
.m-ncard-img img, .m-side-img img { object-fit: contain; }

/* ---------- แถบเมนูบนจอ 1381–1499px: ไม่ให้เมนูชนโลโก้/ปุ่มภาษา ----------
   ป้ายโลโก้แสดงแค่ "EGME" (ชื่อคณะ/มหาวิทยาลัยอยู่ที่ป้ายชื่อด้านล่างของ hero อยู่แล้ว) และบีบช่องไฟเมนูเล็กน้อย */
@media (min-width: 1381px) and (max-width: 1499px) {
  .m-nav > ul { gap: 0; }
  .m-nav a, .m-nav button { padding: 0 8px; }
  html:lang(en) .m-nav > ul > li > a, html:lang(en) .m-nav > ul > li > button { font-size: .75rem; letter-spacing: .01em; }
  .m-nav > ul > li > a, .m-nav > ul > li > button { font-size: .86rem; }
}
.m-nav { min-width: 0; }
.m-nav > ul { min-width: 0; }


/* ---------- About the department: กระชับ — ประโยคนำ + ย่อหน้ารอง + 2 การ์ด (ผู้ใช้: ส่วนนี้ใหญ่และตัวหนังสือเยอะไป ไม่น่าสนใจ) ---------- */
.m-about { padding: clamp(48px, 6vw, 88px) 0 clamp(40px, 5vw, 72px); }
.m-about .m-statement, html:lang(en) .m-about .m-statement { font-size: clamp(1.45rem, 1rem + 1.4vw, 2.15rem); line-height: 1.35; font-weight: 600 !important; max-width: 26em; letter-spacing: -.01em; }
.m-about-rest { margin-top: 18px; max-width: 44em; font-size: 1.0625rem; line-height: 1.75; color: #3a352f; }
.m-about-cards { margin-top: 26px; max-width: 44em; }
.m-about-cap { margin-bottom: 12px; font-size: .95rem; font-weight: 600; color: var(--mute); }
.m-about-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.m-about-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--cream); border: 1px solid rgba(17, 17, 17, .08); }
.m-about-card .m-ic { background: var(--navy); color: #fff; width: 46px; height: 46px; }
.m-about-card b { display: block; font-size: 1.1rem; font-weight: 600; color: var(--navy); }
.m-about-card span { display: block; font-size: .975rem; line-height: 1.5; color: #3a352f; }
.m-about .m-tiles { margin-top: clamp(32px, 4vw, 56px); }
@media (max-width: 640px) { .m-about-two { grid-template-columns: minmax(0, 1fr); } }


/* ---------- ส่วนทางลัด: ลูกศรซ้าย-ขวา (การ์ดเกินจอ) ---------- */
#hub .m-bar { margin-bottom: 28px; }
#hub .m-tabs { margin-bottom: 0; }
.m-circ-btn:disabled { opacity: .3; cursor: default; pointer-events: none; }

/* ---------- เฟืองขบกันหมุนอยู่ด้านหลังส่วนหลักสูตร ---------- */
.m-gears { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.m-gear-cluster { position: absolute; display: block; max-width: none; overflow: visible; }
.m-gear-cluster .gear { color: #fff; }
.m-gear-cluster .body { stroke-width: 1.6; stroke-linejoin: round; fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .26); }
.m-gear-cluster .pitch { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 1; stroke-dasharray: 5 4; }
.m-gear-cluster .t-red .body { fill: rgba(179, 32, 42, .22); stroke: rgba(255, 120, 130, .6); }
.m-panel .m-wrap { position: relative; z-index: 1; }
@media (max-width: 900px) { .m-gears { opacity: .55; } }


/* ---------- เมนูมือถือ: หัวเมนูมีโลโก้ + ปุ่มปิด (เดิมพื้นน้ำเงินทับแถบบนจนไม่เห็นโลโก้/ปุ่มปิด) ---------- */
.m-nav-head { display: none; }
@media (max-width: 1380px) {
  .m-nav { padding: 0 24px 40px; }
  .m-nav-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 3; margin: 0 -24px 8px; padding: 14px 24px; background: var(--blue); border-bottom: 1px solid rgba(255, 255, 255, .2); }
  .m-nav-head .m-logo { color: #fff; }
  .m-nav-head .m-logo img { width: 44px; height: 44px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
  .m-nav-head .m-logo-t b { color: #fff; font-size: 1.1rem; }
  .m-nav-head .m-logo-t small { display: block; color: rgba(255, 255, 255, .85); font-size: .78rem; line-height: 1.25; max-width: 15em; }
  .m-nav-head .m-nav-close { width: 44px; height: 44px; color: #fff; border-color: rgba(255, 255, 255, .6); flex: none; }
  .m-nav-head .m-nav-close:hover { background: #fff; color: var(--blue); }
}

/* ---------- เมนูมือถือ: ลิงก์ย่อยต้องเป็นสีขาว (เดิมกฎสีของแถบบนเดสก์ท็อปทับเป็นสีดำบนพื้นน้ำเงิน) ---------- */
@media (max-width: 1380px) {
  .m-top .m-nav .m-sub, .m-top .m-nav .m-sub li > a, .m-top .m-nav .m-sub a { color: #fff !important; }
  .m-top .m-nav .m-sub a:hover, .m-top .m-nav .m-sub a:focus-visible { background: rgba(255, 255, 255, .14) !important; color: #fff !important; }
  .m-top .m-nav .m-sub .grp > span { color: rgba(255, 255, 255, .75) !important; }
  .m-top .m-nav .m-sub { background: rgba(255, 255, 255, .08); border: 0; box-shadow: none; border-radius: 12px; margin: 0 0 8px; }
  .m-nav > ul > li > a, .m-nav > ul > li > button { color: #fff; }
}

/* ---------- หัวเมนูมือถือ: โลโก้อยู่บนพื้นน้ำเงิน (ไม่ใช้ป้ายขาวของแถบบน) + ปุ่มปิดชัดเจน ---------- */
.m-top .m-nav .m-nav-head .m-logo { background: transparent !important; padding: 0 !important; border-radius: 0 !important; box-shadow: none; }
.m-top .m-nav .m-nav-head .m-logo-t b { color: #fff !important; }
.m-top .m-nav .m-nav-head .m-logo-t small { color: rgba(255, 255, 255, .88) !important; }
.m-top .m-nav .m-nav-head .m-nav-close { width: 46px; height: 46px; border: 1.5px solid rgba(255, 255, 255, .75) !important; background: rgba(255, 255, 255, .08); color: #fff !important; border-radius: 50%; padding: 0; display: inline-grid; place-items: center; }
.m-top .m-nav .m-nav-head .m-nav-close svg { width: 22px; height: 22px; stroke-width: 2; }
.m-top .m-nav .m-nav-head .m-nav-close:hover { background: #fff; color: var(--blue) !important; }
.m-top .m-nav .m-nav-head .m-logo-t small { max-width: 13em; white-space: normal; }
body.menu-open .m-totop, body.menu-open .m-rail { display: none; }

/* ---------- การ์ดสีขาว (ผู้ใช้สั่ง: อ่านง่ายกว่า): ทางลัด + เอกสาร + ประกาศ ---------- */
.m-card { background: #fff; border-color: rgba(17, 17, 17, .22); box-shadow: 0 1px 2px rgba(14, 39, 71, .05); }
.m-card:hover { box-shadow: 0 16px 36px rgba(14, 39, 71, .16); }
.m-card .m-card-x { opacity: 1; color: #4a443d; }
.m-card .m-tag { background: rgba(14, 39, 71, .08); }
.m-card:hover .m-tag { background: rgba(255, 255, 255, .18); }
.m-card:hover .m-card-x { color: rgba(255, 255, 255, .85); }
.m-evt { background: #fff; }
.m-about-card { background: #fff; }

/* ---------- มือถือ: ตัวเลขสถิติจัดกึ่งกลาง (ไอคอน ตัวเลข คำอธิบาย) ---------- */
@media (max-width: 640px) {
  .m-stat, .m-stat:first-child { display: flex; flex-direction: column; align-items: center; text-align: center; }
  .m-stat .m-ic { margin-inline: auto; }
  .m-num { justify-content: center; text-align: center; }
  .m-stat p { margin-inline: auto; text-align: center; max-width: 18em; }
  .m-stat-row { gap: 28px; }
}


/* ---------- ล็อกอัพโลโก้แบบลูกค้า: "Department of Mechanical Engineering / Mahidol University" ---------- */
.m-logo { gap: 12px; }
.m-logo-t { gap: 3px; line-height: 1.2; }
.m-logo-t b { font: 600 .95rem/1.2 var(--font); letter-spacing: .005em; text-transform: none; white-space: nowrap; }
.m-logo-t small { font: 500 .8125rem/1.2 var(--font); letter-spacing: .01em; white-space: nowrap; }
html:lang(th) .m-logo-t b { font-size: 1rem; }
.m-nav-head .m-logo-t b { font-size: 1.05rem; }
.m-nav-head .m-logo-t small { font-size: .875rem; max-width: none; }
.m-top .m-nav .m-nav-head .m-logo-t small { max-width: none; white-space: nowrap; }
.m-foot .m-logo-t b { font-size: 1rem; }
.m-foot .m-logo-t small { font-size: .875rem; }
@media (max-width: 380px) { .m-nav-head .m-logo-t b { font-size: .95rem; } .m-nav-head .m-logo-t small { font-size: .8125rem; } .m-nav-head .m-logo img { width: 38px; height: 38px; } }


/* ---------- ค้นหา: ปุ่มปิดต้องเห็นชัด (เดิมไอคอนสีดำบนพื้นเข้ม → มองไม่เห็น กดปิดไม่ได้) ---------- */
.m-search .m-search-top .m-ico { width: 48px; height: 48px; color: #fff; border: 1.5px solid rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); }
.m-search .m-search-top .m-ico svg { width: 24px; height: 24px; stroke-width: 2; }
.m-search .m-search-top .m-ico:hover { background: #fff; color: #111; }
.m-search-hint { margin-top: 14px; font-size: .875rem; color: rgba(255, 255, 255, .6); }

/* ---------- แถบบนมือถือ/แท็บเล็ต: แสดงชื่อเต็ม "Department of Mechanical Engineering / Mahidol University" (เดิมเหลือแค่ EGME ในป้ายขาว) ---------- */
@media (max-width: 1380px) {
  .m-top .m-tab .m-logo-t small { display: block; }
  .m-top:not(.scrolled) .m-logo { background: transparent; padding: 0 0 0 4px; border-radius: 0; box-shadow: none; }
  .m-top:not(.scrolled) .m-logo-t b { color: #fff; }
  .m-top:not(.scrolled) .m-logo-t small { color: rgba(255, 255, 255, .9); }
  .m-top:not(.scrolled) .m-logo img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .9); }
  .m-top .m-logo { min-width: 0; }
  .m-top .m-logo-t { min-width: 0; }
  .m-top .m-logo-t b, .m-top .m-logo-t small { overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 640px) {
  .m-top .m-logo img { width: 38px; height: 38px; }
  .m-top .m-logo { gap: 9px; }
  .m-top .m-logo-t b { font-size: .8125rem; letter-spacing: 0; }
  .m-top .m-logo-t small { font-size: .75rem; }
  html:lang(th) .m-top .m-logo-t b { font-size: .875rem; }
  .m-tab { gap: 6px; }
  .m-tools { gap: 4px; }
  .m-top .m-ico { width: 38px; height: 38px; }
}
@media (max-width: 400px) {
  .m-top .m-logo-t b { font-size: .75rem; }
  .m-top .m-logo-t small { font-size: .6875rem; }
  .m-top .m-logo img { width: 34px; height: 34px; }
  .m-top .m-ico { width: 36px; height: 36px; }
}


/* ---------- ป้ายชื่อ hero = ชื่อเต็ม "Department of Mechanical Engineering / Faculty of Engineering, Mahidol University" ---------- */
html:lang(en) .m-hero-title { text-transform: none; }
.m-hero-title { font-size: clamp(1.35rem, .8rem + 1.35vw, 2.1rem); letter-spacing: -.01em; }
html:lang(en) .m-line.sub, .m-line.sub { text-transform: none; font-size: .56em; letter-spacing: 0; }
@media (min-width: 901px) and (max-width: 1100px) { .m-hero-title { font-size: 1.3rem; } }

/* ---------- แถบบนจอเล็กมาก: ไอคอนเจ้าหน้าที่ย้ายไปอยู่ในเมนู เพื่อให้ชื่อเต็มพอดี ---------- */
.m-navstaff { display: none; }
@media (max-width: 1380px) { .m-navstaff { display: block; border-bottom: 1px solid rgba(255, 255, 255, .22); } .m-navstaff a { width: 100%; min-height: 56px; padding: 0 4px; gap: 14px; justify-content: flex-start; font-size: 1.1rem; color: #fff; } .m-navstaff .m-ic { background: #fff; color: var(--blue); } }
@media (max-width: 440px) {
  .m-top .m-tools .m-staff { display: none; }
  .m-top .m-logo-t b { font-size: .75rem; }
}
@media (max-width: 380px) {
  .m-top .m-logo-t b { white-space: normal; font-size: .75rem; line-height: 1.15; }
  .m-top .m-logo-t small { font-size: .6875rem; }
}

/* ---------- มือถือ/แท็บเล็ต (≤900): ป้ายชื่ออยู่ "เหนือ" ภาพข่าวเด่น แล้วภาพ แล้วตัวควบคุม ---------- */
@media (max-width: 900px) {
  .m-frame { display: flex; flex-direction: column; background: var(--blue); }
  .m-notch { order: -1; position: relative; width: auto; height: auto; padding: 16px 20px 18px; border-radius: 0; background: var(--blue); }
  .m-notch::after { display: none; }
  .m-slides { order: 1; }
  .m-navnotch { display: none; }
  .m-hero-bar { order: 2; position: relative; left: auto; right: auto; bottom: auto; width: auto; align-items: flex-start; text-align: left; padding: 14px 20px 18px; background: var(--blue); }
  .m-hero-title { font-size: 1.5rem; }
  .m-line.sub { font-size: .8em; }
}

/* ======================= มือถือ (≤640px): จัดกึ่งกลางทุกส่วน (ผู้ใช้สั่ง) ======================= */
@media (max-width: 640px) {
  .m-sec { text-align: center; }
  .m-h2, .m-statement, .m-small, .m-lab, .m-sec-sub, .m-about-rest, .m-ct-lead, .m-count, .n-sub { text-align: center; margin-inline: auto; }
  .m-head, .m-head-split { display: block; text-align: center; }
  .m-head .m-small, .m-head-split .m-small { margin-inline: auto; }
  .m-sample { display: inline-block; margin-top: 8px; }
  /* แท็บ + แถบเครื่องมือ */
  .m-tabs { justify-content: center; text-align: center; }
  .m-bar { flex-direction: column; justify-content: center; align-items: center; gap: 14px; }
  .m-bar .m-tabs { flex: 0 0 auto; width: 100%; }
  .m-bar .m-arrows, .m-arrows { display: flex; justify-content: center; }
  .m-find { margin-inline: auto; }
  .m-find input { text-align: center; }
  /* About */
  .m-about-head { text-align: center; justify-items: center; }
  .m-about-cap { text-align: center; }
  .m-about-card { flex-direction: column; text-align: center; }
  /* การ์ดทางลัด / เอกสาร */
  .m-card { align-items: center; text-align: center; }
  .m-card-head { flex-direction: column; align-items: center; gap: 8px; }
  .m-card-head .m-card-t { padding-top: 0; }
  .m-card-f { justify-content: center; gap: 14px; }
  .m-card-img { margin-inline: -20px; }
  /* หลักสูตร */
  .m-bb-text { align-items: center; text-align: center; }
  .m-bb-text ul { justify-items: center; }
  .m-bb-act { justify-content: center; }
  .m-panel .m-h2, .m-panel .m-small, .m-panel .m-lab { margin-inline: auto; }
  /* ตัวเลข / บริการ */
  .m-svc-text { justify-items: center; text-align: center; }
  .m-svc-p { margin-inline: auto; }
  .m-svc-lab { text-align: center; }
  /* ข่าว / งานวิจัย / กิจกรรม */
  .m-ncard, .m-rcard, .m-evt { align-items: center; text-align: center; }
  .m-meta, .m-evt-meta, .m-ncard .m-meta { justify-content: center; }
  .m-feat { text-align: center; }
  .m-feat-text { align-items: center; }
  .m-side-item { text-align: left; }
  .m-side-h { text-align: center; }
  .m-res-areas { justify-items: center; }
  .m-chips, .m-pills, .m-ct-act { justify-content: center; }
  .m-lab-dot { justify-content: center; }
  /* ติดต่อ */
  .m-ct-info { text-align: center; }
  .m-ct-row, .m-ct-row dt { text-align: center; justify-content: center; }
  .m-ct-row { justify-items: center; }
  .m-ct-act { justify-content: center; }
  /* ท้ายเว็บ */
  .m-foot, .m-foot-grid, .m-foot-bar { text-align: center; }
  .m-foot-grid { justify-items: center; }
  .m-foot-bar { justify-content: center; flex-direction: column; }
  .m-foot li a { justify-content: center; }
  .m-foot-pills { justify-items: center; width: 100%; }
  .m-foot-pills .m-pill { width: 100%; max-width: 320px; }
  .m-socials { justify-content: center; }
  .m-foot .m-logo { justify-content: center; }
  /* หน้าข่าวทั้งหมด */
  .n-back { justify-content: center; width: 100%; }
  .n-title { text-align: center; }
  .n-bar { justify-content: center; }
  .n-tools { justify-content: center; }
  .n-card .n-more-link { margin-inline: auto; }
  .n-more { justify-content: center; }
}
@media (max-width: 440px) { .m-top .m-logo { flex: 1 1 auto; min-width: 0; } .m-top .m-logo-t { min-width: 0; flex: 1 1 auto; } .m-top .m-logo-t b { white-space: normal; overflow: visible; } }
@media (max-width: 440px) { .m-top .m-logo-t { max-width: calc(100vw - 196px); } }
