/* Hawsabah base styles: reset, typography applied to tokens, logo lockup.
   Uses logical properties throughout, so the same rules serve English (LTR) and Arabic (RTL). */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--page-bg);
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection); }

h1, h2, h3, h4, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--heading);
  margin: 0 0 0.5em;
}
.display { font-size: var(--fs-display); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 1em; }

.lede { font-size: 1.2em; color: var(--ink-soft); max-width: 60ch; }
.small { font-size: var(--fs-small); color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-text);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.9em;
}

.mono, code, pre { font-family: var(--font-mono); direction: ltr; unicode-bidi: isolate; text-align: left; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

hr { border: 0; border-block-start: 1px solid var(--rule); margin: 2em 0; }

/* Arabic: never space, italicize, or uppercase letters */
:lang(ar) { letter-spacing: 0 !important; }
:lang(ar) em, :lang(ar) i, :lang(ar) blockquote { font-style: normal; }
:lang(ar) .eyebrow { text-transform: none; }

/* Latin strings inside Arabic text (web addresses, codes) keep their own direction */
bdi, .ltr { direction: ltr; unicode-bidi: isolate; }

/* Logo lockup. Light and paper: the mark sits on the page. Dark: the mark sits on a parchment plate. */
.mark {
  --mark-size: 3.4rem;
  display: inline-flex;
  flex: none;
  width: fit-content;   /* never stretch to fill a grid or flex cell */
  height: fit-content;
  line-height: 0;
  background: var(--plate);
  padding: calc(var(--mark-size) * var(--plate-pad));
  border-radius: var(--plate-radius);
}
.mark img { display: block; width: var(--mark-size); height: auto; }

.lockup { display: flex; align-items: center; gap: 0.9rem; }
.lockup-text { display: flex; flex-direction: column; gap: 0.25rem; }
/* The company name under or beside the mark: Inter Bold, capitals, wide letter-spacing (as on the story page).
   Arabic has no capitals and letter-spacing breaks its joins, so it is a plain bold wordmark in the Arabic sans (Noto Sans Arabic). */
.lockup-name {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--heading);
}
:lang(ar) .lockup-name { font-family: var(--font-text); font-size: 1.55rem; letter-spacing: 0; text-transform: none; }
.lockup.stacked { flex-direction: column; align-items: center; gap: 0.9rem; text-align: center; }
.lockup.stacked .lockup-name { padding-inline-start: 0.22em; }   /* balances the trailing letter-spacing so the name centers under the mark */
:lang(ar) .lockup.stacked .lockup-name { padding-inline-start: 0; }
.lockup-tag { font-size: var(--fs-small); color: var(--ink-soft); line-height: 1.3; }

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