/*
 * Styling for prerendered static pages ONLY (scripts/prerender.ts).
 *
 * These rules dress the HTML that a crawler — and a visitor's first frame —
 * sees before React mounts. The moment `createRoot(...).render(...)` runs, the
 * contents of `#root` are discarded and the real app takes over, so nothing
 * here ever competes with the app's own styles.
 *
 * Why a plain stylesheet rather than Tailwind classes: Tailwind only emits the
 * classes it finds under `apps/web/index.html` and `apps/web/src/**`, so a class
 * used only by a build script in `scripts/` would be purged and every static
 * page would render unstyled. Why a file rather than an inline <style>: it is
 * ~2 KB, and inlining it into 10,000 documents would add megabytes to the deploy
 * for bytes the browser can cache once.
 *
 * The colours and type are literal copies of the new design's tokens
 * (`docs/New Design/Abhyas Buddy.html`, F-10) — a bright study page, Baloo 2
 * headings over Hind body text. They are duplicated deliberately: this file must
 * not import a build pipeline. The font faces themselves come from the web
 * build; until they load, the system fallbacks below are used.
 */

#root {
  --ab-bg: #f8f9fc;
  --ab-card: #ffffff;
  --ab-ink: #1f2237;
  --ab-ink-2: #616680;
  --ab-line: #e8eaf2;
  --ab-brand: #4460e6;
  --ab-brand-soft: #eef1fd;
  --ab-hl: #ffe49a;
  --ab-f-display: 'Baloo 2', 'Hind', system-ui, sans-serif;
  --ab-f-body: 'Hind', 'Noto Sans Devanagari', system-ui, sans-serif;
  --ab-f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  min-height: 100vh;
  background: var(--ab-bg);
  color: var(--ab-ink);
  font-family: var(--ab-f-body);
}

@media (prefers-color-scheme: dark) {
  #root {
    --ab-bg: #0f1122;
    --ab-card: #181b31;
    --ab-ink: #eceefa;
    --ab-ink-2: #a3a8c6;
    --ab-line: #2a2e4a;
    --ab-brand: #8c9eff;
    --ab-brand-soft: #21264a;
    --ab-hl: rgba(255, 209, 102, 0.38);
  }
}

.ab-crumbs {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem 1rem 0;
  font-size: 0.8125rem;
  color: var(--ab-ink-2);
}
.ab-crumbs a {
  color: var(--ab-ink-2);
}

.ab-page {
  max-width: 46rem;
  margin: 1rem auto 4rem;
  padding: 1.5rem 1.25rem 2rem;
  background: var(--ab-card);
  border: 1px solid var(--ab-line);
  border-radius: 1.25rem;
  line-height: 1.65;
}
.ab-page h1,
.ab-page h2,
.ab-page h3 {
  font-family: var(--ab-f-display);
  line-height: 1.25;
}
.ab-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
}
.ab-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.375rem;
}
.ab-page h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin: 1rem 0 0.25rem;
}
.ab-page p {
  margin: 0.5rem 0;
}

.ab-list {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}
.ab-list li {
  margin: 0.25rem 0;
}
.ab-cols {
  columns: 2;
  column-gap: 1.5rem;
}

.ab-pager {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  font-size: 0.9375rem;
}

#root a {
  color: var(--ab-brand);
  font-weight: 600;
  text-decoration: none;
}
#root a:hover {
  text-decoration: underline;
}
#root code {
  font-family: var(--ab-f-mono);
  font-size: 0.9em;
  background: var(--ab-brand-soft);
  padding: 0.1em 0.3em;
  border-radius: 0.25em;
}

/* Devanagari sits taller than Latin and clips at Latin line-heights. */
[lang='mr'] {
  line-height: 1.8;
}

@media (max-width: 32rem) {
  .ab-page {
    margin: 0.75rem 0.75rem 3rem;
    padding: 1.25rem 1rem 1.5rem;
  }
  .ab-cols {
    columns: 1;
  }
}
