/* Unity of Islam — portal stylesheet
   Committed single theme: parchment reading surface, deep-emerald chrome, antique gold.
   Every color painted explicitly. */

:root {
  --emerald-deep: #0a2b21;
  --emerald:      #0e3b2e;
  --emerald-soft: #16503f;
  --parchment:    #f8f3e7;
  --panel:        #fffdf6;
  --ink:          #24312a;
  --muted:        #6d7c72;
  --gold:         #b98f3e;
  --gold-bright:  #d9b96b;
  --gold-pale:    #f0e3c4;
  --hairline:     rgba(185, 143, 62, 0.35);
  --hairline-soft:rgba(185, 143, 62, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--parchment);
  color: var(--ink);
  font-family: "Jost", "Segoe UI", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

/* ---------------- header (two-tier: centred brand + ornamental nav band) ---------------- */
.site-header {
  background: linear-gradient(180deg, var(--emerald-soft), var(--emerald) 70%);
}

.header-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 1.1rem 1.5rem 0.95rem;
}
.header-flourish {
  flex: 0 1 240px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--hairline));
}
.header-flourish.right { background: linear-gradient(to left, transparent, var(--hairline)); }

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark { width: 46px; height: 46px; filter: drop-shadow(0 0 10px rgba(217, 185, 107, 0.35)); }
.brand-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f1e9d8;
  white-space: nowrap;
}
.brand-name i { color: var(--gold-bright); font-weight: 300; text-transform: lowercase; letter-spacing: 0.05em; }

.header-tools {
  position: absolute;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  background: var(--emerald-deep);
  border-top: 3px double var(--hairline);
  border-bottom: 3px double var(--hairline);
  padding: 0.1rem 1rem;
}
.site-nav a {
  position: relative;
  color: #cfdad2;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.7rem 1.15rem;
  transition: color 0.2s ease;
}
.site-nav a + a::before {
  content: "\25C6";
  position: absolute;
  left: -0.28rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.3rem;
  color: var(--gold);
  opacity: 0.75;
}
.site-nav a:hover { color: #fff; }
.site-nav a.active { color: var(--gold-bright); }
.site-nav a.active::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  right: 1.05rem;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--gold-bright), transparent);
}

.lang-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.04);
}
.lang-wrap select {
  background: transparent;
  border: none;
  outline: none;
  color: #f1e9d8;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  max-width: 130px;
}
.lang-wrap select option { color: var(--ink); background: var(--panel); }

.nav-burger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--gold-bright); margin: 5px 0; }

/* ---------------- hero ---------------- */
.hero {
  background:
    radial-gradient(110% 120% at 50% -20%, var(--emerald-soft) 0%, var(--emerald) 45%, var(--emerald-deep) 100%);
  color: #f1e9d8;
  text-align: center;
  padding: 4.2rem 1.5rem 3.4rem;
  border-bottom: 1px solid var(--hairline);
}
.hero-emblem { width: clamp(110px, 15vw, 150px); margin-bottom: 1.6rem; }
.hero-basmala {
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  color: var(--gold-bright);
  margin-bottom: 0.1rem;
}
.hero-basmala-tr, .hero-verse-tr {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #b9c8be;
  max-width: 60ch;
  margin: 0 auto 0.7rem;
  text-wrap: balance;
}
.hero-verse {
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  color: #f1e9d8;
  margin: 0.2rem 0 0.1rem;
}
html[lang="ar"] .hero-basmala-tr { display: none; }
.hero-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.13em;
  text-transform: uppercase;
  line-height: 1.1;
  text-wrap: balance;
  margin-bottom: 0.7rem;
}
.hero-title i { font-weight: 300; text-transform: lowercase; letter-spacing: 0.05em; color: var(--gold-bright); }
.hero-tagline {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: #b9c8be;
  max-width: 52ch;
  margin: 0 auto 2rem;
  text-wrap: balance;
}

