/* ==========================================================================
   F.I.T.R.A.H — site styles
   Calm & editorial: cream paper, maroon ink, serif headlines, Amiri Arabic.
   ========================================================================== */

/* ---------- Fonts (self-hosted) ------------------------------------------ */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* transliteration letters (ḥ ṣ ā ī ū ʿ ʾ …) */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-ext.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-ext-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; src: url("../fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri-400.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }
@font-face { font-family: "Amiri"; src: url("../fonts/amiri-700.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E, U+2010-2011, U+204F, U+2E41; }

/* ---------- Tokens -------------------------------------------------------- */
:root {
  --cream: #fbf7f1;
  --paper: #fffdf9;
  --sand: #f2e9da;
  --sand-2: #e7d8bf;
  --ink: #241b18;
  --text: #4a3e38;
  --muted: #85766c;
  --line: rgba(36, 27, 24, .12);
  --line-strong: rgba(36, 27, 24, .22);
  --maroon: #7d1315;
  --maroon-deep: #4f0c0e;
  --on-dark: #fbf7f1;       /* text on maroon / footer bands, same in both themes */
  --fill: #7d1315;          /* filled buttons / selected states */
  --fill-hover: #4f0c0e;
  --field: #fff;            /* form field background */
  --header-bg: rgba(251, 247, 241, .86);
  --footer-bg: #1e1513;
  --rust: #9c4e1e;
  --gold: #b0843a;
  --gold-soft: #d8bf8f;
  --ok: #2f6b4a;
  --err: #a1261d;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, "Amiri", sans-serif;
  --arabic: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;

  --wrap: 1180px;
  --narrow: 720px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 30, 15, .05), 0 8px 30px rgba(60, 30, 15, .07);
  --shadow-lg: 0 2px 4px rgba(60, 30, 15, .05), 0 20px 50px rgba(60, 30, 15, .13);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%237d1315' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M40 8l9.4 22.6L72 40l-22.6 9.4L40 72l-9.4-22.6L8 40l22.6-9.4z'/%3E%3Cpath d='M17.4 17.4h45.2v45.2H17.4z' transform='rotate(45 40 40)'/%3E%3Cpath d='M17.4 17.4h45.2v45.2H17.4z'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; background: var(--cream); color: var(--text);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: var(--maroon); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--rust); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; text-wrap: balance; font-optical-sizing: auto; }
h1 { font-size: clamp(2.35rem, 4.6vw + .5rem, 4.1rem); font-weight: 450; letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 2.4vw + .8rem, 2.75rem); }
h3 { font-size: clamp(1.25rem, .6vw + 1rem, 1.5rem); }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1.1em; text-wrap: pretty; }
strong { color: var(--ink); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
::selection { background: var(--fill); color: #fff; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[lang="ar"], .arabic { font-family: var(--arabic); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; color: #fff; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, var(--narrow)); margin-inline: auto; }
.center { text-align: center; }
.center p { margin-inline: auto; }

.eyebrow { font: 600 .78rem/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--rust); margin: 0 0 1rem; }
.lead { font-size: clamp(1.1rem, .4vw + 1rem, 1.3rem); line-height: 1.65; color: var(--text); max-width: 62ch; }
.center .lead { margin-inline: auto; }
.muted { color: var(--muted); }

/* Ornamental divider: line — diamond — line */
.ornament { display: flex; align-items: center; justify-content: center; gap: .8rem; color: var(--gold); margin: 1.4rem auto; max-width: 220px; }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.ornament span { width: 8px; height: 8px; background: currentColor; transform: rotate(45deg); }
.ornament.left { margin-left: 0; }

/* ---------- Buttons ------------------------------------------------------- */
.btn {
  --bg: var(--fill); --fg: #fff; --bd: var(--fill);
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .85em 1.6em; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font: 600 .97rem/1 var(--sans); letter-spacing: .01em;
  text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, color .2s;
}
.btn:hover { color: var(--fg); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(125, 19, 21, .22); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 1.1em; height: 1.1em; transition: transform .25s var(--ease); }
.btn:hover .icon { transform: translateX(3px); }
.btn-primary:hover { --bg: var(--fill-hover); --bd: var(--fill-hover); }
.btn-outline { --bg: transparent; --fg: var(--maroon); --bd: var(--line-strong); }
.btn-outline:hover { --bg: var(--fill); --fg: #fff; --bd: var(--fill); }
.btn-light { --bg: var(--cream); --fg: var(--maroon); --bd: var(--cream); }
.btn-light:hover { --bg: #fff; --fg: var(--maroon-deep); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.btn-ghost-light { --bg: transparent; --fg: var(--on-dark); --bd: rgba(251, 247, 241, .45); }
.btn-ghost-light:hover { --bg: var(--on-dark); --fg: #7d1315; }
.btn-sm { padding: .62em 1.15em; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

.link-arrow { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; text-decoration: none; color: var(--maroon); }
.link-arrow .icon { width: 1.05em; height: 1.05em; transition: transform .25s var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* "Start Learning" — header call to action for the Academy */
.btn-learn {
  display: inline-flex; align-items: center; gap: .7em; padding: .72em 1.25em; border-radius: 14px;
  background: linear-gradient(135deg, #d0331f 0%, #a8160f 55%, #8a1010 100%); color: #fff;
  font: 700 .98rem/1 var(--sans); letter-spacing: .005em; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 6px 16px rgba(168, 22, 15, .28);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .2s;
}
.btn-learn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 12px 26px rgba(168, 22, 15, .38); }
.btn-learn .icon { width: 1.15em; height: 1.15em; stroke-width: 2.2; transition: transform .25s var(--ease); }
.btn-learn:hover .icon { transform: translate(2px, -2px); }

/* ---------- Header -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px rgba(60, 30, 15, .06); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 78px; }
.brand { display: block; flex: none; }
.brand img { height: 60px; width: auto; transition: height .3s var(--ease); }
.site-header.is-scrolled .brand img { height: 50px; }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav ul { list-style: none; display: flex; gap: .3rem; margin: 0; padding: 0; }
.site-nav ul a {
  display: block; padding: .55rem .8rem; border-radius: 999px; text-decoration: none;
  color: var(--ink); font-weight: 500; font-size: .95rem; transition: background-color .2s, color .2s;
}
.site-nav ul a:hover { background: var(--sand); color: var(--maroon); }
.site-nav ul a[aria-current] { color: var(--maroon); background: var(--sand); }
.nav-toggle { display: none; }

@media (max-width: 980px) {
  .header-inner { min-height: 68px; }
  .brand img { height: 46px; }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%;
    background: var(--paper); cursor: pointer; color: var(--ink);
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 1.6px; background: currentColor; border-radius: 2px; transition: transform .3s var(--ease), opacity .2s; }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-open .nav-toggle-bars { background: transparent; }
  .nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem 1.25rem 1.5rem; background: var(--cream); border-bottom: 1px solid var(--line);
    box-shadow: 0 30px 40px rgba(60, 30, 15, .12);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav-open .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { padding: .9rem .4rem; border-radius: 0; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.3rem; }
  .site-nav ul a:hover, .site-nav ul a[aria-current] { background: none; }
  .nav-cta { align-self: flex-start; }
  body.nav-open { overflow: hidden; }
}

/* ---------- Flash messages ----------------------------------------------- */
.flashes { margin-top: 1rem; }
.flash { padding: .95rem 1.2rem; border-radius: var(--radius-sm); margin: 0 0 .6rem; border: 1px solid; font-weight: 500; }
.flash-success { background: #eef6f0; border-color: #bcd8c4; color: var(--ok); }
.flash-error { background: #fbeeec; border-color: #ecc3bd; color: var(--err); }

/* ---------- Sections ----------------------------------------------------- */
.section { padding: clamp(4rem, 8vw, 7.5rem) 0; }
.section-sm { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.section-sand { background: var(--sand); }
.section-paper { background: var(--paper); }
.section-pattern { background-color: var(--sand); background-image: var(--pattern); }
.section-maroon { background: var(--maroon-deep); color: rgba(251, 247, 241, .85); background-image: radial-gradient(1000px 500px at 85% -10%, rgba(176, 132, 58, .22), transparent 60%), radial-gradient(800px 500px at -10% 110%, rgba(156, 78, 30, .35), transparent 60%); }
.section-maroon h2, .section-maroon h3 { color: var(--on-dark); }
.section-maroon .eyebrow { color: var(--gold-soft); }
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section-head.center { margin-inline: auto; }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 2rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.section-head-row .section-head { margin-bottom: 0; }

/* ---------- Page hero (inner pages) -------------------------------------- */
.page-hero { position: relative; padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem); text-align: center; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); pointer-events: none; }
.page-hero > * { position: relative; }
.page-hero h1 { max-width: 16ch; margin-inline: auto; }
.page-hero .lead { margin: 0 auto; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--maroon); }
.breadcrumbs span { margin: 0 .45em; opacity: .6; }

/* ---------- Home hero ---------------------------------------------------- */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(4rem, 8vw, 7rem); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pattern); -webkit-mask-image: linear-gradient(90deg, #000, transparent 55%); mask-image: linear-gradient(90deg, #000, transparent 55%); opacity: .9; pointer-events: none; }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: clamp(2rem, 5vw, 5rem); }
.hero-bismillah { text-align: left; font-family: var(--arabic); font-size: clamp(1.5rem, 2vw + .8rem, 2.1rem); color: var(--rust); margin: 0 0 1.4rem; line-height: 1.6; }
.hero h1 { margin-bottom: .35em; }
.hero h1 em { font-style: italic; color: var(--maroon); font-weight: 400; }
.hero .lead { margin-bottom: 2.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-figure { position: relative; margin: 0; }
.hero-figure img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 220px 220px var(--radius) var(--radius); box-shadow: var(--shadow-lg); }
.hero-figure::before { content: ""; position: absolute; inset: -16px 16px 16px -16px; border: 1px solid var(--gold-soft); border-radius: 230px 230px 20px 20px; z-index: -1; }
.hero-badge { position: absolute; left: -1.5rem; bottom: 2.25rem; background: var(--paper); padding: 1rem 1.2rem; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 260px; }
.hero-badge p { margin: 0; font-family: var(--serif); font-style: italic; color: var(--ink); line-height: 1.4; font-size: 1.02rem; }
.hero-badge small { display: block; color: var(--muted); margin-top: .35rem; font-size: .78rem; letter-spacing: .04em; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 440px; margin: 1rem auto 0; }
  .hero-badge { left: .5rem; }
  .hero { text-align: center; }
  .hero-bismillah { text-align: center; }
  .hero .lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
}

/* ---------- Intro split / media ------------------------------------------ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.split.reverse > :first-child { order: 2; }
.split-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; }
.split-media.arch img { border-radius: 999px 999px var(--radius) var(--radius); aspect-ratio: 4 / 5; }
.split-media.tall img { aspect-ratio: 4 / 5; }
.split-media.wide img { aspect-ratio: 4 / 3; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
  .split-media { max-width: 520px; }
}

/* ---------- Feature cards (paths of learning) ----------------------------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.2rem 2rem 2rem; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.feature-num { font-family: var(--serif); font-size: .95rem; color: var(--gold); letter-spacing: .1em; margin-bottom: 1.4rem; display: block; }
.feature h3 { margin-bottom: .6rem; }
.feature p { margin-bottom: 1.2rem; font-size: 1rem; }
.feature .arabic-title { font-family: var(--arabic); font-size: 1.6rem; color: var(--rust); float: right; line-height: 1; margin-top: -.2rem; }
.section-maroon .feature { background: rgba(255, 255, 255, .05); border-color: rgba(251, 247, 241, .14); color: rgba(251, 247, 241, .82); }
.section-maroon .feature h3 { color: var(--on-dark); }
.section-maroon .feature .link-arrow { color: var(--gold-soft); }
.section-maroon .feature:hover { background: rgba(255, 255, 255, .08); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

/* ---------- Pillars -------------------------------------------------------- */
.pillars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pillar { padding: 2rem 1rem; text-align: center; border-right: 1px solid var(--line); }
.pillar:last-child { border-right: 0; }
.pillar .ar { font-family: var(--arabic); font-size: 2rem; color: var(--maroon); line-height: 1.3; display: block; }
.pillar .num { font-size: .75rem; letter-spacing: .14em; color: var(--muted); }
.pillar h3 { font-size: 1.2rem; margin: .4rem 0 .15rem; }
.pillar p { font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .pillar { border-bottom: 1px solid var(--line); }
  .pillar:nth-child(2n) { border-right: 0; }
  .pillar:last-child { grid-column: 1 / -1; border-bottom: 0; }
}

/* ---------- Ayah / hadith ------------------------------------------------- */
.ayah { text-align: center; max-width: 900px; margin: 0 auto; }
.ayah .ar { font-family: var(--arabic); font-size: clamp(1.6rem, 2.2vw + 1rem, 2.4rem); line-height: 2; color: var(--ink); margin: 0 0 1.2rem; }
.ayah .tr { font-family: var(--serif); font-style: italic; font-size: clamp(1.05rem, .5vw + .95rem, 1.25rem); color: var(--text); line-height: 1.7; max-width: 62ch; margin: 0 auto .8rem; }
.ayah cite { font-style: normal; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rust); }
.section-maroon .ayah .ar { color: var(--on-dark); }
.section-maroon .ayah .tr { color: rgba(251, 247, 241, .82); }
.section-maroon .ayah cite { color: var(--gold-soft); }

.hadith {
  position: relative; max-width: 920px; margin: 0 auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: 24px; padding: clamp(2rem, 5vw, 3.5rem); box-shadow: var(--shadow);
}
.hadith::before, .hadith::after { content: ""; position: absolute; width: 56px; height: 56px; border: 1px solid var(--gold-soft); }
.hadith::before { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.hadith::after { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.hadith-tabs { display: flex; justify-content: center; gap: .4rem; margin-bottom: 1.8rem; }
.hadith-tabs button { border: 1px solid var(--line-strong); background: transparent; color: var(--text); padding: .5em 1.1em; border-radius: 999px; font: 500 .9rem var(--sans); cursor: pointer; }
.hadith-tabs button[aria-selected="true"] { background: var(--fill); border-color: var(--fill); color: #fff; }
.hadith-body .ar { font-family: var(--arabic); font-size: clamp(1.35rem, 1.2vw + 1rem, 1.85rem); line-height: 2.05; color: var(--ink); text-align: center; margin: 0; }
.hadith-body .ar mark { background: linear-gradient(transparent 55%, rgba(176, 132, 58, .28) 55%); color: var(--maroon); padding: 0 .1em; }
.hadith-body .en { font-family: var(--serif); font-size: clamp(1.05rem, .4vw + 1rem, 1.2rem); line-height: 1.8; color: var(--text); text-align: center; margin: 0; }
.hadith-body .en mark { background: linear-gradient(transparent 60%, rgba(176, 132, 58, .25) 60%); color: var(--ink); }
.hadith cite { display: block; text-align: center; margin-top: 1.4rem; font-style: normal; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--rust); }
[hidden] { display: none !important; }

/* ---------- Cards: readings ---------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem 1.75rem; }
.card { display: flex; flex-direction: column; background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sand); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-media.placeholder { display: grid; place-items: center; background: var(--sand) var(--pattern); }
.card-media.placeholder span { font-family: var(--arabic); font-size: 2.6rem; color: var(--maroon); opacity: .65; }
.card-body { padding: 1.5rem 1.6rem 1.7rem; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; font-size: .8rem; color: var(--muted); margin-bottom: .8rem; }
.chip { display: inline-block; font: 600 .7rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--rust); background: rgba(156, 78, 30, .09); padding: .5em .85em; border-radius: 999px; text-decoration: none; }
a.chip:hover { background: var(--rust); color: #fff; }
.card h3 { font-size: 1.32rem; line-height: 1.25; margin-bottom: .6rem; }
.card h3 a { color: inherit; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .4s var(--ease); }
.card:hover h3 a { background-size: 100% 1px; }
.card p { font-size: .98rem; color: var(--text); margin-bottom: 1.2rem; }
.card .link-arrow { margin-top: auto; font-size: .92rem; }
.card-lg { grid-column: span 2; flex-direction: row; }
.card-lg .card-media { aspect-ratio: auto; flex: 1.15; min-height: 340px; }
.card-lg .card-body { flex: 1; padding: 2.2rem; justify-content: center; }
.card-lg h3 { font-size: clamp(1.5rem, 1vw + 1.1rem, 2rem); }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) {
  .cards { grid-template-columns: 1fr; }
  .card-lg { grid-column: auto; flex-direction: column; }
  .card-lg .card-media { min-height: 0; aspect-ratio: 16 / 10; }
  .card-lg .card-body { padding: 1.5rem 1.6rem 1.7rem; }
}

/* ---------- Filters / search ---------------------------------------------- */
.toolbar { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; margin-bottom: 3rem; }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.filters a { padding: .55em 1.1em; border-radius: 999px; border: 1px solid var(--line-strong); text-decoration: none; color: var(--text); font-size: .92rem; font-weight: 500; transition: all .2s; background: var(--paper); }
.filters a:hover { border-color: var(--maroon); color: var(--maroon); }
.filters a[aria-current] { background: var(--fill); border-color: var(--fill); color: #fff; }
.search { position: relative; width: min(100%, 560px); }
.search input { width: 100%; padding: .95rem 3.2rem .95rem 1.3rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); font: inherit; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 4px rgba(125, 19, 21, .1); }
.search button { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--fill); color: #fff; display: grid; place-items: center; cursor: pointer; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.result-note { text-align: center; color: var(--muted); margin: -1.5rem 0 2rem; font-size: .95rem; }

/* ---------- Q&A list ----------------------------------------------------- */
.qa-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.qa { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.7rem 1.8rem; text-decoration: none; color: inherit; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.qa:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: inherit; }
.qa h3 { font-size: 1.3rem; margin: .8rem 0 .5rem; }
.qa h3::before { content: "Q."; color: var(--gold); margin-right: .35em; font-style: italic; }
.qa p { font-size: .98rem; margin-bottom: 1rem; }
.qa .link-arrow { margin-top: auto; font-size: .92rem; }
@media (max-width: 760px) { .qa-list { grid-template-columns: 1fr; } }

/* ---------- CTA band ------------------------------------------------------ */
.cta-band { position: relative; border-radius: 28px; overflow: hidden; padding: clamp(3rem, 6vw, 5rem) clamp(1.5rem, 5vw, 5rem); text-align: center; color: rgba(251, 247, 241, .85); background: var(--maroon-deep); isolation: isolate; }
.cta-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--pattern); filter: invert(1) brightness(2); opacity: .35; }
.cta-band::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 400px at 50% -20%, rgba(176, 132, 58, .35), transparent 60%); }
.cta-band h2 { color: var(--on-dark); max-width: 20ch; margin-inline: auto; }
.cta-band p { max-width: 58ch; margin: 0 auto 2rem; }
.cta-band .eyebrow { color: var(--gold-soft); }
.cta-band .actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem; }
.cta-band.with-img { background: var(--maroon-deep) var(--cta-img) center / cover; }
.cta-band.with-img::before { background: linear-gradient(180deg, rgba(79, 12, 14, .82), rgba(36, 27, 24, .9)); filter: none; opacity: 1; }

/* ---------- Article / prose ---------------------------------------------- */
.article-hero { padding: clamp(3rem, 6vw, 5rem) 0 2rem; text-align: center; }
.article-hero h1 { font-size: clamp(2.1rem, 3.6vw + .6rem, 3.5rem); max-width: 20ch; margin-inline: auto; }
.article-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .7rem 1.2rem; color: var(--muted); font-size: .9rem; }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }
.article-cover { width: min(100% - 2.5rem, 1040px); margin: 1rem auto clamp(2.5rem, 5vw, 4rem); }
.article-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: 20px; box-shadow: var(--shadow); }
.prose { font-size: clamp(1.06rem, .25vw + 1rem, 1.16rem); line-height: 1.85; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.35em; }
.prose h2 { font-size: clamp(1.55rem, 1.2vw + 1.1rem, 2rem); margin: 2.2em 0 .7em; }
.prose h3 { font-size: clamp(1.25rem, .6vw + 1.05rem, 1.5rem); margin: 2em 0 .6em; }
.prose h4 { margin: 1.8em 0 .5em; }
.prose a { color: var(--maroon); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.35em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: 2.2em 0; padding: .4em 0 .4em 1.6em; border-left: 2px solid var(--gold); font-family: var(--serif); font-style: italic; font-size: 1.2em; color: var(--ink); line-height: 1.6; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: 14px; margin: 2em auto; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-size: .88rem; color: var(--muted); text-align: center; margin-top: .6rem; }
.prose hr { margin: 3em auto; width: 120px; border-top-color: var(--gold-soft); }
.prose .arabic, .prose [dir="rtl"] { font-family: var(--arabic); font-size: 1.45em; line-height: 2; direction: rtl; text-align: center; color: var(--ink); }
.prose .ayah, .prose .hadith-quote { text-align: center; }
.prose .callout, .prose .note { background: var(--sand); border-radius: 14px; padding: 1.4em 1.6em; margin: 2em 0; }
.prose .short-answer { background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--maroon); border-radius: 12px; padding: 1.4em 1.6em; }
.prose .source { font-size: .9em; color: var(--muted); word-break: break-word; }
.prose .video { position: relative; aspect-ratio: 16 / 9; margin: 2em 0; }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 14px; }
.prose > p:first-of-type::first-letter { font-family: var(--serif); float: left; font-size: 3.6em; line-height: .85; padding: .08em .12em 0 0; color: var(--maroon); }
.prose.no-dropcap > p:first-of-type::first-letter { all: unset; }
.article-end { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.share { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; }
.share a, .share button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); color: var(--text); background: var(--paper); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--maroon); color: var(--maroon); }

