/**
 * Salafi Donations — campaign landing templates.
 *
 * Each template is scoped under .sd-lp--{slug} so its design language is
 * self-contained. The donation form (.sd-form) is reused as-is; templates only
 * style the chrome around it and may hide the form's own banner when they
 * provide their own hero/feature image.
 */

/* ---- Typography: the landing font is driven by --sd-lp-font, which the
   "Landing font" setting can override (e.g. to the website's own font). When
   unset it falls back to a clean sans stack (never the theme's serif body). ---- */
body.sd-standalone,
.sd-lp {
  font-family: var(--sd-lp-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}
.sd-lp h1,
.sd-lp h2,
.sd-lp h3,
.sd-lp h4,
.sd-lp p,
.sd-lp li,
.sd-lp a,
.sd-lp__title {
  font-family: var(--sd-lp-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

/* ---- Standalone document chrome (no theme header/footer) ---- */
body.sd-standalone {
  margin: 0;
  overflow-x: hidden; /* the full-bleed bg uses 100vw */
  background: #fff;
}

/* ---- Shared layout ---- */
.sd-lp {
  position: relative;
  /* Chrome accent. A campaign palette overrides it via an inline style on the
     wrapper. The form keeps its own accent. */
  --sd-lp-accent: #0e7a5f;
}
.sd-lp__inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}
.sd-lp__grid {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 440px);
  gap: 40px;
  align-items: start;
}
.sd-lp__grid--solo {
  grid-template-columns: minmax(320px, 480px);
  justify-content: center;
}
.sd-lp__form {
  position: sticky;
  top: 24px;
}
.sd-lp__title {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 800;
  margin: 0 0 16px;
  /* Explicit dark so host themes that style body { color:#fff } can't wash
     out the title on the white story card. Spotlight overrides this to white
     further down (its hero bg is dark). */
  color: #14231d;
}
.sd-lp__desc {
  line-height: 1.65;
  color: #14231d;
}
.sd-lp__desc > :first-child {
  margin-top: 0;
}
.sd-lp__card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(20, 35, 29, 0.08);
  padding: 28px;
}
@media (max-width: 860px) {
  .sd-lp__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .sd-lp__form {
    position: static;
  }
}