.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto 2.4rem;
  border: 1px solid var(--hairline);
  background: rgba(7, 20, 16, 0.45);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: #f1e9d8;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
}
.hero-search input::placeholder { color: #8fa396; }
.hero-search button,
.fatwa-search button {
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 70%);
  color: var(--emerald-deep);
  border: none;
  cursor: pointer;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0 1.4rem;
}
.hero-search button:hover, .fatwa-search button:hover { filter: brightness(1.1); }

.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1.4rem, 5vw, 3.5rem);
}
.hero-stats div { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.hero-stats strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.hero-stats span {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #9fb2a6;
}

/* ---------------- layout ---------------- */
.container { max-width: 1080px; margin: 0 auto; padding: 3rem 1.5rem; }
.container.narrow { max-width: 640px; }
.center { text-align: center; }

.section-head { text-align: center; margin-bottom: 2.4rem; }
.section-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  color: var(--emerald);
  letter-spacing: 0.04em;
  text-wrap: balance;
  margin-bottom: 0.4rem;
}
.section-head p { color: var(--muted); max-width: 60ch; margin: 0 auto; text-wrap: balance; }

.loading { text-align: center; color: var(--muted); padding: 2rem 0; }
.error-box { text-align: center; color: #8a3b2e; padding: 1.6rem; }
.error-box button { margin-top: 0.6rem; }

.btn-gold {
  display: inline-block;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold) 70%);
  color: var(--emerald-deep);
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.85rem 1.8rem;
  transition: filter 0.2s ease;
}
.btn-gold:hover { filter: brightness(1.08); }

.btn-line {
  background: none;
  border: 1px solid var(--hairline);
  color: var(--emerald);
  cursor: pointer;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  transition: background 0.2s ease;
}
.btn-line:hover { background: var(--gold-pale); }
.btn-line:disabled { opacity: 0.4; cursor: default; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------------- home extras ---------------- */
.home-quran { margin-bottom: 3.5rem; }

/* ---------------- prayer times (inside the hero, above the fold) ---------------- */
.hero { padding: 2.4rem 1.5rem 2.6rem; }
.hero-emblem { width: clamp(84px, 10vw, 110px); margin-bottom: 1rem; }
.hero-tagline { margin-bottom: 1.4rem; }
.hero-search { margin-bottom: 2rem; }

.hero .prayer-sec { max-width: 920px; margin: 0 auto; }
.prayer-head h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: #f1e9d8;
}
.prayer-head #prayerLoc { color: var(--gold-bright); font-size: 0.85rem; letter-spacing: 0.12em; margin: 0.1rem 0 1rem; }
.prayer-note { color: #b9c8be; font-size: 0.88rem; margin-top: 0.5rem; }
.city-form {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 640px;
  margin: 0 auto 1.6rem;
}
.city-form select, .city-form input {
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 0.65rem 0.9rem;
}
.city-form select { min-width: 170px; max-width: 45vw; }
.city-form input { flex: 1; min-width: 180px; }
.prayer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
  max-width: 900px;
  margin: 0 auto 1.2rem;
}
.prayer-tile {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--gold);
  padding: 1rem 0.6rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.prayer-tile .pname {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.prayer-tile .ptime {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}
.prayer-tile.next {
  border-color: var(--gold);
  border-top-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-pale), var(--panel));
  box-shadow: 0 6px 18px rgba(185, 143, 62, 0.18);
}
.prayer-tile.next .pname { color: var(--gold); }

/* ---------------- home articles & FAQ ---------------- */
.articles-sec { margin: 3.5rem 0; }
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}
.seo-art {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--gold);
  padding: 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}
.art-illus { width: 100%; max-width: 150px; height: auto; align-self: center; }
.seo-art h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--emerald);
}
.seo-art p { font-size: 0.92rem; flex: 1; }
.faq-sec { margin-top: 3.5rem; }
.salam-tr { font-size: 0.85rem; font-style: italic; color: #b9c8be; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3.5rem;
}
.feature {
  display: block;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--gold);
  padding: 1.6rem 1.4rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(14, 59, 46, 0.12); }
.feature-glyph {
  display: block;
  font-family: "Amiri", serif;
  font-size: 1.9rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.feature h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--emerald);
  margin-bottom: 0.35rem;
}
.feature p { font-size: 0.9rem; color: var(--muted); }

