/* site.css — additive rules only.
 *
 * Loaded AFTER the recovered compiled stylesheet (_nuxt/entry.gdGE1DqY.css), so
 * these rules win on equal specificity. Nothing here redefines a Tailwind or
 * Nuxt UI token: the original palette and scale must stay untouched, or the
 * rebuild stops matching the baseline in docs/baseline/.
 */

/* ---------------------------------------------------------------- the reveal
 * site.js moves each block's inline opacity/transform into data-reveal and
 * drives this transition. Kept in CSS (not inline) so prefers-reduced-motion
 * can turn it off in one place.
 */
[data-reveal] {
  opacity: 0;
  transform: translateY(2.5rem);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ----------------------------------------------------------------- the drawer
 * The original hydrated a Dialog. This is a plain panel toggled by site.js.
 */
#mobile-nav {
  display: none;
}

#mobile-nav.is-open {
  display: block;
}

/* --------------------------------------------------------- Indie Flower accent
 * The recovered stylesheet sets `:lang(en){font-family:Poppins,…}` on the <html>
 * element. Every descendant inherits it, and a selector with :lang() outranks a
 * plain class selector — so `.indie-flower-regular` on the "Liberate Thinking Hub"
 * line lost to Poppins despite being the element's own class. That line is meant
 * to be handwritten script.
 *
 * Re-assert it with selectors that win on specificity, scoped to the class the
 * markup already carries. The compiled stylesheet stays byte-identical.
 */
p.indie-flower-regular,
:lang(en) .indie-flower-regular {
  font-family: "Indie Flower", cursive;
}

/* ------------------------------------------------------------ hero headline
 * The recovered markup centres the hero with a flex container
 * (`items-center justify-center`) but never sets `text-center`. That centres the
 * h1 *boxes*; the text inside each box still uses the default `text-align:start`.
 * On a wide screen each line fits, so it looks centred. Once a line wraps on a
 * narrow screen, the wrapped line sits flush left while its box is centred, which
 * reads as misaligned.
 *
 * Scoped to the hero container only — the two h1 lines that open the page. Setting
 * `text-align` on the container inherits into both children, so one rule is enough.
 */
.hero-headline {
  text-align: center;
}

/* ------------------------------------------------- language font assignment
 * The recovered stylesheet sets a font stack per language on <html>:
 *
 *   :lang(en){font-family:Poppins, …}
 *   :lang(th){font-family:"Noto Sans Thai", …}
 *
 * That is wrong for the Thai pages, which contain English words, product names
 * ("JAIDEE iPOS"), and the email address. On a `lang="th"` page the entire stack
 * starts at Noto Sans Thai, so English renders in a Thai face — correct glyphs,
 * wrong letterforms.
 *
 * The fix is ordering: put Poppins FIRST on Thai pages. Verified from the font
 * cmaps that Poppins carries ASCII (95 codepoints) and ZERO Thai codepoints, so
 * a Thai string falls through to Noto Sans Thai in the same stack. Thai rendering
 * is unchanged because Thai never resolves to Poppins.
 *
 * Specificity note: the recovered `:lang(th)` rule is (0,1,1) — one pseudo-class
 * plus an element — and it matches every element, including h1. Our rule must
 * therefore be strictly stronger, not merely later: `.isr-page` plus `:lang(th)`
 * plus the element is (0,2,1) and wins. `html:lang(th) body` is used for the
 * chrome outside `.isr-page` for the same reason.
 */
.isr-page:lang(th),
:lang(th) .isr-page,
html:lang(th) .isr-page,
html:lang(th) .isr-page :is(p, li, td, th, dd, dt, span, a, strong, em, small, div) {
  font-family: Poppins, "Noto Sans Thai", "Poppins Fallback: Arial",
    "Noto Sans Thai Fallback: Arial", sans-serif;
}

/* Same correction for the Thai pages' chrome (header nav, footer) outside
 * .isr-page: English labels like "API for Developer" must use Poppins too. */
html:lang(th) body,
html:lang(th) body :is(nav, header, footer, a, p, span, div, li) {
  font-family: Poppins, "Noto Sans Thai", "Poppins Fallback: Arial",
    "Noto Sans Thai Fallback: Arial", sans-serif;
}

/* Headings inherit the same stack. Declared with the element in the selector so
 * it outranks the recovered `:lang(th)` rule, which targets every element. */
html:lang(th) h1,
html:lang(th) h2,
html:lang(th) h3,
html:lang(th) h4,
html:lang(th) h5,
html:lang(th) h6 {
  font-family: Poppins, "Noto Sans Thai", "Poppins Fallback: Arial",
    "Noto Sans Thai Fallback: Arial", sans-serif;
}

/* --------------------------------------------------------- heading colour
 * Every page except the homepage: ALL headings black, body copy unchanged.
 *
 * Two things make this cover "all headings" rather than just the ones present:
 *
 *   1. `h1`-`h6` are all listed. The pages use h1 and h2 today, but h3 is already
 *      styled by `.isr-prose h3`, so a level can appear at any time.
 *   2. `.isr-page :is(h1,…,h6)` is used alongside the descendant selectors. The
 *      recovered stylesheet sets font colour through utility classes and `:lang()`
 *      selectors on ancestors; `:is()` with the `.isr-page` scope keeps this rule
 *      at a specificity that utility classes cannot outrank.
 *
 * Scoped to `.isr-page`, which only the authored sub-pages carry — the homepage
 * never has it, so its recovered styling is untouched. Only `color` is set;
 * font-size, weight, margins, and alignment are left alone.
 */
.isr-page h1,
.isr-page h2,
.isr-page h3,
.isr-page h4,
.isr-page h5,
.isr-page h6,
.isr-page :is(h1, h2, h3, h4, h5, h6) {
  color: #000 !important;
}

/* --------------------------------------------------------------- sub-pages
 * The homepage never uses these; the authored sub-pages do.
 */
.isr-page {
  max-width: 72ch;
}

.isr-prose p + p {
  margin-top: 1rem;
}

.isr-prose h2 {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.isr-prose h3 {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.isr-prose ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.isr-prose li + li {
  margin-top: 0.375rem;
}

.isr-prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* A visibly-marked draft banner for pages awaiting content sign-off. */
.isr-draft-banner {
  border: 2px dashed #111111;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
}

/* ------------------------------------------------------------------- print
 * Contact and legal pages get read on paper.
 */
@media print {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}
