/* CTC Department theme */
:root {
	--brand: #1e3a8a;
	--brand-dark: color-mix(in srgb, var(--brand) 78%, #000);
	--brand-soft: color-mix(in srgb, var(--brand) 9%, #fff);
	--ink: #0f172a;
	--muted: #5b6475;
	--line: #e3e7ee;
	--bg: #ffffff;
	--bg-alt: #f5f7fa;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 6px 18px rgba(15, 23, 42, .06);
	--head: "Prompt", system-ui, sans-serif;
	--body: "Sarabun", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 17px/1.7 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.wrap--narrow { width: min(820px, 100% - 32px); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip-link { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }
.skip-link:focus { left: 8px; }
.ico { flex: none; vertical-align: -3px; }

/* top bar + header */
.topbar { background: var(--brand-dark); color: #fff; font-size: 14px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar__in { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; flex-wrap: wrap; }
.topbar__contact { display: flex; gap: 18px; flex-wrap: wrap; opacity: .92; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand__mark { width: 48px; height: 48px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font: 700 15px var(--head); letter-spacing: .5px; flex: none; }
.brand__logo { width: 52px; height: 52px; object-fit: contain; flex: none; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font: 600 18px/1.3 var(--head); }
.brand__sub { font-size: 13px; color: var(--muted); }
.primary-nav .menu { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.primary-nav a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font: 500 15px var(--head); }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: var(--brand-soft); color: var(--brand); }
.primary-nav .sub-menu { display: none; position: absolute; background: #fff; list-style: none; padding: 6px; margin: 0; border-radius: 10px; box-shadow: var(--shadow); min-width: 220px; }
.primary-nav li { position: relative; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--ink); }

/* hero */
.hero { color: #fff; background:
	radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--brand) 40%, #fff) 0%, transparent 60%),
	linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.hero__in { padding: 72px 0 64px; max-width: 820px; margin-left: max(16px, (100% - 1200px) / 2); }
.hero h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 700; margin-bottom: .3em; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 14px; opacity: .85; margin: 0 0 8px; }
.lead { font-size: 19px; opacity: .92; margin: 0 0 20px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.tags { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tags--hero { margin: 0 0 16px; }
.tag { display: inline-block; font: 500 13px/1 var(--head); padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--brand)) 12%, #fff); color: var(--c, var(--brand)); text-decoration: none; }
.hero .tag, .tag--light { background: rgba(255, 255, 255, .18); color: #fff; }
.page-head .tag--light { background: var(--brand-soft); color: var(--brand); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; background: var(--brand); color: #fff; text-decoration: none; font: 500 16px var(--head); border: 2px solid var(--brand); transition: transform .15s, background .15s; }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); }
.btn--light { background: #fff; color: var(--brand-dark); border-color: #fff; }
.btn--light:hover { background: #f1f5f9; border-color: #f1f5f9; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn--ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn--outline { background: #fff; color: var(--brand); }
.btn--outline:hover { background: var(--brand-soft); }

/* sections */
.section { padding: 56px 0; }
.section--alt { background: var(--bg-alt); }
.section-title { font-size: clamp(22px, 3vw, 30px); position: relative; padding-left: 16px; }
.section-title::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 5px; border-radius: 3px; background: var(--brand); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.more { font: 500 15px var(--head); text-decoration: none; white-space: nowrap; }
.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; background: #fff; }
.prose > * + * { margin-top: 1em; }
.prose img { border-radius: 10px; }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }

/* portal directory */
.dep-group + .dep-group { margin-top: 40px; }
.dep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin-top: 16px; }
.dep-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.dep-card:hover { border-color: var(--c); box-shadow: var(--shadow); transform: translateY(-2px); }
.dep-card__icon { width: 52px; height: 52px; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; font: 600 22px var(--head); flex: none; overflow: hidden; }
.dep-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.dep-card__body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dep-card__body strong { font: 500 16px/1.35 var(--head); }
.dep-card .tag { --c: inherit; font-size: 12px; padding: 4px 8px; }
.dep-card > .ico { color: var(--c); }

/* cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 16px; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__img { aspect-ratio: 16 / 10; background: var(--brand-soft); display: block; overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, color-mix(in srgb, var(--c, var(--brand)) 25%, #fff), color-mix(in srgb, var(--c, var(--brand)) 8%, #fff)); }
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.card__body h3 { font-size: 17px; margin: 0; }
.card__body h3 a { color: var(--ink); text-decoration: none; }
.card__body h3 a:hover { color: var(--brand); }
.card__body time, .meta { color: var(--muted); font-size: 14px; }
.card__body .tag { align-self: flex-start; }

/* people */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-top: 16px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; text-decoration: none; color: var(--ink); padding: 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); }
.person:hover { border-color: var(--brand); }
.person__img { width: 140px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; margin-bottom: 8px; background: var(--brand-soft); }
.person__img img { width: 100%; height: 100%; object-fit: cover; }
.person__ph { display: grid; place-items: center; width: 100%; height: 100%; font: 600 42px var(--head); color: var(--brand); }
.person__ph--lg { aspect-ratio: 4 / 5; border-radius: 12px; background: var(--brand-soft); }
.person strong { font: 500 16px var(--head); }
.person__pos { color: var(--brand); font-size: 14px; }
.person__rank { color: var(--muted); font-size: 14px; }

/* courses */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 16px; }
.course { background: #fff; border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); border-top: 4px solid var(--brand); display: flex; flex-direction: column; gap: 8px; }
.course h3 { margin: 0; font-size: 19px; }
.course h3 a { color: var(--ink); text-decoration: none; }
.course p { margin: 0; color: var(--muted); }
.course__level { align-self: flex-start; font: 600 13px var(--head); color: #fff; background: var(--brand); padding: 4px 10px; border-radius: 6px; }
.course__major { color: var(--brand) !important; font-weight: 500; }
.course__meta { display: flex; gap: 20px; margin: 4px 0; font-size: 15px; }
.course__meta dt { color: var(--muted); font-size: 13px; }
.course__meta dd { margin: 0; font-weight: 500; }
.course__pdf { margin-top: auto; font: 500 15px var(--head); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }

/* admission + contact */
.admission { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; background: var(--brand-soft); border-radius: 20px; padding: 36px; }
.admission__cta { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { padding-left: 30px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; margin-top: 3px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.gallery-grid img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.contact__grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.contact__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact__list .ico { color: var(--brand); margin-right: 6px; }
.contact__social { display: flex; gap: 10px; flex-wrap: wrap; }

/* page head + single */
.page-head { background: linear-gradient(135deg, var(--brand-dark), var(--brand)); color: #fff; padding: 40px 0 36px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); margin: 0; }
.page-head .meta, .page-head .meta a { color: rgba(255, 255, 255, .85); margin: 8px 0 0; }
.single__img { margin: 0 0 24px; }
.single__img img { border-radius: var(--radius); width: 100%; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.profile { display: grid; grid-template-columns: 220px 1fr; gap: 32px; }
.profile__img img { border-radius: 12px; }
.profile__meta { display: grid; gap: 10px; margin: 0 0 20px; }
.profile__meta div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.profile__meta dt { color: var(--muted); }
.profile__meta dd { margin: 0; }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.search-form { display: flex; gap: 8px; margin-top: 16px; }
.search-field { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.search-submit { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; cursor: pointer; }

/* footer */
.site-footer { background: #0b1324; color: #cbd5e1; padding-top: 48px; font-size: 15px; }
.site-footer h3 { color: #fff; font-size: 17px; }
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .menu { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 14px; flex-wrap: wrap; }

/* responsive */
@media (max-width: 960px) {
	.nav-toggle { display: block; }
	.primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
	.primary-nav.is-open { display: block; }
	.primary-nav .menu { flex-direction: column; }
	.primary-nav .sub-menu { display: block; position: static; box-shadow: none; padding-left: 16px; }
	.admission, .contact__grid, .footer__grid { grid-template-columns: 1fr; }
	.gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	body { font-size: 16px; }
	.topbar__college { display: none; }
	.brand__name { font-size: 16px; }
	.brand__sub { display: none; }
	.hero__in { padding: 48px 0 44px; }
	.section { padding: 40px 0; }
	.card-grid, .course-grid { grid-template-columns: 1fr; }
	.people-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.person__img { width: 100%; }
	.admission { padding: 24px; }
	.profile { grid-template-columns: 1fr; }
	.profile__meta div { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
