/* IMEX Intranet · static site styles. No frameworks, no build step. */
/* Notion-faithful light theme + a light IMEX CI touch. Section order: tokens,
   reset/base, a11y, topbar, brand lockup, brandband, cover, pagehead,
   typography, callout, tiles, quicklinks, grid/cards, group sections,
   empty state, footer, responsive, motion/print. */

/* ---------- tokens ---------- */
:root {
  --text: #37352f;
  --text-2: #787774;
  --bg: #ffffff;
  --bg-2: #f7f7f5;
  --line: rgba(55, 53, 47, .09);
  --hover: rgba(55, 53, 47, .055);
  --imex-royal: #003761;
  --imex-springs: #2478B6;
  --imex-sky: #7AC1E3;
  --accent: var(--imex-royal);        /* replaces the old #1f3a5f */
  --accent-soft: rgba(36, 120, 182, .09);
  --w: 900px;
  --pad: 24px;
  /* IMEX CI typography (BRAND-CI.md §2 — artworks/digital face = Sukhumvit Tadmai).
     Tadmai is a licensed retail font with no webfont, so it is named first for
     staff who have it installed; Apple's Sukhumvit Set is the same lineage on
     Mac/iOS; Anuphan is the loaded webfont so every visitor lands on one Thai
     face; Tahoma is the CI e-mail face and ships on every Windows box. */
  --font: 'Sukhumvit Tadmai', 'Sukhumvit Set', 'Anuphan', Tahoma,
          -apple-system, 'Segoe UI', system-ui, sans-serif;
  --zoom: 1.15;          /* whole-page size. 1 = original, 1.15 = 15% bigger. */
}

/* ---------- reset / base ---------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  /* One dial for overall size. This sheet is all px and no rem, so a root
     font-size change is a no-op here; zoom is what actually scales it. */
  zoom: var(--zoom);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
  overflow-x: hidden;   /* no horizontal scroll at 320px */
}

img { max-width: 100%; display: block; }

a { color: inherit; }

/* ---------- a11y helpers ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
  clip-path: inset(50%);
}

.skip {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: top .15s ease;
}
.skip:focus {
  top: 8px;
}

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: none;
  box-shadow: inset 0 -1px 0 var(--line);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* CI touch 2/5: a 3px brand rule under the topbar */
.topbar::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--imex-royal), var(--imex-springs) 55%, var(--imex-sky));
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
}
.topbar a.back {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  /* the only way back on every subpage · full 44px target at every width,
     not just narrow ones, because tablets are touch too */
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.topbar a.back:hover { text-decoration: underline; }

/* ---------- brand lockup ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  height: 34px;
  width: auto;              /* intrinsic 258x120, height-constrained to fit the 48px topbar */
  display: block;
}
.brand-sep {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--line);
}
.brand-word {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-2);
}

/* ---------- cover ---------- */
/* full bleed: no ancestor may constrain width; body/html have no padding
   here, so .cover-wrap naturally spans the viewport edge to edge. */
.cover-wrap {
  width: 100%;
  height: clamp(150px, 26vh, 280px);
  background: var(--bg-2);
  overflow: hidden;
}
.cover-wrap img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

/* ---------- brandband (sub pages) ---------- */
/* A slim CI-gradient strip above the sub-page cover, so the top of every page
   reads IMEX even when the art below it is generic stock clipart. */
.brandband {
  height: 8px;
  background: linear-gradient(90deg, var(--imex-royal), var(--imex-springs) 55%, var(--imex-sky));
}

/* Sub-page cover: every sub page now carries a purpose-built 4:1 imex banner
   (navy block + wordmark, isometric art, white corner slash), so the band is
   locked to that ratio instead of a clamped height. A fixed height plus
   `contain` was the right trade for the old square-ish stock clipart, but with
   matched art it only reintroduces dead margin at narrow widths. Ratio + cover
   fills the column edge to edge at every viewport with nothing cropped.
   Held to the content column, not full bleed: the home banner is the wide one. */
.cover-wrap.is-sub {
  /* width:auto, not the inherited 100% · with side margins added under 940px a
     100% width overflows the viewport and the page scrolls sideways. */
  width: auto;
  max-width: var(--w);
  margin: 22px auto 0;
  height: auto;
  aspect-ratio: 4 / 1;
  background: none;
  padding: 0;
  box-sizing: border-box;
}
.cover-wrap.is-sub img.cover { object-fit: cover; }

@media (max-width: 940px) {
  /* inside the column the plate must not touch the viewport edge */
  .cover-wrap.is-sub { margin-left: var(--pad); margin-right: var(--pad); }
}

/* ---------- pagehead ---------- */
main.wrap {
  padding: var(--pad) var(--pad) 64px;
  max-width: var(--w);
  margin: 0 auto;
}

.pagehead {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding-top: 24px;
}
/* title never overlaps the cover; only the icon plate does · Notion never
   lets a heading sit half-on-navy, half-on-white */
