/* Reset + typography + utilities */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--c-border-strong) transparent; scrollbar-width: thin; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); }
h1 { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.25; }
h2 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; }
h3 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
h4 { font-size: var(--fs-md); font-weight: 700; }
a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Links inside running text are underlined so colour is not the only cue (WCAG 1.4.1) */
p a:not(.btn), .page-desc a, .field__hint a, .small a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--sp-4) 0; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }
::selection { background: var(--c-primary-100); color: var(--c-text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--c-text-3); }
::-webkit-scrollbar-track { background: transparent; }

.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--xs { width: 14px; height: 14px; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }

/* Urdu */
.ur, [lang="ur"] { font-family: var(--font-urdu); direction: rtl; line-height: 2.1; font-size: 1.15em; }

/* Text helpers */
.muted { color: var(--c-text-3); }
.text-2 { color: var(--c-text-2); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.lg { font-size: var(--fs-lg); }
.bold { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.display { font-family: var(--font-display); }
.text-gradient { color: var(--c-primary); }
.upper { font-size: var(--fs-sm); font-weight: 650; color: var(--c-text-3); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.c-success { color: var(--c-success); }
.c-danger { color: var(--c-danger); }
.c-warning { color: var(--c-warning); }
.c-primary { color: var(--c-primary); }

/* Layout helpers */
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--top { align-items: flex-start; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.stack--sm { gap: var(--sp-2); }
.stack--lg { gap: var(--sp-5); }
.grow { flex: 1; min-width: 0; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-4 { gap: var(--sp-4); }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: auto; }
}

/* Page-level inline two-column grids collapse on smaller screens */
@media (max-width: 1100px) {
  .grid[style*="grid-template-columns"], .layout-aside[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}
