/* ============================================================
   Amal Relief — Gaza relief donation site
   Bilingual (EN/AR) with full RTL support.
   Design: Palestinian tatreez embroidery — deep red, olive
   green, cream, near-black, with geometric cross-stitch motifs.
   ============================================================ */

:root {
  --red: #ce1126;          /* tatreez red */
  --red-dark: #a30f1f;
  --green: #0e7a46;        /* olive green */
  --green-dark: #0a5c34;
  --cream: #faf6ef;         /* sandstone */
  --cream-dark: #f1eadd;
  --ink: #161613;          /* near-black */
  --ink-soft: #4a4a42;
  --gold: #c9a24b;

  --shadow: 0 10px 30px rgba(22, 22, 19, .12);
  --radius: 14px;

  --font-main: "Inter", "Segoe UI", "Tahoma", system-ui, sans-serif;
  /* Arabic-capable stack; Amiri for headings in AR for warmth */
  --font-heading: "Playfair Display", "Amiri", Georgia, serif;
}

html[dir="rtl"] {
  --font-main: "Tahoma", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Amiri", "Playfair Display", Georgia, serif;
}

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

html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1100px, 92%); margin-inline: auto; }

/* ---------- Tatreez decorative band ---------- */
.tatreez-band {
  height: 14px;
  background:
    linear-gradient(45deg, var(--red) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(-45deg, var(--red) 25%, transparent 25%) 0 0/14px 14px,
    linear-gradient(45deg, transparent 75%, var(--red) 75%) 0 0/14px 14px,
    linear-gradient(-45deg, transparent 75%, var(--red) 75%) 0 0/14px 14px;
  background-color: var(--cream);
}

/* ---------- Emergency banner ---------- */
.emergency-banner {
  background: var(--red);
  color: #fff;
  padding: .8rem 0;
}
.em-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 1.2rem; flex-wrap: wrap; text-align: center;
}
.em-inner p { font-weight: 700; font-size: .95rem; max-width: 52rem; margin: 0; }
.em-cta {
  background: #fff; color: var(--red-dark);
  font-weight: 800; font-size: .9rem;
  padding: .45rem 1.3rem; border-radius: 999px;
  text-decoration: none; white-space: nowrap;
}
.em-cta:hover { background: var(--cream); text-decoration: none; }
html[dir="rtl"] .em-inner p { font-size: 1.02rem; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 239, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(22, 22, 19, .08);
}
.nav {
  display: flex; align-items: center; gap: 1rem;
  padding-block: .7rem;
}
.nav .logo {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--font-heading);
  font-weight: 700; font-size: 1.25rem; color: var(--ink);
  text-decoration: none;
}
.nav .logo .flag { width: 30px; height: 30px; }
.nav .logo .amal { color: var(--red); }
.nav-links {
  display: flex; gap: 1.4rem; margin-inline-start: auto;
  list-style: none;
}
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--green); text-decoration: none; }
.nav .donate-btn {
  background: var(--red); color: #fff; font-weight: 700;
  padding: .55rem 1.2rem; border-radius: 999px;
  text-decoration: none; transition: background .2s;
}
.nav .donate-btn:hover { background: var(--red-dark); text-decoration: none; }

/* Language selector */
.lang-select {
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: transparent; color: var(--ink);
  padding: .4rem 1.6rem .4rem .8rem;
  font-weight: 700; font-size: .85rem; font-family: var(--font-main);
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23161613' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center;
}
html[dir="rtl"] .lang-select { background-position: left .7rem center; padding: .4rem .8rem .4rem 1.6rem; }

/* Language toggle */
.lang-toggle {
  display: flex; border: 1.5px solid var(--ink); border-radius: 999px;
  overflow: hidden; flex-shrink: 0;
}
.lang-toggle button {
  border: none; background: transparent; cursor: pointer;
  padding: .35rem .8rem; font-weight: 700; font-size: .85rem;
  color: var(--ink-soft); font-family: var(--font-main);
}
.lang-toggle button.active { background: var(--ink); color: var(--cream); }