.answer-box { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--maroon); border-radius: 14px; padding: 1.6rem 1.8rem; margin-bottom: 2.5rem; }
.answer-box h2 { font-size: 1rem; font-family: var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--maroon); margin: 0 0 .6rem; }
.answer-box p { margin: 0; font-size: 1.12rem; color: var(--ink); }

/* ---------- Events --------------------------------------------------------- */
.events-list { display: grid; gap: 1.5rem; }
.event-card { display: grid; grid-template-columns: 300px 1fr auto; gap: 2rem; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding-right: 2rem; transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.event-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.event-card .card-media { aspect-ratio: 4 / 3; height: 100%; }
.event-card h3 { font-size: 1.55rem; margin: 0 0 .7rem; }
.event-card h3 a { color: inherit; text-decoration: none; }
.event-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; color: var(--text); font-size: .95rem; }
.event-facts li { display: inline-flex; align-items: center; gap: .45rem; }
.event-facts .icon { color: var(--rust); width: 18px; height: 18px; }
.date-badge { text-align: center; min-width: 88px; padding: .9rem .6rem; border-radius: 14px; background: var(--sand); color: var(--maroon); font-family: var(--serif); line-height: 1.1; }
.date-badge b { display: block; font-size: 2.1rem; font-weight: 500; }
.date-badge span { font: 600 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.event-card.past { opacity: .78; }
@media (max-width: 860px) {
  .event-card { grid-template-columns: 1fr; padding: 0 0 1.6rem; gap: 1.2rem; }
  .event-card > div { padding: 0 1.6rem; }
  .event-card .date-badge { display: none; }
}
.event-detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.event-aside { position: sticky; top: 110px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); }
.event-aside .event-facts { flex-direction: column; gap: .8rem; margin-bottom: 1.6rem; font-size: 1rem; }
@media (max-width: 900px) { .event-detail { grid-template-columns: 1fr; } .event-aside { position: static; } }