.knowledge {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}
.know-col {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  padding: 1.8rem 1.6rem;
}
.know-col h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.45rem;
  color: var(--emerald);
  margin-bottom: 1rem;
}
.know-list { list-style: none; counter-reset: know; display: flex; flex-direction: column; gap: 0.7rem; }
.know-list li { counter-increment: know; padding-left: 2.1rem; position: relative; font-size: 0.95rem; }
.know-list li::before {
  content: counter(know);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.4rem;
  height: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--emerald-deep);
  background: var(--gold-pale);
  border: 1px solid var(--hairline);
  transform: rotate(45deg);
}
.know-list li::before { border-radius: 2px; }
.know-list strong { font-weight: 500; color: var(--emerald); }

/* ---------------- quran ---------------- */
.surah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.8rem;
}
.surah-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  padding: 0.8rem 1rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.surah-card:hover { border-color: var(--gold); box-shadow: 0 6px 16px rgba(14, 59, 46, 0.1); }
.surah-num {
  flex-shrink: 0;
  width: 2.1rem;
  height: 2.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(45deg);
  border: 1px solid var(--gold);
  color: var(--emerald);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.surah-num span { transform: rotate(-45deg); }
.surah-names { flex: 1; min-width: 0; }
.surah-en { display: block; font-weight: 500; color: var(--emerald); font-size: 0.95rem; }
.surah-meta { display: block; font-size: 0.75rem; color: var(--muted); }
.surah-ar { font-family: "Amiri", serif; font-size: 1.25rem; color: var(--gold); flex-shrink: 0; }

.reader-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.reader-nav { display: flex; gap: 0.6rem; }

.surah-header {
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--gold);
  padding: 1.6rem 1rem 1.4rem;
  margin-bottom: 1.6rem;
}
.surah-header .ar {
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: 2rem;
  color: #b02418;
}
.surah-header .en {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  color: var(--gold);
}
.surah-header .meta { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 0.3rem; }
.surah-header .basmala { font-family: "Scheherazade New", "Amiri", serif; font-size: 1.5rem; color: #b02418; margin-top: 1rem; }

.ayah-list { display: flex; flex-direction: column; gap: 0; }
.ayah {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: none;
  padding: 1.3rem 1.5rem;
}
.ayah:first-child { border-top: 1px solid var(--hairline-soft); }
.ayah .ar {
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: 1.65rem;
  line-height: 2.35;
  color: var(--ink);
  direction: rtl;
  text-align: right;
  margin-bottom: 0.6rem;
}
.ayah .ar .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7em;
  font-size: 0.55em;
  color: var(--gold);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.1em 0.4em;
  margin-right: 0.5em;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.ayah .tr { color: var(--ink); font-size: 0.98rem; }
.ayah .tr b { color: var(--gold); font-weight: 500; margin-inline-end: 0.4rem; font-variant-numeric: tabular-nums; }

/* ---------------- mushaf (3D book, Arabic only) ---------------- */
.quran-modes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.quran-modes .btn-line.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #f1e9d8;
}

#diyanetWrap {
  /* full-bleed: break out of the 1080px container */
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 clamp(0.75rem, 2vw, 2rem);
}
.diyanet-frame {
  display: block;
  width: 100%;
  height: max(640px, calc(100vh - 215px));
  border: 1px solid var(--hairline);
  background: #fff;
}
#diyanetWrap .content-note { margin: 0 auto 0.8rem; }
#diyanetWrap .content-note a { color: var(--gold); }

.mushaf-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.mushaf-bar input[type="number"] {
  width: 66px;
  text-align: center;
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 0.4rem 0.3rem;
  font-variant-numeric: tabular-nums;
}
.mushaf-juz {
  font-family: "Amiri", serif;
  font-size: 1.05rem;
  color: var(--gold);
}

