/* ==========================================================================
   Dar-ul-Ehsan — Modern Mobile-First Stylesheet
   Color palette inspired by Islamic art:
     --emerald-900 #0d3b2e (deep heritage green)
     --emerald-700 #186146
     --emerald-500 #2a8b6a
     --gold-500   #c79a3a (warm gold accent)
     --gold-300   #e2c47a
     --cream-50   #fbf7ef
     --ink-900    #1d2218
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --emerald-900: #0d3b2e;
  --emerald-800: #11493a;
  --emerald-700: #186146;
  --emerald-600: #1f7a59;
  --emerald-500: #2a8b6a;
  --emerald-100: #e6f1ec;
  --emerald-50:  #f3f8f5;

  --gold-700: #a4791c;
  --gold-500: #c79a3a;
  --gold-300: #e2c47a;
  --gold-100: #f5e9c7;

  --cream-100: #fbf7ef;
  --cream-50:  #fffdf7;

  --ink-900: #1d2218;
  --ink-700: #3d4438;
  --ink-500: #6b7365;
  --ink-300: #b7bcae;
  --ink-100: #e5e7df;

  --paper:    #ffffff;
  --bg-soft:  #f6f1e7;
  --line:     rgba(13, 59, 46, 0.12);

  --shadow-sm: 0 1px 2px rgba(13, 59, 46, 0.06), 0 1px 3px rgba(13, 59, 46, 0.05);
  --shadow-md: 0 6px 18px -8px rgba(13, 59, 46, 0.18), 0 2px 6px rgba(13, 59, 46, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(13, 59, 46, 0.25), 0 8px 16px -8px rgba(13, 59, 46, 0.12);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-display: 'Cormorant Garamond', 'Amiri', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-urdu:    'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Alvi Nastaleeq', 'Tahoma', serif;
  --font-arabic:  'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;

  --container: 1200px;
  --header-h:  72px;
  --transition: 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-900);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: var(--emerald-700); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--emerald-500); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; color: var(--ink-900); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }

[lang="ur"], .rtl, [dir="rtl"] {
  font-family: var(--font-urdu);
  direction: rtl;
  text-align: right;
}

[hidden] { display: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section    { padding: 64px 0; }
.section-lg { padding: 96px 0; }
.section--soft { background: var(--bg-soft); }
.section--emerald { background: var(--emerald-900); color: var(--cream-50); }
.section--emerald h1, .section--emerald h2, .section--emerald h3 { color: var(--cream-50); }

.text-center { text-align: center; }
.muted { color: var(--ink-500); }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-700);
  font-weight: 600;
  margin-bottom: 12px;
}
.section--emerald .eyebrow { color: var(--gold-300); }

.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px auto 24px;
  color: var(--gold-500);
}
.divider-ornament::before, .divider-ornament::after {
  content: '';
  flex: 0 0 60px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
}
.divider-ornament svg { width: 24px; height: 24px; }

.section-header { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-header h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 12px; }
.section-header p  { color: var(--ink-500); font-size: 17px; }
.section--emerald .section-header p { color: rgba(255,255,255,.78); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  background: var(--emerald-700);
  color: var(--cream-50);
  transition: background var(--transition), color var(--transition), transform var(--transition), border-color var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--emerald-600); color: var(--cream-50); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--emerald-700); border-color: var(--emerald-700); }
.btn--ghost:hover { background: var(--emerald-700); color: var(--cream-50); }
.btn--gold   { background: var(--gold-500); color: var(--emerald-900); }
.btn--gold:hover { background: var(--gold-700); color: var(--cream-50); }
.btn--light  { background: var(--cream-50); color: var(--emerald-900); }
.btn--light:hover { background: var(--gold-300); color: var(--emerald-900); }
.btn--sm     { padding: 8px 14px; font-size: 12px; }
.btn--lg     { padding: 16px 28px; font-size: 15px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 247, 0.96);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header--branded { background: var(--cream-50); }
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 16px;
}

/* Branding strip: logo + 3 calligraphic emblems + seal */
.branding-strip {
  background: linear-gradient(180deg, var(--cream-50), #fff);
  border-bottom: 1px solid var(--line);
  padding: 16px 0 12px;
}
.branding-strip__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.branding-strip__logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  margin-left: auto;
  filter: drop-shadow(0 4px 12px rgba(13, 59, 46, 0.18));
}
.branding-strip__centre {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.branding-strip__centre .emblem {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 6px rgba(13, 59, 46, 0.10));
}
.branding-strip__centre .emblem img {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
.branding-strip__centre .emblem--bismillah img { height: 72px; }
.branding-strip__seal {
  display: flex;
  justify-content: flex-start;
}
.branding-strip__seal img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(13, 59, 46, 0.18));
}

