/* ==========================================================================
   Individual-fundraiser pages (Asim & Amir). Layers on top of styles.css,
   reusing the same tokens: navy/rust/surface, Merriweather, 4/8px radii.
   ========================================================================== */

/* Hero: ask + live progress, above the fold. */
.fund-hero { padding: var(--space-8) 0 var(--space-7); }
.fund-hero__eyebrow {
  display: inline-block;
  background: #FFE066;
  color: var(--color-navy);
  font-style: italic;
  font-size: clamp(1.8rem, 4.5vw, 2.85rem);   /* ~3x, per Dr. Mohsin */
  line-height: 1.15;
  font-weight: 700;
  padding: 0.4rem 1.2rem;
  border-radius: 12px 0 12px 0;       /* signature ribbon corner */
  margin-bottom: var(--space-4);
}
.fund-hero__first {
  margin-top: var(--space-3);
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem);   /* matches h1 */
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.fund-hero h1 { max-width: 16ch; }
.fund-hero h1 em { font-style: italic; color: var(--color-rust); }
.fund-hero__lead {
  margin-top: var(--space-4);
  font-size: 1.15rem;
  color: var(--color-navy-soft);
  max-width: 60ch;
}

/* Progress card */
.fund-progress {
  margin-top: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: 0 10px 30px rgba(5, 10, 64, 0.08);
}
.fund-progress__figures {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.fund-progress__raised {
  font-weight: 900;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  color: var(--color-navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fund-progress__goal { font-size: 1.1rem; color: var(--color-text-muted); }
.fund-bar {
  margin-top: var(--space-4);
  height: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.fund-bar__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-rust), #b0331f);
  border-radius: 999px;
  transition: width 700ms ease;
}
.fund-progress__meta {
  margin-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: 0.98rem;
  color: var(--color-navy-soft);
}
.fund-progress__meta strong { color: var(--color-navy); font-variant-numeric: tabular-nums; }
.fund-progress__cta {
  margin-top: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.fund-progress__suggest { font-size: 0.95rem; color: var(--color-text-muted); }
.btn--wide { padding: 1rem 2.2rem; font-size: 1.05rem; }

/* Give block (offline methods) */
.fund-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-6);
}
.fund-method {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--transition-base);
}
.fund-method:hover { border-color: var(--color-navy); }
.fund-method__label {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-rust);
  font-weight: 700;
}
.fund-method__value { margin-top: var(--space-2); font-size: 1.05rem; color: var(--color-navy); font-weight: 700; }
.fund-method__note { margin-top: var(--space-1); font-size: 0.9rem; color: var(--color-text-muted); }

/* Pitch: tech differentiator chips + proof */
.fund-chips { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.fund-chip {
  background: var(--color-navy);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.fund-proof {
  margin-top: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.fund-proof__num { font-weight: 900; font-size: 2.4rem; color: var(--color-rust); line-height: 1; font-variant-numeric: tabular-nums; }
.fund-proof__text { font-size: 1.1rem; color: var(--color-navy); font-weight: 700; }

/* Testimonials */
.fund-quotes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-top: var(--space-5); }
.fund-quote blockquote { font-style: italic; font-size: 1.15rem; color: var(--color-navy-soft); }
.fund-quote cite {
  display: block;
  margin-top: var(--space-3);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}

/* Donor wall */
.fund-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); margin-top: var(--space-5); }
.fund-donor {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  background: var(--color-bg);
}
.fund-donor__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.fund-donor__name { font-weight: 700; color: var(--color-navy); font-size: 1.05rem; }
.fund-donor__amt { font-weight: 900; color: var(--color-rust); font-variant-numeric: tabular-nums; }
.fund-donor__meta {
  margin-top: var(--space-2);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}
.fund-donor__msg { margin-top: var(--space-3); font-style: italic; color: var(--color-navy-soft); font-size: 0.95rem; }
.fund-wall__empty { color: var(--color-text-muted); font-style: italic; margin-top: var(--space-4); }

/* Visible quotation marks on family testimonials */
.fund-quote blockquote::before { content: '\201C'; }
.fund-quote blockquote::after  { content: '\201D'; }

/* Highlighted phrase inside a testimonial */
.fund-hl {
  background: #FFE066;
  color: var(--color-navy);
  font-weight: 700;
  padding: 0.05em 0.25em;
  border-radius: 3px;
}

/* Qur'an / virtue block in the hero */
.fund-ayah {
  margin-top: var(--space-5);
  background: var(--color-surface);
  border-left: 4px solid var(--color-rust);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-5) var(--space-6);
  max-width: 62ch;
}
.fund-ayah__quote { font-style: italic; font-size: 1.4rem; line-height: 1.6; color: var(--color-navy); }
.fund-ayah__src {
  margin-top: var(--space-2);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}
.fund-ayah__body { margin-top: var(--space-4); font-size: 1rem; line-height: 1.7; color: var(--color-text); }

