/* Smart Private School — reset + base typography (RTL). */

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

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

body {
  margin: 0;
  /* Defense-in-depth for mobile: across dozens of templates one inline style
     or a long untranslated string can push a row wider than the viewport. This
     does not fix that row, but it stops the symptom that actually breaks the
     page — the whole document scrolling sideways — rather than leaving every
     template to get this right on its own. */
  overflow-x: hidden;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; color: var(--navy-800); line-height: 1.3; }
p { margin: 0; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-700); }

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

button { font-family: inherit; cursor: pointer; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--navy-200); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-500); }

/* Numbers inside an RTL page.
   `isolate` is the important part: it stops a number from reordering the Arabic
   around it (and vice versa), so a cell like "الإجمالي: 1,500,000 د.ع" keeps its
   parts in the right places while the digits still read left-to-right. */
.num { font-variant-numeric: tabular-nums; letter-spacing: .2px; unicode-bidi: isolate; }

/* Identifiers that are read left-to-right even in Arabic: phone numbers,
   national IDs, receipt/student numbers, verification codes, emails, IBANs.
   Plain digits already resolve LTR by themselves, but a leading "+964", a
   hyphen, or two numbers separated by "/" do not — those flip without an
   explicit direction. Kept right-aligned so the column still reads as part of
   the RTL layout. */
.ltr { direction: ltr; unicode-bidi: isolate; text-align: right; }
/* Inside a left-aligned context (print slips, definition rows) let it sit left. */
.ltr--start { direction: ltr; unicode-bidi: isolate; text-align: left; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
