/* ==========================================================================
   Birhan Academy — Design System
   Light upon light · Qur'an 24:35
   Palette derived from the Birhan Academy logo.
   ========================================================================== */

:root {
  /* Brand */
  --gold: #daa625;
  --gold-deep: #b88a14;
  --gold-tint: #f6e7b8;
  --espresso: #524138;
  --espresso-soft: #6b5649;
  --espresso-deep: #2a211c;
  --charcoal: #343538;
  --black: #000000;

  /* Surfaces */
  --white: #ffffff;
  --cream: #fbf7ee;
  --parchment: #f3ead3;
  --parchment-deep: #ecdfc0;

  /* Lines & shadows */
  --line: rgba(82, 65, 56, 0.14);
  --line-strong: rgba(82, 65, 56, 0.26);
  --line-gold: rgba(184, 138, 20, 0.34);
  --shadow-sm: 0 1px 2px rgba(42, 33, 28, 0.05), 0 2px 8px rgba(42, 33, 28, 0.04);
  --shadow-md: 0 2px 4px rgba(42, 33, 28, 0.05), 0 12px 28px -12px rgba(42, 33, 28, 0.18);
  --shadow-lg: 0 4px 8px rgba(42, 33, 28, 0.06), 0 32px 64px -28px rgba(42, 33, 28, 0.28);

  /* Type */
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --arabic: "Amiri Quran", "Scheherazade New", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --ethiopic: "Noto Serif Ethiopic", "Noto Sans Ethiopic", "Nyala", serif;

  /* Metrics */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --header-h: 74px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------- Reset ---- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; height: auto; }
img { display: block; }

a { color: var(--espresso); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--gold-deep); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--espresso);
  margin: 0 0 0.5em;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4.2rem); line-height: 1.04; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.85rem, 1.4rem + 1.7vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); }
h4 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0.01em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

::selection { background: var(--gold-tint); color: var(--espresso-deep); }

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

/* ------------------------------------------------------------ Utilities -- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2.5rem); }
.wrap-narrow { max-width: var(--wrap-narrow); }
.section { padding-block: clamp(3.2rem, 6vw, 6rem); }
.section--tight { padding-block: clamp(2.4rem, 4vw, 3.6rem); }
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.flow > * + * { margin-top: 1.4rem; }
.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; left: 1rem; top: -100px; z-index: 200;
  background: var(--espresso); color: var(--cream); padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm); font-family: var(--sans); font-size: 0.9rem;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 1rem; color: var(--cream); }

.muted { color: var(--espresso-soft); }
.small { font-size: 0.875rem; line-height: 1.6; }
.tiny { font-size: 0.75rem; line-height: 1.5; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--espresso-soft);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: none;
}
.center .eyebrow { justify-content: center; }

[lang="ar"] { font-family: var(--arabic); direction: rtl; unicode-bidi: isolate; }
[lang="ti"], [lang="am"] { font-family: var(--ethiopic); }

.hide { display: none !important; }

/* --------------------------------------------------------------- Layout -- */
.grid { display: grid; gap: clamp(1.1rem, 2.2vw, 1.8rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); grid-template-columns: 1.05fr 0.95fr; align-items: center; }
.split--narrow { grid-template-columns: 0.85fr 1.15fr; }
@media (max-width: 860px) { .split, .split--narrow { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- Top bar ---- */
.topbar {
  background: var(--espresso-deep);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 38px; flex-wrap: wrap;
}
.topbar a { color: rgba(251, 247, 238, 0.82); text-decoration: none; }
.topbar a:hover { color: var(--gold-tint); }
.topbar__note { display: flex; align-items: center; gap: 0.5rem; color: rgba(251, 247, 238, 0.72); }
.topbar__note svg { color: var(--gold); flex: none; }
.topbar__tools { display: flex; align-items: center; gap: 1.15rem; }
.topbar__tools select {
  font-family: var(--sans); font-size: 0.76rem;
  background: transparent; color: var(--cream);
  border: 1px solid rgba(251, 247, 238, 0.24);
  border-radius: 4px; padding: 0.2rem 0.4rem; max-width: 8.5rem;
}
.topbar__tools select option { color: var(--charcoal); background: var(--white); }
@media (max-width: 720px) {
  .topbar__note span { display: none; }
  .topbar .wrap { justify-content: center; }
}

/* -------------------------------------------------------------- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(251, 247, 238, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-stuck { box-shadow: 0 8px 30px -22px rgba(42, 33, 28, 0.6); background: rgba(251, 247, 238, 0.97); }
.header-inner {
  display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem);
  min-height: var(--header-h);
  padding-block: 0.55rem;
}
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; flex: none; }
.brand__mark { width: 46px; height: 46px; flex: none; }
.brand__type { display: flex; flex-direction: column; line-height: 1; }
.brand__ar { font-family: var(--arabic); font-size: 1rem; color: var(--espresso); line-height: 1.5; }
.brand__ti { font-family: var(--ethiopic); font-size: 0.62rem; color: var(--espresso-soft); letter-spacing: 0.04em; }
.brand__en {
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.19em; text-transform: uppercase; color: var(--charcoal);
  margin-top: 0.18rem;
}
@media (max-width: 400px) { .brand__type { display: none; } }

.main-nav { margin-inline-start: auto; }
.main-nav ul {
  display: flex; align-items: center; gap: 0.15rem;
  list-style: none; margin: 0; padding: 0;
}
.main-nav a {
  display: block; padding: 0.5rem 0.62rem; border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 0.845rem; font-weight: 500;
  color: var(--espresso); text-decoration: none; letter-spacing: 0.01em;
  position: relative; white-space: nowrap;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0.62rem; right: 0.62rem; bottom: 0.28rem;
  height: 1.5px; background: var(--gold); transform: scaleX(0);
  transform-origin: left; transition: transform 0.3s var(--ease);
}
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a[aria-current="page"] { color: var(--espresso-deep); font-weight: 600; }
.main-nav a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid transparent; background: transparent; color: var(--espresso);
  cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { background: var(--gold-tint); color: var(--espresso-deep); }
.icon-btn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }

@media (max-width: 1080px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 620px) {
  .header-actions .btn--subscribe { display: none; }
}

/* Mobile drawer */
.drawer-nav {
  position: fixed; inset: 0 0 0 auto; width: min(88vw, 380px); z-index: 120;
  background: var(--espresso-deep); color: var(--cream);
  transform: translateX(102%); transition: transform 0.4s var(--ease);
  display: flex; flex-direction: column; padding: 1.4rem 1.5rem 2rem;
  overflow-y: auto; box-shadow: var(--shadow-lg);
}
.drawer-nav[data-open="true"] { transform: translateX(0); }
.drawer-nav ul { list-style: none; margin: 1.2rem 0 0; padding: 0; }
.drawer-nav li + li { border-top: 1px solid rgba(251, 247, 238, 0.12); }
.drawer-nav a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.95rem 0.2rem; color: rgba(251, 247, 238, 0.9);
  text-decoration: none; font-family: var(--sans); font-size: 1rem;
}
.drawer-nav a:hover { color: var(--gold-tint); }
.drawer-nav a span { color: rgba(218, 166, 37, 0.7); font-size: 0.8rem; }
.drawer-close { align-self: flex-end; color: var(--cream); }
.drawer-foot { margin-top: auto; padding-top: 1.6rem; color: rgba(251, 247, 238, 0.55); font-size: 0.8rem; }
.scrim {
  position: fixed; inset: 0; background: rgba(42, 33, 28, 0.5); z-index: 110;
  opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.scrim[data-open="true"] { opacity: 1; visibility: visible; }

/* -------------------------------------------------------------- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.78rem 1.4rem; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em;
  text-decoration: none; cursor: pointer; line-height: 1.2;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease),
              color 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn--gold { background: var(--gold); color: var(--charcoal); box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 10px 24px -14px rgba(184, 138, 20, 0.9); }
.btn--gold:hover { background: var(--gold-deep); color: var(--white); }
.btn--espresso { background: var(--espresso); color: var(--cream); }
.btn--espresso:hover { background: var(--espresso-deep); color: var(--white); }
.btn--outline { background: transparent; border-color: var(--line-strong); color: var(--espresso); }
.btn--outline:hover { border-color: var(--gold-deep); background: rgba(246, 231, 184, 0.4); color: var(--espresso-deep); }
.btn--onDark { background: transparent; border-color: rgba(251, 247, 238, 0.35); color: var(--cream); }
.btn--onDark:hover { border-color: var(--gold); color: var(--gold-tint); }
.btn--sm { padding: 0.52rem 0.95rem; font-size: 0.78rem; }
.btn--lg { padding: 0.95rem 1.75rem; font-size: 0.92rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-size: 0.84rem; font-weight: 600;
  color: var(--espresso); text-decoration: none; letter-spacing: 0.02em;
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.24s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }
.link-arrow:hover { color: var(--gold-deep); }

/* ---------------------------------------------------------- Hero / bands -- */
.hero { position: relative; overflow: hidden; background: var(--cream); }
.hero__rays {
  position: absolute; inset: -30% -10% auto auto; width: 78%; height: 150%;
  background:
    conic-gradient(from 208deg at 88% 18%,
      rgba(218, 166, 37, 0.20) 0deg, rgba(218, 166, 37, 0) 12deg,
      rgba(218, 166, 37, 0.13) 22deg, rgba(218, 166, 37, 0) 34deg,
      rgba(218, 166, 37, 0.16) 47deg, rgba(218, 166, 37, 0) 62deg,
      rgba(218, 166, 37, 0.10) 74deg, rgba(218, 166, 37, 0) 90deg);
  filter: blur(2px);
  pointer-events: none;
  mask-image: radial-gradient(60% 60% at 88% 18%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(60% 60% at 88% 18%, #000 0%, transparent 72%);
}
.hero__glow {
  position: absolute; right: -12%; top: -30%; width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(218, 166, 37, 0.16), transparent 62%);
  pointer-events: none;
}
.hero__inner {
  position: relative; display: grid; gap: clamp(2rem, 5vw, 4rem);
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center; padding-block: clamp(3rem, 7vw, 6.2rem);
}
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; padding-block: clamp(2.4rem, 8vw, 3.6rem); }
}
.hero__title { color: var(--espresso-deep); margin-bottom: 0.35rem; }
.hero__title em { font-style: italic; color: var(--gold-deep); }
.hero__arabic {
  font-family: var(--arabic); direction: rtl; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.3rem);
  color: var(--espresso); line-height: 1.9; margin: 0 0 1.2rem;
}
.hero__lead { font-size: clamp(1.02rem, 0.95rem + 0.25vw, 1.15rem); color: var(--espresso-soft); max-width: 54ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.8rem; }
.hero__meta {
  margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem;
  font-family: var(--sans); font-size: 0.76rem; color: var(--espresso-soft);
  letter-spacing: 0.03em;
}
.hero__meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero__meta svg { width: 14px; height: 14px; color: var(--gold-deep); }