/* ---- Full-bleed background layer ---- */
.sd-lp__bg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.sd-lp__bg--split {
  background: linear-gradient(
    to bottom,
    var(--sd-lp-c1, #fff) 0,
    var(--sd-lp-c1, #fff) var(--sd-lp-split, 40%),
    var(--sd-lp-c2, #dfe9e0) var(--sd-lp-split, 40%),
    var(--sd-lp-c2, #dfe9e0) 100%
  );
}
.sd-lp__bg--image {
  /* Solid base: the page colour (accent) fills the hero when no image is set,
     falling back to a dark slate so overlaid white text stays readable. */
  background-color: var(--sd-lp-accent, #1f2937);
  background-image: linear-gradient(
      rgba(0, 0, 0, var(--sd-lp-overlay, 0.45)),
      rgba(0, 0, 0, var(--sd-lp-overlay, 0.45))
    ),
    var(--sd-lp-img, none);
  background-size: cover;
  background-position: center;
}

/* ---- Impact: warm, card-based, stats-forward ---- */
/* The background is a soft mesh — a palette-tinted blob in the top-right plus
   a hairline tint at the bottom — over a near-white field. Pinned to the
   viewport so the colour field never shifts when the form grows (e.g. when
   Apple/Google Pay loads in a moment after render). Fixed (not
   background-attachment) so it also holds on iOS, where Apple Pay lives.
   Falls back to a flat near-white if the browser does not support color-mix. */
.sd-lp--impact .sd-lp__bg--split {
  position: fixed;
  height: 100vh;
  /* Mesh base: a near-white field; the accent provides the soft mesh tint. */
  background: #f7faf8;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .sd-lp--impact .sd-lp__bg--split {
    background:
      radial-gradient(
        ellipse 70% 60% at 88% -10%,
        color-mix(in srgb, var(--sd-lp-accent) 22%, transparent) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse 90% 50% at 50% 115%,
        color-mix(in srgb, var(--sd-lp-accent) 10%, transparent) 0%,
        transparent 65%
      ),
      #f7faf8;
  }
}
.sd-lp--impact .sd-lp__story {
  overflow: hidden;
  padding: 0;
}
.sd-lp--impact .sd-lp__feature {
  height: 240px;
  background-size: cover;
  background-position: center;
}
.sd-lp--impact .sd-lp__story-body {
  padding: 28px;
}

/* One-shot fade-up entrance on the story and form cards. Applied on Impact
   and Spotlight (Classic stays calm — it's the neutral template). Reduced-
   motion users see the final state immediately. */
@media (prefers-reduced-motion: no-preference) {
  .sd-lp--impact .sd-lp__story,
  .sd-lp--spotlight .sd-lp__story {
    animation: sd-lp-impact-rise 360ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }
  .sd-lp--impact .sd-lp__form,
  .sd-lp--spotlight .sd-lp__form {
    animation: sd-lp-impact-rise 240ms cubic-bezier(0.23, 1, 0.32, 1) both;
  }
  @keyframes sd-lp-impact-rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ---- Spotlight: cinematic full-bleed hero + overlay form ---- */
.sd-lp--spotlight .sd-lp__inner {
  padding: 88px 20px;
  min-height: 520px;
}
.sd-lp--spotlight .sd-lp__story {
  color: #fff;
}
.sd-lp--spotlight .sd-lp__title {
  font-size: 2.8rem;
  /* Override the shared dark default so the title reads on the dark hero. */
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.sd-lp--spotlight .sd-lp__desc {
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.1rem;
  max-width: 46ch;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.35);
}
.sd-lp--spotlight .sd-banner {
  display: none; /* the hero is the visual */
}

/* ===================== CRO components (wave 1) ===================== */

/* ---- Subheading (emotional one-liner under the title) ---- */
.sd-lp__subhead {
  font-size: 1.15rem;
  line-height: 1.5;
  font-weight: 500;
  color: #475247;
  margin: 0 0 18px;
}

/* ---- Logo-as-title (Settings → Use site logo as title) ---- */
.sd-lp__logo {
  margin: 0 0 14px;
}
.sd-lp__logo img,
.sd-lp__logo .custom-logo {
  max-height: 72px;
  width: auto;
}
.sd-lp--spotlight .sd-lp__logo {
  filter: drop-shadow(0 2px 16px rgba(0, 0, 0, 0.35));
}
.sd-lp__title--sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sd-lp--spotlight .sd-lp__subhead {
  color: rgba(255, 255, 255, 0.92);
}

/* ---- Impact strip (amount → impact, clickable) ---- */
.sd-lp__impact {
  margin-top: 48px;
}
.sd-lp__impact-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 20px;
}
.sd-lp__impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.sd-lp__impact-card {
  text-align: left;
  background: #fff;
  border: 1px solid #e3e9e6;
  border-radius: 14px;
  padding: 18px;
  cursor: pointer;
  font: inherit;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .sd-lp__impact-card {
    transition: border-color 0.15s ease, background-color 0.15s ease;
  }
}
.sd-lp__impact-card:hover,
.sd-lp__impact-card:focus-visible {
  /* no transform — movement reads as templated/AI. Calm colour shift only. */
  border-color: var(--sd-lp-accent, #0e7a5f);
  background: #f6faf8;
  outline: none;
}
.sd-lp__impact-card.is-selected {
  border-color: var(--sd-lp-accent, #0e7a5f);
  box-shadow: inset 0 0 0 1px var(--sd-lp-accent, #0e7a5f);
}
.sd-lp__impact-amount {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--sd-lp-accent, #0e7a5f);
}
.sd-lp__impact-caption {
  display: block;
  margin-top: 4px;
  color: #5b6b63;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ---- Hadith ---- */
.sd-lp__hadith {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.sd-lp__quote {
  margin: 0;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(20, 35, 29, 0.06);
}
.sd-lp__quote-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #14231d;
}
.sd-lp__quote-author {
  margin-top: 12px;
  font-weight: 700;
  color: var(--sd-lp-accent, #0e7a5f);
  font-size: 0.9rem;
}

/* ---- Spotlight hero + content band below ---- */
.sd-lp--spotlight .sd-lp__hero {
  position: relative;
}
/* Reserve space for the Apple/Google Pay block before it mounts so the form
   keeps a stable height. Stripe's ExpressCheckoutElement is hidden on first
   paint and only shows after the SDK confirms an available wallet (a moment
   later). Without this reservation the form grows ~80px when the wallet
   appears, and the cover-sized hero bg jumps to a larger size with it. Scoped
   to Spotlight because that is the only template where the bg image rescales
   visibly; on Classic/Impact the wallet still hides/shows but no photo is
   tied to the hero. */
.sd-lp--spotlight .sd-form .sd-wallets[hidden] {
  display: block;
  visibility: hidden;
  min-height: 80px;
}
.sd-lp__below {
  background: #fff;
}
.sd-lp__below-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 20px;
}
.sd-lp__below-inner > :first-child {
  margin-top: 0;
}

/* ---- Mobile: form first so the ask is immediately visible ---- */
@media (max-width: 860px) {
  .sd-lp__form {
    order: -1;
  }
  .sd-lp--spotlight .sd-lp__inner {
    padding: 44px 18px;
    min-height: 0;
  }
}

/* ---- Brand bar/footer (rendered inside the template, blends with its bg) ---- */
.sd-lp__brandbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* left-aligned, in line with the content column */
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 0;
}
.sd-lp__brandlink {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.sd-lp__brandbar img,
.sd-lp__brandbar .custom-logo,
.sd-lp__brandlogo {
  max-height: 48px;
  width: auto;
  display: block;
}
.sd-lp__brand {
  font-weight: 800;
  font-size: 1.2rem;
  color: #14231d;
  text-decoration: none;
}
/* On dark/colourful templates the brand text goes light to stay legible. */
.sd-lp--spotlight .sd-lp__brand {
  color: #fff;
}

/* ---- Landing footer: payment marks · reg. charity · © year + site ----
   Single centred row. Payment marks sized to the text x-height so they read
   as inline detail rather than graphical chips. Wraps to a second line on
   narrow viewports. */
.sd-lp__foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  row-gap: 6px;
  max-width: 1100px;
  /* Generous margin-top so there's clear breathing room between the form
     column (which can be sticky-positioned and extend down) and the footer.
     No top border — the whitespace alone separates the footer from the
     content above it. */
  margin: 56px auto 0;
  padding: 28px 24px 32px;
  color: #5b6b63;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.1px;
}
.sd-lp__methods {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.sd-lp__method {
  display: inline-flex;
  align-items: center;
  /* Slight de-emphasis — payment marks are reassurance, not headline. */
  opacity: 0.6;
}
.sd-lp__method img {
  display: block;
  width: auto;
}
/* Per-brand heights, tuned so the four marks read at a similar visual
   weight across the row. Visa's wordmark is solid and chunky so it reads
   substantial at a smaller height; Mastercard is square (aspect ~1.6:1)
   and Apple Pay / Google Pay have more whitespace inside the SVG so they
   need a few extra pixels to match. */
.sd-lp__method--visa img       { height: 12px; }
.sd-lp__method--mastercard img { height: 18px; }
.sd-lp__method--apple-pay img  { height: 16px; }
.sd-lp__method--google-pay img { height: 18px; }
.sd-lp__foot-sep {
  color: rgba(20, 35, 29, 0.22);
  font-size: 13px;
  line-height: 1;
  user-select: none;
}
.sd-lp__foot-text {
  color: inherit;
}

/* ---- Spotlight: keep the cinematic headline on top on mobile (no form-first) ---- */
@media (max-width: 860px) {
  .sd-lp--spotlight .sd-lp__form {
    order: 0;
  }
}
