/* First Rain Foundation — public site */
:root {
  --primary: #0E5E5A;
  --accent: #E8A33D;
  --ink: #1d2a2a;
  --muted: #5d6b69;
  --bg: #FAF7F2;
  --card: #ffffff;
  --line: #e7e0d4;
  --soft: color-mix(in srgb, var(--primary) 8%, #fff);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 40, 38, .06), 0 8px 28px rgba(20, 40, 38, .07);
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 16px; }
img, video, iframe { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 99; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; padding: .8em 1.4em; border-radius: 999px; border: 0;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.btn-accent { background: var(--accent); color: #1b1305; }
.btn-ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px currentColor; }
.btn-sm { padding: .45em 1.1em; font-size: .9rem; }
.btn-lg { padding: 1em 1.4em; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; min-width: 0; }
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; flex: none; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.lang-switch { text-decoration: none; font-size: .9rem; color: var(--muted); }
.preview-banner { background: #fff3cd; color: #6b4e00; text-align: center; padding: 8px 16px; font-size: .9rem; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--primary); color: #fff; }
.hero-in { position: relative; padding: clamp(56px, 10vw, 110px) 0; max-width: 760px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; }
.hero .lead { color: rgba(255,255,255,.85); font-size: 1.1rem; }
.hero .eyebrow { color: var(--accent); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero .btn-ghost { color: #fff; }
.rain { position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: radial-gradient(ellipse 1.5px 9px at 50% 50%, #fff 60%, transparent 62%);
  background-size: 38px 54px; animation: rain 6s linear infinite; mask-image: linear-gradient(to bottom, #000 30%, transparent); }
@keyframes rain { to { background-position: 0 540px; } }
@media (prefers-reduced-motion: reduce) { .rain { animation: none; } html { scroll-behavior: auto; } }
.eyebrow { font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); margin-bottom: .5em; }
[dir=rtl] .eyebrow { letter-spacing: 0; text-transform: none; }
.lead { font-size: 1.08rem; }

/* ---------- sections & cards ---------- */
.section { padding: 56px 0; }
.sec-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-img { aspect-ratio: 16/10; background: var(--soft); display: block; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .ph { display: block; height: 100%; background: linear-gradient(135deg, var(--soft), color-mix(in srgb, var(--primary) 20%, #fff)); }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.15rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body .btn { margin-top: auto; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.cards-sm { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.mini-card { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.badge { align-self: flex-start; background: var(--soft); color: var(--primary); font-size: .75rem; padding: 2px 10px; border-radius: 99px; font-weight: 600; }
.empty { padding: 24px; background: var(--card); border-radius: var(--radius); text-align: center; }

/* ---------- progress ---------- */
.progress { display: flex; flex-direction: column; gap: 8px; }
.progress-nums { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.progress-nums .raised { font-size: 1.25rem; color: var(--ink); margin-inline-end: 6px; }
.progress-big .raised { font-size: clamp(1.6rem, 4vw, 2.1rem); }
.pct { font-weight: 700; color: var(--primary); }
.bar { height: 10px; background: color-mix(in srgb, var(--primary) 12%, #fff); border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); }
[dir=rtl] .bar span { background: linear-gradient(270deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--accent))); }
.bar.thin { height: 7px; }
.progress-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9rem; }
.urgency { margin: 10px 0 0; font-weight: 600; color: #a2490d; background: #fdf0e1; padding: 8px 14px; border-radius: 12px; display: inline-block; }
.urgency.done { color: var(--primary); background: var(--soft); }

/* ---------- donate card ---------- */
.donate-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.donate-title { font-size: 1.25rem; margin: 0; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; background: var(--soft); border-radius: 999px; padding: 4px; }
.toggle button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: .65em; border-radius: 999px; color: var(--muted); cursor: pointer; }
.toggle button[aria-selected=true] { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.panel { display: flex; flex-direction: column; gap: 10px; }
.panel[hidden] { display: none; }
.panel p { margin: 0; }
.monthly-amt { font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.monthly-amt span { font-size: 1rem; font-weight: 400; color: var(--muted); }
.monthly-note { background: var(--soft); border-radius: 12px; padding: 10px 14px; color: var(--primary); font-weight: 500; }
.impacts h3 { font-size: 1rem; margin-bottom: 8px; }
.impacts ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.impacts li { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: .95rem; }
.impacts li strong { color: var(--primary); white-space: nowrap; }
.secure { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--muted); margin: 0; }
.secure svg { color: var(--primary); flex: none; margin-top: 3px; }

/* ---------- amount picker (direct Stripe mode) ---------- */
.small-lead { margin: -6px 0 0; font-size: .92rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.form-err { margin: 0; background: #fdecea; color: #b3261e; padding: 8px 12px; border-radius: 10px; font-size: .9rem; }
.cur-select select { width: 100%; font: inherit; font-size: .92rem; padding: .55em .8em; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.amounts { display: flex; flex-direction: column; gap: 10px; }
.amt-opt { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.amt-opt:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.amt-opt input[type=radio] { appearance: none; flex: none; width: 18px; height: 18px; margin: 3px 0 0; border: 2px solid #b9c3c1; border-radius: 50%; display: grid; place-content: center; cursor: pointer; }
.amt-opt input[type=radio]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); transform: scale(0); transition: transform .12s; }
.amt-opt input[type=radio]:checked { border-color: var(--primary); }
.amt-opt input[type=radio]:checked::before { transform: scale(1); }
.amt-opt:has(input[type=radio]:checked) { border-color: var(--primary); background: var(--soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent); }
.amt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.amt { font-size: 1.15rem; color: var(--ink); }
.per { font-size: .85rem; color: var(--muted); margin-inline-start: 4px; }
.amt-row { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.per[hidden] { display: none; }
.amt-body small { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.custom-row { display: flex; align-items: center; gap: 6px; }
.cur-sym { font-weight: 600; color: var(--primary); }
.amt-custom input[type=number] { flex: 1; min-width: 0; border: 0; border-bottom: 1px dashed var(--line); background: transparent; font: inherit; font-size: 1.05rem; font-weight: 600; padding: 2px 0; color: var(--ink); -moz-appearance: textfield; }
.amt-custom input[type=number]::-webkit-outer-spin-button, .amt-custom input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.amt-custom input[type=number]:focus { outline: none; border-bottom-color: var(--primary); }
.amt-custom input.invalid { border-bottom-color: #b3261e; }
.chk-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.chk-row input { width: 16px; height: 16px; accent-color: var(--primary); }
.donate-card textarea { width: 100%; min-height: 84px; font: inherit; font-size: .92rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
.donate-card textarea[hidden] { display: none; }
.btn.loading { opacity: .7; pointer-events: none; }

/* ---------- in-box payment step ---------- */
.step { display: flex; flex-direction: column; gap: 14px; }
.step[hidden] { display: none; }
.pay-head { display: flex; align-items: center; gap: 12px; background: var(--primary); color: #fff; margin: -22px -22px 0; padding: 14px 18px; border-radius: var(--radius) var(--radius) 0 0; }
.pay-head > div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.pay-summary { font-size: .88rem; opacity: .85; }
.pay-head .back { border: 0; background: rgba(255,255,255,.15); color: #fff; width: 34px; height: 34px; border-radius: 50%; font-size: 1.1rem; cursor: pointer; flex: none; }
.pay-head .back:hover { background: rgba(255,255,255,.28); }
.pay-head .lock { opacity: .85; }
.pay-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--muted); font-size: .92rem; }
.pay-loading[hidden] { display: none; }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-mount { min-height: 10px; margin: 0 -8px; }
@media (max-width: 520px) { .pay-head { margin: -18px -18px 0; } .pay-mount { margin: 0 -6px; } }

/* ---------- support section ---------- */
.support { background: var(--soft); }
.support-in { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }

/* ---------- case page ---------- */
.case-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: 40px;
  grid-template-areas: "head aside" "media aside" "story aside" "rest aside"; grid-template-rows: auto auto auto 1fr; padding: 32px 0 56px; }
.case-head { grid-area: head; }
.case-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.case-progress { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin: 18px 0 24px; }
.case-media { grid-area: media; display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 82%; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
.gallery figure { margin: 0; scroll-snap-align: start; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; background: var(--soft); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.case-story { grid-area: story; font-size: 1.08rem; margin-bottom: 24px; }
.photo { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--soft); }
.photo img { width: 100%; height: auto; max-height: 760px; object-fit: cover; }
.photos-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.case-aside { grid-area: aside; }
.sticky { position: sticky; top: 84px; }
.case-rest { grid-area: rest; display: flex; flex-direction: column; gap: 22px; }
.block { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.block h2 { font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.count { background: var(--soft); color: var(--primary); font-size: .85rem; padding: 1px 10px; border-radius: 99px; }
.breakdown { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bd-row { display: flex; justify-content: space-between; margin-bottom: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.timeline li { position: relative; padding-inline-start: 20px; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline time { font-size: .85rem; color: var(--muted); }
.timeline p { margin: 2px 0 8px; }
.timeline img { border-radius: 12px; max-height: 320px; object-fit: cover; }
.donors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.donors li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.donors li:last-child { border-bottom: 0; }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-weight: 700; }
.d-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.d-amt { color: var(--primary); font-weight: 600; }
.d-top time { font-size: .8rem; }
.donors p { margin: 4px 0 0; font-size: .95rem; }
.share { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: .5em 1em; border-radius: 99px; text-decoration: none; font: inherit; font-size: .9rem; cursor: pointer; }
.sh-wa { background: #25D366; color: #fff; border-color: #25D366; }
.sh-fb { background: #1877F2; color: #fff; border-color: #1877F2; }
.sh-x { background: #111; color: #fff; border-color: #111; }
.sh-tg { background: #229ED9; color: #fff; border-color: #229ED9; }
.sticky-cta { display: none; }

/* ---------- thanks ---------- */
.thanks-card { max-width: 640px; margin-inline: auto; text-align: center; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(28px, 6vw, 52px); }
.thanks-icon svg { margin: 0 auto 10px; }
.thanks .share { justify-content: center; margin-bottom: 24px; }
.h3 { font-size: 1.05rem; margin-top: 24px; }
.thanks-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

/* ---------- footer ---------- */
.footer { background: #102423; color: #d6e2e0; padding: 48px 0 0; margin-top: 24px; }
.footer a { color: #fff; }
.footer .muted { color: #a9bbb8; }
.footer h3 { color: #fff; font-size: 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.brand-foot { color: #fff; margin-bottom: 12px; }
.reg { font-size: .85rem; color: #a9bbb8; border-inline-start: 3px solid var(--accent); padding-inline-start: 10px; }
.foot-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding: 16px 0; font-size: .85rem; color: #a9bbb8; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .case-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "media" "story" "aside" "rest"; padding-top: 20px; }
  .case-aside { margin: 8px 0 24px; scroll-margin-top: 76px; }
  .sticky { position: static; }
  .support-in { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .sticky-cta { display: block; position: fixed; inset-inline: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); transition: transform .25s; }
  .sticky-cta.hide { transform: translateY(110%); }
  .page-case .footer { padding-bottom: 80px; }
}
@media (max-width: 520px) {
  .brand span { font-size: .95rem; }
  .gallery { grid-auto-columns: 90%; }
  .donate-card, .block { padding: 18px; }
}