.mushaf-stage {
  perspective: 2600px;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 2rem;
}
.mushaf-book {
  direction: rtl;
  position: relative;
  display: flex;
  background: linear-gradient(180deg, #123c2f, #0a2b21);
  padding: 10px 10px 14px;
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(10, 43, 33, 0.35), 0 4px 14px rgba(10, 43, 33, 0.25);
}
.mushaf-book::after {
  /* spine shadow */
  content: "";
  position: absolute;
  top: 10px;
  bottom: 14px;
  left: 50%;
  width: 44px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(36, 49, 42, 0.22) 46%, rgba(36, 49, 42, 0.3) 50%, rgba(36, 49, 42, 0.22) 54%, transparent);
  pointer-events: none;
  z-index: 4;
}
.mushaf-page {
  position: relative;
  width: min(400px, 44vw);
  min-height: calc(min(400px, 44vw) * 1.45);
  background: linear-gradient(135deg, #fdfaf1 0%, #f7f1e2 100%);
  padding: clamp(0.9rem, 2.5vw, 1.7rem);
  display: flex;
  flex-direction: column;
}
.mushaf-page::before {
  /* gilded frame */
  content: "";
  position: absolute;
  inset: clamp(0.45rem, 1.2vw, 0.8rem);
  border: 1px solid var(--hairline);
  outline: 1px solid var(--hairline-soft);
  outline-offset: 3px;
  pointer-events: none;
}
.mushaf-text {
  flex: 1;
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: clamp(0.82rem, 1.75vw, 1.22rem);
  line-height: 2.25;
  text-align: justify;
  direction: rtl;
  color: var(--ink);
  padding: clamp(0.5rem, 1.4vw, 1rem);
  overflow: hidden;
}
.lafz { color: #b02418; }
.ayah-marker {
  color: var(--gold);
  font-size: 0.82em;
  margin: 0 0.12em;
  white-space: nowrap;
}
.mushaf-run { margin: 0; text-align: justify; }
.mushaf-run + .mushaf-surah-band { margin-top: 0.55em; }
.mushaf-surah-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7em;
  text-align: center;
  font-size: 1.04em;
  color: #b02418;
  background: linear-gradient(90deg, transparent 2%, var(--gold-pale) 20%, var(--gold-pale) 80%, transparent 98%);
  border-top: 4px double var(--gold);
  border-bottom: 4px double var(--gold);
  margin: 0.25em 0 0.3em;
  padding: 0.22em 0.4em;
}
.mushaf-surah-band .rosette { color: var(--gold); font-size: 0.75em; }
.mushaf-bismillah {
  display: block;
  text-align: center;
  font-size: 1.06em;
  color: #b02418;               /* classic Turkish mushaf rubrication */
  margin: 0.05em 0 0.3em;
}
.mushaf-pagenum {
  font-family: "Scheherazade New", "Amiri", serif;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
  padding: 0 clamp(0.5rem, 1.4vw, 1rem);
}
.mushaf-pagenum.pn-right { text-align: right; }
.mushaf-pagenum.pn-left { text-align: left; }
.mushaf-sheet {
  position: absolute;
  top: 10px;
  bottom: 14px;
  width: calc(50% - 10px);
  transform-style: preserve-3d;
  transition: transform 0.95s cubic-bezier(0.35, 0.1, 0.25, 1);
  z-index: 6;
}
.mushaf-sheet.from-left  { left: 10px;  transform-origin: right center; }
.mushaf-sheet.from-right { right: 10px; transform-origin: left center; }
.mushaf-sheet.from-left.turn  { transform: rotateY(-180deg); }
.mushaf-sheet.from-right.turn { transform: rotateY(180deg); }
.mushaf-sheet .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  width: 100%;
  min-height: 100%;
  box-shadow: 0 0 18px rgba(36, 49, 42, 0.18);
}
.mushaf-sheet .face.back { transform: rotateY(180deg); }

@media (prefers-reduced-motion: reduce) {
  .mushaf-sheet { transition: none; }
}

