/* ==========================================================================
   RESET + BASE + LAYOUT PRIMITIVES
   RTL is built in from the start via logical properties (19 §3) - there is no
   separate rtl.css to bolt on later.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* The off-canvas drawer sits outside the viewport until opened; without this it
   would extend the document's scrollable width on small screens. */
html, body { overflow-x: hidden; max-width: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--text-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--text-h3); line-height: var(--lh-h3); }
p  { text-wrap: pretty; }

a { color: var(--heritage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--heritage-gold); }
:root[data-theme="dark"] a { color: var(--heritage-gold-soft); }

/* Visible, consistent focus - required by 19 §7 */
:focus-visible {
  outline: 3px solid var(--heritage-gold);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; inset-inline-start: var(--sp-4); top: -100px;
  background: var(--heritage-deep); color: var(--text-inverse);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); z-index: 200;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

.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;
}

/* ---- layout ----------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-6); }
.wrap-narrow { max-width: var(--wrap-narrow); }
main { flex: 1 0 auto; }

.section { padding-block: var(--sp-16); }
.section--tight { padding-block: var(--sp-12); }
.section--sunken { background: var(--surface-sunken); }

.section-head { margin-bottom: var(--sp-8); display: flex; align-items: flex-end;
                justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.section-head__title { display: flex; flex-direction: column; gap: var(--sp-2); }
.eyebrow {
  font-family: var(--font-body); font-size: var(--text-caption);
  letter-spacing: .12em; text-transform: uppercase; font-weight: 600;
  color: var(--heritage-gold);
}
:root[lang="ur"] .eyebrow { letter-spacing: normal; text-transform: none; }
.section-sub { color: var(--text-secondary); font-size: var(--text-small); max-width: 62ch; }

.grid { display: grid; gap: var(--sp-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

.gold-rule {
  height: 2px; width: 64px; border: 0; border-radius: var(--r-full);
  background: var(--grad-gold); margin: 0;
}

/* ---- directional icons mirror in RTL; symmetric ones never do (19 §3) -- */
[dir="rtl"] .icon-directional { transform: scaleX(-1); }
