/* =====================================================================
   ASEAN+ Business Gateway: polish layer (impeccable audit, 1 Dec 2026)
   Loaded last on every gateway page. Keeps the UnionSPACE look, layout
   and wording; only fixes contrast, type rhythm, focus and form details
   the audit found. Delete this file to return to the previous look.
   ===================================================================== */

:root {
  /* Brand orange #eb5428 is 3.6:1 on white: fine for large headings, too
     light for small text and for white text on a button. This is the
     smallest darkening of the same hue that passes WCAG AA (4.9:1). */
  --gw-accent-ink: #cd3d13;
  --gw-accent-ink-hover: #b0330f;
  /* Chat buttons: white on #1fc65e / #5ec36a was 2.2-2.3:1. */
  --gw-chat: #158640;
  --gw-chat-hover: #106b33;
  /* Secondary text and form placeholders (were 2.5-3.3:1). */
  --gw-muted: #767372;
  --gw-placeholder: #747371;
  --gw-success: #1f8035;
}

/* Scope note: ':is(main, #gwp)' matches <main> but has ID-level specificity
   (no element has id="gwp"), so these fixes beat the theme's long class
   selectors without !important. */

/* ---------- Small orange text → text-safe orange ---------- */
/* Plain links: deliberately LOW specificity (main a), so it only replaces
   the theme's default `a { color: accent }` and never overrides links a
   component styles itself (cards, dark bands, buttons). */
main a {
  color: var(--gw-accent-ink);
}
main a:hover {
  color: var(--gw-accent-ink-hover);
}
:is(main, #gwp) .price .currency.contrast,
:is(main, #gwp) .price-card .contrast:not(h1 *):not(h2 *),
:is(main, #gwp) a.btn-cta,
:is(main, #gwp) a.btn-secondary,
:is(main, #gwp) a.btn-secondary > span {
  color: var(--gw-accent-ink);
}

/* ---------- White-on-orange buttons (the contact-form button is below) ---------- */
:is(main, #gwp) .action-buttons .btn-primary {
  background-color: var(--gw-accent-ink);
  border-color: var(--gw-accent-ink);
  color: #fff;
}
:is(main, #gwp) .action-buttons .btn-primary:hover {
  background-color: var(--gw-accent-ink-hover);
  border-color: var(--gw-accent-ink-hover);
  color: #fff;
}

/* ---------- Chat buttons (WhatsApp / LINE / WeChat style) ---------- */
:is(main, #gwp) .btn-wechat {
  background-color: var(--gw-chat);
  border-color: var(--gw-chat);
  color: #fff;
}
:is(main, #gwp) .btn-wechat:hover,
:is(main, #gwp) .btn-wechat:focus-visible {
  background-color: var(--gw-chat-hover);
  border-color: var(--gw-chat-hover);
  color: #fff;
}

/* ---------- Orange stats band ---------- */
/* Darker band so the small white labels pass; numbers become solid white
   instead of gradient-clipped text (same visual weight, readable). */
:is(main, #gwp) .stats-highlight {
  background-color: var(--gw-accent-ink);
}
:is(main, #gwp) .stats-highlight .stat-number,
:is(main, #gwp) .stats-highlight .stat-number * {
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: currentColor;
  color: #fff;
}
:is(main, #gwp) .stats-highlight .stat-label {
  color: #fff;
  opacity: 1;
}

/* ---------- Secondary text, placeholders, notes ---------- */
/* The theme also set these captions to 50% opacity, which halved contrast. */
:is(main, #gwp) .step-card p.sub {
  color: var(--gw-muted);
  opacity: 1;
}
/* Contact form: on the MM2H pages it sits outside <main>, so scope by #contact too. */
:is(main, #contact, #gwp) input::placeholder,
:is(main, #contact, #gwp) textarea::placeholder {
  color: var(--gw-placeholder);
  opacity: 1;
}
:is(#contact, #gwp) .form-submit button,
:is(#contact, #gwp) #contact_us button[type="submit"] {
  background-color: var(--gw-accent-ink);
  border-color: var(--gw-accent-ink);
  color: #fff;
}
:is(#contact, #gwp) .form-submit button:hover,
:is(#contact, #gwp) #contact_us button[type="submit"]:hover {
  background-color: var(--gw-accent-ink-hover);
  border-color: var(--gw-accent-ink-hover);
}
/* Small orange numbers on the service cards ("01", "02"…; mobile shows them as text). */
:is(main, #gwp) .featured-services .service-card .content .service-number,
:is(main, #gwp) .featured-services .serv-card .content .service-number {
  color: var(--gw-accent-ink);
}

/* ---------- China page (own colour system: --uc-orange #ff581a = 3.2:1) ---------- */
:is(.us-china, #gwp) .uc-primary {
  background: var(--gw-accent-ink);
}
:is(.us-china, #gwp) .uc-primary:hover {
  background: var(--gw-accent-ink-hover);
}
:is(.us-china, #gwp) .uc-benefit .uc-index {
  color: var(--gw-accent-ink);
}
:is(.us-china, #gwp) th:nth-child(2) {
  background: var(--gw-accent-ink);
}
:is(main, #gwp) .note .gw-success {
  color: var(--gw-success);
}

/* ---------- Reading rhythm ---------- */
/* Long centred intros and FAQ answers ran 95-156 characters per line. */
:is(main, #gwp) .section-title p,
:is(main, #gwp) .accordion-body,
:is(main, #gwp) #sources p {
  max-width: 72ch;
}
:is(main, #gwp) .section-title p {
  margin-left: auto;
  margin-right: auto;
}
/* Fewer one-word last lines and lopsided two-line headings. */
:is(main, #gwp) p,
:is(main, #gwp) li {
  text-wrap: pretty;
}
:is(main, #gwp) h1,
:is(main, #gwp) h2,
:is(main, #gwp) h3,
:is(main, #gwp) h4,
:is(main, #gwp) h5 {
  text-wrap: balance;
}
/* 11.4px fine print → 13px. */
:is(main, #gwp) p > small {
  font-size: 0.8125rem;
}
/* Label above the hero heading: less letter-spacing on running text. */
:is(main, #gwp) .hero-badge {
  letter-spacing: 0.02em;
}

/* ---------- Contact block heading (was a second <h1>) ---------- */
/* Same size and spacing the <h1> had, now an <h2> so each page has one H1. */
#contact .map-wrapper .gw-contact-title {
  font-size: 42px;
  line-height: 1.2;
  font-weight: 500;
  margin: 0 0 20px;
}
/* Phones: the old h1 stayed 42px on a 375px screen; slightly smaller keeps
   it a section heading rather than a second page title. */
@media (max-width: 576px) {
  #contact .map-wrapper .gw-contact-title {
    font-size: 34px;
  }
}

/* ---------- Keyboard focus and selection ---------- */
:is(main, #gwp) a:focus-visible,
:is(main, #gwp) button:focus-visible,
:is(main, #gwp) input:focus-visible,
:is(main, #gwp) select:focus-visible,
:is(main, #gwp) textarea:focus-visible,
:is(main, #gwp) summary:focus-visible,
:is(main, #gwp) .accordion-button:focus-visible {
  outline: 2px solid var(--gw-accent-ink);
  outline-offset: 3px;
  box-shadow: none;
}
::selection {
  background: #fbd3c5;
  color: #1f1b18;
}

@media (prefers-reduced-motion: reduce) {
  main * {
    scroll-behavior: auto;
  }
}