.band { position: relative; }
.band--parchment { background: var(--parchment); }
.band--white { background: var(--white); }
.band--espresso { background: var(--espresso); color: var(--cream); }
.band--espresso h2, .band--espresso h3, .band--espresso h4 { color: var(--cream); }
.band--espresso p { color: rgba(251, 247, 238, 0.82); }
.band--deep { background: var(--espresso-deep); color: var(--cream); }
.band--deep h2, .band--deep h3 { color: var(--cream); }
.band--deep p { color: rgba(251, 247, 238, 0.8); }

.pattern {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23524138' stroke-width='1' stroke-opacity='.07'%3E%3Cpath d='M60 4 76 20 92 4M60 4 44 20 28 4M60 116 76 100 92 116M60 116 44 100 28 116M4 60 20 76 4 92M116 60 100 76 116 92M4 60 20 44 4 28M116 60 100 44 116 28'/%3E%3Crect x='36' y='36' width='48' height='48' transform='rotate(45 60 60)'/%3E%3Crect x='44' y='44' width='32' height='32'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.pattern--light {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23daa625' stroke-width='1' stroke-opacity='.16'%3E%3Cpath d='M60 4 76 20 92 4M60 4 44 20 28 4M60 116 76 100 92 116M60 116 44 100 28 116M4 60 20 76 4 92M116 60 100 76 116 92M4 60 20 44 4 28M116 60 100 44 116 28'/%3E%3Crect x='36' y='36' width='48' height='48' transform='rotate(45 60 60)'/%3E%3Crect x='44' y='44' width='32' height='32'/%3E%3C/g%3E%3C/svg%3E");
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: clamp(1.6rem, 3vw, 2.4rem); }
.section-head h2 { margin-bottom: 0.2rem; }
.section-head p { margin: 0.35rem 0 0; color: var(--espresso-soft); max-width: 62ch; }
.section-head .link-arrow { flex: none; padding-bottom: 0.35rem; }
@media (max-width: 640px) { .section-head { flex-direction: column; align-items: flex-start; gap: 0.8rem; } }

/* Star divider */
.star-divider { display: flex; align-items: center; gap: 1rem; color: var(--gold); }
.star-divider::before, .star-divider::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, transparent, var(--line-gold), transparent);
}
.star-divider svg { width: 22px; height: 22px; flex: none; }

/* ---------------------------------------------------------------- Cards --- */
.card {
  position: relative; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: clamp(1.2rem, 2vw, 1.65rem);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.card--parchment { background: var(--parchment); }
.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-gold); }
a.card { display: block; text-decoration: none; color: inherit; }
a.card h3 { color: var(--espresso); }
a.card:hover h3 { color: var(--espresso-deep); }

.tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--sans); font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 0.24rem 0.6rem; border-radius: 999px;
  background: var(--gold-tint); color: var(--espresso); border: 1px solid rgba(218, 166, 37, 0.35);
}
.tag--quiet { background: rgba(243, 234, 211, 0.7); border-color: var(--line); color: var(--espresso-soft); }
.tag--dark { background: transparent; border-color: rgba(251, 247, 238, 0.3); color: rgba(251, 247, 238, 0.85); }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem;
  font-family: var(--sans); font-size: 0.74rem; color: var(--espresso-soft);
  letter-spacing: 0.02em;
}
.meta svg { width: 13px; height: 13px; opacity: 0.75; }
.meta > span { display: inline-flex; align-items: center; gap: 0.32rem; }

/* Lesson card */
.lesson-card { display: flex; flex-direction: column; gap: 0.7rem; height: 100%; }
.lesson-card__top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.lesson-card h3 { font-size: 1.35rem; margin: 0.1rem 0 0; line-height: 1.2; }
.lesson-card p { margin: 0; color: var(--espresso-soft); font-size: 0.96rem; line-height: 1.62; }
.lesson-card__foot { margin-top: auto; padding-top: 0.7rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* Pathway cards */
.pathways { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.pathway {
  position: relative; padding: 1.6rem 1.5rem 1.4rem; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; color: inherit;
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.pathway::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s var(--ease);
}
.pathway:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-gold); }
.pathway:hover::after { transform: scaleX(1); }
.pathway__num {
  font-family: var(--serif); font-size: 0.95rem; letter-spacing: 0.14em;
  color: var(--gold-deep); display: flex; align-items: center; gap: 0.5rem;
}
.pathway__num::after { content: ""; height: 1px; width: 28px; background: var(--line-gold); }
.pathway h3 { font-size: 1.45rem; margin: 0; }
.pathway p { margin: 0; font-size: 0.95rem; color: var(--espresso-soft); }
.pathway__cta { margin-top: 0.6rem; font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--espresso); display: inline-flex; align-items: center; gap: 0.35rem; }
.pathway:hover .pathway__cta { color: var(--gold-deep); }
.pathway__cta svg { width: 14px; height: 14px; }

/* -------------------------------------------------------------- Filters --- */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center;
  padding: 1rem 1.1rem; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.filterbar__group { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filterbar label { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--espresso-soft); }
.select, .input, .textarea {
  font-family: var(--sans); font-size: 0.86rem; color: var(--charcoal);
  background: var(--cream); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 0.55rem 0.7rem; min-height: 42px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.select:focus, .input:focus, .textarea:focus { border-color: var(--gold-deep); background: var(--white); }
.textarea { width: 100%; min-height: 130px; resize: vertical; font-family: var(--text); font-size: 1rem; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.chip {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  padding: 0.42rem 0.85rem; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--espresso);
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--gold-deep); background: rgba(246, 231, 184, 0.35); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--espresso); border-color: var(--espresso); color: var(--cream); }
.result-count { font-family: var(--sans); font-size: 0.78rem; color: var(--espresso-soft); }
.empty-state { padding: 3rem 1.5rem; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--espresso-soft); }