@media (max-width: 760px) {
  .nav-links { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 5rem 0 4rem;
  background:
    radial-gradient(ellipse 80% 60% at 80% -10%, rgba(14, 122, 70, .12), transparent),
    radial-gradient(ellipse 60% 50% at 10% 110%, rgba(206, 17, 38, .10), transparent),
    var(--cream);
  overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 3rem; align-items: center;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(206, 17, 38, .1); color: var(--red-dark);
  font-weight: 700; font-size: .85rem;
  padding: .35rem .9rem; border-radius: 999px;
  margin-bottom: 1.1rem;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.15; color: var(--ink);
  margin-bottom: 1rem;
}
.hero h1 .accent { color: var(--green); }
.hero p.lead {
  font-size: 1.15rem; color: var(--ink-soft);
  max-width: 34rem; margin-bottom: 2rem;
}
.hero .cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.8rem; border-radius: 999px;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  text-decoration: none; border: 2px solid transparent;
  transition: transform .15s, background .2s, color .2s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--green-dark); border-color: var(--green); }
.btn-ghost:hover { background: var(--green); color: #fff; text-decoration: none; }

/* Impact stats strip under hero */
.stats-strip {
  background: var(--ink); color: var(--cream);
  padding: 1.4rem 0;
}
.stats-strip .container {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; text-align: center;
}
@media (max-width: 760px) { .stats-strip .container { grid-template-columns: repeat(2, 1fr); } }
.stat .num { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--gold); }
.stat .label { font-size: .8rem; opacity: .75; }

/* ---------- Sections ---------- */
section { padding: 4rem 0; }
section.alt { background: var(--cream-dark); }
.sec-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.3rem);
  text-align: center; margin-bottom: .6rem;
}
.sec-sub { text-align: center; color: var(--ink-soft); max-width: 40rem; margin: 0 auto 2.5rem; }

/* Programs / where funds go */
.programs-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.3rem;
}
.program-card {
  background: #fff; border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
  border-top: 4px solid var(--green);
  transition: transform .15s;
}
.program-card:nth-child(2) { border-top-color: var(--red); }
.program-card:nth-child(3) { border-top-color: var(--gold); }
.program-card:hover { transform: translateY(-4px); }
.program-card .icon { font-size: 1.8rem; margin-bottom: .6rem; }
.program-card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.program-card p { font-size: .92rem; color: var(--ink-soft); }

/* Transparent accounting list */
.transparency-list {
  max-width: 640px; margin-inline: auto; list-style: none;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.transparency-list li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .95rem 1.4rem; border-bottom: 1px solid rgba(22,22,19,.06);
  font-size: .95rem;
}
.transparency-list li:last-child { border-bottom: none; }
.transparency-list .pct { font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.transparency-list li:first-child .pct { color: var(--red-dark); }

.flood-report { background: var(--cream); padding: 2.5rem 0 0; }
.flood-report figure { margin: 0; }
.flood-report img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(22, 22, 19, .08);
}
.flood-report figcaption { padding: 1.2rem .2rem 0; }
.flood-report h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 1.8rem); line-height: 1.3;
  margin-bottom: .5rem;
}
.flood-report figcaption p { color: var(--ink-soft); font-size: .95rem; max-width: 46rem; }
.flood-cta { margin-bottom: 1.5rem; }

/* ---------- Crisis photo ---------- */
.crisis-photo { padding: 3rem 0; }
.crisis-photo figure { margin: 0; }
.crisis-photo img {
  width: 100%; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(22, 22, 19, .08);
}
.crisis-photo figcaption {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: .6rem; font-size: .85rem; color: var(--ink-soft);
}
.crisis-photo figcaption .credit { opacity: .75; font-size: .78rem; }
.crisis-photo figcaption a { color: inherit; }

/* ---------- Donation form ---------- */
#donate { scroll-margin-top: 80px; }
.donate-card {
  max-width: 560px; margin-inline: auto;
  background: #fff; border-radius: 20px;
  box-shadow: 0 20px 50px rgba(22, 22, 19, .16);
  border: 1px solid rgba(22, 22, 19, .07);
  overflow: hidden;
}
.donate-card .card-head {
  background: var(--ink); color: var(--cream);
  padding: 1.2rem 1.6rem; text-align: center; position: relative;
}
.donate-card .card-head h2 { font-family: var(--font-heading); font-size: 1.5rem; }
.donate-card .card-head p { font-size: .85rem; opacity: .7; }
.donate-card .card-body { padding: 1.6rem; }