/* ---------------- hadith ---------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.book-card {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-top: 3px solid var(--emerald);
  padding: 1.5rem 1.4rem;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.book-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(14, 59, 46, 0.12); }
.book-card .ar { font-family: "Amiri", serif; font-size: 1.4rem; color: var(--gold); display: block; }
.book-card .en {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--emerald);
  display: block;
  margin: 0.2rem 0 0.4rem;
}
.book-card .by { font-size: 0.85rem; color: var(--muted); display: block; }
.book-card .ct { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); display: block; margin-top: 0.6rem; }

.select-wrap { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.select-wrap select {
  font-family: "Jost", system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 0.45rem 0.6rem;
  max-width: min(420px, 60vw);
}

.hadith-list { display: flex; flex-direction: column; gap: 1rem; }
.hadith-card {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  padding: 1.3rem 1.5rem;
}
.hadith-card .hnum {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.hadith-card .ar {
  font-family: "Amiri", serif;
  font-size: 1.35rem;
  line-height: 2.1;
  direction: rtl;
  text-align: right;
  color: var(--ink);
  border-bottom: 1px dashed var(--hairline-soft);
  padding-bottom: 0.8rem;
  margin-bottom: 0.8rem;
}
.hadith-card .tr { font-size: 0.95rem; color: var(--ink); }
.hadith-card .grade { margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.hadith-card .tr-mt {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--hairline-soft);
  font-size: 0.95rem;
  color: var(--ink);
}
.hadith-card .mt-tag { font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.source-line {
  margin-top: 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  direction: ltr;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  border-top: 1px dashed var(--hairline-soft);
  padding-top: 0.5rem;
}
.source-line { flex-wrap: wrap; }
.source-line .src-left { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; min-width: 0; }
.source-line .src-site {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}
.source-line .src-site:hover { text-decoration: underline; color: var(--gold); }
.source-line .src-note {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  font-weight: 300;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1.6rem;
}
.pager span { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- scholars ---------------- */
.content-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 64ch;
  margin: -1rem auto 2rem;
}
.scholar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
}
.scholar-card {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  padding: 1.6rem 1.5rem;
}
.scholar-card .years { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
.scholar-card h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--emerald);
  margin: 0.2rem 0 0.1rem;
}
.scholar-card .field { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.7rem; }
.scholar-card p.bio { font-size: 0.92rem; }
.scholar-card .work { margin-top: 0.7rem; font-size: 0.82rem; color: var(--muted); }
.scholar-card .work b { color: var(--emerald); font-weight: 500; }

/* ---------------- fatwas ---------------- */
.fatwa-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto 1.2rem;
  border: 1px solid var(--hairline);
  background: var(--panel);
}
.fatwa-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--ink);
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  padding: 0.9rem 1.1rem;
}
.fatwa-search input::placeholder { color: var(--muted); }

#fatwaResultsInfo { text-align: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
#fatwaResultsInfo button { margin-left: 0.6rem; }

.fatwa-cat {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--emerald);
  margin: 1.6rem 0 0.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.fatwa-list { display: flex; flex-direction: column; }
.fatwa {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  margin-bottom: 0.6rem;
}
.fatwa summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.9rem 1.2rem;
  font-weight: 400;
  color: var(--emerald);
}
.fatwa summary::-webkit-details-marker { display: none; }
.fatwa summary::before { content: "◆"; font-size: 0.6rem; color: var(--gold); flex-shrink: 0; }
.fatwa[open] summary { border-bottom: 1px dashed var(--hairline-soft); }
.fatwa .answer { padding: 1rem 1.2rem 1.2rem 2.4rem; font-size: 0.94rem; }
.fatwa .answer p + p { margin-top: 0.7em; }
.hname { font-weight: 600; }
.fatwa .answer .fx-head { font-weight: 600; color: var(--emerald); margin-top: 1em; }
.fatwa .answer .refs a { color: var(--gold); text-decoration: none; }
.fatwa .answer .refs a:hover { text-decoration: underline; }
.fatwa .answer .refs {
  margin-top: 0.8rem;
  text-align: right;
  direction: ltr;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  border-top: 1px dashed var(--hairline-soft);
  padding-top: 0.5rem;
}
.fatwa.hit { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-pale); }
mark { background: var(--gold-pale); color: inherit; padding: 0 2px; }