/* --------------------------------------------------------------- Forms ---- */
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > label, .label { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--espresso); letter-spacing: 0.01em; }
.field__hint { font-size: 0.78rem; color: var(--espresso-soft); }
.input, .textarea { width: 100%; background: var(--white); }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.92rem; color: var(--espresso-soft); }
.checkbox input { margin-top: 0.35rem; accent-color: var(--gold-deep); width: 17px; height: 17px; flex: none; }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-grid .field--full { grid-column: auto; } }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); font-family: var(--sans); font-size: 0.86rem; display: none; }
.form-status[data-state="success"] { display: block; background: rgba(246, 231, 184, 0.6); border: 1px solid var(--line-gold); color: var(--espresso-deep); }
.form-status[data-state="error"] { display: block; background: #fdefe9; border: 1px solid #d8a48f; color: #7b3b23; }

/* ---------------------------------------------------------- Newsletter ---- */
.subscribe-band { position: relative; overflow: hidden; background: var(--espresso); color: var(--cream); border-radius: var(--radius-lg); padding: clamp(1.8rem, 4vw, 3rem); }
.subscribe-band h2 { color: var(--cream); }
.subscribe-band .eyebrow { color: var(--gold-tint); }
.subscribe-band .eyebrow::before { background: var(--gold); }
.subscribe-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.4rem; }
.subscribe-form .input { flex: 1 1 240px; background: rgba(251, 247, 238, 0.96); border-color: transparent; min-height: 48px; }
.subscribe-form .btn { flex: none; }

/* ------------------------------------------------------------ Home hero --- */
.hero-verse {
  background: var(--white); border: 1px solid var(--line-gold);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 3vw, 2.1rem); position: relative; overflow: hidden;
}
.hero-verse::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(246, 231, 184, 0.55), transparent 58%);
  pointer-events: none;
}
.hero-verse > * { position: relative; }
.hero-verse__label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.hero-verse__ar {
  font-family: var(--arabic); direction: rtl; text-align: right;
  font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem);
  line-height: 2.15; color: var(--espresso-deep); margin: 0 0 1rem;
}
.hero-verse__tr { font-size: 0.98rem; line-height: 1.72; color: var(--espresso-soft); margin: 0 0 1.1rem; }
.hero-verse__foot { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; padding-top: 1rem; border-top: 1px solid var(--line); }
.hero-verse__ref { font-family: var(--sans); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--espresso); }

/* Ayah of the day */
.aotd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 0; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-md); }
.aotd__side { background: var(--espresso); color: var(--cream); padding: clamp(1.5rem, 3vw, 2.2rem); display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem; position: relative; }
.aotd__side .eyebrow { color: var(--gold-tint); }
.aotd__side h2 { color: var(--cream); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.aotd__body { padding: clamp(1.5rem, 3vw, 2.2rem); }
.aotd__ar { font-family: var(--arabic); direction: rtl; text-align: right; font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.85rem); line-height: 2.1; color: var(--espresso-deep); margin: 0 0 1rem; }
.aotd__tr { font-size: 0.98rem; color: var(--espresso-soft); line-height: 1.72; }
.aotd__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 1.1rem; }
.aotd__day { font-family: var(--serif); font-size: 3.2rem; line-height: 1; color: var(--gold); }
@media (max-width: 820px) { .aotd { grid-template-columns: 1fr; } }

/* Featured video */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--espresso-deep); border: 1px solid var(--line);
}
.video-frame iframe, .video-frame video { width: 100%; height: 100%; border: 0; display: block; }
.video-poster {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(70% 70% at 50% 40%, rgba(218, 166, 37, 0.18), transparent 70%),
    linear-gradient(160deg, #3a2e28, #2a211c 65%);
  border: 0; cursor: pointer; color: var(--cream); width: 100%;
}
.video-poster__play {
  width: 76px; height: 76px; border-radius: 50%; background: var(--gold);
  color: var(--charcoal); display: grid; place-items: center;
  box-shadow: 0 0 0 10px rgba(218, 166, 37, 0.14);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.video-poster:hover .video-poster__play { transform: scale(1.06); background: var(--gold-deep); color: var(--white); }
.video-poster__play svg { width: 26px; height: 26px; margin-left: 3px; }
.video-poster__label { position: absolute; bottom: 1rem; left: 0; right: 0; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(251, 247, 238, 0.72); }
.video-poster__badge { position: absolute; top: 1rem; left: 1rem; }

/* Quote / reflection block */
.pullquote {
  border-left: 2px solid var(--gold); padding: 0.2rem 0 0.2rem 1.4rem;
  font-family: var(--serif); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  line-height: 1.45; color: var(--espresso); font-style: italic;
}
.pullquote cite { display: block; font-family: var(--sans); font-size: 0.76rem; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--espresso-soft); margin-top: 0.8rem; }

/* Callout */
.callout {
  background: rgba(243, 234, 211, 0.75); border: 1px solid var(--line-gold);
  border-radius: var(--radius); padding: 1.1rem 1.3rem; font-size: 0.94rem; color: var(--espresso-soft);
  display: flex; gap: 0.9rem; align-items: flex-start;
}
.callout svg { width: 20px; height: 20px; color: var(--gold-deep); flex: none; margin-top: 0.15rem; }
.callout strong { color: var(--espresso); }

/* ---------------------------------------------------------------- Footer -- */
.site-footer { background: var(--espresso-deep); color: rgba(251, 247, 238, 0.72); padding-top: clamp(2.8rem, 5vw, 4.2rem); position: relative; }
.site-footer a { color: rgba(251, 247, 238, 0.8); text-decoration: none; }
.site-footer a:hover { color: var(--gold-tint); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; flex-direction: column; gap: 1rem; max-width: 34ch; }
.footer-brand img, .footer-brand svg { width: 150px; height: auto; }
.footer-brand p { font-size: 0.9rem; line-height: 1.68; margin: 0; }
.footer h4 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-tint); font-weight: 600; margin: 0 0 0.9rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; font-family: var(--sans); font-size: 0.84rem; }
.footer .social { display: flex; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.footer .social a {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(251, 247, 238, 0.18);
  display: grid; place-items: center; color: rgba(251, 247, 238, 0.78);
  transition: all 0.2s var(--ease);
}
.footer .social a:hover { border-color: var(--gold); color: var(--gold); background: rgba(218, 166, 37, 0.08); }
.footer .social svg { width: 17px; height: 17px; }
.footer-bottom {
  margin-top: 2.6rem; padding: 1.3rem 0 1.8rem; border-top: 1px solid rgba(251, 247, 238, 0.12);
  display: flex; flex-wrap: wrap; gap: 0.8rem 1.6rem; justify-content: space-between; align-items: center;
  font-family: var(--sans); font-size: 0.76rem; color: rgba(251, 247, 238, 0.55);
}
.footer-bottom nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-legal { display: flex; gap: 1rem; flex-wrap: wrap; }

/* --------------------------------------------------------------- Page ----- */
.page-head { background: var(--white); border-bottom: 1px solid var(--line); padding-block: clamp(2.4rem, 5vw, 4rem); position: relative; overflow: hidden; }
.page-head__inner { position: relative; max-width: 780px; }
.page-head h1 { margin-bottom: 0.6rem; }
.page-head p { color: var(--espresso-soft); font-size: clamp(1rem, 0.95rem + 0.25vw, 1.12rem); margin: 0; max-width: 66ch; }
.breadcrumb { display: flex; gap: 0.5rem; flex-wrap: wrap; font-family: var(--sans); font-size: 0.74rem; color: var(--espresso-soft); margin-bottom: 1.1rem; letter-spacing: 0.02em; }
.breadcrumb ol { display: flex; gap: 0.5rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.breadcrumb a { text-decoration: none; color: var(--espresso-soft); }
.breadcrumb a:hover { color: var(--gold-deep); }

.prose { font-size: 1.03rem; line-height: 1.78; color: #3b3634; max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; font-size: 1.9rem; }
.prose h3 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin-bottom: 0.5rem; }
.prose blockquote {
  margin: 1.8rem 0; padding: 1.2rem 1.4rem; background: var(--parchment);
  border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.6; color: var(--espresso);
}
.prose blockquote p { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 1.4rem 0; }
.prose th, .prose td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
.prose th { font-family: var(--sans); font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--espresso-soft); background: var(--parchment); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: var(--parchment); padding: 0.1em 0.35em; border-radius: 4px; }
.prose .quran-ref { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; color: var(--gold-deep); text-decoration: underline; text-decoration-color: rgba(184,138,20,0.4); }

.arabic-inline { font-family: var(--arabic); font-size: 1.5em; line-height: 2; color: var(--espresso-deep); }

/* ----------------------------------------------------------- Verse cards -- */
.verse-grid { display: grid; gap: clamp(1.1rem, 2.4vw, 1.7rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.verse-card { display: flex; flex-direction: column; gap: 0.9rem; padding: clamp(1.2rem, 2.2vw, 1.6rem); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease); }
.verse-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-gold); }
.verse-card__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.verse-card__ref { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--espresso); }
.verse-card__term { font-family: var(--serif); font-style: italic; font-size: 0.92rem; color: var(--gold-deep); }
.verse-card__ar {
  font-family: var(--arabic); direction: rtl; text-align: right;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem); line-height: 2.1;
  color: var(--espresso-deep); margin: 0;
}
.verse-card__tr { font-size: 0.93rem; line-height: 1.7; color: var(--espresso-soft); margin: 0; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.verse-card__theme { font-size: 0.87rem; line-height: 1.62; color: var(--espresso-soft); margin: 0; }
.verse-card__theme strong { color: var(--espresso); font-weight: 600; }
.verse-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding-top: 0.3rem; }