/* frequency toggle */
.freq-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--cream-dark); border-radius: 999px;
  padding: 4px; margin-bottom: 1.3rem;
}
.freq-toggle button {
  border: none; background: transparent; cursor: pointer;
  padding: .6rem; border-radius: 999px;
  font-weight: 700; font-size: .95rem; color: var(--ink-soft);
  font-family: var(--font-main);
  transition: background .2s, color .2s;
}
.freq-toggle button.active { background: var(--green); color: #fff; }

/* amount grid */
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: .9rem; }
.amount-btn {
  border: 2px solid rgba(22, 22, 19, .15); background: #fff;
  border-radius: 10px; padding: .8rem .5rem;
  font-weight: 700; font-size: 1rem; cursor: pointer;
  color: var(--ink); font-family: var(--font-main);
  transition: border-color .15s, background .15s, transform .1s;
}
.amount-btn:hover { border-color: var(--green); }
.amount-btn.active { border-color: var(--red); background: rgba(206, 17, 38, .07); color: var(--red-dark); }
.amount-btn .per { display: block; font-size: .72rem; font-weight: 600; opacity: .6; }

.custom-amount { margin-bottom: 1.2rem; }
.custom-amount label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .4rem; color: var(--ink-soft); }
.custom-amount .money-wrap { display: flex; border: 2px solid rgba(22,22,19,.15); border-radius: 10px; overflow: hidden; }
.custom-amount .currency {
  background: var(--cream-dark); padding: .7rem .9rem;
  font-weight: 700; color: var(--ink-soft); border-inline-end: 1px solid rgba(22,22,19,.1);
}
.custom-amount input {
  flex: 1; border: none; outline: none; padding: .7rem;
  font-size: 1.05rem; font-family: var(--font-main);
}
.custom-amount input:focus { background: rgba(14,122,70,.04); }

/* impact line */
.impact-line {
  font-size: .9rem; color: var(--green-dark);
  background: rgba(14, 122, 70, .08);
  border-inline-start: 3px solid var(--green);
  padding: .6rem .9rem; border-radius: 6px;
  margin-bottom: 1.2rem;
}

/* pay button */
.pay-btn {
  width: 100%; padding: 1rem; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.pay-btn:disabled { opacity: .55; cursor: not-allowed; }

.paypal-buttons { margin-bottom: .6rem; }
.paypal-buttons iframe { border-radius: 999px; }

/* Gumroad secondary button */
.btn-gumroad {
  width: 100%; justify-content: center; margin-top: .6rem;
  background: #fff; color: var(--green-dark);
  border: 2px solid var(--green); font-size: .98rem;
}
.btn-gumroad:hover { background: var(--green); color: #fff; text-decoration: none; transform: none; }
.btn-gumroad:disabled { opacity: .55; cursor: not-allowed; }

/* fee note + security */
.secure-note {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  font-size: .8rem; color: var(--ink-soft); margin-top: .8rem;
}
.secure-note svg { flex-shrink: 0; }

/* status banners */
.banner {
  max-width: 560px; margin: 1.2rem auto 0;
  padding: 1rem 1.3rem; border-radius: 12px; font-weight: 600;
  display: none;
}
.banner.show { display: block; }
.banner.success { background: rgba(14, 122, 70, .12); color: var(--green-dark); border: 1px solid var(--green); }
.banner.cancel { background: rgba(206, 17, 38, .08); color: var(--red-dark); border: 1px solid var(--red); }

/* ---------- Footer ---------- */
footer {
  background: var(--ink); color: rgba(250, 246, 239, .8);
  padding: 2.5rem 0 1.5rem; margin-top: 0;
}
footer .container { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
footer .f-logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; color: var(--cream); }
footer .f-logo .flag { width: 26px; height: 26px; }
footer .f-links { display: flex; gap: 1.2rem; list-style: none; font-size: .9rem; }
footer .f-links a { color: rgba(250, 246, 239, .7); }
footer .f-links a:hover { color: var(--cream); }
footer .f-bottom { width: 100%; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(250,246,239,.15); font-size: .8rem; opacity: .6; text-align: center; }

/* ---------- RTL refinements ---------- */
html[dir="rtl"] body { letter-spacing: 0; }
html[dir="rtl"] .hero-eyebrow, html[dir="rtl"] .btn-primary { flex-direction: row-reverse; }

/* print-ish small screens */
@media (max-width: 480px) {
  .amounts { grid-template-columns: repeat(2, 1fr); }
  .card-body { padding: 1.1rem; }
}