/* ---------------- site search results ---------------- */
.result-item {
  display: block;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  padding: 0.8rem 1.1rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s ease;
}
.result-item:hover { border-color: var(--gold); }
.result-item .rt { display: block; font-weight: 400; color: var(--emerald); }
.result-item .snip { display: block; font-size: 0.85rem; color: var(--muted); margin-top: 0.15rem; }
.result-item .snip[lang="ar"] { font-family: "Amiri", serif; direction: rtl; text-align: right; font-size: 1.05rem; }
.ayah.hit, .scholar-card.hit { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-pale); }

/* ---------------- contact ---------------- */
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.contact-form span { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font-family: "Jost", system-ui, sans-serif;
  font-weight: 300;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 0.8rem 1rem;
  resize: vertical;
}
.contact-form .btn-gold { align-self: flex-start; }
.contact-done {
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--emerald);
  padding: 2rem 0;
}

/* ---------------- footer ---------------- */
.site-footer {
  background: linear-gradient(180deg, var(--emerald), var(--emerald-deep));
  color: #9fb2a6;
  text-align: center;
  padding: 2.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-top: 1px solid var(--hairline);
}
.site-footer .salam { font-family: "Scheherazade New", "Amiri", serif; font-size: 1.45rem; color: var(--gold); }
.site-footer .fine { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; }
.site-footer .fine-src { font-size: 0.72rem; }

/* ---------------- rtl ---------------- */
html[dir="rtl"] .surah-card, html[dir="rtl"] .book-card { text-align: right; }
html[dir="rtl"] .ayah .ar .num { margin-right: 0; margin-left: 0.5em; }
html[dir="rtl"] .fatwa .answer { padding: 1rem 2.4rem 1.2rem 1.2rem; }
html[dir="rtl"] .contact-form .btn-gold { align-self: flex-end; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .header-top { justify-content: flex-start; padding: 0.8rem 1rem; }
  .header-flourish { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .header-tools { position: static; transform: none; margin-left: auto; }
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0.4rem 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.65rem 1.2rem; border-left: 2px solid transparent; }
  .site-nav a + a::before { display: none; }
  .site-nav a.active::after { display: none; }
  .site-nav a.active { border-left-color: var(--gold-bright); }
  .nav-burger { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ================= body design refresh (matches the new header) ================= */

/* hero: faint eight-point-star lattice + double gold rule, echoing the nav band */
.hero {
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23d9b96b' stroke-opacity='.06'%3E%3Crect x='54' y='54' width='52' height='52'/%3E%3Crect x='54' y='54' width='52' height='52' transform='rotate(45 80 80)'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(110% 120% at 50% -20%, var(--emerald-soft) 0%, var(--emerald) 45%, var(--emerald-deep) 100%);
  border-bottom: 3px double var(--hairline);
  padding: 3rem 1.5rem 3rem;
}

/* ornamental section headings */
.section-head h2::after {
  content: "\2756";
  display: block;
  font-size: 0.7rem;
  color: var(--gold);
  margin-top: 0.55rem;
  letter-spacing: normal;
}

/* soften the cards */
.feature, .seo-art, .scholar-card, .know-col, .fatwa, .hadith-card,
.surah-card, .book-card, .result-item, .surah-header {
  border-radius: 12px;
}
.seo-art, .scholar-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.seo-art:hover, .scholar-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(14, 59, 46, 0.1); }
.know-col { border-top: 3px double var(--hairline); }
.fatwa summary { transition: background 0.2s ease; border-radius: 12px; }
.fatwa[open] summary { border-radius: 12px 12px 0 0; }
.fatwa summary:hover { background: var(--gold-pale); }

/* prayer tiles as mihrab niches */
.prayer-tile {
  position: relative;
  border-radius: 70px 70px 10px 10px;
  padding: 1.6rem 0.6rem 1rem;
  border-top: 1px solid var(--hairline-soft);
}
.prayer-tile::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--hairline-soft);
  border-radius: 62px 62px 7px 7px;
  pointer-events: none;
}
.prayer-tile.next { border-color: var(--gold); }
.prayer-tile.next::before { border-color: var(--hairline); }