/* ------------------------------------------------------------ Accordion --- */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.accordion details + details { border-top: 1px solid var(--line); }
.accordion summary {
  cursor: pointer; padding: 1rem 1.2rem; font-family: var(--sans); font-size: 0.92rem; font-weight: 600;
  color: var(--espresso); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-size: 1.15rem; color: var(--gold-deep); font-weight: 400; }
.accordion details[open] summary::after { content: "–"; }
.accordion .accordion__body { padding: 0 1.2rem 1.2rem; font-size: 0.95rem; color: var(--espresso-soft); }

/* ==========================================================================
   QUR'AN READER
   ========================================================================== */
.reader { background: var(--cream); }
.reader[data-rt-theme="sepia"] { --rd-bg: #f3ead3; --rd-panel: #fbf3e0; --rd-text: #3f352e; --rd-soft: #6b5849; --rd-line: rgba(82,65,56,.18); }
.reader[data-rt-theme="light"] { --rd-bg: #fbf7ee; --rd-panel: #ffffff; --rd-text: #343538; --rd-soft: #6b5649; --rd-line: rgba(82,65,56,.14); }
.reader[data-rt-theme="dark"] { --rd-bg: #2a211c; --rd-panel: #352a24; --rd-text: #f6e7b8; --rd-soft: rgba(246,231,184,.68); --rd-line: rgba(246,231,184,.16); }
.reader[data-rt-theme="night"] { --rd-bg: #17120f; --rd-panel: #1f1915; --rd-text: #d8cdb8; --rd-soft: #9c9080; --rd-line: rgba(216,205,184,.14); }
.reader, .reader .wrap, .reader-main, .reader-panel { transition: background 0.35s var(--ease), color 0.35s var(--ease); }

.reader-toolbar {
  position: sticky; top: var(--header-h); z-index: 70;
  background: var(--rd-panel); border-bottom: 1px solid var(--rd-line);
  box-shadow: 0 6px 24px -22px rgba(0,0,0,.6);
}
.reader-toolbar__inner { display: flex; align-items: center; gap: 0.7rem; min-height: 58px; padding-block: 0.45rem; flex-wrap: wrap; }
.reader-toolbar .icon-btn { color: var(--rd-text); }
.reader-toolbar .icon-btn:hover { background: var(--gold-tint); color: var(--espresso-deep); }
.tool-group { display: flex; align-items: center; gap: 0.25rem; }
.tool-sep { width: 1px; height: 24px; background: var(--rd-line); margin-inline: 0.2rem; }
.tool-btn {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  padding: 0.42rem 0.7rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--rd-text); cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.38rem; white-space: nowrap;
}
.tool-btn:hover { background: rgba(218,166,37,.14); }
.tool-btn[aria-pressed="true"] { background: var(--espresso); color: var(--cream); border-color: var(--espresso); }
.reader[data-rt-theme="dark"] .tool-btn[aria-pressed="true"],
.reader[data-rt-theme="night"] .tool-btn[aria-pressed="true"] { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
.tool-btn svg { width: 15px; height: 15px; }
.jump-form { display: flex; align-items: center; gap: 0.35rem; }
.jump-form input {
  width: 108px; font-family: var(--sans); font-size: 0.8rem; padding: 0.42rem 0.6rem;
  border: 1px solid var(--rd-line); border-radius: var(--radius-sm);
  background: transparent; color: var(--rd-text);
}
.jump-form input::placeholder { color: var(--rd-soft); }
.toolbar-spacer { margin-inline-start: auto; }

.reader-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr) 0; gap: 0; align-items: start; }
.reader-shell[data-tafsir="open"] { grid-template-columns: 300px minmax(0, 1fr) 380px; }
@media (max-width: 1240px) { .reader-shell[data-tafsir="open"] { grid-template-columns: 280px minmax(0, 1fr) 340px; } }
@media (max-width: 1080px) {
  .reader-shell, .reader-shell[data-tafsir="open"] { grid-template-columns: minmax(0, 1fr); }
  .surah-rail { display: none; }
  .surah-rail[data-open="true"] {
    display: block; position: fixed; inset: var(--header-h) 0 0 0; z-index: 80; overflow-y: auto;
    background: var(--rd-bg); padding: 1rem;
  }
}

/* Surah rail */
.surah-rail {
  position: sticky; top: calc(var(--header-h) + 58px);
  height: calc(100vh - var(--header-h) - 58px);
  border-right: 1px solid var(--rd-line); background: var(--rd-panel);
  display: flex; flex-direction: column; min-height: 0;
}
.rail-tabs { display: flex; gap: 0.2rem; padding: 0.8rem 0.9rem 0.4rem; }
.rail-tab {
  flex: 1; font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
  padding: 0.45rem 0.2rem; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--rd-soft); cursor: pointer;
}
.rail-tab[aria-selected="true"] { color: var(--rd-text); border-color: var(--gold); }
.rail-search { padding: 0.4rem 0.9rem 0.7rem; }
.rail-search input {
  width: 100%; font-family: var(--sans); font-size: 0.82rem; padding: 0.5rem 0.65rem;
  border: 1px solid var(--rd-line); border-radius: var(--radius-sm);
  background: transparent; color: var(--rd-text);
}
.rail-list { overflow-y: auto; padding: 0 0.45rem 1.5rem; flex: 1; scrollbar-width: thin; }
.rail-list[hidden] { display: none; }
.surah-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.6rem;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--rd-text);
  border: 1px solid transparent;
}
.surah-item:hover { background: rgba(218,166,37,.12); }
.surah-item[aria-current="true"] { background: rgba(218,166,37,.16); border-color: var(--line-gold); }
.surah-item__num {
  flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  font-family: var(--sans); font-size: 0.7rem; color: var(--rd-soft);
  border: 1px solid var(--rd-line); transform: rotate(45deg); border-radius: 4px;
}
.surah-item__num span { transform: rotate(-45deg); }
.surah-item__txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.surah-item__name { font-family: var(--sans); font-size: 0.84rem; font-weight: 500; }
.surah-item__meta { font-size: 0.7rem; color: var(--rd-soft); font-family: var(--sans); }
.surah-item__ar { margin-inline-start: auto; font-family: var(--arabic); font-size: 1.05rem; color: var(--rd-soft); direction: rtl; }
.rail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.35rem; padding: 0 0.2rem; }
.rail-cell {
  font-family: var(--sans); font-size: 0.76rem; padding: 0.55rem 0.2rem; border-radius: 4px;
  border: 1px solid var(--rd-line); background: transparent; color: var(--rd-text); cursor: pointer;
}
.rail-cell:hover { border-color: var(--gold-deep); background: rgba(218,166,37,.14); }

/* Reader main */
.reader-main { padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 3vw, 2.2rem) 4rem; max-width: 900px; margin-inline: auto; width: 100%; }
.surah-head {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--espresso), var(--espresso-deep));
  color: var(--cream); padding: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1.6rem;
  border: 1px solid rgba(218,166,37,.28);
}
.surah-head__pattern { position: absolute; inset: 0; opacity: 0.5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23daa625' stroke-width='.8' stroke-opacity='.22'%3E%3Cpath d='M50 2 62 14 74 2M50 98 62 86 74 98M2 50 14 62 2 74M98 50 86 62 98 74M38 38h24v24H38z' transform='rotate(45 50 50)'/%3E%3C/g%3E%3C/svg%3E"); background-size: 100px 100px; pointer-events: none; }
.surah-head > * { position: relative; }
.surah-head__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.surah-head__kicker { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(246,231,184,.8); }
.surah-head h1 { font-family: var(--serif); color: var(--cream); font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin: 0.4rem 0 0.2rem; }
.surah-head__meaning { color: rgba(251,247,238,.75); font-style: italic; font-size: 1.02rem; margin: 0; }
.surah-head__ar { font-family: var(--arabic); direction: rtl; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); color: var(--gold-tint); line-height: 1.7; }
.surah-head__facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid rgba(251,247,238,.16); font-family: var(--sans); font-size: 0.76rem; color: rgba(251,247,238,.72); }
.bismillah {
  text-align: center; font-family: var(--arabic); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  color: var(--rd-text); padding: 1.1rem 0 1.8rem; line-height: 1.9;
}
.reader-note {
  display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.82rem; font-family: var(--sans);
  color: var(--rd-soft); background: rgba(218,166,37,.1); border: 1px solid var(--line-gold);
  border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin-bottom: 1.4rem;
}
.reader-note button { margin-inline-start: auto; background: none; border: 0; color: var(--rd-soft); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0.2rem; }

