/* Al-Burhaniya — base styles */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; color: var(--text); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

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

.skip-link {
  position: fixed; inset-block-start: -60px; inset-inline-start: 12px;
  z-index: 9999; background: var(--emerald); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--r-sm) var(--r-sm);
  transition: inset-block-start var(--speed);
}
.skip-link:focus { inset-block-start: 0; }

/* Boot splash */
.boot-splash {
  position: fixed; inset: 0; z-index: 400;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem; background: var(--grad-hero); color: #f4efe0;
}
.boot-logo { width: 88px; height: 88px; filter: drop-shadow(0 8px 24px rgba(0,0,0,.35)); }
.boot-name { font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.boot-arabic { font-family: var(--font-urdu); font-size: 1.3rem; color: var(--light-gold); }
.boot-bar { width: 160px; height: 4px; border-radius: 99px; background: #ffffff22; overflow: hidden; margin-top: .75rem; }
.boot-bar span { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--grad-gold); animation: bootSlide 1s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-100%);} 100% { transform: translateX(280%);} }

/* Offline banner */
.offline-banner {
  position: fixed; inset-inline: 0; inset-block-start: 0; z-index: 900;
  background: #7a2d24; color: #fff; text-align: center;
  font-size: var(--fs-sm); padding: .45rem .75rem;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.offline-banner[hidden] { display: none !important; }
.offline-banner button {
  background: #ffffff22; border: 1px solid #ffffff66; color: #fff;
  border-radius: var(--r-full); padding: .1rem .6rem; cursor: pointer; font-size: .75rem;
}
body.is-offline { padding-block-start: 32px; }

/* Utilities */
.text-muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.bold { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.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;
}
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }
.mt-2 { margin-block-start: var(--sp-2); } .mt-4 { margin-block-start: var(--sp-4); } .mt-6 { margin-block-start: var(--sp-6); }
.mb-0 { margin-block-end: 0; }
.hidden { display: none !important; }
.mono { font-variant-numeric: tabular-nums; }
.divider { height: 1px; background: var(--border); border: 0; margin: var(--sp-4) 0; }

.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-auto { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid { gap: .75rem; } /* tighter card rhythm on phones */
}

/* ---------- Touch / native-app foundations ---------- */
a, button, .btn, .nav-item, .bottom-nav a, .card.clickable, [role='button'], summary { touch-action: manipulation; } /* instant taps, no double-tap zoom delay */
body { -webkit-tap-highlight-color: transparent; } /* inherited: no grey flash on tap */

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text) 32%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
