/* ============================================================
   Teradix — Base element styles & RTL switch
   Lightweight defaults so any consuming page inherits the brand
   type + ink. Bilingual: set dir="rtl" on <html> to switch the
   Latin face to Forma DJR Arabic and mirror layout.
   ============================================================ */

:root {
  color-scheme: light;
}

body {
  margin: 0;
  font: var(--font-body);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Arabic / RTL: swap the body family and mirror direction.
   Headings use the Display cut. */
[dir="rtl"] body,
[lang="ar"] body {
  font-family: var(--font-arabic);
}
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 {
  font-family: var(--font-arabic-display);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-sans);
}
h1 { font: var(--font-h1); }
h2 { font: var(--font-h2); }
h3 { font: var(--font-h3); }
h4 { font: var(--font-h4); }

p { margin: 0; text-wrap: pretty; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
a:hover { color: var(--color-primary-active); }

*, *::before, *::after { box-sizing: border-box; }

::selection {
  background: var(--color-primary-tint);
  color: var(--text-strong);
}

/* Reinstated, accessible focus ring — legacy product suppressed this. */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Utility helpers consumers may use directly */
.tx-eyebrow {
  font: var(--font-overline);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-subtle);
}
.tx-muted { color: var(--text-muted); }
.tx-mono { font-family: var(--font-mono); }