/* ---------- Forms ---------------------------------------------------------- */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: clamp(1.6rem, 4vw, 3rem); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .field .label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink); margin-bottom: .4rem; }
.field .req { color: var(--maroon); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.input, .field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field);
  font: inherit; font-size: 1rem; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23241b18' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 4px rgba(125, 19, 21, .1); }
.check { display: flex; gap: .65rem; align-items: flex-start; font-size: .94rem; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: .2rem; accent-color: var(--maroon); flex: none; }
.form-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.form-note { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: .4rem; }
.form-note .icon { width: 16px; height: 16px; }

/* ---------- Donation -------------------------------------------------------- */
.donate-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 920px) { .donate-grid { grid-template-columns: 1fr; } }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.amounts input { position: absolute; opacity: 0; pointer-events: none; }
.amounts label { display: grid; place-items: center; padding: 1rem .5rem; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--field); cursor: pointer; font: 500 1.15rem var(--serif); color: var(--ink); margin: 0; transition: all .2s; }
.amounts label:hover { border-color: var(--maroon); }
.amounts input:checked + label { background: var(--fill); border-color: var(--fill); color: #fff; box-shadow: 0 8px 18px rgba(125, 19, 21, .22); }
.amounts input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }
@media (max-width: 480px) { .amounts { grid-template-columns: repeat(2, 1fr); } }
.money-input { position: relative; }
.money-input::before { content: "$"; position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input input { padding-left: 2rem !important; }
#card-container { min-height: 92px; }
.pay-error { color: var(--err); font-weight: 500; margin: .2rem 0 0; }
.thank-you { text-align: center; padding: 2rem 1rem; }
.thank-you .seal { width: 76px; height: 76px; margin: 0 auto 1.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--maroon); }
.thank-you .seal .icon { width: 36px; height: 36px; }
.impact { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.impact li { display: flex; gap: 1rem; align-items: flex-start; }
.impact .icon-wrap { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--maroon); }
.impact strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.12rem; }
.impact p { margin: 0; font-size: .95rem; }

