/* Shared theme for every page: tokens, base type, header, footer, page hero, breadcrumb, site search.
   2569-11 redesign: navy ink + one saffron accent, IBM Plex Sans Thai (display) / Looped (text). */
:root{
  --navy:#102b55;--navy-deep:#0b2042;--blue:#235b9d;--sky:#eaf4ff;
  --gold:#d39a36;--gold-soft:#f6ead4;--gold-deep:#8f5f17;
  --red:#bb2e34;--green:#367b69;--plum:#8a3949;
  --ink:#1b2233;--muted:#535c6e;--paper:#fffdf9;--bg:#f6f7f9;--line:#dce3ec;
  --radius:18px;--shadow:0 18px 50px rgba(20,27,45,.12);--shadow-sm:0 6px 18px rgba(20,27,45,.08);
  --btn:#1f5fa8;--btn-hover:#16477f;--btn-shadow:0 8px 18px rgba(31,95,168,.25);
  /* 2569-11 */
  --ink-navy:#141b2d;--ink-soft:#3b4356;--hairline:#e2e5eb;--wash:#f4f5f8;
  --saffron:#d9741a;--saffron-hover:#bf6211;--saffron-tint:#fbe9d8;--saffron-text:#a8520c;
  --font-display:"IBM Plex Sans Thai","Sarabun","Noto Sans Thai",Tahoma,sans-serif;
  --font-text:"IBM Plex Sans Thai Looped","IBM Plex Sans Thai","Sarabun","Noto Sans Thai",Tahoma,sans-serif;
  --gutter:clamp(16px,2.6vw,40px);
  --header-h:84px;
  /* header scale (the home page overrides these) */
  --hdr-logo:56px;--hdr-name:19px;--hdr-sub:14px;--hdr-nav:16.5px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
/* Aa: enlarge the whole page (all text and controls) for readers who need larger type */
html.ts-1{zoom:1.12}
html.ts-2{zoom:1.25}
body{margin:0;color:var(--ink);background:var(--bg);font-family:var(--font-text);font-size:17px;line-height:1.7}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1,h2,h3{font-family:var(--font-display);line-height:1.25}
::selection{background:var(--saffron-tint);color:var(--ink-navy)}
:focus-visible{outline:3px solid var(--saffron);outline-offset:3px;border-radius:8px}
.shell{width:min(1180px,calc(100% - 40px));margin-inline:auto}
.nw{white-space:nowrap}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;left:16px;top:-80px;z-index:9999;padding:10px 16px;background:#fff;color:var(--ink-navy);border-radius:10px;font-weight:700}
.skip-link:focus{top:16px}

/* Header */
.site-header{position:sticky;top:0;z-index:200;background:rgba(255,255,255,.97);border-bottom:1px solid var(--hairline);backdrop-filter:saturate(1.4) blur(14px);color:var(--ink-navy)}
.header-inner{position:relative;width:min(1456px,calc(100% - 2 * var(--gutter)));min-height:var(--header-h);margin:auto;display:flex;align-items:center;gap:clamp(12px,1.5vw,26px)}
.brand{display:flex;align-items:center;gap:clamp(10px,1vw,16px);margin-right:auto;min-width:0}
.brand img{width:var(--hdr-logo);height:var(--hdr-logo);object-fit:contain;flex:none}
.brand span{display:flex;flex-direction:column;line-height:1.3;min-width:0;padding-right:clamp(12px,1.6vw,30px);border-right:1px solid currentColor;border-right-color:color-mix(in srgb,currentColor 22%,transparent)}
.brand strong{font-family:var(--font-display);font-size:var(--hdr-name);font-weight:600;color:inherit;white-space:nowrap}
.brand small{font-size:var(--hdr-sub);font-weight:400;opacity:.78;white-space:nowrap}
.main-nav{display:flex;align-items:center;gap:clamp(4px,1.3vw,30px)}
.main-nav a,.main-nav button{position:relative;padding:8px 2px;font-family:var(--font-display);font-size:var(--hdr-nav);font-weight:500;color:inherit;white-space:nowrap}
.main-nav a:after{content:"";position:absolute;left:2px;right:2px;bottom:0;height:2px;border-radius:2px;background:var(--saffron);transform:scaleX(0);transform-origin:left;transition:transform .25s cubic-bezier(.2,.7,.2,1)}
.main-nav a:hover:after,.main-nav a[aria-current="page"]:after{transform:scaleX(1)}
.main-nav .nav-extra{display:none}
.header-tools{display:flex;align-items:center;gap:6px;padding-left:clamp(10px,1.2vw,22px);border-left:1px solid color-mix(in srgb,currentColor 22%,transparent)}
.header-icon{display:grid;place-items:center;width:42px;height:42px;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;font:600 19px/1 var(--font-display);transition:background .2s}
.header-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.header-icon:hover{background:color-mix(in srgb,currentColor 10%,transparent)}
.header-aa[data-level="1"],.header-aa[data-level="2"]{background:var(--saffron);color:#fff}
.header-aa[data-level="2"]{box-shadow:0 0 0 3px color-mix(in srgb,var(--saffron) 35%,transparent)}
/* Staff sign-in: an outline pill beside the saffron student button, so staff can find it at a glance */
.header-staff{display:inline-flex;align-items:center;margin-left:6px;min-height:42px;padding:6px 16px;border:1.5px solid color-mix(in srgb,currentColor 60%,transparent);border-radius:999px;font-family:var(--font-display);font-size:16px;font-weight:600;line-height:1;white-space:nowrap;transition:background .2s,border-color .2s}
.header-staff:hover{border-color:currentColor;background:color-mix(in srgb,currentColor 12%,transparent)}
.header-staff .fa{display:none}
/* 18.7px bold = large text: white on saffron passes 3:1 */
.header-login{display:inline-flex;align-items:center;min-height:46px;padding:8px 16px;border-radius:999px;background:var(--saffron);color:#fff;font-family:var(--font-display);font-size:18.7px;font-weight:700;white-space:nowrap;box-shadow:0 6px 16px rgba(10,16,32,.22);transition:background .2s,transform .2s}
.header-login:hover{background:var(--saffron-hover);transform:translateY(-1px)}
.header-login .fa{display:none}
.header-search{display:none}
.nav-toggle{display:none;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;flex:none}
.nav-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.nav-toggle .fa{font-size:20px}

/* Shared building blocks (inner pages) */
.eyebrow{margin:0 0 8px;color:#ffd383;font-size:14px;font-weight:700}
.eyebrow.dark{color:var(--gold-deep)}
.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:12px 22px;border-radius:12px;font-size:15px;font-weight:800;transition:transform .2s,background .2s}
.button:hover{transform:translateY(-1px)}
.button.primary{background:var(--btn);color:#fff;box-shadow:var(--btn-shadow)}
.button.primary:hover{background:var(--btn-hover)}
.page-hero .button.primary,.a-hero .button.primary{background:#fff;color:var(--navy);box-shadow:0 10px 24px rgba(0,0,0,.18)}
.page-hero .button.primary:hover,.a-hero .button.primary:hover{background:#e8f0fb}
.button.ghost{border:1px solid rgba(255,255,255,.6);color:#fff;background:rgba(255,255,255,.08)}
.button.ghost:hover{background:rgba(255,255,255,.16)}
.section{padding-block:80px}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:28px}
.section-heading h2{margin:0;color:var(--navy);font-size:clamp(28px,3.6vw,40px)}
.section-heading>a{font-size:15px;color:var(--blue);font-weight:800;white-space:nowrap}
.section-heading>a:hover{text-decoration:underline}
.section-intro{max-width:440px;margin:0;color:var(--muted);font-size:15px}

/* Inner-page hero + breadcrumb */
.page-hero{position:relative;overflow:hidden;background:linear-gradient(120deg,var(--navy-deep),var(--navy) 55%,#1b4579);color:#fff}
.page-hero:after{content:"";position:absolute;right:-120px;top:-160px;width:460px;height:460px;border-radius:50%;border:70px solid rgba(255,211,131,.07)}
.page-hero .shell{position:relative;z-index:1;padding-block:34px 48px}
.page-hero h1{max-width:820px;margin:6px 0 10px;font-size:clamp(30px,4.4vw,48px)}
.page-hero p.lead{max-width:680px;margin:0;color:#d6e0ee;font-size:17px}
.breadcrumb{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 22px;padding:0;list-style:none;font-size:14px;color:#a9bad3}
.breadcrumb li+li:before{content:"›";margin-right:6px;color:#7f93b3}
.breadcrumb a{color:#dbe5f3}
.breadcrumb a:hover{color:#fff;text-decoration:underline}

/* Footer */
.site-footer{padding:64px 0 40px;background:var(--ink-navy);color:#c3cad6;font-size:16px}
.footer-grid{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:40px}
.footer-brand{display:flex;gap:18px;align-items:flex-start}
.footer-brand img{width:64px;height:64px;flex:none}
.footer-brand strong{display:block;color:#fff;font-family:var(--font-display);font-size:19px;font-weight:600;margin-bottom:6px}
.footer-brand p{margin:0}
.site-footer h2{margin:0 0 14px;color:#fff;font-size:17px;font-weight:600}
.footer-links{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.footer-links a{color:#dfe4ec}
.footer-links a:hover{color:#f6b27a;text-decoration:underline;text-underline-offset:4px}
.footer-links .fa{width:18px;color:#f6b27a}
.footer-bottom{margin-top:44px;padding-top:22px;border-top:1px solid rgba(255,255,255,.12);font-size:14px;color:#98a2b3}

/* Site search (site.js) */
.site-search{width:min(640px,calc(100% - 32px));max-height:min(640px,calc(100dvh - 64px));margin:clamp(16px,10vh,96px) auto auto;padding:0;border:0;border-radius:22px;background:#fff;color:var(--ink);box-shadow:0 30px 80px rgba(10,16,32,.35);overflow:auto}
.site-search::backdrop{background:rgba(14,19,33,.55);backdrop-filter:blur(3px)}
.ss-bar{position:sticky;top:0;display:flex;align-items:center;gap:12px;padding:14px 14px 14px 20px;border-bottom:1px solid var(--hairline);background:#fff}
.ss-bar>svg,.ss-close svg{width:22px;height:22px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ss-bar>svg{color:var(--muted)}
.ss-bar input{flex:1;min-width:0;min-height:48px;border:0;background:none;color:var(--ink-navy);font:500 19px/1.4 var(--font-display);outline:none}
.ss-bar input::placeholder{color:#7b8394}
.ss-close{display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:var(--wash);color:var(--ink-navy);cursor:pointer}
.ss-close:hover{background:#e8eaf0}
.ss-body{padding:16px 20px 22px}
.ss-title{margin:0 0 6px;color:var(--muted);font-family:var(--font-text);font-size:15px;font-weight:500}
.ss-results,.ss-more ul{display:grid;margin:0;padding:0;list-style:none}
.ss-results a,.ss-more a{display:flex;align-items:center;min-height:48px;padding:10px 12px;border-radius:12px;color:var(--ink-navy);font-family:var(--font-display);font-size:18px;font-weight:500}
.ss-results a:hover,.ss-results a:focus-visible,.ss-more a:hover,.ss-more a:focus-visible{background:var(--wash);color:var(--saffron-text)}
.ss-more{margin-top:12px;padding-top:12px;border-top:1px solid var(--hairline)}
.ss-more p{margin:0 0 4px;color:var(--muted);font-size:15px}
.ss-more a{font-size:17px;color:var(--ink-soft)}

/* Header: one row needs ~1,100px; tighten above that, hamburger menu below it */
@media(max-width:1500px){
  .main-nav{gap:clamp(4px,1vw,18px)}
  .brand strong{font-size:16px}
  .brand small{font-size:12px}
}
@media(max-width:1280px){
  .nav-toggle{display:grid;order:3}
  .header-login{order:2}
  .header-inner{gap:10px}
  /* search and Aa move into the menu; the staff button stays in the bar until phone width */
  .header-tools{padding-left:0;border-left:0}
  .header-tools .header-icon{display:none}
  .header-staff{margin-left:0}
  .brand span{border-right:0;padding-right:0}
  .main-nav{display:none;position:absolute;top:100%;left:calc(-1 * var(--gutter));right:calc(-1 * var(--gutter));padding:8px var(--gutter) 18px;background:#fff;color:var(--ink-navy);border-bottom:1px solid var(--hairline);box-shadow:0 18px 30px rgba(16,27,45,.14)}
  .main-nav.open{display:grid}
  .main-nav a,.main-nav button{padding:14px 4px;border-bottom:1px solid var(--hairline);font-size:17px;text-align:left}
  .main-nav a:after{display:none}
  .main-nav a[aria-current="page"]{color:var(--saffron-text)}
  .main-nav>:last-child{border-bottom:0}
  .main-nav .nav-extra{display:block}
  .main-nav button.nav-extra{border:0;border-bottom:1px solid var(--hairline);background:none;cursor:pointer;width:100%}
  .main-nav a.nav-extra[href*="staff-login"]{display:none}
}
@media(max-width:980px){
  .footer-grid{grid-template-columns:1fr 1fr}
  .footer-grid>:first-child{grid-column:1/-1}
}
/* Below 760px the bar has no room for the staff button: it becomes the last, navy item of the menu */
@media(max-width:760px){
  .header-tools{display:none}
  .main-nav a.nav-extra[href*="staff-login"]{order:99;display:flex;align-items:center;justify-content:center;margin-top:16px;padding:14px 18px;border:0;border-radius:12px;background:var(--ink-navy);color:#fff;font-weight:600;text-align:center}
  .main-nav a.nav-extra[href*="staff-login"]:hover{background:#26304a}
}
@media(max-width:600px){
  :root{--header-h:66px;--hdr-logo:42px;--hdr-name:16px}
  .shell{width:calc(100% - 32px)}
  .header-login{min-height:40px;padding:6px 13px;font-size:16px}
  .brand strong{font-size:12.5px;line-height:1.25;white-space:nowrap}
  .brand small{font-size:10.5px;line-height:1.25;white-space:normal}
  .brand span{min-width:0}
  .header-login-more{display:none}
  .section{padding-block:56px}
  .section-heading{flex-direction:column;align-items:flex-start;gap:8px;margin-bottom:20px}
  .section-intro{font-size:15px}
  .page-hero .shell{padding-block:24px 36px}
  .page-hero p.lead{font-size:16px}
  .footer-grid{gap:28px 20px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
/* Small phones (360px): the name, the student button and the menu share one row */
@media(max-width:380px){
  :root{--hdr-logo:36px}
  .header-inner{gap:8px}
  .brand{gap:8px}
  .brand strong{font-size:11.5px}
  .brand small{font-size:10px}
  .header-login{padding:6px 10px;font-size:15px}
}
@media(max-width:340px){
  .brand strong{font-size:11px;white-space:normal}
  .brand small{font-size:9.5px}
  .header-login{padding:5px 8px;font-size:14px}
}
