/* ============================================================
   A7mad.me · Base
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  /* rv--start/rv--end pre-reveal transforms must never widen the page */
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--bg-page);
  /* Body copy reads Mid Navy; heavy headings stay Deep Navy via
     --text-heading. This is what kills the charcoal feel page-wide. */
  color: var(--text-secondary);
  font-family: var(--font-ar);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--brand-primary);
  color: var(--bg-page);
}

h1, h2, h3, h4, p {
  margin: 0;
}

/* D-042/D-043: heavy headings come from one explicit knob token */
h1, h2, h3 {
  color: var(--text-heading);
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

/* Latin runs inside Arabic text stay isolated and readable */
.latin {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-ar);
  letter-spacing: 0.01em;
}

/* Pixel-font Latin: brand labels and tiny kickers only, never body text */
.px-label {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Keyboard focus */
:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

/* Skip-to-content for keyboard users */
.skip-link {
  position: absolute;
  inset-inline-start: 8px;
  top: -48px;
  z-index: 300;
  padding: 10px 18px;
  background: var(--brand-primary);
  color: var(--bg-page);
  font-size: var(--fs-small);
  border-radius: var(--r-btn);
  transition: top var(--t-fast) ease;
}

.skip-link:focus {
  top: 8px;
}

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