@media (max-width: 720px) {
  .branding-strip { padding: 12px 0 8px; }
  .branding-strip__inner { grid-template-columns: 1fr 1fr; gap: 12px; }
  .branding-strip__logo { display: flex; justify-content: flex-start; }
  .branding-strip__logo img { width: 64px; height: 64px; margin: 0; }
  .branding-strip__centre { display: none; } /* fall back to mobile-friendly below */
  .branding-strip__seal { display: flex; justify-content: flex-end; }
  .branding-strip__seal img { width: 52px; height: 52px; }
}

/* On phones, show the 3 emblems in a row below the logo */
@media (max-width: 720px) {
  .branding-strip__mobile {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line);
    margin-top: 8px;
  }
  .branding-strip__mobile .emblem {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .branding-strip__mobile .emblem img {
    height: 56px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
  }
  .branding-strip__mobile .emblem--bismillah img { height: 64px; }
}
@media (min-width: 721px) {
  .branding-strip__mobile { display: none; }
}

/* Darood marquee strip */
.darood-strip {
  background: linear-gradient(180deg, var(--gold-100), #fff);
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  overflow: hidden;
}
.darood-strip__inner {
  position: relative;
  overflow: hidden;
}
.darood-strip__text {
  display: inline-block;
  white-space: nowrap;
  color: var(--emerald-800);
  font-family: var(--font-arabic);
  font-size: 16px;
  letter-spacing: .02em;
  animation: darood-marquee 60s linear infinite;
  padding-left: 100%;
}
.darood-strip__text span { padding-right: 60px; }
@keyframes darood-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .darood-strip__text { animation: none; padding-left: 0; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--emerald-900);
}
.brand__logo {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-700), var(--emerald-500));
  display: grid;
  place-items: center;
  color: var(--gold-300);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand__text { line-height: 1.1; }
.brand__title { font-family: var(--font-display); font-size: 19px; font-weight: 600; color: var(--emerald-900); }
.brand__sub   { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-700); }

.nav-desktop { display: none; }
.nav-desktop a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-700);
  transition: background var(--transition), color var(--transition);
}
.nav-desktop a:hover, .nav-desktop a.is-active {
  background: var(--emerald-50);
  color: var(--emerald-800);
}
.nav-desktop .has-children { position: relative; }
.nav-desktop .submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}
.nav-desktop .has-children:hover .submenu,
.nav-desktop .has-children:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-desktop .submenu a { display: block; padding: 10px 12px; border-radius: 6px; }
.nav-desktop .submenu a:hover { background: var(--emerald-50); color: var(--emerald-800); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--emerald-800);
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle .icon-open  { display: inline; }
.nav-toggle .icon-close { display: none; }
body.nav-open .nav-toggle .icon-open  { display: none; }
body.nav-open .nav-toggle .icon-close { display: inline; }

.nav-mobile {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream-50);
  padding: 20px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 320ms ease;
  z-index: 40;
}
body.nav-open .nav-mobile { transform: translateX(0); }
.nav-mobile ul { list-style: none; padding: 0; margin: 0; }
.nav-mobile > ul > li { border-bottom: 1px solid var(--line); }
.nav-mobile a {
  display: block;
  padding: 16px 4px;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-900);
}
.nav-mobile a:hover { color: var(--emerald-700); }
.nav-mobile .submenu { padding: 0 0 12px 16px; }
.nav-mobile .submenu a { padding: 10px 4px; font-size: 15px; color: var(--ink-700); }