/* Gift amount picker + cover-the-costs */
.fund-give-box { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--color-border); }
.fund-give-box__label {
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--color-rust);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.fund-amounts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fund-amt {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base), border-color var(--transition-base);
}
.fund-amt:hover { border-color: var(--color-navy); }
.fund-amt.is-selected { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }
.fund-amt-other {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0 0.7rem;
  background: var(--color-bg);
  min-height: 44px;
}
.fund-amt-other:focus-within { border-color: var(--color-navy); }
.fund-amt-other__sign { color: var(--color-text-muted); font-weight: 700; }
.fund-amt-other input {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  border: none;
  outline: none;
  width: 5.5rem;
  padding: 0.5rem 0.2rem;
  background: transparent;
}
.fund-cover {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: var(--space-4);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text);
  cursor: pointer;
}
.fund-cover input {
  margin-top: 0.28rem;
  width: 18px;
  height: 18px;
  accent-color: var(--color-rust);
  flex-shrink: 0;
  cursor: pointer;
}
.fund-give-box .btn { margin-top: var(--space-4); width: 100%; text-align: center; }
.fund-give-note { margin-top: var(--space-3); font-size: 0.85rem; color: var(--color-text-muted); text-align: center; }
.fund-give-note.is-error { color: var(--color-rust); font-weight: 700; }

/* Tier buttons carry an impact label under the amount */
.fund-amt { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; line-height: 1.25; }
.fund-amt__tier {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-rust);
}
.fund-amt__amt { font-size: 1.05rem; font-weight: 700; }
.fund-amt__label { font-size: 0.72rem; font-weight: 400; color: var(--color-text-muted); max-width: 15ch; }
.fund-amt.is-selected .fund-amt__tier { color: rgba(255, 255, 255, 0.92); }
.fund-amt.is-selected .fund-amt__label { color: rgba(255, 255, 255, 0.82); }
.fund-anon { margin-top: var(--space-2); font-size: 0.9rem; color: var(--color-text-muted); }

/* Founding-donor slot grid. Only rendered once seeded (see [key].js). */
.fund-slots {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: var(--space-2);
}
.fund-slot {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-sm);
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.35rem;
  text-align: center;
}
.fund-slot.is-filled {
  border-style: solid;
  border-color: var(--color-navy);
  background: var(--color-navy);
  color: #fff;
  font-weight: 700;
}

/* First-person advocate story */
.fund-story {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: var(--space-5);
  align-items: start;
}
.fund-story__photo { width: 132px; height: 132px; object-fit: cover; border-radius: var(--radius-md); display: block; }
.fund-story__body p { margin-bottom: var(--space-3); }
.fund-story__body p:last-child { margin-bottom: 0; }
.fund-story__sign { font-weight: 700; color: var(--color-navy); font-style: italic; }

/* Story without a photo reads as a centered letter */
.fund-story--nophoto { grid-template-columns: 1fr; text-align: center; max-width: 56ch; margin-left: auto; margin-right: auto; }

/* Emphasis paragraph in a story: _wrapped in underscores_ in the story text */
.fund-story__em { font-size: 1.15rem; font-weight: 700; color: var(--color-navy); }

/* The story's emotional closer: slow rise + settle once it scrolls into view.
   Visible by default; JS adds .is-armed (hide) then .is-in (reveal), so if
   scripting fails in any way the line simply shows normally. */
.fund-story__closer {
  margin-top: var(--space-5);
  font-style: italic;
  font-size: 1.74rem;
  line-height: 1.45;
  color: var(--color-navy);
  background: #FFE066;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 0.3rem 0.9rem;
  border-radius: 6px;
}
.fund-story__closer.is-armed { opacity: 0; transform: translateY(16px) scale(0.97); }
.fund-story__closer.is-in {
  opacity: 1;
  transform: none;
  /* 2.75s hold gives the reader time to finish the paragraph above before the line blooms */
  transition: opacity 1.1s ease-out 2.75s, transform 1.1s ease-out 2.75s;
}
@media (prefers-reduced-motion: reduce) {
  .fund-story__closer.is-armed { opacity: 1; transform: none; }
  .fund-story__closer.is-in { transition: none; }
}