/* feature glyphs inside little arched niches */
.feature-glyph {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 80px;
  height: 66px;
  padding-bottom: 0.35rem;
  background: linear-gradient(180deg, var(--gold-pale), var(--panel));
  border: 1px solid var(--hairline-soft);
  border-radius: 60px 60px 8px 8px;
  font-size: 1.7rem;
  margin-bottom: 0.8rem;
}

/* pill buttons and rounded inputs */
.btn-gold, .btn-line { border-radius: 999px; }
.hero-search { border-radius: 999px; overflow: hidden; }
.hero-search input { padding-left: 1.4rem; }
.fatwa-search { border-radius: 999px; overflow: hidden; }
.city-form select, .city-form input { border-radius: 10px; }
.contact-form input, .contact-form textarea { border-radius: 10px; }
.mushaf-bar input[type="number"] { border-radius: 10px; }
.select-wrap select { border-radius: 10px; }

/* footer echoes the header band */
.site-footer {
  border-top: 3px double var(--hairline);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke='%23d9b96b' stroke-opacity='.05'%3E%3Crect x='54' y='54' width='52' height='52'/%3E%3Crect x='54' y='54' width='52' height='52' transform='rotate(45 80 80)'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--emerald), var(--emerald-deep));
}
/* header search (top-right, left of the language pill) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.header-search {
  margin: 0;
  max-width: 250px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: rgba(7, 20, 16, 0.45);
}
.header-search input { padding: 0.42rem 0.4rem 0.42rem 1rem; font-size: 0.85rem; width: 150px; }
.header-search button { padding: 0 0.9rem; font-size: 0.68rem; letter-spacing: 0.12em; }
.hero-tagline { margin-top: 0.4rem; font-size: clamp(1.15rem, 2.4vw, 1.5rem); color: #d9c9a8; }
@media (max-width: 1080px) {
  .header-flourish { display: none; }
  .header-top { justify-content: flex-start; }
}
@media (max-width: 860px) {
  .header-search { display: none; }
}
/* wider header search */
.header-search { max-width: 420px; }
.header-search input { width: 280px; }
@media (max-width: 1200px) { .header-search input { width: 190px; } }

/* four-column middle and lower bands on wide screens */
@media (min-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(4, 1fr); }
  .art-grid { grid-template-columns: repeat(4, 1fr); }
  .seo-art { padding: 1.3rem 1.1rem; }
  .seo-art .art-illus { height: 74px; }
}

/* sirah timeline */
.sirah-timeline { position: relative; max-width: 780px; margin: 0 auto; padding-left: 2.3rem; }
.sirah-timeline::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  opacity: 0.5;
}
.sirah-item {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-radius: 12px;
  padding: 1.15rem 1.4rem;
  margin-bottom: 1rem;
}
.sirah-item::before {
  content: "\25C6";
  position: absolute;
  left: -2.05rem;
  top: 1.35rem;
  color: var(--gold);
  font-size: 0.6rem;
}
.sirah-item .s-year {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.sirah-item h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--emerald);
  margin: 0.1rem 0 0.35rem;
}
.sirah-item p { font-size: 0.95rem; }
html[dir="rtl"] .sirah-timeline { padding-left: 0; padding-right: 2.3rem; }
html[dir="rtl"] .sirah-timeline::before { left: auto; right: 0.55rem; }
html[dir="rtl"] .sirah-item::before { left: auto; right: -2.05rem; }
/* sticky header: the whole band follows the scroll, shrinking gently */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: 0 6px 20px rgba(10, 43, 33, 0.25);
}
.site-nav { position: static; }
.header-top { transition: padding 0.25s ease; }
.brand-mark { transition: width 0.25s ease, height 0.25s ease; }
.brand-name { transition: font-size 0.25s ease; }
.site-header.scrolled .header-top { padding-top: 0.4rem; padding-bottom: 0.35rem; }
.site-header.scrolled .brand-mark { width: 32px; height: 32px; }
.site-header.scrolled .brand-name { font-size: 1.1rem; }