/* EGME landing page v2
   โครงตามเทมเพลตเว็บมหาวิทยาลัยแนวมินิมอลที่ผู้ใช้ให้ + โทนสี CI จากโปสเตอร์ของภาควิชา (กรมท่า + แดงเข้ม)
   พื้นสลับ ขาว / เทาอมฟ้า เพื่อให้เห็นขอบเขตแต่ละส่วน และมีแถบสีเข้มเป็นจุดโฟกัส (แบนเนอร์, ตัวเลข, ท้ายเว็บ) */
:root {
  --ink: #111827;
  --muted: #566074;
  --line: #dfe3ea;
  --bg: #ffffff;
  --soft: #f3f4f7;
  --tint: #eef1f6;
  --navy: #0e2747;
  --navy-2: #173a66;
  --accent: #b3202a;
  --accent-dark: #8f1a22;
  --accent-tint: #fde8ea;
  --maxw: 1240px;
  --r-img: 18px;
  --shadow: 0 1px 2px rgba(14, 39, 71, .05), 0 12px 28px rgba(14, 39, 71, .08);
  --font: "Inter", "IBM Plex Sans Thai", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.7; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.3; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
section[id], li[id], article[id] { scroll-margin-top: 150px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.band.dark :focus-visible, .site-footer :focus-visible, .itile :focus-visible, .ptile :focus-visible { outline-color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -64px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }

/* ---------- buttons / icons ---------- */
.pill { display: inline-flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 6px 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: .9375rem; font-weight: 500; text-decoration: none; transition: background-color .18s, transform .18s; }
.pill:hover { background: var(--accent-dark); }
.pill-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 50%; transition: transform .2s; }
.pill:hover .pill-ico { transform: translateX(3px); }
.pill-ico svg { width: 16px; height: 16px; }
.pill-sm { min-height: 40px; padding-left: 18px; font-size: .875rem; }
.pill-sm .pill-ico { width: 28px; height: 28px; }
.textlink { font-size: .9375rem; text-decoration: underline; text-underline-offset: 4px; }
.textlink:hover { color: var(--accent); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: transparent; transition: background-color .18s; }
.icon-btn:hover { background: var(--soft); }
.icon-btn svg { width: 22px; height: 22px; }
.ctl { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%; border: 1.5px solid #c4cad6; background: #fff; color: var(--navy); transition: background-color .18s, border-color .18s; }
.ctl:hover { border-color: var(--navy); }
.ctl svg { width: 20px; height: 20px; }
.ctl:disabled { opacity: .4; cursor: default; }
.ctl-play .i-play { display: none; }
.ctl-play[data-paused="true"] .i-play { display: inline-grid; }
.ctl-play[data-paused="true"] .i-pause { display: none; }
.ctl-play span { display: inline-grid; place-items: center; }

/* ---------- header: แถวโลโก้ (ซ้ายสุด) + แถบเมนูกรมท่า ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-top: 3px solid var(--accent); box-shadow: 0 1px 0 var(--line); }
.brandbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; flex: none; }
.brand-logo { height: 46px; width: auto; max-width: 180px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.375rem; font-weight: 600; letter-spacing: .1em; color: var(--navy); }
.brand-text small { font-size: .75rem; color: var(--muted); }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.staff-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 999px; font-size: .875rem; font-weight: 500; text-decoration: none; transition: background-color .18s, color .18s; }
.staff-btn:hover { background: var(--navy); color: #fff; }
.staff-ico svg { width: 16px; height: 16px; display: block; }
.lang { display: inline-flex; border: 1.5px solid #c4cad6; border-radius: 999px; overflow: hidden; }
.lang button { background: transparent; border: 0; padding: 0 12px; min-height: 36px; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; }
.lang button[aria-pressed="true"] { background: var(--navy); color: #fff; }
.menu-btn { display: none; }

.navbar { background: linear-gradient(90deg, #0e2747 0%, #17407a 100%); border-bottom: 4px solid var(--accent); }
.navbar :focus-visible { outline-color: #fff; }
.nav .top { display: flex; flex-wrap: wrap; }
.nav .top > li { position: relative; }
.nav .nav-btn, .nav .top > li > a { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-right: 1px solid rgba(255, 255, 255, .1); background: none; color: #fff; font-size: .9375rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; border-radius: 0; transition: background-color .18s; }
.nav .nav-btn:hover, .nav .top > li > a:hover, .nav .top > li.has-sub.open > .nav-btn { background: var(--accent); }
.nav .nav-btn svg { width: 14px; height: 14px; transition: transform .2s; flex: none; }
.nav .has-sub.open > .nav-btn svg { transform: rotate(180deg); }
.nav-staff { display: none; }
.sub { display: none; position: absolute; left: 0; top: 100%; z-index: 60; min-width: 300px; padding: 8px; background: #fff; color: var(--ink); border-top: 3px solid var(--accent); border-radius: 0 0 14px 14px; box-shadow: 0 22px 44px rgba(14, 39, 71, .22); }
.has-sub.open > .sub, .has-sub:focus-within > .sub { display: block; }
@media (hover: hover) and (min-width: 1121px) { .has-sub:hover > .sub { display: block; } .nav .top > li.has-sub:hover > .nav-btn { background: var(--accent); } }
.sub li { position: relative; }
.nav .sub a, .nav .sub .nav-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: var(--ink); font-size: .9rem; font-weight: 400; text-align: left; text-decoration: none; white-space: normal; }
.nav .sub a:hover, .nav .sub .nav-btn:hover, .nav .sub .has-sub.open > .nav-btn, .nav .sub .has-sub:hover > .nav-btn { background: var(--accent-tint); color: var(--accent-dark); }
.sub .sub { left: calc(100% + 4px); top: -11px; border-radius: 14px; }
.nav .sub .nav-btn svg { transform: rotate(-90deg); }
.nav .sub .has-sub.open > .nav-btn svg { transform: rotate(-90deg); }

.search-panel { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 18px 40px rgba(14, 39, 71, .12); padding: 22px 0 28px; }
.search-panel[hidden] { display: none; }
.sp-title { font-size: 1.125rem; margin-bottom: 14px; }
.search-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.field.grow { flex: 1 1 280px; }
.field label { font-size: .8125rem; font-weight: 600; }
input[type="search"], select { min-height: 48px; padding: 0 16px; border: 1.5px solid #c4cad6; border-radius: 12px; background: #fff; width: 100%; }
input[type="search"]:hover, select:hover { border-color: var(--navy); }
.results { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; max-height: 50vh; overflow: auto; }
.res-summary { margin: 0 0 10px; color: var(--muted); font-size: .9375rem; }
.res-list { display: grid; gap: 4px; }
.res-item a { display: flex; gap: 14px; align-items: baseline; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.res-item a:hover { background: var(--tint); }
.res-type { flex: none; min-width: 76px; text-align: center; font-size: .75rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-dark); }
.res-title { font-weight: 500; }
.res-sub { display: block; color: var(--muted); font-size: .875rem; }
mark { background: #fff0a8; color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- photo placeholders (fallback เมื่อรูปจริงไม่มี) ---------- */
.ph { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: inherit; background: linear-gradient(135deg, var(--c1), var(--c2)); --stroke: rgba(14, 39, 71, .16); --fill: rgba(255, 255, 255, .22); }
.ph[data-tone="a"] { --c1: #e2e6ec; --c2: #b8c2cf; }
.ph[data-tone="b"] { --c1: #efe6d6; --c2: #cdbd9c; }
.ph[data-tone="c"] { --c1: #dde9e0; --c2: #a8c3b0; }
.ph[data-tone="d"] { --c1: #eae1ee; --c2: #c1b0ca; }
.ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph .g { fill: var(--fill); stroke: var(--stroke); stroke-width: 1.4; }
.ph-tag { position: absolute; left: 12px; top: 12px; padding: 1px 10px; border-radius: 999px; background: rgba(255, 255, 255, .72); color: #3a3a40; font-size: .6875rem; }
.img { position: relative; overflow: hidden; background: var(--soft); }
.img .ph, .slide .ph { position: absolute; inset: 0; width: auto; height: auto; }
.img img, .slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- hero ---------- */
.hero-band { position: relative; overflow: hidden; padding-bottom: 36px; background: radial-gradient(circle at 10% 12%, rgba(179, 32, 42, .13), transparent 38%), radial-gradient(circle at 92% 88%, rgba(29, 99, 191, .2), transparent 46%), linear-gradient(180deg, #e6eefb 0%, #f7f9fe 100%); }
.banner-wrap { padding-top: 28px; }
.banner { position: relative; border-radius: 22px; overflow: hidden; background: #fff; box-shadow: 0 0 0 6px rgba(255, 255, 255, .85), 0 26px 56px rgba(14, 39, 71, .26); }
.slides { display: grid; }
.slide { grid-area: 1 / 1; position: relative; aspect-ratio: 1800 / 1000; opacity: 0; visibility: hidden; transition: opacity .5s ease-out, visibility 0s linear .5s; }
.slide.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.slide .ph { border-radius: 0; }
.slide > a { position: absolute; inset: 0; display: block; }
.banner-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; margin-top: 16px; color: var(--navy); }
.banner-cap { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; min-width: 0; }
.bc-title { font-size: 1.0625rem; font-weight: 500; }
.banner-bar .textlink:hover { color: var(--accent); }
.banner-ctl { display: flex; align-items: center; gap: 8px; flex: none; }
.hero-band .ctl { border-color: #b9c3d6; }
.dots { display: flex; background: rgba(14, 39, 71, .07); border-radius: 999px; padding: 0 4px; }
.dot { width: 34px; height: 44px; background: transparent; border: 0; padding: 0; display: inline-grid; place-items: center; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: rgba(14, 39, 71, .3); transition: width .2s, background-color .2s; }
.dot[aria-current="true"]::before { width: 24px; border-radius: 999px; background: var(--accent); }

/* ---------- section bands ---------- */
.band { padding: 88px 0; position: relative; }
.band.tint { background: var(--tint); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sec-head.stack { display: block; }
.sec-head h2, .band.dark h2, .video-text h2, .svc-text h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); color: var(--navy); }
.sec-head h2::after, .video-text h2::after, .svc-text h2::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 10px; border-radius: 2px; background: var(--accent); }
.sec-sub { margin-top: 10px; color: var(--muted); max-width: 640px; }
.sub { margin: -10px 0 20px; font-size: .9375rem; }
.sample-chip { padding: 2px 12px; border: 1px dashed #aeb6c4; border-radius: 999px; color: var(--muted); font-size: .75rem; white-space: nowrap; background: #fff; }
.eyebrow { display: inline-block; margin-bottom: 10px; padding: 2px 12px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-dark); font-size: .8125rem; font-weight: 600; }
.mini-h { margin: 36px 0 14px; font-size: .9375rem; font-weight: 600; color: var(--navy); letter-spacing: .02em; display: flex; align-items: center; gap: 12px; }
.mini-h::after { content: ""; flex: 1; height: 1px; background: #cfd5e0; }
.mini-h:first-of-type { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid #c4cad6; background: #fff; font-size: .875rem; transition: background-color .18s, border-color .18s, color .18s; }
.chip:hover { border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.count { color: var(--muted); font-size: .875rem; margin: 10px 0 14px; min-height: 1.5em; }

/* ---------- hub: กระเบื้องภาพ (image tiles) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px 34px; margin-bottom: 28px; border-bottom: 1px solid #c8cfdc; }
.tab { position: relative; min-height: 50px; padding: 0 2px; border: 0; background: none; font-size: 1.0625rem; font-weight: 600; color: var(--muted); transition: color .2s; }
.tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease-out; }
.tab:hover, .tab[aria-selected="true"] { color: var(--navy); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.hub-panel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.hub-panel:focus-visible { outline-offset: 8px; }
.itile { position: relative; display: block; grid-column: span 2; min-height: 280px; border-radius: 22px; overflow: hidden; background: var(--navy); color: #fff; text-decoration: none; isolation: isolate; box-shadow: 0 10px 26px rgba(14, 39, 71, .18); animation: fadeUp .5s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); transition: box-shadow .3s, transform .3s; }
.itile:hover { transform: translateY(-4px); box-shadow: 0 22px 44px rgba(14, 39, 71, .3); }
.itile.s3 { grid-column: span 3; }
.itile.s4 { grid-column: span 4; }
.itile.s6 { grid-column: span 6; }
.itile.feat { min-height: 360px; }
.itile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s ease-out; }
.itile:hover > img { transform: scale(1.07); }
.itile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 24, 48, .92) 0%, rgba(8, 24, 48, .5) 42%, rgba(8, 24, 48, .1) 100%); }
.itile[data-tone="crimson"]::before { background: linear-gradient(to top, rgba(112, 14, 24, .93) 0%, rgba(112, 14, 24, .5) 42%, rgba(112, 14, 24, .08) 100%); }
.itile[data-tone="teal"]::before { background: linear-gradient(to top, rgba(6, 70, 66, .93) 0%, rgba(6, 70, 66, .5) 42%, rgba(6, 70, 66, .08) 100%); }
.itile[data-tone="blue"]::before { background: linear-gradient(to top, rgba(18, 56, 108, .93) 0%, rgba(18, 56, 108, .5) 42%, rgba(18, 56, 108, .08) 100%); }
.itile.cms { background: linear-gradient(135deg, var(--accent), #6e1019); }
.itile.cms::before { background: none; }
.it-bigico { position: absolute; z-index: -1; right: -18px; top: -18px; width: 190px; height: 190px; color: rgba(255, 255, 255, .13); }
.it-bigico svg { width: 100%; height: 100%; stroke-width: 1.2; }
.it-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 26px; display: flex; flex-direction: column; gap: 2px; }
.it-sub { font-size: .8125rem; letter-spacing: .07em; text-transform: uppercase; color: rgba(255, 255, 255, .82); }
.itile h3 { font-size: 1.4375rem; font-weight: 600; line-height: 1.25; color: #fff; }
.itile.feat h3 { font-size: 2.125rem; }
.it-text { max-height: 0; opacity: 0; overflow: hidden; font-size: .9375rem; color: rgba(255, 255, 255, .92); transition: max-height .35s, opacity .3s, margin .3s; }
.itile:hover .it-text, .itile:focus-visible .it-text, .itile.feat .it-text, .itile.cms .it-text { max-height: 6em; opacity: 1; margin-top: 8px; }
.it-go { position: absolute; right: 18px; top: 18px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--navy); opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; }
.it-go svg { width: 18px; height: 18px; }
.itile:hover .it-go, .itile:focus-visible .it-go { opacity: 1; transform: none; }
@media (hover: none) { .it-text { max-height: 6em; opacity: 1; margin-top: 8px; } .it-go { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.pill-light { background: #fff; color: var(--ink); }
.pill-light:hover { background: #f1f1f4; }
.pill-light .pill-ico { border-color: rgba(0, 0, 0, .5); }

/* ---------- programs: ภาพเต็มกรอบ ---------- */
.prog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ptile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 540px; border-radius: 26px; overflow: hidden; color: #fff; background: var(--navy); isolation: isolate; box-shadow: 0 14px 34px rgba(14, 39, 71, .22); transition: transform .3s, box-shadow .3s; }
.ptile:hover { transform: translateY(-6px); box-shadow: 0 26px 52px rgba(14, 39, 71, .34); }
.ptile > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s ease-out; }
.ptile:hover > img { transform: scale(1.06); }
.ptile::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 24, 48, .96) 0%, rgba(8, 24, 48, .78) 40%, rgba(8, 24, 48, .12) 78%); }
.ptile:nth-child(1)::before { background: linear-gradient(to top, rgba(112, 14, 24, .96) 0%, rgba(112, 14, 24, .78) 40%, rgba(112, 14, 24, .1) 78%); }
.ptile:nth-child(3)::before { background: linear-gradient(to top, rgba(6, 66, 62, .96) 0%, rgba(6, 66, 62, .78) 40%, rgba(6, 66, 62, .1) 78%); }
.pt-level { position: absolute; left: 24px; top: 24px; padding: 5px 18px; border-radius: 999px; background: #fff; color: var(--navy); font-weight: 600; font-size: .9375rem; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.pt-level small { margin-left: 8px; font-weight: 400; color: var(--muted); font-size: .8125rem; }
.pt-body { padding: 28px 28px 30px; display: flex; flex-direction: column; gap: 12px; }
.ptile h3 { font-size: 1.625rem; font-weight: 600; line-height: 1.25; color: #fff; }
.pt-facts { display: grid; gap: 6px; font-size: .9375rem; color: rgba(255, 255, 255, .9); }
.pt-facts li { position: relative; padding-left: 18px; }
.pt-facts li::before { content: ""; position: absolute; left: 0; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: #ff8a94; }
.pt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-top: 8px; }
.ptile .textlink { color: #fff; }
.ptile .textlink:hover { color: #ffd6d9; }

/* ---------- news ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 28px; }
.filters .field.kw { width: 300px; min-width: 0; flex: 0 1 300px; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.news-more { display: flex; justify-content: center; margin-top: 30px; }
.news-more[hidden], .news-more > [hidden] { display: none; }
#newsMore .pill-ico svg { transition: transform .25s; }
#newsMore[aria-expanded="true"] .pill-ico svg { transform: rotate(180deg); }
.ncard { position: relative; display: flex; animation: fadeUp .45s ease-out backwards; animation-delay: calc(var(--i, 0) * 60ms); flex-direction: column; gap: 10px; padding-bottom: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-img); overflow: hidden; box-shadow: 0 1px 2px rgba(14, 39, 71, .04), 0 10px 24px rgba(14, 39, 71, .07); transition: transform .25s, box-shadow .25s; }
.ncard:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(14, 39, 71, .14); }
.ncard > :not(.img) { margin-inline: 18px; }
.ncard .img { aspect-ratio: 16 / 9; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .8125rem; color: var(--muted); }
.tag { padding: 1px 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; font-size: .75rem; }
.ncard h3 { font-size: 1rem; }
.ncard p { color: var(--muted); font-size: .8125rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin-top: auto; font-size: .875rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; min-height: 32px; display: inline-flex; align-items: center; }
.more:hover { color: var(--accent); }
.empty { grid-column: 1 / -1; padding: 28px; text-align: center; border: 1.5px dashed #aeb6c4; border-radius: 16px; color: var(--muted); background: #fff; }
.link-btn { background: none; border: 0; text-decoration: underline; padding: 6px 4px; min-height: 44px; font-weight: 500; }

/* ---------- events ---------- */
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.ecard { position: relative; display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.ecard:hover { transform: translateY(-6px); box-shadow: 0 24px 46px rgba(14, 39, 71, .18); }
.ecard .img { aspect-ratio: 16 / 10; }
.ecard .img img { transition: transform .6s ease-out; }
.ecard:hover .img img { transform: scale(1.06); }
.date-badge { position: absolute; z-index: 2; left: 16px; top: 16px; min-width: 60px; padding: 8px 6px; border-radius: 14px; background: var(--accent); color: #fff; text-align: center; line-height: 1.1; box-shadow: 0 8px 18px rgba(143, 26, 34, .4); }
.date-badge b { display: block; font-size: 1.5rem; font-weight: 600; }
.date-badge span { font-size: .8125rem; }
.ec-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.ecard h3 { font-size: 1.125rem; color: var(--navy); }
.ec-meta { font-size: .875rem; color: var(--muted); }
.soon { align-self: flex-start; padding: 0 10px; border-radius: 999px; background: var(--accent-tint); color: var(--accent-dark); font-size: .75rem; font-weight: 600; }
.ecard.all { justify-content: center; align-items: center; text-align: center; gap: 10px; padding: 32px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; text-decoration: none; min-height: 280px; }
.ecard.all .hc-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .15); color: #fff; margin: 0 auto 6px; }
.ecard.all .hc-ico svg { width: 28px; height: 28px; }
.ecard.all h3 { color: #fff; }
.ecard.all p { color: #cfd9ea; font-size: .875rem; }

/* ---------- video ---------- */
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 52px; align-items: center; }
.video-text { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.fine-print { font-size: .8125rem; color: var(--muted); }
.video-card { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: 24px; overflow: hidden; background: #000; box-shadow: 0 26px 56px rgba(14, 39, 71, .28); }
.video-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease-out, filter .3s; }
.video-card:hover img { transform: scale(1.04); filter: brightness(.92); }
.video-card iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .25s; }
.play::after { content: ""; position: absolute; inset: -10px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 50%; animation: ring 2.2s ease-out infinite; }
.video-card:hover .play { transform: scale(1.1); }
.play svg { width: 34px; height: 34px; margin-left: 4px; }
@keyframes ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

/* ---------- research ---------- */
.area-list { display: flex; flex-wrap: wrap; gap: 10px; }
.area { display: inline-flex; align-items: center; gap: 10px; padding: 7px 18px 7px 8px; background: #fff; border: 1px solid #d3d9e4; border-radius: 999px; font-size: .9rem; transition: transform .2s, border-color .2s, box-shadow .2s; }
.area:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 18px rgba(14, 39, 71, .1); }
.area i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); font-style: normal; }
.area i svg { width: 16px; height: 16px; }
.best-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.bcard { position: relative; display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.bcard:hover { transform: translateY(-5px); box-shadow: 0 22px 44px rgba(14, 39, 71, .16); }
.bcard > :not(.img) { margin-inline: 20px; }
.bcard .img { aspect-ratio: 16 / 9; }
.badge { position: absolute; z-index: 2; right: 14px; top: 14px; padding: 3px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8125rem; font-weight: 600; box-shadow: 0 6px 14px rgba(143, 26, 34, .4); }
.bcard h3 { font-size: 1.0625rem; color: var(--navy); }
.bcard p { font-size: .875rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.link-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--navy); border-radius: 999px; font-size: .9rem; font-weight: 500; text-decoration: none; color: var(--navy); transition: background-color .2s, color .2s; }
.link-pill:hover { background: var(--navy); color: #fff; }
.link-pill svg { width: 16px; height: 16px; }

/* ---------- services ---------- */
.svc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.svc-img { position: relative; aspect-ratio: 16 / 9; border-radius: 22px; box-shadow: var(--shadow); }
.svc-img::before { content: ""; position: absolute; z-index: -1; left: -16px; bottom: -16px; width: 62%; height: 62%; border-radius: 22px; background: var(--accent-tint); }
.svc-img .img { position: absolute; inset: 0; border-radius: 22px; }
.svc-text { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.svc-text p { color: var(--muted); }
.link-list { width: 100%; border-top: 1px solid var(--line); }
.link-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: .9375rem; transition: color .2s, padding .2s; }
.link-list a:hover { color: var(--accent); padding-left: 6px; }
.link-list svg { width: 16px; height: 16px; flex: none; }

/* ---------- about: ตัวเลข + หัวหน้าภาควิชา ---------- */
.band.dark { color: #fff; background-color: var(--navy); background-image: linear-gradient(105deg, rgba(14, 39, 71, .94) 0%, rgba(14, 39, 71, .84) 55%, rgba(143, 26, 34, .8) 100%), url("../../images/photo-expo.jpg"); background-size: cover; background-position: center; }
.band.dark h2 { color: #fff; }
.band.dark h2::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 10px; border-radius: 2px; background: #ff7a85; }
.about-in { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.about-text > p { margin: 16px 0 36px; max-width: 560px; color: #d5deee; }
.stat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.stat { padding-top: 14px; border-top: 3px solid #ff7a85; }
.stat b { display: block; font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem); font-weight: 600; line-height: 1.05; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat > span { display: block; margin-top: 6px; font-size: .9375rem; color: #d5deee; }
.head-card { background: #fff; color: var(--ink); border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, .35); max-width: 340px; margin-left: auto; transition: transform .3s; }
.head-card:hover { transform: translateY(-5px); }
.head-card .img { aspect-ratio: 4 / 5; }
.hc-info { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 4px; }
.hc-info strong { font-size: 1.125rem; color: var(--navy); }
.hc-info span { font-size: .875rem; color: var(--muted); }
.hc-info .textlink { margin-top: 10px; }

/* ---------- documents ---------- */
.doc-list { display: grid; gap: 12px; }
.doc { display: grid; grid-template-columns: 120px 1fr auto; gap: 22px; align-items: center; padding: 12px 22px 12px 12px; background: #fff; border: 1px solid var(--line); border-radius: 18px; transition: box-shadow .25s, border-color .25s, transform .25s; }
.doc:hover { box-shadow: var(--shadow); border-color: #b9c2d3; transform: translateY(-2px); }
.dthumb, .ext { position: relative; display: block; width: 120px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; }
.dthumb { background: #fff; border: 1px solid var(--line); }
.dthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ext { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; font-size: .8125rem; font-weight: 600; letter-spacing: .08em; }
.doc h3 { font-size: 1.0625rem; }
.doc .meta { margin-top: 4px; }
.dl { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--accent); color: var(--accent); border-radius: 999px; font-size: .875rem; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .2s, color .2s; }
.dl:hover { background: var(--accent); color: #fff; }
.dl svg { width: 16px; height: 16px; }

/* ---------- contact ---------- */
.contact-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 64px; align-items: center; }
.ct-photo { position: relative; aspect-ratio: 5 / 4.6; border-radius: 28px; box-shadow: var(--shadow); }
.ct-photo::before { content: ""; position: absolute; z-index: -1; right: -18px; bottom: -18px; width: 64%; height: 64%; border-radius: 28px; background: var(--accent); }
.ct-photo .img { position: absolute; inset: 0; border-radius: 28px; }
.ct-tag { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 20px; padding: 14px 18px; border-radius: 16px; background: rgba(14, 39, 71, .9); color: #fff; }
.ct-tag strong { display: block; font-size: 1.0625rem; font-weight: 600; }
.ct-tag span { font-size: .875rem; color: #cfd9ea; }
.ct-info h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem); color: var(--navy); }
.ct-info h2::after { content: ""; display: block; width: 44px; height: 4px; margin-top: 12px; border-radius: 2px; background: var(--accent); }
.ct-lead { margin-top: 16px; color: var(--muted); max-width: 520px; }
.ct-list { margin-top: 28px; border-top: 1px solid var(--line); }
.ct-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.ct-k { font-size: .8125rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-dark); }
.ct-v { font-size: 1.0625rem; overflow-wrap: anywhere; }
.ct-v a { text-decoration: underline; text-underline-offset: 4px; }
.ct-v a:hover { color: var(--accent); }
.ct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 30px; }

/* ---------- footer ---------- */
.site-footer { position: relative; background: var(--navy); color: #fff; padding-top: 68px; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--accent), #ff8a94 45%, var(--navy-2)); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 44px; padding-bottom: 52px; }
.foot-brand { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.fb-row { display: flex; align-items: center; gap: 14px; }
.fb-row svg { width: 48px; height: 48px; flex: none; }
.fb-row strong { display: block; font-size: 1.375rem; letter-spacing: .1em; }
.fb-row span { display: block; font-size: .8125rem; color: #c4d0e4; }
.foot-brand p { color: #c4d0e4; font-size: .9375rem; max-width: 340px; }
.foot-col h3 { margin-bottom: 14px; font-size: .8125rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #ffb3ba; }
.foot-col ul { display: grid; gap: 2px; }
.foot-col a { display: inline-flex; align-items: center; min-height: 36px; color: #e6edf8; font-size: .9375rem; text-decoration: none; transition: color .2s, transform .2s; }
.foot-col a:hover { color: #fff; transform: translateX(4px); text-decoration: underline; text-underline-offset: 4px; }
.foot-contact p { color: #e6edf8; font-size: .9375rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.foot-contact a { display: inline; min-height: 0; text-decoration: underline; text-underline-offset: 4px; }
.foot-staff { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 12px; padding: 0 20px; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 999px; color: #fff; font-size: .875rem; font-weight: 500; text-decoration: none; transition: background-color .2s, color .2s; }
.foot-staff:hover { background: #fff; color: var(--navy); }
.foot-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; padding: 22px 0 30px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .8125rem; color: #aebcd3; }
.foot-bar a { color: #d3deee; text-decoration: underline; text-underline-offset: 4px; }
.eyebrow-light { display: inline-block; margin-bottom: 12px; padding: 3px 14px; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: .875rem; font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }

/* ---------- scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease-out, transform .7s ease-out; transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .staff-btn { display: none; }
  .menu-btn { display: inline-grid; }
  .navbar { display: none; position: absolute; left: 0; right: 0; top: 100%; max-height: calc(100vh - 150px); overflow: auto; box-shadow: 0 22px 44px rgba(0, 0, 0, .3); }
  .navbar.open { display: block; }
  .nav .top { flex-direction: column; flex-wrap: nowrap; }
  .nav .nav-btn, .nav .top > li > a { width: 100%; min-height: 50px; justify-content: space-between; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); padding: 0 4px; }
  .sub { position: static; min-width: 0; padding: 4px 0 8px 14px; background: rgba(255, 255, 255, .07); border-top: 0; border-radius: 0; box-shadow: none; color: #fff; }
  .nav .sub a, .nav .sub .nav-btn { color: #fff; }
  .nav .sub a:hover, .nav .sub .nav-btn:hover, .nav .sub .has-sub.open > .nav-btn { background: rgba(255, 255, 255, .14); color: #fff; }
  .sub .sub { position: static; border-radius: 0; background: rgba(255, 255, 255, .06); }
  .nav .sub .nav-btn svg, .nav .sub .has-sub.open > .nav-btn svg { transform: none; }
  .nav .sub .has-sub.open > .nav-btn svg { transform: rotate(180deg); }
  .nav-staff { display: block; }
  .nav-staff a { justify-content: flex-start !important; gap: 8px; }
  .has-sub:focus-within > .sub { display: none; }
  .has-sub.open > .sub { display: block; }
}
@media (max-width: 1040px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .band { padding: 64px 0; }
  .best-grid { grid-template-columns: minmax(0, 1fr); }
  .video-layout, .svc, .about-in { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .head-card { margin-left: 0; max-width: 360px; }
  .banner-bar { flex-direction: column; align-items: stretch; }
  .banner-ctl { width: 100%; }
  .dots { display: flex; background: rgba(14, 39, 71, .07); border-radius: 999px; padding: 0 4px; }
  .dot { flex: 1 1 0; width: auto; min-width: 0; }
}
@media (max-width: 640px) {
  .container { padding-inline: 18px; }
  .band { padding: 52px 0; }
  .brand-text small { display: none; }
  .brand-text strong { font-size: 1.125rem; }
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .filters .field.kw { width: 100%; flex-basis: 100%; }
  .event-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-list { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .search-form .pill { width: 100%; justify-content: space-between; }
  .field { min-width: 0; flex: 1 1 100%; }
  .play { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1040px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hub-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .itile, .itile.s3, .itile.s4, .itile.s6 { grid-column: auto; }
  .itile.feat { grid-column: 1 / -1; }
  .prog-grid { grid-template-columns: minmax(0, 1fr); }
  .ptile { min-height: 470px; }
  .contact-wrap { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .ct-photo { aspect-ratio: 16 / 11; }
}
@media (max-width: 640px) {
  .tabs { gap: 2px 20px; }
  .hub-panel { grid-template-columns: minmax(0, 1fr); }
  .itile.feat { grid-column: auto; min-height: 300px; }
  .itile { min-height: 240px; }
  .itile.feat h3 { font-size: 1.75rem; }
  .doc { grid-template-columns: 92px 1fr; gap: 14px; padding-right: 14px; }
  .dthumb, .ext { width: 92px; }
  .doc .dl { grid-column: 1 / -1; justify-content: center; }
  .ct-list li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .site-footer { padding-top: 52px; }
}

.ecard.reveal.in:hover, .bcard.reveal.in:hover, .ptile.reveal.in:hover { transform: translateY(-6px); }

/* ---------- documents: รายการลิงก์หน้าเดิมแบบกะทัดรัด ---------- */
.doc-group { margin-top: 18px; }
.doc-group .mini-h { margin: 0 0 14px; }
.web-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wlink { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px 10px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.wlink:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.wl-title { flex: 1; font-size: .9375rem; font-weight: 500; line-height: 1.4; }
.wl-go { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid #c4cad6; color: var(--navy); transition: background-color .2s, color .2s, border-color .2s; }
.wl-go svg { width: 15px; height: 15px; }
.wlink:hover .wl-go { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (max-width: 900px) { .web-list { grid-template-columns: minmax(0, 1fr); } }

/* footer: ปุ่มเจ้าหน้าที่ ต้องชนะกฎลิงก์ของคอลัมน์ */
.foot-col a.foot-staff { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 14px; padding: 0 20px; border: 1.5px solid rgba(255, 255, 255, .7); border-radius: 999px; color: #fff; font-size: .875rem; font-weight: 500; text-decoration: none; transform: none; }
.foot-col a.foot-staff:hover { background: #fff; color: var(--navy); text-decoration: none; transform: none; }
.foot-col a.foot-staff .staff-ico svg { width: 16px; height: 16px; display: block; }

/* ---------- ชื่อเต็มของภาควิชาที่ส่วนหัว + โลโก้จริง ---------- */
:root { --serif: "Libre Baskerville", Georgia, "Times New Roman", serif; }
.brand { gap: 14px; }
.brand-logo { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; box-shadow: 0 3px 10px rgba(14, 39, 71, .22); }
.brand-text { gap: 0; }
.brand-text strong { font-size: 1.4375rem; font-weight: 600; letter-spacing: 0; line-height: 1.2; color: var(--navy); }
html:lang(en) .brand-text strong { font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; }
.brand-text small { margin-top: 6px; padding-top: 6px; border-top: 1px solid #c4cad6; font-family: var(--serif); font-size: .6875rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.fb-mark { position: relative; display: inline-block; width: 52px; height: 52px; flex: none; }
.fb-mark svg, .fb-mark img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fb-mark img { border-radius: 50%; object-fit: cover; background: #fff; }
.info-text { font-size: 1.0625rem; line-height: 1.9; color: #2b3446; }
@media (min-width: 901px) { .video-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.25fr); } }
.brandbar-in .brand { min-width: 0; flex: 1 1 auto; }
.brand-text { min-width: 0; }
.actions { flex: none; }
@media (max-width: 640px) {
  .actions { gap: 4px; }
  .brand { gap: 10px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-text strong { font-size: 1.125rem; }
  html:lang(en) .brand-text strong { font-size: .6875rem; letter-spacing: .01em; line-height: 1.25; }
}

/* ---------- ชื่อมหาวิทยาลัยที่ส่วนหัว (โหมดไทย = ภาษาไทย) + ปุ่มภาษาในเมนูมือถือ ---------- */
html:lang(th) .brand-text small { font-family: var(--font); font-size: .875rem; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--navy-2); }
.nav-lang { display: none; }
@media (max-width: 1120px) {
  .actions .lang { display: none; }
  .nav-lang { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 6px; color: #fff; font-size: .9375rem; font-weight: 500; }
  .nav-lang .lang { border-color: rgba(255, 255, 255, .55); }
  .nav-lang .lang button { color: #fff; }
  .nav-lang .lang button[aria-pressed="true"] { background: #fff; color: var(--navy); }
}
@media (max-width: 640px) {
  .brand-text small { display: block; margin-top: 4px; padding-top: 4px; font-size: .625rem; line-height: 1.35; }
  html:lang(th) .brand-text small { font-size: .75rem; }
  .brand-text strong { font-size: .9375rem; }
  html:lang(en) .brand-text strong { font-size: .6875rem; }
}


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

/* ---------- ธีม Standard: หัวข้อของแต่ละส่วนจัดกึ่งกลาง (ผู้ใช้สั่ง) — ส่วนสองคอลัมน์ (ข้อมูลภาควิชา/บริการวิชาการ/ติดต่อ) คงชิดซ้ายตามเดิม ---------- */
.sec-head, .sec-head.stack { display: block; text-align: center; }
.sec-head h2::after { margin-left: auto; margin-right: auto; }
.sec-head .sample-chip { display: inline-block; margin-top: 10px; }
.sec-sub, .sub { margin-left: auto; margin-right: auto; text-align: center; }
.tabs { justify-content: center; }
.filters, .chips { justify-content: center; }
.count { text-align: center; }
.mini-h { justify-content: center; }
.mini-h::before { content: ""; flex: 1; height: 1px; background: #cfd5e0; }
.area-list, .link-row { justify-content: center; }
.news-more, .doc-group .mini-h { justify-content: center; }