/* Ayah blocks */
.ayah {
  display: block; position: relative; padding: 1.3rem 1.4rem; margin-bottom: 0.9rem;
  border: 1px solid var(--rd-line); border-radius: var(--radius); background: var(--rd-panel);
  scroll-margin-top: calc(var(--header-h) + 90px);
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.ayah:hover { border-color: var(--line-gold); }
.ayah.is-active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow-sm); }
.ayah.is-playing { border-color: var(--gold); background: rgba(218,166,37,.08); }
.ayah__top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 0.8rem; }
.ayah__ref {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--sans); font-size: 0.72rem; font-weight: 600; color: var(--rd-soft);
  letter-spacing: 0.06em; text-transform: uppercase;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.ayah__ref:hover { color: var(--gold-deep); }
.ayah__badge {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
  color: var(--gold-deep); font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
}
.ayah__badge svg { position: absolute; width: 30px; height: 30px; }
.ayah__badge span { position: relative; }
.ayah__actions { display: flex; gap: 0.1rem; opacity: 0; transition: opacity 0.2s var(--ease); }
.ayah:hover .ayah__actions, .ayah:focus-within .ayah__actions { opacity: 1; }
@media (hover: none) { .ayah__actions { opacity: 1; } }
.ayah__actions .icon-btn { width: 32px; height: 32px; color: var(--rd-soft); }
.ayah__actions .icon-btn svg { width: 16px; height: 16px; }
.ayah__actions .icon-btn:hover { background: rgba(218,166,37,.16); color: var(--rd-text); }
.ayah__actions .icon-btn[aria-pressed="true"] { color: var(--gold-deep); background: rgba(218,166,37,.18); }

.ayah__arabic {
  font-family: var(--arabic); direction: rtl; text-align: right;
  font-size: var(--ar-size, 1.85rem); line-height: var(--ar-lh, 2.15);
  color: var(--rd-text); margin: 0;
  transition: font-size 0.2s var(--ease);
  unicode-bidi: isolate;
}
.ayah__arabic:lang(ar) { font-feature-settings: "liga" 1, "calt" 1; }
.ayah__translation { margin: 1rem 0 0; padding-top: 0.9rem; border-top: 1px dashed var(--rd-line); font-size: var(--tr-size, 1rem); line-height: 1.75; color: var(--rd-soft); }
.ayah__translation[dir="ltr"] { text-align: left; }
.ayah__translation[dir="rtl"] { text-align: right; }
.ayah__translator { font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--rd-soft); opacity: 0.8; display: block; margin-top: 0.35rem; }
.ayah__translit { font-family: var(--sans); font-size: 0.84rem; color: var(--rd-soft); font-style: italic; margin: 0.5rem 0 0; line-height: 1.6; }
.ayah__words { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; direction: rtl; }
.word {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  padding: 0.35rem 0.5rem; border-radius: 4px; background: rgba(218,166,37,.08);
  border: 1px solid transparent; cursor: help;
}
.word:hover { border-color: var(--line-gold); }
.word__ar { font-family: var(--arabic); font-size: 1.25rem; line-height: 1.6; color: var(--rd-text); }
.word__en { font-family: var(--sans); font-size: 0.65rem; color: var(--rd-soft); direction: ltr; }

.ayah[data-hidden="true"] .ayah__arabic { filter: blur(7px); user-select: none; }
.ayah[data-hidden="true"] .ayah__arabic:hover { filter: none; }

.reader[data-view="reading"] .ayah { padding: 0.9rem 1rem; margin-bottom: 0; border-color: transparent; background: transparent; border-radius: 0; }
.reader[data-view="reading"] .ayah + .ayah { border-top: 1px solid var(--rd-line); }
.reader[data-view="reading"] .ayah:hover { background: rgba(218,166,37,.05); }
.reader[data-view="reading"] .ayah__top { margin-bottom: 0.5rem; }
.reader[data-view="reading"] .ayah__translation { border-top: 0; padding-top: 0.5rem; }

.parallel-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .parallel-grid { grid-template-columns: 1fr; } }
.parallel-col { min-width: 0; }
.parallel-col__head { font-family: var(--sans); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rd-soft); padding-bottom: 0.5rem; border-bottom: 1px solid var(--rd-line); margin-bottom: 0.8rem; }
.translation-slot {
  border: 1px dashed var(--line-gold); border-radius: var(--radius-sm); padding: 0.85rem 1rem;
  font-family: var(--sans); font-size: 0.8rem; color: var(--rd-soft); background: rgba(246,231,184,.14);
}
.translation-slot strong { color: var(--rd-text); display: block; margin-bottom: 0.2rem; font-size: 0.82rem; }

/* Tafsir drawer */
.tafsir-drawer {
  position: sticky; top: calc(var(--header-h) + 58px); height: calc(100vh - var(--header-h) - 58px);
  overflow-y: auto; background: var(--rd-panel); border-left: 1px solid var(--rd-line);
  padding: 1.2rem 1.3rem 2rem;
}
.reader-shell:not([data-tafsir="open"]) .tafsir-drawer { display: none; }
@media (max-width: 1080px) {
  .tafsir-drawer {
    position: fixed; inset: auto 0 0 0; height: 82vh; z-index: 85; border-left: 0; border-top: 1px solid var(--line-gold);
    border-radius: 18px 18px 0 0; box-shadow: 0 -20px 50px -30px rgba(0,0,0,.8);
    transform: translateY(102%); transition: transform 0.35s var(--ease); display: block;
  }
  .reader-shell[data-tafsir="open"] .tafsir-drawer { transform: translateY(0); }
}
.tafsir-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin-bottom: 1rem; position: sticky; top: -1.2rem; background: var(--rd-panel); padding: 0.4rem 0 0.8rem; }
.tafsir-drawer h2 { font-size: 1.3rem; margin: 0; color: var(--rd-text); }
.tafsir-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tafsir-body { font-size: 0.9rem; line-height: 1.72; color: var(--rd-soft); }
.tafsir-body h3 { font-family: var(--sans); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--rd-text); margin: 1.4rem 0 0.5rem; }
.tafsir-body p { margin-bottom: 0.9rem; }
.tafsir-source { font-family: var(--sans); font-size: 0.72rem; color: var(--rd-soft); border-top: 1px solid var(--rd-line); padding-top: 0.8rem; margin-top: 1.2rem; }

/* Audio bar */
.audio-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  background: var(--espresso-deep); color: var(--cream);
  border-top: 1px solid rgba(218,166,37,.35);
  box-shadow: 0 -12px 40px -28px rgba(0,0,0,.9);
  transform: translateY(110%); transition: transform 0.4s var(--ease);
}
.audio-bar[data-open="true"] { transform: translateY(0); }
.audio-bar__inner { display: flex; align-items: center; gap: 0.9rem; padding: 0.65rem 0; flex-wrap: wrap; }
.audio-bar__info { min-width: 0; flex: 1 1 180px; }
.audio-bar__title { font-family: var(--sans); font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.audio-bar__sub { font-family: var(--sans); font-size: 0.7rem; color: rgba(251,247,238,.6); }
.audio-bar .icon-btn { color: var(--cream); width: 42px; height: 42px; }
.audio-bar .icon-btn:hover { background: rgba(218,166,37,.2); color: var(--gold-tint); }
.audio-bar .icon-btn--play { background: var(--gold); color: var(--charcoal); width: 46px; height: 46px; }
.audio-bar .icon-btn--play:hover { background: var(--gold-deep); color: var(--white); }
.audio-bar select, .audio-bar input[type="range"] { accent-color: var(--gold); }
.audio-bar select { font-family: var(--sans); font-size: 0.74rem; background: rgba(251,247,238,.08); color: var(--cream); border: 1px solid rgba(251,247,238,.2); border-radius: 4px; padding: 0.3rem; max-width: 140px; }
.audio-bar select option { color: var(--charcoal); background: var(--white); }
.audio-bar__progress { flex: 1 1 140px; height: 4px; background: rgba(251,247,238,.16); border-radius: 2px; overflow: hidden; }
.audio-bar__progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.2s linear; }
@media (max-width: 720px) { .audio-bar__extra { display: none; } }
.audio-bar__close { padding: 0.2rem; }

