/* ==========================================================
   International Relations · BCN Chakriraj
   Palette: warm cream + deep ink navy + terracotta + gold
   ========================================================== */
:root {
  --cream: #fbf6ef;
  --sand: #f4eadd;
  --sand-2: #ecdcc8;
  --peach: #e9c9a8;
  --ink: #1b2a41;
  --ink-2: #2c3e5c;
  --text: #2a2723;
  --muted: #6f655a;
  --line: #e4d6c3;
  --terra: #b85c38;
  --terra-dark: #9a4627;
  --gold: #d4a24c;
  --white: #fff;

  --cn: #c8341f;
  --id: #b0213a;
  --th: #2d4a7a;

  --radius: 18px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(27, 42, 65, .06), 0 2px 8px rgba(27, 42, 65, .05);
  --shadow: 0 2px 6px rgba(27, 42, 65, .06), 0 18px 40px -18px rgba(27, 42, 65, .28);
  --shadow-lg: 0 30px 60px -24px rgba(27, 42, 65, .38);

  --font-display: "Fraunces", "Noto Serif Thai", Georgia, serif;
  --font-thai-display: "Noto Serif Thai", "Fraunces", serif;
  --font-body: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; color: var(--ink); }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
figure { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[lang="th"] { line-height: 1.75; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  padding: .85em 1.4em; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none; line-height: 1.2;
  border: 1.5px solid transparent;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease, color .2s ease, border-color .2s ease;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 10px 24px -12px rgba(27,42,65,.7); }
.btn-primary:hover { background: var(--terra); transform: translateY(-2px); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-primary svg { transition: transform .2s ease; }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: .6em 1.1em; font-size: .88rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(251, 246, 239, .72);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, box-shadow .3s ease, background-color .3s ease;
}
.site-header.is-scrolled { background: rgba(251, 246, 239, .92); border-color: var(--line); box-shadow: 0 6px 24px -18px rgba(27,42,65,.5); }
.nav-wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { width: 44px; height: auto; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text { overflow: hidden; }
:lang(en) .brand-name { font-weight: 600; letter-spacing: -.01em; }
.brand-sub { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:lang(en) .brand-sub { letter-spacing: .06em; text-transform: uppercase; font-size: .7rem; }

/* language switch */
.nav-tools { display: flex; align-items: center; gap: 6px; order: 3; flex: none; }
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(27,42,65,.07); }
.lang-switch a {
  min-width: 42px; padding: 5px 10px; border-radius: 999px; text-align: center; text-decoration: none;
  font-size: .8rem; font-weight: 600; color: var(--muted); line-height: 1.4; transition: background-color .2s ease, color .2s ease;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }


.site-nav { display: flex; align-items: center; gap: 2px; order: 2; margin-left: auto; }
.site-nav a {
  position: relative; text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--ink-2);
  padding: 8px 12px; border-radius: 999px; transition: color .2s ease, background-color .2s ease;
}
.site-nav a:hover { color: var(--terra); }
.site-nav a.is-active { color: var(--terra); }
.site-nav a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px;
  border-radius: 50%; background: var(--terra);
}
.site-nav .nav-cta { background: var(--ink); color: #fff; margin-left: 8px; padding: 8px 18px; }
.site-nav .nav-cta:hover { background: var(--terra); color: #fff; }
.site-nav .nav-cta.is-active { color: #fff; background: var(--terra); }
.site-nav .nav-cta.is-active::after { display: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px;
  position: relative; flex: none;
}
.nav-toggle span { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .nav-wrap { gap: 12px; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 12px var(--gutter) 24px;
    background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -24px rgba(27,42,65,.4);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav a { padding: 12px 14px; font-size: 1rem; border-radius: 12px; }
  .site-nav a:hover { background: var(--sand); }
  .site-nav a.is-active::after { left: 4px; top: 50%; bottom: auto; margin: -2.5px 0 0; }
  .site-nav .nav-cta { margin: 8px 0 0; text-align: center; }
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em; flex-wrap: wrap;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--terra);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 28px; height: 1.5px; background: currentColor; }
.eyebrow [lang="th"] { letter-spacing: .02em; text-transform: none; font-size: .95rem; font-weight: 500; color: var(--muted); }
.eyebrow.light { color: var(--gold); }
.eyebrow.light [lang="th"] { color: rgba(255,255,255,.6); }

h2 { font-family: var(--font-display); font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 500; letter-spacing: -.015em; font-variation-settings: "opsz" 100; }
h2 em, h1 em { font-style: italic; color: var(--terra); font-weight: 500; }

.section { padding-block: clamp(72px, 10vw, 128px); position: relative; }
.section-sand { background: var(--sand); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head .sub { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }
.section-head.split { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head.split > div:first-child { max-width: 680px; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-top: clamp(32px, 6vw, 72px); padding-bottom: 56px; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 85% 20%, rgba(233, 201, 168, .55), transparent 70%),
    radial-gradient(40% 40% at 5% 90%, rgba(212, 162, 76, .18), transparent 70%);
}
.hero-arches { position: absolute; z-index: -1; right: -160px; bottom: -60px; width: 640px; color: rgba(184, 92, 56, .12); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; }

.kicker {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 16px 7px 12px; border-radius: 999px; background: rgba(255,255,255,.7);
  border: 1px solid var(--line); font-size: .88rem; font-weight: 500; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.kicker [lang="th"] { font-family: var(--font-thai-display); font-weight: 700; color: var(--ink); }
.kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terra); box-shadow: 0 0 0 4px rgba(184,92,56,.18); }

h1 {
  margin-top: 22px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4.6rem); letter-spacing: -.025em; line-height: 1.04;
  font-variation-settings: "opsz" 144;
}
.lead { margin-top: 22px; font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: #4a443d; max-width: 560px; }
.lead-sub { margin-top: 12px; font-size: .92rem; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

.hero-art { position: relative; aspect-ratio: 1 / 1.02; max-width: 560px; justify-self: end; width: 100%; }
.arch { position: absolute; overflow: hidden; box-shadow: var(--shadow-lg); background: var(--sand-2); }
.arch img { width: 100%; height: 100%; object-fit: cover; }
.arch-a { right: 0; top: 0; width: 60%; height: 84%; border-radius: 999px 999px 26px 26px; border: 6px solid #fff; }
.arch-b { left: 2%; bottom: 0; width: 48%; height: 58%; border-radius: 999px 999px 26px 26px; border: 6px solid #fff; }
.arch-b img { object-position: 40% center; }
.arch-c { left: 8%; top: 4%; width: 32%; aspect-ratio: 1; border-radius: 50%; border: 6px solid #fff; }
.float-card {
  position: absolute; right: 4%; bottom: 4%;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 12px 14px; background: #fff; border-radius: 18px; box-shadow: var(--shadow);
  font-size: .85rem; line-height: 1.3;
}
.float-card strong { display: block; color: var(--ink); font-weight: 600; }
.float-card small { color: var(--muted); }
.flags { display: flex; }
.flags .flag { margin-left: -6px; border: 2px solid #fff; }
.flags .flag:first-child { margin-left: 0; }
.flag { width: 26px; height: 18px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

.stats {
  margin: clamp(48px, 7vw, 80px) 0 0; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr);
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden;
}
.stat { padding: 26px 28px; position: relative; display: flex; flex-direction: column-reverse; gap: 4px; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 1px; background: var(--line); }
.stat dd { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 3.6vw, 2.8rem); font-weight: 500; color: var(--ink); line-height: 1; font-variation-settings: "opsz" 144; }
.stat dt { font-size: .86rem; color: var(--muted); line-height: 1.4; }
.stat:first-child dd { color: var(--terra); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { justify-self: center; max-width: 480px; margin-top: 8px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3)::before { display: none; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .stat { padding: 20px 18px; }
  .float-card { right: 0; bottom: 0; padding: 10px 12px; font-size: .78rem; }
  .arch-a, .arch-b, .arch-c { border-width: 4px; }
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.vision {
  margin: 36px 0 0; padding: 30px 32px 28px; position: relative;
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.vision::after {
  content: ""; position: absolute; right: -40px; bottom: -70px; width: 200px; height: 200px;
  border-radius: 50%; border: 28px solid rgba(212,162,76,.18);
}
.vision .q-mark { position: absolute; top: -18px; left: 22px; font-family: var(--font-display); font-size: 7rem; color: var(--gold); opacity: .55; line-height: 1; }
.vision p { position: relative; font-family: var(--font-display); font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-style: italic; line-height: 1.25; padding-top: 18px; }
.vision cite { display: block; margin-top: 12px; font-style: normal; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.about-body p { color: #463f38; font-size: 1.04rem; }
.about-body p + p { margin-top: 18px; }
.about-body p:first-child::first-letter {
  font-family: var(--font-display); float: left; font-size: 3.6em; line-height: .9; padding: 6px 10px 0 0; color: var(--terra);
}
.about-body strong { color: var(--ink); }

.missions { margin-top: clamp(48px, 7vw, 80px); display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.mission {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mission:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.m-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sand); color: var(--terra); margin-bottom: 18px; }
.m-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mission { position: relative; }
.m-num { position: absolute; top: 22px; right: 24px; font-family: var(--font-display); font-size: 1.6rem; color: var(--sand-2); font-weight: 500; line-height: 1; }
.mission h3 { font-size: 1.08rem; font-weight: 600; font-family: var(--font-body); }
.mission p { margin-top: 4px; color: var(--muted); font-size: .92rem; }

@media (max-width: 920px) {
  .about-grid { grid-template-columns: 1fr; }
  .missions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) { .missions { grid-template-columns: 1fr; } }

/* ---------- Frames (arches & ovals) ---------- */
.frame { overflow: hidden; background: var(--sand-2); position: relative; }
.frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.arch-frame { border-radius: 999px 999px 20px 20px; aspect-ratio: 207 / 227; }
.oval { border-radius: 50%; aspect-ratio: 192 / 284; }
.oval img { transform: scale(1.06); }

/* ---------- Leadership ---------- */
.org { display: flex; flex-direction: column; align-items: center; }
.leader { display: flex; flex-direction: column; align-items: center; text-align: center; }
.leader .frame { box-shadow: var(--shadow); border: 5px solid #fff; }
.leader-top .frame { width: clamp(170px, 20vw, 210px); }
.org-line { width: 1.5px; height: 40px; background: linear-gradient(var(--terra), transparent); margin-top: 18px; }
.leaders { margin-top: 8px; width: 100%; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: clamp(16px, 3vw, 36px); position: relative; padding-top: 34px; }
.leaders::before { content: ""; position: absolute; top: 0; left: 12.5%; right: 12.5%; height: 1.5px; background: var(--peach); }
.leaders .leader::before { content: ""; width: 1.5px; height: 34px; background: var(--peach); margin-top: -34px; }
.leaders .frame { width: 100%; max-width: 210px; }
.role-pill {
  display: inline-block; margin-top: 16px; padding: 8px 16px; border-radius: 18px;
  background: #fff; color: var(--ink); font-weight: 600; font-size: .86rem; line-height: 1.35;
  box-shadow: var(--shadow-sm); max-width: 250px;
}
.leader-top .role-pill { background: var(--ink); color: #fff; font-size: .95rem; padding: 8px 22px; }
.leader figcaption { display: flex; flex-direction: column; align-items: center; }
.leader-name { margin-top: 8px; font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); font-weight: 500; }
.leader:hover img { transform: scale(1.05); }
.leader-top:hover img { transform: scale(1.1); }

@media (max-width: 820px) {
  .leaders { grid-template-columns: repeat(2, 1fr); padding-top: 0; row-gap: 32px; }
  .leaders::before, .leaders .leader::before { display: none; }
  .org-line { height: 28px; }
}

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.person {
  background: #fff; border-radius: var(--radius-lg); padding: 20px 20px 26px; text-align: center;
  border: 1px solid var(--line); transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.person:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.person:hover img { transform: scale(1.04); }
.person .frame { aspect-ratio: 4 / 4.4; margin-bottom: 20px; }
.person .frame img { object-position: center 12%; }
.p-title { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--terra); font-weight: 600; }
.person h3 { margin-top: 4px; font-family: var(--font-display); font-weight: 500; font-size: 1.42rem; letter-spacing: -.01em; }
.p-role { margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.5; }

@media (max-width: 920px) { .team { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .team { grid-template-columns: 1fr; }
  .person { display: grid; grid-template-columns: 112px 1fr; gap: 0 16px; text-align: left; padding: 14px; align-items: center; }
  .person .frame { grid-row: span 3; margin: 0; aspect-ratio: 207 / 227; }
  .person h3 { font-size: 1.18rem; }
  .p-role { margin-top: 2px; font-size: .84rem; }
}

/* ---------- Collaborations / timeline ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--sand-2); background: #fff;
  font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: all .2s ease;
}
.chip .flag { width: 20px; height: 14px; border-radius: 3px; }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

.timeline { position: relative; }
.year-group { display: grid; grid-template-columns: 170px 1fr; gap: 0 clamp(20px, 3vw, 40px); }
.year-group[hidden] { display: none; }
.year { align-self: start; position: sticky; top: calc(var(--header-h) + 24px); padding-bottom: 24px; }
.year span { display: block; font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 400; color: var(--terra); line-height: 1; letter-spacing: -.02em; font-variation-settings: "opsz" 144; }
.year small { display: block; margin-top: 8px; color: var(--muted); font-family: var(--font-body); font-size: .85rem; font-weight: 500; }

.events { position: relative; padding-left: 40px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; }
.events::before { content: ""; position: absolute; left: 7px; top: 14px; bottom: 0; width: 2px; background: repeating-linear-gradient(var(--sand-2) 0 6px, transparent 6px 12px); }
.year-group:last-child .events { padding-bottom: 0; }

.event {
  position: relative; background: #fff; border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-sm); border: 1px solid rgba(228, 214, 195, .7);
}
.event[hidden] { display: none; }
.events > .event::before, .event-pair::before {
  content: ""; position: absolute; left: -40px; top: 30px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--cream); border: 3px solid var(--terra); box-shadow: 0 0 0 5px var(--sand);
}
.event-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.event-pair .event { display: flex; flex-direction: column; }
.event-pair .event h4 { min-height: 2.3em; }
.event-pair .mosaic { margin-top: auto; padding-top: 16px; }
.event-pair[hidden] { display: none; }
.event-pair .event::before { display: none; }

.event-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.date { font-size: .85rem; font-weight: 600; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.tag-cn { background: #fbe4df; color: var(--cn); }
.tag-id { background: #f8e1e5; color: var(--id); }
.tag-th { background: #e2e8f3; color: var(--th); }
.tag-moa { background: #f6ecd6; color: #8a6418; }
.tag-visit { background: #e5efe8; color: #2f6b46; }
.tag-online { background: #e6e4f3; color: #4c4590; }
.event h4 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.25rem, 2.2vw, 1.55rem); letter-spacing: -.01em; }
.event > p, .poster-body > p { margin-top: 10px; color: #4d463f; font-size: .98rem; }
.event-note { background: linear-gradient(135deg, #fff, #f7f3ff); }

/* mosaic gallery */
.mosaic { margin-top: 20px; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(84px, 11vw, 132px); gap: 8px; }
.mosaic.compact { grid-auto-rows: clamp(70px, 8vw, 100px); }
.ph { position: relative; display: block; overflow: hidden; border-radius: 12px; background: var(--sand-2); cursor: zoom-in; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1), filter .3s ease; }
.ph:hover img { transform: scale(1.06); }
.ph::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(transparent 55%, rgba(27,42,65,.35)); opacity: 0; transition: opacity .3s ease; }
.ph:hover::before { opacity: 1; }
.ph:nth-child(n+6) { display: none; }
.ph[data-more]::after {
  content: attr(data-more); position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  background: rgba(27, 42, 65, .58); color: #fff; font-family: var(--font-display); font-size: 1.8rem; font-weight: 500;
  backdrop-filter: blur(1px);
}
.m5 .ph:first-child, .m4 .ph:first-child, .m3 .ph:first-child { grid-column: span 2; grid-row: span 2; }
.m4 .ph:nth-child(2) { grid-column: span 2; }
.m3 .ph:nth-child(n+2) { grid-column: span 2; }
.m2 .ph { grid-column: span 2; grid-row: span 2; }
.m1 .ph { grid-column: 1 / -1; grid-row: span 2; }
.mosaic.wide { grid-auto-rows: auto; }
.mosaic.wide .ph { aspect-ratio: 616 / 198; grid-row: auto; }

.event-poster { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start; background: linear-gradient(135deg, #fff 55%, #eef6e8); }
.event-poster .mosaic { margin: 0; grid-auto-rows: auto; }
.mosaic.poster .ph { aspect-ratio: 1239 / 2000; grid-row: auto; box-shadow: var(--shadow); }
.facts { margin-top: 18px; display: grid; gap: 8px; }
.facts li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; font-size: .94rem; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.8); border: 1px solid var(--line); }
.facts span { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #3f7a3a; align-self: center; }

.filter-empty { text-align: center; color: var(--muted); padding: 40px 0; }

@media (max-width: 820px) {
  .year-group { grid-template-columns: 1fr; }
  .year { position: static; display: flex; align-items: baseline; gap: 12px; padding-bottom: 16px; }
  .year small { margin: 0; }
  .events { padding-left: 28px; }
  .events::before { left: 5px; }
  .events > .event::before, .event-pair::before { left: -29px; width: 14px; height: 14px; top: 28px; }
  .event-pair { grid-template-columns: 1fr; }
  .event-poster { grid-template-columns: 1fr; }
  .event-poster .mosaic { max-width: 260px; }
}
@media (max-width: 480px) {
  .mosaic { gap: 6px; }
  .ph { border-radius: 9px; }
  .facts li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Way forward ---------- */
.forward {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--ink); color: #e9e4dc; padding-block: clamp(72px, 10vw, 120px);
}
.forward::before {
  content: ""; position: absolute; z-index: -1; left: -120px; top: -160px; width: 520px; height: 520px;
  border-radius: 50%; background: radial-gradient(circle, rgba(212,162,76,.22), transparent 65%);
}
.forward::after {
  content: ""; position: absolute; z-index: -1; right: -60px; bottom: -220px; width: 420px; height: 520px;
  border-radius: 999px 999px 0 0; border: 2px solid rgba(255,255,255,.08);
  box-shadow: 0 0 0 40px rgba(255,255,255,.025), 0 0 0 80px rgba(255,255,255,.02);
}
.forward-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.forward h2 { color: #fff; }
.forward h2 em { color: var(--gold); }
.forward-text { font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.75; color: rgba(255,255,255,.82); }
.skills { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.skills li {
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.04); font-size: .9rem; color: #fff;
}
.skills li::before { content: "✦"; color: var(--gold); margin-right: 8px; font-size: .8em; }
@media (max-width: 820px) { .forward-grid { grid-template-columns: 1fr; } }

/* ---------- Partners ---------- */
.partners-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.map {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: linear-gradient(180deg, #f3f6f9, #eaf0f5); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: inset 0 0 0 1px rgba(27,42,65,.06);
}
.map > img, .map-overlay { width: 100%; height: auto; }
.map-overlay { position: absolute; inset: 18px; width: calc(100% - 36px); height: auto; overflow: visible; }
.map figcaption { margin-top: 10px; text-align: center; font-size: .82rem; color: var(--muted); letter-spacing: .04em; }
.arc { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 6 7; }
.arc-cn { stroke: var(--cn); }
.arc-id { stroke: var(--terra); }
.arc-th { stroke: var(--th); }
.map.is-visible .arc { animation: dash 1.6s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -26; } }
.pin { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.pin-home { fill: var(--gold); stroke: #fff; stroke-width: 3; }
.pulse { fill: var(--gold); opacity: .4; transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
.labels text {
  font-family: var(--font-body); font-size: 19px; font-weight: 600; fill: var(--ink);
  paint-order: stroke; stroke: rgba(255,255,255,.92); stroke-width: 5px; stroke-linejoin: round;
}
.labels .lbl-home { font-size: 21px; fill: var(--terra-dark); }
@media (prefers-reduced-motion: reduce) { .map.is-visible .arc, .pulse { animation: none; } }

.partner-lists { display: flex; flex-direction: column; gap: 32px; }
.country h3 { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; margin-bottom: 14px; }
.country h3 .flag { width: 30px; height: 20px; }
.partners { display: grid; gap: 12px; }
.partner {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center;
  padding: 14px 18px 14px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.partner:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: transparent; }
.logo { width: 64px; height: 64px; border-radius: 16px; background: var(--cream); display: grid; place-items: center; padding: 8px; }
.logo img { width: auto; height: auto; max-width: 48px; max-height: 48px; object-fit: contain; }
.logo.mono { background: var(--ink); color: var(--gold); font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: .04em; }
.p-info { min-width: 0; line-height: 1.35; }
.p-info strong { display: block; color: var(--ink); font-weight: 600; font-size: 1rem; }
.p-info small { display: block; margin-top: 3px; color: var(--muted); font-size: .84rem; }
.status { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: #e3f1e6; color: #2f6b46; white-space: nowrap; }
.status-past { background: var(--sand); color: var(--muted); }

@media (max-width: 920px) {
  .partners-grid { grid-template-columns: 1fr; }
  .map { position: relative; top: 0; max-width: 560px; margin-inline: auto; width: 100%; }
}
@media (max-width: 560px) {
  .labels text { font-size: 24px; }
  .labels .lbl-home { font-size: 26px; }
  .partner { grid-template-columns: 52px 1fr; padding: 12px; gap: 12px; }
  .logo { width: 52px; height: 52px; border-radius: 12px; padding: 6px; }
  .logo img { max-width: 40px; max-height: 40px; }
  .status { grid-column: 2; justify-self: start; }
}

/* ---------- Downloads ---------- */
.docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 920px; margin-inline: auto; }
.doc {
  display: flex; gap: 22px; align-items: flex-start; background: #fff; border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.doc:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.doc-icon { flex: none; width: 60px; height: 70px; border-radius: 14px; background: var(--sand); display: grid; place-items: center; color: var(--terra); }
.doc-icon svg { width: 34px; height: 40px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.doc h3 { font-family: var(--font-thai-display); font-size: 1.35rem; font-weight: 600; line-height: 1.4; }
.doc-body > p { color: var(--muted); font-size: .95rem; }
.doc-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn-word { background: #e8eef9; color: #1f4fa3; }
.btn-word:hover { background: #1f4fa3; color: #fff; }
.btn-pdf { background: #fbe6e2; color: #b3361f; }
.btn-pdf:hover { background: #b3361f; color: #fff; }
@media (max-width: 720px) { .docs { grid-template-columns: 1fr; } .doc { padding: 22px; gap: 16px; } }

/* ---------- Footer ---------- */
.site-footer { background: #142033; color: rgba(255,255,255,.72); padding-top: clamp(56px, 8vw, 88px); font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(32px, 5vw, 64px); }
.f-logos { display: flex; gap: 12px; margin-bottom: 20px; }
.f-logo { width: 68px; height: 68px; border-radius: 18px; background: #fff; display: grid; place-items: center; padding: 8px; }
.f-logo img { width: auto; height: auto; max-width: 52px; max-height: 52px; object-fit: contain; }
.f-name { font-family: var(--font-display); color: #fff; font-size: 1.2rem; font-weight: 600; line-height: 1.6; }
.f-en { margin-top: 10px; font-size: .88rem; max-width: 380px; }
.f-head { font-family: var(--font-body); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 16px; }
address { font-style: normal; line-height: 1.7; }
.f-addr-th { display: block; margin-top: 6px; font-size: .88rem; color: rgba(255,255,255,.55); }
.f-contact { margin-top: 18px; display: flex; flex-direction: column; }
.f-contact span { font-size: .82rem; color: rgba(255,255,255,.55); }
.f-contact a { color: #fff; font-weight: 600; text-decoration: none; }
.f-contact a:hover { color: var(--gold); }
.f-links { display: grid; gap: 8px; }
.f-links a { text-decoration: none; transition: color .2s ease; }
.f-links a:hover { color: var(--gold); }
.f-bottom { margin-top: clamp(40px, 6vw, 64px); padding-block: 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .85rem; }
.to-top { text-decoration: none; }
.to-top:hover { color: var(--gold); }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .f-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #0c121c; color: #fff;
  display: none; grid-template-rows: auto 1fr auto;
}
.lightbox[open] { display: grid; animation: lb-in .25s ease; }
.lightbox::backdrop { background: rgba(12, 18, 28, .6); }
@keyframes lb-in { from { opacity: 0; } }
.lb-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px clamp(14px, 3vw, 28px); }
.lb-caption { font-size: .95rem; color: rgba(255,255,255,.85); }
.lb-count { color: var(--gold); font-weight: 600; margin-left: 6px; white-space: nowrap; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 clamp(8px, 6vw, 88px); touch-action: pan-y; }
.lb-stage { overflow: hidden; }
.lb-img { max-width: 100%; max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.5); user-select: none; -webkit-user-drag: none; transition: opacity .2s ease; }
.lb-img.is-loading { opacity: .3; }
.lb-btn { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; transition: background-color .2s ease; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.lb-prev { left: clamp(8px, 2vw, 24px); }
.lb-next { right: clamp(8px, 2vw, 24px); }
.lb-thumbs { display: flex; gap: 8px; justify-content: center; padding: 14px; overflow-x: auto; scrollbar-width: thin; }
.lb-thumbs button { flex: none; width: 64px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; opacity: .5; background: #333; transition: opacity .2s ease, border-color .2s ease; }
.lb-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.lb-thumbs button:hover { opacity: .85; }
.lb-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--gold); }
@media (max-width: 600px) {
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; background: rgba(0,0,0,.45); }
  .lb-stage { padding-bottom: 64px; }
  .lb-img { max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); }
  .lb-thumbs button { width: 52px; height: 38px; }
}

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; }
}

/* ---------- Thai typography ---------- */
:lang(th) h1 { line-height: 1.32; letter-spacing: 0; font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
:lang(th) h2 { line-height: 1.35; letter-spacing: 0; }
:lang(th) h3, :lang(th) h4 { line-height: 1.45; letter-spacing: 0; }
:lang(th) .eyebrow { letter-spacing: .02em; font-size: .9rem; }
:lang(th) .p-title, :lang(th) .tag, :lang(th) .status, :lang(th) .facts span, :lang(th) .f-head, :lang(th) .vision cite { letter-spacing: .02em; }
:lang(th) .tag, :lang(th) .status { font-size: .78rem; }
:lang(th) .p-title { font-size: .84rem; }
:lang(th) .person h3 { font-size: 1.3rem; }
:lang(th) .year small, :lang(th) .stat dt { font-size: .92rem; }
:lang(th) .lead { line-height: 1.85; }
:lang(th) .about-body p { line-height: 1.95; }
:lang(th) .about-body p:first-child::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; font-family: inherit; }
:lang(th) .forward-text { line-height: 1.9; }
:lang(th) .m-icon + .m-num + h3, :lang(th) .mission h3 { font-size: 1.12rem; }

/* ---------- Admin preview ribbon ---------- */
.preview-ribbon {
  position: fixed; z-index: 90; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--terra); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  box-shadow: var(--shadow); pointer-events: none;
}
@media (max-width: 480px) {
  .brand img { width: 36px; }
  .brand-name { font-size: 1rem; }
  .lang-switch a { min-width: 36px; padding: 4px 8px; }
}
@media (max-width: 420px) {
  .nav-wrap { gap: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 32px; }
  .brand-name { font-size: .92rem; }
  .lang-switch a { min-width: 32px; padding: 4px 6px; font-size: .76rem; }
  .nav-tools { gap: 2px; }
}
@media (max-width: 380px) { .brand-sub { display: none; } }