/* ---------- Values / vision ------------------------------------------------ */
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.value { padding: 2rem 1.6rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.value .ar { font-family: var(--arabic); font-size: 2rem; color: var(--rust); display: block; line-height: 1.2; margin-bottom: .6rem; }
.value h3 { font-size: 1.3rem; }
.value p { font-size: .97rem; margin: 0; }
@media (max-width: 1000px) { .values { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .values { grid-template-columns: 1fr; } }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.pair > div { padding: 2.4rem 2.2rem; border-radius: 20px; background: var(--paper); border: 1px solid var(--line); }
.pair .eyebrow { margin-bottom: .6rem; }
@media (max-width: 760px) { .pair { grid-template-columns: 1fr; } }

.statement { text-align: center; padding: clamp(3rem, 6vw, 5rem) 1rem; }
.statement p { font-family: var(--serif); font-size: clamp(1.6rem, 2.4vw + .9rem, 2.6rem); line-height: 1.3; color: var(--ink); max-width: 24ch; margin: 0 auto; font-weight: 400; }
.statement p em { color: var(--maroon); }

/* ---------- Accordion (FAQ) ------------------------------------------------ */
.faq { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.4rem 3rem 1.4rem 0; position: relative; font-family: var(--serif); font-size: 1.25rem; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .3rem; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: linear-gradient(var(--maroon), var(--maroon)) center / 100% 1.5px no-repeat, linear-gradient(var(--maroon), var(--maroon)) center / 1.5px 100% no-repeat; transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 1.5rem; padding-right: 2rem; }

/* ---------- Icon list (course highlights) --------------------------------- */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.highlight { text-align: center; padding: 1.8rem 1.2rem; }
.highlight .icon-wrap { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--gold-soft); color: var(--maroon); }
.highlight .icon-wrap .icon { width: 26px; height: 26px; }
.highlight h3 { font-size: 1.15rem; margin: 0; }
@media (max-width: 860px) { .highlights { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Pagination ------------------------------------------------------ */
.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 3rem; }
.pagination a, .pagination span { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); text-decoration: none; color: var(--text); }
.pagination span { background: var(--maroon); border-color: var(--maroon); color: #fff; }

/* ---------- Footer ----------------------------------------------------------- */
.site-footer { background: var(--footer-bg); color: rgba(251, 247, 241, .7); margin-top: 0; padding: clamp(3.5rem, 6vw, 5rem) 0 2rem; font-size: .96rem; }
.site-footer a { color: rgba(251, 247, 241, .82); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h2, .site-footer h3 { color: var(--on-dark); }
.newsletter { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem 4rem; align-items: center; padding-bottom: 3.5rem; margin-bottom: 3.5rem; border-bottom: 1px solid rgba(251, 247, 241, .12); }
.newsletter .eyebrow { color: var(--gold-soft); }
.newsletter h2 { font-size: clamp(1.6rem, 1.6vw + 1rem, 2.2rem); margin-bottom: .4em; }
.newsletter p { margin: 0; }
.newsletter-form { display: flex; gap: .6rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(251, 247, 241, .16); border-radius: 999px; padding: .4rem; }
.newsletter-form input { flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font: inherit; padding: .7rem 1.1rem; }
.newsletter-form input::placeholder { color: rgba(251, 247, 241, .5); }
.newsletter-form input:focus { outline: none; }
.newsletter-form:focus-within { border-color: var(--gold-soft); }
@media (max-width: 860px) { .newsletter { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .newsletter-form { flex-direction: column; border-radius: 18px; } .newsletter-form .btn { width: 100%; } }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-brand img { height: 84px; width: auto; margin-bottom: 1.2rem; opacity: .95; }
.footer-brand p { max-width: 34ch; }
.footer-grid h3 { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.socials { display: flex !important; gap: .5rem !important; margin-top: 1.4rem !important; }
.socials a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(251, 247, 241, .2); }
.socials a:hover { background: var(--on-dark); color: #7d1315; }
.socials .icon { width: 17px; height: 17px; }
.footer-base { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid rgba(251, 247, 241, .12); font-size: .85rem; }
.footer-base p { margin: 0; }
.footer-dua { font-family: var(--arabic); font-size: 1.35rem; color: var(--gold-soft); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- Message pages / 404 ------------------------------------------- */
.message-page { text-align: center; padding: clamp(5rem, 10vw, 8rem) 0; }
.message-page .big { font-family: var(--arabic); font-size: 4rem; color: var(--gold); line-height: 1; margin-bottom: 1rem; }

/* ---------- Reveal on scroll ------------------------------------------------ */
.reveal { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.reveal-wait { opacity: 0; transform: translateY(18px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.reveal-wait { opacity: 1; transform: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ==========================================================================
   Dark mode — set on <html data-theme="dark"> by theme.js (follows the
   visitor's device setting until they choose with the header toggle).
   ========================================================================== */
html { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --cream: #15100e;
  --paper: #1f1815;
  --sand: #2a201c;
  --sand-2: #3a2c25;
  --ink: #f4ebdf;
  --text: #d5c7b9;
  --muted: #a39486;
  --line: rgba(244, 235, 223, .11);
  --line-strong: rgba(244, 235, 223, .22);
  --maroon: #e7a08a;        /* accent text & links: soft rose for contrast */
  --maroon-deep: #3d0b0d;   /* deep sections & bands */
  --rust: #dc9a68;
  --gold: #c99a4e;
  --gold-soft: #d8bf8f;
  --fill: #9b2427;
  --fill-hover: #b3302f;
  --field: #241c19;
  --header-bg: rgba(21, 16, 14, .82);
  --footer-bg: #0e0a09;
  --ok: #7fc59c;
  --err: #f0a49b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 20px 50px rgba(0, 0, 0, .5);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23f4ebdf' stroke-opacity='.045' stroke-width='1'%3E%3Cpath d='M40 8l9.4 22.6L72 40l-22.6 9.4L40 72l-9.4-22.6L8 40l22.6-9.4z'/%3E%3Cpath d='M17.4 17.4h45.2v45.2H17.4z' transform='rotate(45 40 40)'/%3E%3Cpath d='M17.4 17.4h45.2v45.2H17.4z'/%3E%3C/g%3E%3C/svg%3E");
}
html[data-theme="dark"] body { background: var(--cream); }
html[data-theme="dark"] img { filter: brightness(.92); }
html[data-theme="dark"] .brand img, html[data-theme="dark"] .footer-brand img { filter: none; }
html[data-theme="dark"] .section-paper { background: #1a1411; }
html[data-theme="dark"] .section-sand { background: #1d1613; }
html[data-theme="dark"] .section-pattern { background-color: #1d1613; }
html[data-theme="dark"] .section-maroon { background-color: #2e0809; }
html[data-theme="dark"] .cta-band { background-color: #2e0809; }
html[data-theme="dark"] .btn-light { --bg: #f4ebdf; --fg: #5a0d0f; --bd: #f4ebdf; }
html[data-theme="dark"] .btn-outline { --fg: var(--ink); }
html[data-theme="dark"] .btn-outline:hover { --fg: #fff; }
html[data-theme="dark"] .hero-figure::before { border-color: rgba(216, 191, 143, .35); }
html[data-theme="dark"] .card-media.placeholder span { color: var(--gold-soft); }
html[data-theme="dark"] .flash-success { background: rgba(47, 107, 74, .18); border-color: rgba(127, 197, 156, .35); }
html[data-theme="dark"] .flash-error { background: rgba(161, 38, 29, .18); border-color: rgba(240, 164, 155, .35); }
html[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f4ebdf' stroke-width='1.6'/%3E%3C/svg%3E"); }
html[data-theme="dark"] .input:focus, html[data-theme="dark"] .field input:focus, html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus, html[data-theme="dark"] .search input:focus { box-shadow: 0 0 0 4px rgba(231, 160, 138, .15); }
html[data-theme="dark"] .hadith-body .ar mark, html[data-theme="dark"] .hadith-body .en mark { background: linear-gradient(transparent 55%, rgba(201, 154, 78, .3) 55%); }
html[data-theme="dark"] .amounts input:checked + label { box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
html[data-theme="dark"] #card-container { background: #fff; border-radius: 12px; padding: 4px; }

/* Logo: brand colours on light, cream line-art on dark */
.brand .logo-dark { display: none; }
html[data-theme="dark"] .brand .logo-light { display: none; }
html[data-theme="dark"] .brand .logo-dark { display: block; }

/* Theme toggle */
.header-tools { display: flex; align-items: center; gap: .5rem; order: 3; }
.site-nav { order: 2; margin-left: auto; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
  transition: background-color .2s, color .2s, transform .3s var(--ease);
}
.theme-toggle:hover { background: var(--sand); color: var(--maroon); }
.theme-toggle:active { transform: rotate(-20deg) scale(.95); }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle .when-dark { display: none; }
html[data-theme="dark"] .theme-toggle .when-dark { display: block; }
html[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (max-width: 980px) { .theme-toggle { width: 46px; height: 46px; background: var(--paper); } }
@media (prefers-reduced-motion: no-preference) {
  html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }
}

@media print {
  .site-header, .site-footer, .cta-band, .share { display: none !important; }
  html, body { background: #fff !important; color: #000; }
}