/* Reader settings popover */
.popover {
  position: absolute; z-index: 100; background: var(--white); color: var(--charcoal);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 1rem; width: min(320px, calc(100vw - 2rem));
}
.popover[hidden] { display: none; }
.popover h3 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--espresso-soft); margin: 0 0 0.6rem; }
.popover__row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.popover__row:last-child { border-bottom: 0; }
.popover__row label, .popover__row span { font-family: var(--sans); font-size: 0.82rem; }
.stepper { display: inline-flex; align-items: center; gap: 0.3rem; }
.stepper button { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--cream); cursor: pointer; font-size: 1rem; line-height: 1; color: var(--espresso); }
.stepper output { font-family: var(--sans); font-size: 0.8rem; min-width: 36px; text-align: center; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 0.35rem 0.65rem; font-family: var(--sans); font-size: 0.75rem; cursor: pointer; color: var(--espresso-soft); }
.seg button[aria-pressed="true"] { background: var(--espresso); color: var(--cream); }
.swatch-row { display: flex; gap: 0.4rem; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch[aria-pressed="true"] { border-color: var(--gold-deep); }
.swatch--light { background: #fbf7ee; border: 1px solid var(--line-strong); }
.swatch--sepia { background: #f3ead3; border: 1px solid var(--line-strong); }
.swatch--dark { background: #2a211c; }
.swatch--night { background: #17120f; }

/* Share card modal */
.modal {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 1rem;
  background: rgba(26, 20, 17, 0.72); opacity: 0; visibility: hidden; transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.modal[data-open="true"] { opacity: 1; visibility: visible; }
.modal__panel { background: var(--white); border-radius: var(--radius-lg); padding: 1.4rem; max-width: 560px; width: 100%; box-shadow: var(--shadow-lg); max-height: 92vh; overflow-y: auto; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.modal__head h2 { font-size: 1.35rem; margin: 0; }
.modal__canvas { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* Search overlay */
.search-modal .modal__panel { max-width: 720px; }
.search-input-wrap { display: flex; align-items: center; gap: 0.7rem; border-bottom: 1px solid var(--line); padding-bottom: 0.8rem; }
.search-input-wrap input { flex: 1; border: 0; background: transparent; font-family: var(--text); font-size: 1.1rem; color: var(--charcoal); padding: 0.4rem 0; }
.search-input-wrap input:focus { outline: none; }
.search-results { margin-top: 1rem; max-height: 55vh; overflow-y: auto; }
.search-result { display: block; padding: 0.8rem 0.6rem; border-radius: var(--radius-sm); text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.search-result:hover { background: var(--parchment); }
.search-result__ref { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.search-result__ar { font-family: var(--arabic); direction: rtl; font-size: 1.2rem; line-height: 1.9; color: var(--espresso-deep); margin-top: 0.2rem; }
.search-result__tr { font-size: 0.86rem; color: var(--espresso-soft); }
.search-hint { font-size: 0.8rem; color: var(--espresso-soft); font-family: var(--sans); margin-top: 0.6rem; }

/* --------------------------------------------------------------- Misc ----- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 160;
  background: var(--espresso-deep); color: var(--cream); font-family: var(--sans); font-size: 0.84rem;
  padding: 0.7rem 1.1rem; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  box-shadow: var(--shadow-md); max-width: calc(100vw - 2rem); text-align: center;
}
.toast[data-open="true"] { opacity: 1; transform: translate(-50%, 0); }

.reading-progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--gold); z-index: 200; width: 0; }

.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 140;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 1rem 1.2rem; display: none;
  gap: 1rem; align-items: center; flex-wrap: wrap; max-width: 760px; margin-inline: auto;
}
.cookie-banner[data-open="true"] { display: flex; }
.cookie-banner p { margin: 0; font-size: 0.84rem; color: var(--espresso-soft); flex: 1 1 320px; }

.loader {
  position: fixed; inset: 0; z-index: 300; background: var(--cream);
  display: grid; place-items: center; transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.loader[data-done="true"] { opacity: 0; visibility: hidden; }
.loader__mark { width: 96px; height: 96px; animation: breathe 2.4s var(--ease) infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.5; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1); } }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Dark mode (site chrome) — reader themes are separate */
[data-theme="dark"] body { background: #1c1714; color: #ddd3c2; }
[data-theme="dark"] .site-header { background: rgba(28, 23, 20, 0.94); border-color: rgba(246,231,184,.12); }
[data-theme="dark"] .main-nav a, [data-theme="dark"] .brand__en { color: #e8ddc9; }
[data-theme="dark"] .brand__ar { color: var(--gold-tint); }
[data-theme="dark"] .brand__ti { color: rgba(246,231,184,.6); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4 { color: #f3e7cf; }
[data-theme="dark"] .card, [data-theme="dark"] .filterbar, [data-theme="dark"] .pathway, [data-theme="dark"] .aotd__body, [data-theme="dark"] .verse-card {
  background: #262019; border-color: rgba(246,231,184,.14); color: #ddd3c2;
}
[data-theme="dark"] .muted, [data-theme="dark"] .lesson-card p, [data-theme="dark"] .pathway p,
[data-theme="dark"] .section-head p, [data-theme="dark"] .meta, [data-theme="dark"] .page-head p { color: #b9ac96; }
[data-theme="dark"] .page-head, [data-theme="dark"] .hero { background: #1c1714; }
[data-theme="dark"] .band--parchment { background: #221c17; }
[data-theme="dark"] .band--white { background: #201a15; }
[data-theme="dark"] .hero-verse, [data-theme="dark"] .aotd { background: #262019; border-color: rgba(184,138,20,.35); }
[data-theme="dark"] .hero-verse__ar, [data-theme="dark"] .aotd__ar { color: #f6e7b8; }
[data-theme="dark"] .hero-verse__tr, [data-theme="dark"] .aotd__tr { color: #b9ac96; }
[data-theme="dark"] .btn--outline { color: #e8ddc9; border-color: rgba(246,231,184,.24); }
[data-theme="dark"] .btn--outline:hover { background: rgba(218,166,37,.14); color: #f6e7b8; }
[data-theme="dark"] .input, [data-theme="dark"] .select, [data-theme="dark"] .textarea { background: #2b241d; color: #e8ddc9; border-color: rgba(246,231,184,.18); }
[data-theme="dark"] .prose { color: #cfc4b0; }
[data-theme="dark"] .prose blockquote { background: #262019; color: #e8ddc9; }
[data-theme="dark"] .accordion, [data-theme="dark"] .modal__panel { background: #262019; border-color: rgba(246,231,184,.14); }
[data-theme="dark"] .accordion summary { color: #e8ddc9; }
[data-theme="dark"] .accordion .accordion__body { color: #b9ac96; }
[data-theme="dark"] .topbar { background: #120e0c; }
[data-theme="dark"] .callout { background: #2a231c; color: #c3b8a4; }
[data-theme="dark"] .tag { background: rgba(218,166,37,.14); color: #f0dfae; border-color: rgba(218,166,37,.3); }
[data-theme="dark"] .chip { color: #e8ddc9; border-color: rgba(246,231,184,.22); }
[data-theme="dark"] .chip.is-active, [data-theme="dark"] .chip[aria-pressed="true"] { background: var(--gold); color: var(--charcoal); border-color: var(--gold); }
[data-theme="dark"] .site-footer { background: #100c0a; }

/* Print */
@media print {
  .topbar, .site-header, .site-footer, .reader-toolbar, .surah-rail, .tafsir-drawer,
  .ayah__actions, .audio-bar, .cookie-banner, .toast, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .ayah { break-inside: avoid; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; }
  a { color: #000; text-decoration: none; }
}

/* ==========================================================================
   READER — additional components
   ========================================================================== */
.rail-close { display: none; position: absolute; top: 0.5rem; right: 0.5rem; z-index: 2; color: var(--rd-text); }
@media (max-width: 1080px) { .rail-close { display: inline-flex; } }

.reader-landing { background: var(--cream); }
.reader-landing__hero { padding-block: clamp(2.4rem, 5vw, 4rem) clamp(1.4rem, 3vw, 2rem); background: var(--espresso); color: var(--cream); position: relative; overflow: hidden; }
.reader-landing__hero h1 { color: var(--cream); margin-bottom: 0.5rem; }
.reader-landing__hero p { color: rgba(251,247,238,.78); max-width: 62ch; margin: 0; }
.reader-landing__hero .eyebrow { color: var(--gold-tint); }
.resume-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.6rem; padding: 1rem 1.2rem; border: 1px solid rgba(246,231,184,.28); background: rgba(0,0,0,.14); border-radius: var(--radius); }
.resume-card p { margin: 0; font-size: 0.9rem; }
.resume-card strong { color: var(--gold-tint); }

.surah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.75rem; margin-top: 1.6rem; }
.surah-card {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.8rem 0.9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--white); text-decoration: none; color: inherit;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.surah-card:hover { border-color: var(--line-gold); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.surah-card__num { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-gold); border-radius: 4px; transform: rotate(45deg); font-family: var(--sans); font-size: 0.74rem; color: var(--gold-deep); }
.surah-card__num span { transform: rotate(-45deg); }
.surah-card__txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.surah-card__name { font-family: var(--sans); font-size: 0.88rem; font-weight: 600; }
.surah-card__meta { font-family: var(--sans); font-size: 0.72rem; color: var(--espresso-soft); }
.surah-card__ar { margin-inline-start: auto; font-family: var(--arabic); font-size: 1.2rem; color: var(--espresso); direction: rtl; }

.reader-quick { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }
.reader-quick a { font-family: var(--sans); font-size: 0.82rem; color: rgba(251,247,238,.8); text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.reader-quick a:hover { color: var(--gold-tint); }

.surah-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.2rem; }
.surah-nav a { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem 1.2rem; border: 1px solid var(--rd-line); border-radius: var(--radius); text-decoration: none; background: var(--rd-panel); }
.surah-nav a:hover { border-color: var(--gold); }
.surah-nav span { font-family: var(--sans); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rd-soft); }
.surah-nav strong { font-family: var(--serif); font-size: 1.2rem; color: var(--rd-text); font-weight: 500; }
.surah-nav .next { text-align: right; }
@media (max-width: 520px) { .surah-nav { grid-template-columns: 1fr; } .surah-nav .next { text-align: left; } }

.translation-credit { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rd-line); font-family: var(--sans); font-size: 0.72rem; color: var(--rd-soft); line-height: 1.7; }

.reader-chip-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.reader-chip { font-family: var(--sans); font-size: 0.72rem; padding: 0.3rem 0.65rem; border-radius: 999px; border: 1px solid var(--rd-line); color: var(--rd-soft); background: transparent; }
.reader-chip--gold { border-color: var(--line-gold); color: var(--gold-deep); }

.bookmark-dot { position: absolute; top: 0.65rem; right: 0.75rem; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.note-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-deep); margin-left: 3px; vertical-align: middle; }

/* Tajweed colouring — warm, muted palette; always paired with a legend */
.tajweed { color: var(--rd-text); }
.tajweed .ham_wasl, .tajweed .slnt { color: #9a8a72; }
.tajweed .laam_shamsiyah { color: #7d6a50; }
.tajweed .madda_normal { color: #b8860b; }
.tajweed .madda_permissible { color: #c99a2e; }
.tajweed .madda_obligatory, .tajweed .madda_necessary { color: #a3422c; }
.tajweed .qalaqah { color: #8a4b2a; }
.tajweed .ikhafa, .tajweed .ikhafa_shafawi { color: #7a4a5e; }
.tajweed .idgham, .tajweed .idgham_shafawi, .tajweed .idgham_ghunnah, .tajweed .idgham_wo_ghunnah,
.tajweed .idgham_mutajanisayn, .tajweed .idgham_mutaqaribayn { color: #6b6a34; }
.tajweed .iqlab { color: #3f4c57; }
.tajweed .ghunna { color: #8c6a1f; font-weight: 500; }
.reader[data-rt-theme="dark"] .tajweed .madda_normal,
.reader[data-rt-theme="night"] .tajweed .madda_normal { color: #e9c877; }
.reader[data-rt-theme="dark"] .tajweed .madda_obligatory,
.reader[data-rt-theme="night"] .tajweed .madda_obligatory { color: #e8a08e; }
.reader[data-rt-theme="dark"] .tajweed .ham_wasl,
.reader[data-rt-theme="night"] .tajweed .ham_wasl { color: #b8a98f; }

.tajweed-legend { display: none; gap: 0.5rem 1rem; flex-wrap: wrap; font-family: var(--sans); font-size: 0.7rem; margin: -0.4rem 0 1.2rem; padding: 0.7rem 0.9rem; border: 1px solid var(--rd-line); border-radius: var(--radius-sm); color: var(--rd-soft); }
.reader[data-tajweed="true"] .tajweed-legend { display: flex; }
.tajweed-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.tajweed-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.word--loading { opacity: 0.5; }
.reader-status { font-family: var(--sans); font-size: 0.76rem; color: var(--rd-soft); display: flex; align-items: center; gap: 0.45rem; }
.reader-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }

.saved-list { display: grid; gap: 0.4rem; max-height: 50vh; overflow-y: auto; margin-top: 0.8rem; }
.saved-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; color: inherit; font-size: 0.88rem; }
.saved-item:hover { background: var(--parchment); }
.saved-item__meta { margin-left: auto; font-family: var(--sans); font-size: 0.72rem; color: var(--espresso-soft); }
.saved-empty { color: var(--espresso-soft); font-size: 0.9rem; padding: 1rem 0; }

@media (max-width: 720px) {
  .reader-toolbar__inner { gap: 0.35rem; }
  .tool-btn span { display: none; }
  .tool-btn { padding: 0.42rem 0.5rem; }
  .reader-main { padding-bottom: 7rem; }
}

/* Ayah body layout (translation / parallel) */
.ayah__body { display: block; }
.reader[data-translation="false"] .ayah__col--tr { display: none; }
.reader[data-parallel="true"] .ayah__body {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 1.6rem; align-items: start;
}
.reader[data-parallel="true"] .ayah__col--tr { border-left: 1px solid var(--rd-line); padding-left: 1.6rem; }
.reader[data-parallel="true"] .ayah__arabic { font-size: calc(var(--ar-size) * 0.94); }
.reader[data-parallel="true"] .ayah__translation { border-top: 0; padding-top: 0; margin-top: 0; }
@media (max-width: 780px) {
  .reader[data-parallel="true"] .ayah__body { grid-template-columns: 1fr; gap: 1rem; }
  .reader[data-parallel="true"] .ayah__col--tr { border-left: 0; padding-left: 0; border-top: 1px solid var(--rd-line); padding-top: 0.9rem; }
}
.ayah__words { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; direction: rtl; }
.ayah__translit { font-family: var(--sans); font-size: 0.82rem; font-style: italic; color: var(--rd-soft); line-height: 1.65; margin: 0.55rem 0 0; }
.translation-slot[hidden] { display: none; }

.reader-settings h3 + .popover__row { margin-top: 0; }
.popover .popover__row select { font-family: var(--sans); font-size: 0.78rem; padding: 0.3rem 0.4rem; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--white); max-width: 160px; }
.popover .toggle { display: inline-flex; align-items: center; }
.popover .toggle input { width: 16px; height: 16px; accent-color: var(--gold-deep); }
.popover .popover__actions { margin-top: 0.8rem; display: flex; gap: 0.5rem; }

.ayah__badge { position: relative; }
[data-act="memorise"] { display: none; }
body.hifz-on [data-act="memorise"] { display: inline-flex; }
body.hifz-on .ayah[data-hidden="true"] .ayah__arabic { filter: blur(7px); }
body.hifz-on .ayah[data-hidden="true"]:hover .ayah__arabic { filter: blur(4px); }
[data-act="memorise"][aria-pressed="true"] { color: var(--gold-deep); background: rgba(218,166,37,.18); }

[hidden] { display: none !important; }

.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ayah__badge {
  width: 26px; height: 26px; border: 1px solid var(--line-gold); border-radius: 2px;
  transform: rotate(45deg); display: grid; place-items: center; flex: none;
  margin: 0.3rem 0.45rem 0.3rem 0.2rem;
}
.ayah__badge span { transform: rotate(-45deg); font-family: var(--sans); font-size: 0.7rem; font-weight: 600; color: var(--gold-deep); }
.ayah__badge svg { display: none; }

/* Inline icon sizing in loose text contexts */
.topbar__note svg { width: 13px; height: 13px; flex: none; }
.search-input-wrap > svg { width: 20px; height: 20px; flex: none; color: var(--espresso-soft); }
.drawer-nav a svg { width: 16px; height: 16px; flex: none; color: rgba(218, 166, 37, 0.75); }
.reader-quick svg { width: 14px; height: 14px; flex: none; }
.icn-sm { width: 16px; height: 16px; flex: none; }
.card a > svg, .card p a > svg { width: 17px; height: 17px; flex: none; vertical-align: -3px; }

/* Reveal: animate on load rather than hiding content until scroll */
.reveal { opacity: 1; transform: none; animation: reveal-up 0.7s var(--ease) both; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes reveal-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.grid > .reveal:nth-child(2) { animation-delay: 0.07s; }
.grid > .reveal:nth-child(3) { animation-delay: 0.14s; }
.grid > .reveal:nth-child(4) { animation-delay: 0.21s; }
.grid > .reveal:nth-child(5) { animation-delay: 0.28s; }
.grid > .reveal:nth-child(6) { animation-delay: 0.35s; }
@media print { .reveal { animation: none; opacity: 1; transform: none; } }

/* Rail / banner layering */
.surah-rail[data-open="true"] { z-index: 135; }
@media (max-width: 1080px) { .rail-tabs { padding-right: 2.6rem; } }
.cookie-banner { z-index: 100; }

/* Glossary */
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 0.8rem; margin: 0; }
.glossary-item { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.glossary-item dt { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; font-family: var(--sans); font-weight: 600; color: var(--espresso); font-size: 0.9rem; }
.glossary-ar { font-family: var(--arabic); font-size: 1.2rem; color: var(--gold-deep); font-weight: 400; }
.glossary-item dd { margin: 0.35rem 0 0; font-size: 0.88rem; line-height: 1.6; color: var(--espresso-soft); }

.translation-slot span[lang] { display: block; margin: 0.4rem 0; font-size: 0.98rem; line-height: 1.8; color: var(--rd-text); font-family: var(--ethiopic); }
.translation-slot .ayah__translator { display: block; font-size: 0.68rem; color: var(--rd-soft); }

/* Prevent grid/flex blowout from wide images and long words */
.split > *, .grid > *, .pathways > *, .footer-grid > * { min-width: 0; }
img { max-width: 100%; }

/* Footer headings after h4 change */
.footer .footer__h, .site-footer .footer__h {
  font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-tint); font-weight: 600; margin: 0 0 0.9rem;
}
/* Gold as accent, never as small text on light surfaces */
.reader-chip--gold { color: var(--espresso); border-color: var(--line-gold); background: rgba(246, 231, 184, 0.55); }
.verse-card__term { color: var(--espresso-soft); }
.search-result__ref { color: var(--espresso); }
.ayah__badge span { color: var(--espresso); }
.pathway__num { color: var(--espresso-soft); }
.glossary-ar { color: var(--espresso); }

/* Cookie notice: rendered immediately for first paint, hidden for returning readers */
.cookie-banner[data-open="true"] { display: flex; }
[data-cookies="ok"] .cookie-banner { display: none !important; }
/* Qur'an reference links: dark text, gold rule */
.quran-ref, .prose .quran-ref {
  color: var(--espresso); font-weight: 600;
  text-decoration: underline; text-decoration-color: rgba(184, 138, 20, 0.55);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.quran-ref:hover { color: var(--espresso-deep); text-decoration-color: var(--gold-deep); }

/* Long surahs: skip layout work for offscreen ayat (height is remembered after first paint) */
.ayah { content-visibility: auto; contain-intrinsic-size: auto 320px; }

/* Deep links: lay out every ayah so the browser can scroll to the exact verse */
[data-deep="1"] .ayah { content-visibility: visible; }

/* Make ayah actions discoverable without hovering */
.ayah__actions { opacity: 0.38; }
.ayah:hover .ayah__actions, .ayah:focus-within .ayah__actions { opacity: 1; }
@media (hover: none) { .ayah__actions { opacity: 1; } }

/* Footer lockup sits on a light plate so the official logo keeps its colours on espresso */
.footer-brand img { width: 190px; height: auto; background: var(--cream); padding: 10px 14px; border-radius: 10px; }

/* Header lockup spacing (Arabic + Latin only; the full three-script lockup lives in the footer) */
.brand__type { gap: 1px; }
.brand__ar { font-size: 0.92rem; line-height: 1.5; white-space: nowrap; }
.brand__en { margin-top: 0.12rem; font-size: 0.63rem; letter-spacing: 0.17em; }
.brand { gap: 0.75rem; }

.lesson-media { margin-bottom: 2rem; }

/* Qur'an landing: roomier surah cards */
.surah-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); }
.surah-card__ar { white-space: nowrap; font-size: 1.1rem; }
.surah-card__meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.surah-card__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Mobile surah index: full-screen sheet, no gap, above header and toolbar */
@media (max-width: 1080px) {
  .surah-rail[data-open="true"] {
    display: flex; flex-direction: column; position: fixed; inset: 0;
    height: 100dvh; z-index: 135; overflow-y: auto; background: var(--rd-bg);
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1.5rem;
  }
  .surah-rail[data-open="true"] .rail-close { top: max(1rem, env(safe-area-inset-top)); right: 1rem; }
}

/* Contrast corrections: gold stays an accent (fills, rules, icons), never small text on light */
a:hover { color: var(--espresso-deep); }
.link-arrow:hover { color: var(--espresso-deep); }
.link-arrow:hover svg { color: var(--gold-deep); }
.pathway:hover .pathway__cta { color: var(--espresso-deep); }
.surah-card__num { color: var(--espresso-soft); }
.surah-item:hover .surah-item__name { color: var(--espresso-deep); }
.ayah__ref:hover { color: var(--espresso-deep); }
.hero__title em {
  font-style: italic; color: var(--espresso-deep);
  background: linear-gradient(180deg, transparent 58%, var(--gold-tint) 58%, var(--gold-tint) 92%, transparent 92%);
  padding: 0 0.06em;
}

/* Video collections + English Commentary / Tafsir */
.video-tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin: 1.3rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.video-tabs a { padding: .55rem .9rem; font-family: var(--sans); font-size: .84rem; font-weight: 600; text-decoration: none; color: var(--espresso-soft); border-bottom: 2px solid transparent; }
.video-tabs a:hover { color: var(--espresso-deep); }
.video-tabs a[aria-current="page"] { color: var(--espresso-deep); border-color: var(--gold); }

.commentary-feature {
  display: flex; gap: 1.2rem; align-items: center; padding: 1.2rem 1.4rem;
  border: 1px solid var(--line-gold); border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(246, 231, 184, 0.5), rgba(255, 255, 255, 0.4) 60%);
  text-decoration: none; color: inherit; transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.commentary-feature:hover { border-color: var(--gold-deep); transform: translateY(-2px); }
.commentary-feature__mark img { width: 54px; height: 54px; }
.commentary-feature__body { flex: 1 1 320px; }
.commentary-feature h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); margin: 0 0 .3rem; }
.commentary-feature p { margin: 0; color: var(--espresso-soft); font-size: .92rem; }
.commentary-feature .btn { flex: none; }

.commentary-label { font-family: var(--sans); font-size: .66rem; letter-spacing: .07em; color: var(--espresso-soft); text-transform: uppercase; margin: 0; line-height: 1.6; }
.commentary-card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; }
.commentary-card h3 { font-size: 1.2rem; margin: 0; line-height: 1.3; }
.commentary-desc { font-size: .9rem; color: var(--espresso-soft); margin: 0; }
.commentary-card .link-arrow { margin-top: .15rem; }
.video-poster[disabled] { cursor: default; }
.video-poster[disabled] .video-poster__play { background: rgba(246, 231, 184, 0.16); box-shadow: none; color: var(--gold-tint); }

.commentary-surah { margin-bottom: 2.8rem; scroll-margin-top: 110px; }
.commentary-surah__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.commentary-surah h2 { font-size: 1.7rem; margin: 0; }
.commentary-surah__meaning { font-family: var(--sans); font-size: .78rem; color: var(--espresso-soft); font-weight: 400; letter-spacing: .02em; }
.commentary-surah__meta { font-family: var(--sans); font-size: .75rem; color: var(--espresso-soft); margin: .25rem 0 0; }
.commentary-surah__ar { font-family: var(--arabic); font-size: 2rem; color: var(--espresso); direction: rtl; }

.commentary-empty { display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--white); }
.commentary-empty h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
.commentary-empty p { color: var(--espresso-soft); font-size: .95rem; max-width: 62ch; }
.commentary-example { display: flex; gap: .6rem; flex-wrap: wrap; font-family: var(--sans); font-size: .7rem; letter-spacing: .05em; color: var(--espresso); background: var(--parchment); border: 1px solid var(--line-gold); padding: .6rem .8rem; border-radius: 6px; margin-top: .9rem !important; }
.commentary-example span + span { border-left: 1px solid var(--line-strong); padding-left: .6rem; }

@media (max-width: 700px) {
  .commentary-feature { flex-direction: column; align-items: flex-start; }
  .commentary-surah__ar { font-size: 1.5rem; }
  .commentary-empty { flex-direction: column; }
}

.commentary-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