@media (min-width: 960px) {
  .nav-desktop { display: flex; align-items: center; gap: 4px; }
  .nav-toggle, .nav-mobile { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(circle at 20% 0%, rgba(199, 154, 58, 0.18), transparent 60%),
              radial-gradient(circle at 90% 100%, rgba(42, 139, 106, 0.18), transparent 55%),
              linear-gradient(180deg, var(--emerald-900) 0%, var(--emerald-800) 100%);
  color: var(--cream-50);
  padding: 56px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/img/bismillah.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.06;
  mix-blend-mode: screen;
  z-index: -1;
}
.hero__inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.1fr 1fr; gap: 56px; }
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.05;
  color: var(--cream-50);
  margin: 0 0 12px;
}
.hero h1 small { display: block; font-size: 0.45em; color: var(--gold-300); font-weight: 500; letter-spacing: 0.04em; margin-top: 6px; }
.hero .urdu-greeting {
  font-family: var(--font-arabic);
  font-size: clamp(24px, 3vw, 32px);
  color: var(--gold-300);
  margin-bottom: 8px;
  direction: rtl;
}
.hero p.lead {
  font-size: 17px;
  color: rgba(255, 253, 247, 0.85);
  max-width: 560px;
  margin-bottom: 24px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__quote {
  background: rgba(255, 253, 247, 0.06);
  border: 1px solid rgba(255, 253, 247, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: relative;
}
.hero__quote-emblem {
  position: absolute;
  top: 14px; right: 16px;
  width: 28px; height: 28px;
  color: var(--gold-300);
  opacity: 0.6;
}
.hero__quote blockquote {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.45;
  font-style: italic;
  margin: 0 0 10px;
  color: var(--cream-50);
  padding-right: 36px;
}
.hero__quote cite { font-style: normal; font-size: 12px; color: var(--gold-300); letter-spacing: 0.1em; text-transform: uppercase; }
.hero__quote cite span { color: rgba(255, 253, 247, 0.65); text-transform: none; letter-spacing: 0; margin-left: 6px; }

/* Hero carousel (right column) */
.hero__right { position: relative; }
.hero__carousel {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(199, 154, 58, 0.4);
  background: rgba(0,0,0,0.2);
}
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 800ms ease;
}
.hero__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero__slide.is-active { opacity: 1; }
.hero__dots {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.hero__dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.4);
  border: 0;
  cursor: pointer;
  padding: 0;
  transition: background 220ms ease, transform 220ms ease;
}
.hero__dot.is-active { background: var(--gold-500); transform: scale(1.2); }

@media (max-width: 899px) {
  .hero__right { order: -1; max-width: 480px; margin: 0 auto; }
  .hero__quote { padding: 16px 20px; }
  .hero__quote blockquote { font-size: 18px; padding-right: 32px; }
}

.hero__seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 32px;
  border: 1px solid rgba(199, 154, 58, 0.4);
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,0.15);
}
.hero__seal .bismillah {
  font-family: var(--font-arabic);
  font-size: 36px;
  color: var(--gold-300);
  direction: rtl;
}
.hero__seal .seal-divider { width: 80px; height: 1px; background: var(--gold-500); opacity: 0.6; }
.hero__seal .seal-meta { font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(255, 253, 247, 0.65); }
.hero__seal .seal-name { font-family: var(--font-display); font-size: 22px; color: var(--cream-50); }
.hero__seal .seal-title { font-size: 14px; color: var(--gold-300); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 600px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px)  { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Book card */
.book-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  height: 100%;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold-500); }
.book-card__cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--emerald-900), var(--emerald-700));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.book-card__cover img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.book-card__lang {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(13, 59, 46, 0.85);
  color: var(--gold-300);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.book-card[dir="rtl"] .book-card__lang { right: auto; left: 12px; }
.book-card__vol {
  position: absolute;
  bottom: 12px; left: 12px;
  background: var(--gold-500);
  color: var(--emerald-900);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.book-card[dir="rtl"] .book-card__vol { left: auto; right: 12px; }
.book-card__body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-card__title { font-family: var(--font-display); font-size: 20px; line-height: 1.25; margin: 0; color: var(--ink-900); }
.book-card[dir="rtl"] .book-card__title { font-family: var(--font-urdu); font-size: 22px; }
.book-card__meta { font-size: 13px; color: var(--ink-500); display: flex; gap: 12px; align-items: center; }
.book-card__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-300); }
.book-card__cta { margin-top: auto; display: flex; align-items: center; gap: 6px; color: var(--emerald-700); font-weight: 600; font-size: 13px; letter-spacing: 0.04em; }

/* Audio card */
.audio-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
}
.audio-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--emerald-500); }
.audio-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.audio-card__icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--emerald-50);
  color: var(--emerald-700);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.audio-card__icon svg { width: 22px; height: 22px; }