.pagehead.has-cover.has-icon {
  margin-top: -44px;
  padding-top: 0;
}
.pagehead.has-cover:not(.has-icon) {
  margin-top: 24px;
}
.pageicon {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 6px;
  overflow: visible;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pageicon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}
.pageicon.is-emoji {
  font-size: 66px;
  line-height: 78px;
  background: none;
}
.pagehead h1 {
  margin: 0 0 4px;
}
.pagehead.has-icon h1 {
  margin-top: 8px;
}
/* home only: h1 + tagline stacked, sub pages keep the plain h1 */
.pagehead-text { min-width: 0; }
.pagetagline {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ---------- typography ---------- */
h1 {
  font-size: 40px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 4px;
}
h2 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
  margin: 32px 0 8px;
}
h3 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0;
  margin: 24px 0 6px;
}
main p {
  font-size: 16px;
  line-height: 1.75;
  margin: 0 0 6px;
}
/* one link language site-wide: navy accent, underlined, soft-alpha underline */
main a {
  text-decoration: underline;
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
main a:hover { text-decoration-color: var(--accent); }
main ul, main ol { padding-left: 24px; margin: 0 0 16px; }
main li { margin: 4px 0; }
main hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
main img {
  max-width: 100%;
  height: auto;
}
main table {
  border-collapse: collapse;
}
.bold { font-weight: 600; }

/* ---------- callout ---------- */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-2);
  border-radius: 6px;
  padding: 16px;
  margin: 20px 0;
}
.callout .emoji { font-size: 20px; line-height: 1.4; }
.callout .body { flex: 1; min-width: 0; }
.callout .body > p:last-child { margin-bottom: 0; }

/* ---------- tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 12px 0 8px;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

a.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: var(--bg);
  font-weight: 600;
  font-size: 15px;
  transition: background .15s ease;
}
a.tile:hover { background: var(--hover); }
a.tile .emoji { font-size: 18px; flex: 0 0 auto; }
a.tile .tile-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  object-fit: contain;            /* wide transparent logos must not crop */
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px;
}
a.tile .sub { font-weight: 400; font-size: 13px; color: var(--text-2); }

/* ---------- quicklinks ---------- */
.quicklinks-block {
  margin: 32px 0 4px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
/* a single link is the page's one action, so it gets the weight of a button */
.quicklinks-block.is-single { border-top: 0; padding-top: 0; }
a.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: filter .15s ease;
}
a.action:hover { filter: brightness(1.12); }
.quicklinks-cap {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 6px;
}
.quicklinks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quicklinks a {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  text-decoration: none;
  color: var(--accent);
  transition: background .15s ease;
}
.quicklinks a:hover { background: var(--hover); }

/* ---------- grid / cards ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0 8px;
  padding: 0;
  list-style: none;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
a.card {
  text-decoration: none;
  color: inherit;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
a.card:hover {
  background: var(--hover);
  box-shadow: 0 4px 14px rgba(15, 15, 15, .08);
  transform: translateY(-1px);
  border-color: var(--imex-sky);      /* CI touch 4/5 */
}
a.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* a static (non-clickable) card renders as a plain div, or carries
   .is-static explicitly: neither gets hover motion or a pointer cursor. */
a.card.is-static,
a.card.is-static:hover {
  background: var(--bg);
  box-shadow: none;
  transform: none;
  cursor: default;
}

.card .thumb,
.card .thumb-blank {
  width: 100%;
  aspect-ratio: 3 / 2;            /* was 16/9 · most source art is 4:3, less dead band */
  object-fit: contain;            /* nothing is ever cropped */
  padding: 18px 18px 22px;        /* uniform inset · the bleeders stop shouting */
  border-bottom: 1px solid var(--line);
}
.card .thumb { background: #fff; }         /* real artwork: white plate */
.card .thumb-blank { background: var(--bg-2); }  /* no image: neutral grey */

.card .meta {
  position: relative;
  padding: 12px 14px;
}
.card.has-icon .meta { padding-top: 12px; }

.card .icon {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 4px;
  margin-top: -34px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(15, 15, 15, .1);
}
.card .icon-emoji {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  margin-top: -34px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(15, 15, 15, .1);
}

.card .title {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  margin-top: 8px;
}
.card .sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 2px;
}

/* ---------- group sections (§4) ---------- */
.group          { margin: 40px 0 0; }
.group:first-of-type { margin-top: 28px; }
.grouphead      { margin: 0 0 4px; }
.grouphead.is-standalone { margin-top: 40px; }
.kicker         { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .09em;
                  text-transform: uppercase; color: var(--imex-springs); }
.grouphead h2   { margin: 2px 0 0; font-size: 21px; font-weight: 600; }

