/* Azkari Pro — design tokens: typography, palette, themes and spacing. */

@font-face {
  font-family: "Amiri";
  src: url("../assets/fonts/Amiri-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Amiri";
  src: url("../assets/fonts/Amiri-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Cairo";
  src: url("../assets/fonts/Cairo-Variable.ttf") format("truetype-variations");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

/* Cairo draws the Arabic-Indic zero as a square; use Amiri's round zero for
   counters in the dark theme. Only U+0660 is taken from this face. */
@font-face {
  font-family: "AzkariZero";
  src: url("../assets/fonts/Amiri-Bold.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0660;
}

:root {
  color-scheme: light;

  /* Brand */
  --brand-emerald: #1B4332;
  --brand-gold: #C9A227;
  --brand-cream: #F8F6F0;
  --brand-night: #0F172A;

  /* Semantic surfaces — light: warm parchment with clear depth */
  --bg: #EAE2D3;
  --surface: #FFFFFF;
  --surface-2: #F5F0E6;
  --surface-3: #EAE1CF;
  --text: #1B2A22;
  --text-strong: #102018;
  --text-muted: #6B756C;
  --border: rgba(27, 67, 50, 0.14);
  --border-strong: rgba(27, 67, 50, 0.24);
  --accent: var(--brand-emerald);
  --accent-hover: #143627;
  --accent-soft: #E4EFE8;
  --accent-ink: #FFFFFF;
  --gold: var(--brand-gold);
  --gold-soft: #FBF3DA;
  --danger: #B42318;
  --overlay: rgba(12, 24, 18, 0.46);
  --shadow-sm: 0 2px 10px rgba(63, 52, 31, 0.07);
  --shadow-md: 0 12px 30px rgba(63, 52, 31, 0.13);
  --shadow-lg: 0 24px 70px rgba(48, 40, 24, 0.22);

  /* Typography */
  --font-ui: "Cairo", "Segoe UI", system-ui, sans-serif;
  --font-quran: "Amiri", "Noto Naskh Arabic", serif;
  --fs-xs: 0.72rem;
  --fs-sm: 0.82rem;
  --fs-md: 0.94rem;
  --fs-lg: 1.06rem;
  --fs-xl: 1.28rem;
  --fs-2xl: 1.6rem;

  /* Geometry */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --nav-height: 72px;
  --header-height: 74px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  /* Royal emerald header */
  --header-bg: linear-gradient(135deg, #0D3B2E 0%, #1B4332 100%);
  --header-ink: #FFFFFF;
  --header-muted: rgba(255, 255, 255, .72);
  --header-gold: #E2C46B;
  --header-border: rgba(255, 255, 255, .16);

  /* Hadith grade badges */
  --grade-sahih: #1B4332;
  --grade-sahih-bg: #E2EFE7;
  --grade-hasan: #0E7490;
  --grade-hasan-bg: #DCF2F6;
  --grade-daif: #B45309;
  --grade-daif-bg: #FCEFD3;
  --grade-quran: #9A7312;
  --grade-quran-bg: #FBF1D5;
  --grade-unknown: #64748B;
  --grade-unknown-bg: #EEF1F4;
}

/* Black & Gold Illuminated Mushaf — dark theme only. */
html[data-theme="dark"] {
  color-scheme: dark;

  /* Warm velvet black, rich charcoal surfaces and royal gold. */
  --bg: #090806;
  --surface: #14120D;
  --surface-2: #1B1811;
  --surface-3: #262117;
  --text: #F6EFE0;
  --text-strong: #FCF7EC;
  --text-muted: #B8AD96;
  --border: rgba(212, 175, 55, 0.28);
  --border-strong: rgba(212, 175, 55, 0.44);
  --accent: #D4AF37;
  --accent-hover: #E2C258;
  --accent-soft: #2A2313;
  --accent-ink: #171205;
  --gold: #D4AF37;
  --gold-soft: #2B2412;
  --danger: #F08A78;
  --overlay: rgba(3, 3, 2, 0.78);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.56);
  --shadow-lg: 0 28px 78px rgba(0, 0, 0, 0.7);

  --header-bg: linear-gradient(135deg, #0D0B07 0%, #1A150B 52%, #090806 100%);
  --header-ink: #F6EFE0;
  --header-muted: rgba(246, 239, 224, 0.7);
  --header-gold: #F1D37E;
  --header-border: rgba(212, 175, 55, 0.35);

  /* Hadith grades stay distinct and pass WCAG AA on charcoal. */
  --grade-sahih: #8FE9BE;
  --grade-sahih-bg: #14352A;
  --grade-hasan: #86DCEB;
  --grade-hasan-bg: #10333C;
  --grade-daif: #F5C97D;
  --grade-daif-bg: #3B2A12;
  --grade-quran: #F3D88A;
  --grade-quran-bg: #372C0F;
  --grade-unknown: #CFC7B4;
  --grade-unknown-bg: #29251D;
}

/* Direction-sensitive helper: arrows and chevrons point forward in the
   reading direction, so they must flip in RTL. */
[dir="rtl"] .flip { transform: scaleX(-1); }