.audio-card__title { font-family: var(--font-display); font-size: 18px; line-height: 1.2; color: var(--ink-900); margin: 0; }
.audio-card__sub   { font-size: 12px; color: var(--ink-500); letter-spacing: 0.05em; }
.audio-card__meta  { font-size: 13px; color: var(--ink-500); margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.audio-card__play  { color: var(--emerald-700); font-weight: 600; font-size: 13px; }

/* Gallery card */
.gallery-card {
  position: relative;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--ink-100);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  transition: transform var(--transition);
}
.gallery-card:hover { transform: scale(1.01); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.gallery-card:hover img { transform: scale(1.06); }
.gallery-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(13, 59, 46, 0.85));
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  color: var(--cream-50);
  font-size: 13px;
}
.gallery-card:hover .gallery-card__overlay { opacity: 1; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(13, 30, 24, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; box-shadow: var(--shadow-lg); border-radius: 8px; }
.lightbox__close {
  position: absolute;
  top: 20px; right: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.1);
  border: 1px solid rgba(255, 253, 247, 0.2);
  color: var(--cream-50);
  display: grid; place-items: center;
  cursor: pointer;
}
.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.1);
  border: 1px solid rgba(255, 253, 247, 0.2);
  color: var(--cream-50);
  display: grid; place-items: center;
  cursor: pointer;
}
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }
.lightbox__caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 30, 24, 0.7);
  color: var(--cream-50);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  max-width: 90%;
  text-align: center;
}

/* ---------- Featured sections ---------- */
.feature-row {
  display: grid;
  gap: 32px;
  align-items: center;
}
@media (min-width: 900px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature-row--reverse > :first-child { order: 2; }
}
.feature-row__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  aspect-ratio: 4/3;
  background: var(--emerald-100);
}
.feature-row__image img { width: 100%; height: 100%; object-fit: cover; }
.feature-row h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 16px; }
.feature-row p  { font-size: 17px; color: var(--ink-700); }
.feature-row .urdu-block { font-family: var(--font-urdu); font-size: 26px; line-height: 2; color: var(--emerald-800); margin: 0 0 16px; }

.checklist { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
.checklist li { display: flex; align-items: flex-start; gap: 10px; }
.checklist .check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--emerald-700);
  color: var(--gold-300);
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.checklist .check svg { width: 12px; height: 12px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  text-align: center;
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat__value {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  color: var(--gold-500);
  line-height: 1;
  margin-bottom: 6px;
  font-weight: 600;
}
.section--emerald .stat__value { color: var(--gold-300); }
.stat__label { font-size: 13px; color: var(--ink-500); letter-spacing: 0.06em; text-transform: uppercase; }
.section--emerald .stat__label { color: rgba(255, 253, 247, 0.7); }

/* Timeline / milestones */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-500), var(--emerald-500));
}
.timeline__item { position: relative; padding-bottom: 24px; }
.timeline__item::before {
  content: '';
  position: absolute;
  left: -28px; top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--cream-50);
  border: 3px solid var(--gold-500);
  box-shadow: 0 0 0 4px rgba(199, 154, 58, 0.18);
}
.timeline__year { font-family: var(--font-display); color: var(--emerald-700); font-weight: 600; font-size: 18px; }
.timeline__title { font-weight: 600; color: var(--ink-900); margin: 4px 0; }
.timeline__body { color: var(--ink-700); font-size: 15px; }

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}
.filter-bar input[type="search"] {
  flex: 1 1 240px;
  max-width: 320px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: var(--paper);
}
.filter-bar input[type="search"]:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(42, 139, 106, 0.2);
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-pill:hover { color: var(--emerald-700); border-color: var(--emerald-500); }
.filter-pill.is-active { background: var(--emerald-700); color: var(--cream-50); border-color: var(--emerald-700); }

/* Viewer */
.viewer {
  position: fixed;
  inset: 0;
  background: #0a1a13;
  display: flex;
  flex-direction: column;
  z-index: 200;
}
.viewer__bar {
  background: var(--emerald-900);
  color: var(--cream-50);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.viewer__bar a, .viewer__bar button {
  color: var(--cream-50);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.viewer__bar a:hover, .viewer__bar button:hover { background: rgba(255,255,255,0.1); }
.viewer__bar .label { font-size: 13px; line-height: 1.2; }
.viewer__bar .label small { display: block; color: var(--gold-300); font-size: 11px; }
.viewer__bar input[type="number"] {
  width: 64px;
  background: rgba(0,0,0,0.25);
  color: var(--cream-50);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  text-align: center;
}
.viewer__bar input[type="number"]:focus { outline: none; border-color: var(--gold-500); }
.viewer__bar .divider { width: 1px; height: 24px; background: rgba(255,255,255,0.15); }
.viewer__bar .grow { flex: 1; }
.viewer__main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: auto;
  background: #0a1a13;
}
.viewer__main img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
}
.viewer__bar .pageinfo { font-size: 13px; color: rgba(255,255,255,0.75); }
.viewer__loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cream-50);
  font-size: 14px;
  background: rgba(10, 26, 19, 0.9);
}
.viewer__rtl .viewer__main img { direction: rtl; }

@media (max-width: 640px) {
  .viewer__bar { padding: 10px 12px; }
  .viewer__bar .label { display: none; }
  .viewer__bar input[type="number"] { width: 52px; }
}

