/* Alkafeel+ — base (style v2): fonts, reset, typography, page transitions. Uses tokens.css only. */

/* Cairo (SIL OFL 1.1) — self-hosted variable font, 2 subsets. One file covers weights 400–800. */
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/cairo-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Cairo';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/cairo-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--c-bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text-body);
  font: var(--fw-regular) var(--fs-14)/var(--lh-base) var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { color: var(--c-text); line-height: var(--lh-tight); font-weight: var(--fw-bold); }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }
.link { color: var(--c-link); text-decoration: underline; text-underline-offset: 3px; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--c-focus); outline-offset: 3px; border-radius: var(--r-xs); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; inset-inline-start: var(--sp-3); top: calc(-1 * var(--sp-9)); z-index: var(--z-skip);
  background: var(--c-primary); color: var(--c-text); font-weight: var(--fw-bold); font-size: var(--fs-14);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-pill);
  transition: transform var(--dur-2) var(--ease);
}
.skip:focus { transform: translateY(calc(var(--sp-9) + var(--sp-3))); }

.wrap { width: 100%; padding-inline: var(--gutter); }   /* full width: no max-width container */

/* ---------- Page transitions (cross-document View Transitions) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out var(--dur-2) var(--ease) both; }
::view-transition-new(root) { animation: vt-in var(--dur-3) var(--ease) both; }
::view-transition-group(poster) { animation-duration: var(--dur-3); animation-timing-function: var(--ease); }
::view-transition-old(poster), ::view-transition-new(poster) { animation-duration: var(--dur-3); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
/* Fallback for browsers without cross-document View Transitions: simple fade-in */
.no-vt body { animation: page-in var(--dur-3) var(--ease) both; }
@keyframes page-in { from { opacity: 0; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
}

/* ---------- Direction helpers (ar / fa / ckb = RTL, en = LTR) ---------- */
:root { --dirx: -1; }                 /* "forward" on the x axis: left in RTL */
[dir="ltr"] { --dirx: 1; }
/* Arabic content (titles, descriptions) inside a non-Arabic page keeps the page's alignment */
[dir="ltr"] [lang="ar"][dir="auto"] { text-align: left; }
[dir="rtl"] [lang="ar"][dir="auto"] { text-align: right; }