/* Trust strip under the give box */
.fund-trust {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem var(--space-4);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.fund-trust strong { color: var(--color-navy); }

/* Single share control above the donor wall */
.fund-share {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.fund-share span { font-size: 0.92rem; color: var(--color-text-muted); }
.fund-share__head { font-weight: 900; font-size: 1.05rem; color: var(--color-navy); }

/* Arrived via a friend's share */
.fund-viafriend { background: #FFF7DF; border: 1px solid #F2E2A9; color: var(--color-navy); font-style: italic; font-size: 0.95rem; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); margin-bottom: var(--space-4); }

/* Donor wall permanence note */
.fund-wall-note { font-size: 0.9rem; font-style: italic; color: var(--color-navy-soft); }

/* Campaign updates under the story */
.fund-updates { margin: var(--space-5) auto 0; max-width: 56ch; }
.fund-update {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}
.fund-update__label {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-rust);
  margin-right: 0.5rem;
}

/* Founders-wall unlock challenge, shown while the tracker is still hidden */
.fund-unlock { margin: var(--space-4) auto 0; max-width: 52ch; font-size: 0.95rem; font-style: italic; color: var(--color-navy-soft); }

/* Sticky mobile give bar */
.fund-stickybar { display: none; }
@media (max-width: 640px) {
  body { padding-bottom: 72px; }
  .fund-stickybar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 0.6rem var(--space-4);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -8px 24px rgba(5, 10, 64, 0.12);
    transition: transform 0.25s ease;
  }
  .fund-stickybar.is-hidden { transform: translateY(110%); }
  .fund-stickybar__days { font-size: 0.92rem; color: var(--color-navy); font-weight: 700; }
  .fund-stickybar__days strong { color: var(--color-rust); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
  .fund-stickybar .btn { flex-shrink: 0; padding: 0.7rem 1.8rem; }
}

/* Prominent countdown pill above the goal bar — same yellow as .fund-hl */
.fund-daysleft {
  display: inline-block;
  background: #FFE066;
  color: var(--color-navy);
  font-weight: 700;
  font-size: 1.4rem;
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  margin-bottom: var(--space-3);
}
.fund-daysleft strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.fund-daysleft--final { background: var(--color-rust); color: #fff; }
.fund-daysleft__date { font-size: 0.8rem; color: var(--color-text-muted); margin: 0.15rem 0 var(--space-2); }

/* Point-of-giving urgency lines */
.fund-milestone { margin-bottom: var(--space-3); font-size: 0.95rem; font-weight: 700; color: var(--color-rust); }
.fund-scarcity { margin-top: var(--space-3); font-size: 0.92rem; font-weight: 700; color: var(--color-navy); }

/* Class photo under the hadith */
.fund-photo { margin-top: var(--space-5); max-width: 62ch; }
.fund-photo img { width: 100%; height: auto; display: block; border-radius: var(--radius-md); }
.fund-photo figcaption { margin-top: var(--space-2); font-size: 0.8rem; color: var(--color-text-muted); }

/* Dedication nudge in the give box */
.fund-dedicate { margin-top: var(--space-3); font-size: 0.9rem; font-style: italic; color: var(--color-text-muted); max-width: 52ch; }

/* Post-donation thank-you overlay (?thanks=1) */
.fund-thanks { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 64, 0.55); display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.fund-thanks[hidden] { display: none; }
.fund-thanks__card { background: #fff; border-radius: var(--radius-md); padding: var(--space-6); max-width: 30rem; text-align: center; box-shadow: 0 18px 60px rgba(5, 10, 64, 0.35); }
.fund-thanks__card h3 { color: var(--color-navy); font-size: 1.35rem; }
.fund-thanks__card p { margin-top: var(--space-3); color: var(--color-text); font-size: 0.95rem; line-height: 1.6; }
.fund-thanks__card .btn { margin-top: var(--space-4); }
.fund-thanks__mark { width: 44px; height: 44px; margin: 0 auto var(--space-3); border-radius: 50%; background: #E8F5E9; color: #1B7F3B; font-size: 22px; line-height: 44px; font-weight: 700; }
.fund-thanks__close { display: block; margin: var(--space-3) auto 0; background: none; border: none; color: var(--color-text-muted); font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: underline; }

@media (max-width: 640px) {
  .fund-story { grid-template-columns: 1fr; }
  .fund-story__photo { width: 108px; height: 108px; }
  .fund-slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .fund-share { flex-direction: column; align-items: stretch; text-align: center; }
}

@media (max-width: 640px) {
  .fund-quotes { grid-template-columns: 1fr; }
  .fund-progress { padding: var(--space-5); }
  .fund-progress__cta { flex-direction: column; align-items: stretch; }
  .fund-progress__cta .btn { text-align: center; }
  .fund-ayah { padding: var(--space-5); }
  .fund-amt { flex: 1 1 calc(50% - var(--space-2)); }
  .fund-amt-other { flex: 1 1 100%; }
  .fund-amt-other input { width: 100%; }
}

/* ==========================================================================
   Invitation-style centering (per Dr. Mohsin): the whole page centers to
   match the story's closing line. Text blocks center via the containers;
   flex rows need justify-content; width-capped blocks need auto margins.
   Donor name/amount rows keep their left/right flex layout by design.
   ========================================================================== */
.fund-hero .container,
.section .container,
.site-footer .container { text-align: center; }

.fund-hero h1,
.fund-hero__lead,
.fund-ayah,
.fund-photo,
.fund-dedicate,
.section-head p { margin-left: auto; margin-right: auto; }

.fund-amounts,
.fund-chips,
.fund-trust,
.fund-share,
.fund-proof,
.fund-cover,
.fund-progress__figures,
.fund-progress__meta,
.fund-progress__cta { justify-content: center; }

.fund-amt { align-items: center; text-align: center; }