/* Audio player block (single) */
.audio-player {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audio-player audio { width: 100%; }
.audio-player__title { font-weight: 600; font-size: 15px; }
.audio-player__sub   { font-size: 12px; color: var(--ink-500); }

/* Volume grid (audios) */
.volume-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .volume-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .volume-list { grid-template-columns: repeat(3, 1fr); } }

/* Single-column override for the per-volume track list.
   Tracks need a full-width player so the play button stays
   comfortably tappable on desktop too. */
.volume-list--tracks {
  grid-template-columns: 1fr !important;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--emerald-900);
  color: var(--cream-50);
  padding: 64px 0 24px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/img/bismillah.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-position: center;
  opacity: 0.04;
  pointer-events: none;
}
.site-footer a { color: var(--gold-300); }
.site-footer a:hover { color: var(--gold-100); }
.site-footer .footer-grid {
  display: grid;
  gap: 40px;
  margin-bottom: 40px;
  position: relative;
}
@media (min-width: 720px) { .site-footer .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer h4 {
  color: var(--gold-300);
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer li { font-size: 14px; color: rgba(255, 253, 247, 0.8); }
.site-footer li a { display: inline-flex; align-items: center; gap: 6px; }
.site-footer__about p { font-size: 14px; color: rgba(255, 253, 247, 0.75); line-height: 1.7; }
.site-footer__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.site-footer__brand .brand__title { color: var(--cream-50); }
.site-footer__brand .brand__sub { color: var(--gold-300); }
.site-footer__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  position: relative;
  font-size: 13px;
  color: rgba(255, 253, 247, 0.7);
}
@media (min-width: 720px) { .site-footer__bottom { flex-direction: row; justify-content: space-between; text-align: left; } }
.site-footer__credits a { color: var(--gold-300); font-weight: 600; }

/* ---------- Utility ---------- */
.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;
}
.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--emerald-700);
  color: var(--cream-50);
  padding: 8px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { top: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--emerald-50);
  color: var(--emerald-700);
  font-weight: 600;
}
.badge--gold { background: var(--gold-100); color: var(--gold-700); }
.badge--ink  { background: var(--ink-100); color: var(--ink-700); }

.spinner {
  display: inline-block;
  width: 32px; height: 32px;
  border: 3px solid var(--emerald-100);
  border-top-color: var(--emerald-700);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 0%, var(--cream-100) 50%, var(--ink-100) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s linear infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Page-specific tweaks */
.page-header {
  background: linear-gradient(180deg, var(--cream-100), var(--cream-50));
  border-bottom: 1px solid var(--line);
  padding: 56px 0 40px;
  text-align: center;
}
.page-header h1 {
  font-size: clamp(32px, 5vw, 52px);
  margin: 0 0 12px;
}
.page-header p { color: var(--ink-500); font-size: 17px; max-width: 600px; margin: 0 auto; }
.breadcrumbs {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-500);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--emerald-700); }
.breadcrumbs__sep { color: var(--ink-300); }

/* Viewer anchor with sticky header offset */
.viewer-anchor { scroll-margin-top: 80px; }

/* Inline list of links */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.link-list a { display: inline-flex; align-items: center; gap: 6px; }

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-500);
}

/* Notice / banner */
.notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--gold-100), var(--cream-100));
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-md);
  color: var(--ink-900);
  font-size: 14px;
}
.notice svg { color: var(--gold-700); flex-shrink: 0; }

/* Quran-style verse */
.verse {
  font-family: var(--font-arabic);
  font-size: 28px;
  line-height: 2;
  text-align: center;
  color: var(--emerald-800);
  background: var(--cream-100);
  border: 1px solid var(--gold-300);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  margin: 0 0 24px;
  direction: rtl;
}
.verse__ref { display: block; font-family: var(--font-body); font-size: 13px; color: var(--ink-500); margin-top: 12px; direction: ltr; }

/* Soft divider between content blocks */
.soft-divider {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 32px 0; color: var(--gold-500);
}
.soft-divider::before, .soft-divider::after {
  content: ''; flex: 0 0 80px; height: 1px; background: currentColor; opacity: 0.4;
}

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
table.data thead th { background: var(--cream-100); font-family: var(--font-display); font-weight: 600; color: var(--emerald-800); }
table.data tbody tr:hover { background: var(--emerald-50); }

/* Print friendliness */
@media print {
  .site-header, .site-footer, .nav-toggle, .nav-mobile, .filter-bar, .btn { display: none !important; }
  body { background: white; color: black; }
}
