/* Asas: reset, tipografi, kebolehcapaian, sokongan RTL Arab */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
}

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-3);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-3); }

a {
  color: var(--c-primary);
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -60px;
  z-index: 100;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--sp-3);
}

.muted { color: var(--c-text-muted); }

[hidden] { display: none !important; }

/* ---------- Teks Arab ----------
   Sentiasa gunakan .ar (dengan dir="rtl" lang="ar" pada elemen)
   supaya bentuk huruf, tanda baris dan arah betul. */
.ar {
  font-family: var(--font-arabic);
  font-size: var(--fs-arabic);
  line-height: 2;            /* ruang untuk tanda baris atas/bawah */
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
  font-feature-settings: "liga" 1, "calt" 1;
  word-spacing: 0.08em;
}

.ar--center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