/* ---------- empty state ---------- */
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
  color: var(--text-2);
  padding: 40px 24px;
  margin: 16px 0;
}
.empty-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
}
.empty p { margin: 0 0 4px; }
.empty p.sub { font-size: 13px; }
.empty .empty-cap {
  margin: 20px 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-2);
}
.empty .tiles { text-align: left; margin: 0; }
.empty a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* ---------- footer ---------- */
.footer {
  margin-top: 56px;
  border-top: 2px solid var(--imex-royal);  /* CI touch 5/5 */
  background: var(--bg-2);
  padding: 32px 0 36px;
  font-size: 13px;
  color: var(--text-2);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.footer-tag {
  margin: 6px 0 0;
  max-width: 34ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
}
.footer-cap {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 28px;
}
.footer-nav a {
  display: flex;
  align-items: center;
  min-height: 32px;
  color: var(--text-2);
  text-decoration: none;
  line-height: 1.4;
}
.footer-nav a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.footer-note { color: var(--text-2); }

/* ---------- responsive ---------- */
/* Touch-sized targets up to tablet width. Paired with the pointer:coarse block
   below: width is measurable here, pointer is the more accurate signal. */
@media (max-width: 900px) {
  .footer-nav a { min-height: 44px; }
}

/* On a phone the footer must stack: as a flex row the nav shrank to 121px and
   the long Thai link names wrapped onto two lines beside 230px of empty band. */
@media (max-width: 700px) {
  .footer-top { flex-direction: column; gap: 24px; }
  .footer-nav { width: 100%; }
  .footer-tag { max-width: none; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (max-width: 560px) {
  :root { --pad: 16px; }

  h1 { font-size: 28px; }
  .pagetagline { font-size: 15px; }

  .pageicon { width: 56px; height: 56px; }
  .pageicon.is-emoji { font-size: 46px; line-height: 56px; }
  .pagehead.has-cover.has-icon { margin-top: -32px; }
  .pagehead.has-cover:not(.has-icon) { margin-top: 20px; }

  .cover-wrap { height: clamp(120px, 20vh, 180px); }

  a.tile { width: 100%; }

  /* tap targets >= 44px on touch widths */
  .quicklinks a { min-height: 44px; padding: 10px 14px; }
  a.action { display: flex; width: 100%; }
  .footer-nav ul { grid-template-columns: 1fr; }
  .footer-nav a { min-height: 44px; }
  a.tile { min-height: 44px; }
}

@media (max-width: 400px) {
  .brand-sep, .brand-word { display: none; }
}

/* wide tables never force page-level horizontal scroll */
main table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* ---------- motion / print ---------- */
/* Width is a bad proxy for touch: a tablet at 768px is still a finger. Ask the
   pointer itself, so every touch device gets full-size targets at any width. */
@media (pointer: coarse) {
  .quicklinks a { min-height: 44px; padding: 10px 14px; }
  a.tile { min-height: 44px; }
  .footer-nav a { min-height: 44px; }
  .card { min-height: 44px; }
}

/* ---------- press (click) feedback · one primitive for every clickable ----------
   One scale token, one curve. Pressing any item dips it; releasing springs back.
   Touch devices have no hover, so this is their only "I got your tap" signal. */
:root {
  --press: .975;            /* cards, tiles: bigger surfaces dip a little */
  --press-sm: .96;          /* pills / buttons: small surfaces need more dip */
  --press-t: transform .12s cubic-bezier(.2, .8, .3, 1);   /* ease-OUT, inside the 100-160ms press band */
}
/* we draw our own press state, so kill the grey mobile flash */
a.card, a.tile, a.action, .quicklinks a, .topbar a.back, .footer-nav a {
  -webkit-tap-highlight-color: transparent;
}

a.card { transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
a.card:active:not(.is-static) {
  transform: scale(var(--press));
  box-shadow: 0 1px 4px rgba(15, 15, 15, .10);
  transition: var(--press-t), box-shadow .12s ease-out;
}
a.tile { transition: background .15s ease, var(--press-t); }
a.tile:active {
  background: var(--hover);
  transform: scale(var(--press));
  transition: var(--press-t);
}
.quicklinks a { transition: background .15s ease, var(--press-t); }
.quicklinks a:active {
  background: var(--hover);
  transform: scale(var(--press-sm));
  transition: var(--press-t);
}
a.action { transition: filter .15s ease, var(--press-t); }
a.action:active {
  filter: brightness(.94);
  transform: scale(var(--press-sm));
  transition: var(--press-t), filter .12s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
  a.card:hover { transform: none; }
  a.card:active, a.tile:active, .quicklinks a:active, a.action:active { transform: none; }
}

@media (prefers-color-scheme: dark) {
  /* single-look client portal: stay light, but state colors explicitly
     so the OS dark UI chrome never bleeds through. */
  body { background: var(--bg); color: var(--text); }
}

@media print {
  .topbar, .footer, .cover-wrap, .skip { display: none; }
  body { background: #fff; color: #000; }
  main.wrap { max-width: 100%; padding: 0; }
  a { color: #000; text-decoration: underline; }
}
