/* ==========================================================================
   Donation page (page-templates/donate.php). Loaded on that template only.
   One card holds the whole gift; the story column explains where it goes.
   Wide screens: intro and story on the start side, the card sticky on the end
   side. Phones: intro, card, story.
   ========================================================================== */

.donate { position: relative; isolation: isolate; padding-block: clamp(20px, 3vw, 40px) var(--section); }
.donate__ground {
	position: absolute;
	inset: 0 0 auto;
	z-index: -1;
	height: min(620px, 80vh);
	background: linear-gradient(180deg, var(--tint-apricot), var(--bg) 92%);
}
.donate__ground::after {
	content: "";
	position: absolute;
	inset: 0;
	background-color: var(--pattern-ink);
	-webkit-mask: var(--lattice) 0 0 / 56px 56px repeat, linear-gradient(180deg, #000, transparent 85%);
	mask: var(--lattice) 0 0 / 56px 56px repeat, linear-gradient(180deg, #000, transparent 85%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

.donate__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "intro" "panel" "story";
	gap: clamp(22px, 3vw, 40px);
}
@media (min-width: 1000px) {
	.donate__grid {
		grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
		grid-template-areas: "intro panel" "story panel";
		grid-template-rows: auto 1fr;
		column-gap: clamp(40px, 5vw, 80px);
	}
	.donate__panel { align-self: start; }
}
/* Sticky only when the whole card fits on screen, so its buttons are never out of reach. */
@media (min-width: 1000px) and (min-height: 860px) {
	.donate__panel { position: sticky; top: calc(var(--header-h) + 20px); }
}
.donate__intro { grid-area: intro; display: grid; gap: 14px; align-content: start; justify-items: start; padding-block-start: clamp(4px, 2vw, 28px); }
.donate__panel { grid-area: panel; min-width: 0; }
.donate__story { grid-area: story; display: grid; gap: clamp(28px, 4vw, 48px); align-content: start; min-width: 0; }

.donate__title { max-width: 16ch; color: var(--title); font-family: var(--font-display); font-size: var(--fs-4xl); font-weight: 400; line-height: 1.25; text-wrap: balance; }
.donate__lead { max-width: 52ch; color: var(--text); font-size: var(--fs-md); line-height: 1.9; }
.donate__trust { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 6px; list-style: none; }
.donate__trust li { display: inline-flex; align-items: center; gap: .45em; padding: .4em .9em; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--title); font-size: var(--fs-sm); backdrop-filter: blur(6px); }
.donate__trust .icon { width: 16px; height: 16px; color: var(--peach-ink); }

/* Phones: get to the card quickly. The secure-payment line under the card stands in for the chips. */
@media (max-width: 999px) {
	.donate__intro { gap: 10px; }
	.donate__title { max-width: none; font-size: var(--fs-3xl); }
}
@media (max-width: 600px) {
	.donate__trust { display: none; }
	.donate__lead { font-size: var(--fs-base); line-height: 1.8; }
}

/* The card --------------------------------------------------------------- */

.dcard {
	position: relative;
	display: grid;
	gap: 18px;
	padding: clamp(18px, 3vw, 30px);
	border: 1px solid var(--line);
	border-radius: 28px;
	background: var(--surface);
	box-shadow: var(--shadow-3);
}
/* The brand rule along the top edge, following the card's rounded corners: a full-size
   layer masked down to its 5 px top padding. */
.dcard::before {
	content: "";
	position: absolute;
	inset: -1px;
	padding-block-start: 5px;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--teal), var(--apricot) 45%, var(--peach));
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
	pointer-events: none;
}
.dform { display: grid; gap: 18px; }
.dform__hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.dform__label { margin-block-end: 10px; padding: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.dform__error { color: var(--cta); font-size: var(--fs-sm); }
.dform__error:empty { display: none; }
.dform__muted { color: var(--muted); font-size: var(--fs-xs); text-align: center; }

.dnote { padding: 10px 14px; border-radius: 14px; font-size: var(--fs-sm); line-height: 1.7; }
.dnote--test { border: 1px dashed rgba(154, 106, 31, .45); background: var(--tint-apricot); color: #7A5418; }
.dnote--warn { background: var(--tint-peach); color: var(--peach-ink); }
:root[data-theme="dark"] .dnote--test { color: var(--apricot); }
:root[data-theme="dark"] .dnote--warn { color: #F2B39F; }

/* Frequency and currency */
.dform__top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dfreq { display: flex; flex: 1 1 0; min-width: min(100%, 180px); margin: 0; padding: 4px; border: 0; border-radius: 999px; background: var(--surface-2); }
.dfreq__opt { position: relative; flex: 1; cursor: pointer; }
.dfreq__opt input { position: absolute; opacity: 0; pointer-events: none; }
.dfreq__opt > span { display: flex; align-items: center; justify-content: center; gap: .35em; min-height: 42px; padding: 0 .9em; border-radius: 999px; color: var(--muted); font-weight: 700; white-space: nowrap; transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.dfreq__opt:hover > span { color: var(--title); }
.dfreq__opt input:checked + span { background: var(--surface); color: var(--title); box-shadow: 0 1px 2px rgba(43, 45, 66, .08), 0 6px 14px -8px rgba(43, 45, 66, .3); }
.dfreq__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.dfreq__badge { display: inline-grid; place-items: center; color: var(--peach); font-style: normal; }
.dfreq__badge .icon { width: 14px; height: 14px; fill: currentColor; }
.dfreq__opt input:checked + span .dfreq__badge { animation: beat 1.2s var(--ease) 1; }

.dcur { position: relative; display: inline-flex; align-items: center; flex: none; height: 50px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--title); transition: border-color var(--t-fast); }
.dcur:hover, .dcur:focus-within { border-color: var(--title); }
.dcur .icon { position: absolute; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
/* The menu is always left-to-right (codes like "EUR"), so the globe sits on its
   left and the chevron on its right in every language, with matching padding. */
.dcur > .icon:first-of-type { left: 14px; }
.dcur .dcur__chev { right: 12px; }
.dcur select { height: 100%; padding: 0 34px 0 38px; border: 0; border-radius: 999px; background: transparent; color: inherit; font-family: "Readex Pro", var(--font-ui); font-size: .98rem; font-weight: 600; appearance: none; cursor: pointer; outline: none; }
.dcur select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.dcur select option { color: #2B2D42; }
@media (max-width: 480px) {
	.dcur > .icon:first-of-type { display: none; }
	.dcur select { padding: 0 32px 0 16px; }
}

/* Amounts */
.damounts { min-width: 0; margin: 0; padding: 0; border: 0; }
.damounts__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.damount { position: relative; display: block; cursor: pointer; }
.damount > input { position: absolute; opacity: 0; pointer-events: none; }
.damount__value, .damount__field {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 64px;
	padding: .3em .5em;
	border: 1.5px solid var(--line-strong);
	border-radius: 18px;
	background: var(--surface);
	color: var(--title);
	font-family: "Readex Pro", var(--font-ui);
	font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	transition: border-color var(--t-fast), background-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.damount:hover .damount__value, .damount:hover .damount__field { border-color: var(--text); transform: translateY(-1px); }
.damount > input:checked + .damount__value,
.damount > input:checked + .damount__field,
.damount--other:focus-within .damount__field { border-color: var(--peach-ink); background: var(--tint-peach); color: var(--peach-ink); box-shadow: inset 0 0 0 1px var(--peach-ink); transform: none; }
.damount > input:focus-visible + .damount__value { outline: 2px solid var(--focus); outline-offset: 3px; }
.damount__field { gap: 4px; padding-inline: 10px; cursor: text; }
.damount__sym { flex: none; color: var(--muted); font-size: .8em; }
.damount__field input { width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: center; outline: none; }
.damount__field input::placeholder { color: var(--muted); font-family: var(--font-ui); font-size: .85rem; font-weight: 700; opacity: 1; }
.damount--other.is-invalid .damount__field { border-color: var(--cta); }
@media (max-width: 340px) { .damounts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Hint (monthly nudge, yearly total) */
.dhint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; border-radius: 16px; background: var(--tint-teal); color: var(--teal-ink); font-size: var(--fs-sm); line-height: 1.7; animation: rise 300ms var(--ease-out); }
:root[data-theme="dark"] .dhint { color: #B7DCC9; }
.dhint button { padding: .3em .9em; border: 1px solid currentColor; border-radius: 999px; background: transparent; color: inherit; font: inherit; font-weight: 700; cursor: pointer; }
.dhint button:hover { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; }

/* Checkboxes: fee cover, dedication */
.dcheck { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: var(--fs-sm); line-height: 1.6; cursor: pointer; }
.dcheck > input { position: absolute; opacity: 0; pointer-events: none; }
.dcheck__box { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: transparent; transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast); }
.dcheck__box .icon { width: 15px; height: 15px; stroke-width: 3; }
.dcheck:hover .dcheck__box { border-color: var(--title); }
.dcheck > input:checked + .dcheck__box, .dded[open] > summary .dcheck__box { border-color: var(--indigo-700); background: var(--indigo-700); color: #fff; }
.dcheck > input:focus-visible + .dcheck__box, .dded > summary:focus-visible .dcheck__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.dded > summary { list-style: none; }
.dded > summary::-webkit-details-marker { display: none; }
.dded > summary:focus-visible { outline: none; }
.dded__body { display: grid; gap: 10px; margin-block-start: 12px; padding: 14px; border-radius: 16px; background: var(--surface-2); animation: rise 250ms var(--ease-out); }
.dded__types { display: flex; flex-wrap: wrap; gap: 8px; }
.dded__types label { position: relative; cursor: pointer; }
.dded__types input { position: absolute; opacity: 0; }
.dded__types span { display: block; padding: .4em 1em; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.dded__types input:checked + span { border-color: var(--indigo-700); background: var(--indigo-700); color: #fff; }
.dded__types input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.dfield input { width: 100%; height: 50px; padding-inline: 14px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--title); font: inherit; }
.dfield input:focus { border-color: var(--title); outline: none; box-shadow: 0 0 0 4px rgba(61, 64, 91, .1); }

/* Pay buttons */
.dform__actions { display: grid; gap: 10px; margin-block-start: 4px; }
.dbtn {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 2px;
	width: 100%;
	min-height: 62px;
	padding: .55em 1.2em;
	border: 0;
	border-radius: 999px;
	font-family: var(--font-ui);
	cursor: pointer;
	transition: background-color var(--t) var(--ease), transform var(--t) var(--ease), box-shadow var(--t) var(--ease), opacity var(--t);
}
.dbtn__main { display: inline-flex; align-items: center; gap: .5em; font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.dbtn__main .icon { width: 18px; height: 18px; }
.dbtn__sub { font-size: .78rem; font-weight: 600; opacity: .82; }
.dbtn--primary { background: var(--cta); color: var(--on-cta); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 30px -16px rgba(168, 77, 53, .9); }
.dbtn--primary:hover { background: var(--cta-hover); transform: translateY(-1px); box-shadow: 0 18px 34px -16px rgba(168, 77, 53, .95); }
.dbtn--paypal { min-height: 54px; background: #FFC439; color: #003087; }
.dbtn--paypal:hover { background: #F2BA36; transform: translateY(-1px); }
.dbtn--paypal .dbtn__main { font-family: "Readex Pro", var(--font-ui); }
.dbtn:active { transform: translateY(1px); }
/* Every state of the pay buttons stays in the brand colours (no browser tap tint). */
.dbtn, .damount, .dfreq__opt, .dcheck { -webkit-tap-highlight-color: transparent; }
.dbtn--primary:active, .dbtn--primary.is-busy { background: var(--cta-hover); color: var(--on-cta); }
.dbtn--primary:focus-visible { outline-color: var(--peach); }
.dbtn--paypal:active, .dbtn--paypal.is-busy { background: #F2BA36; color: #003087; }
.dbtn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.dbtn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.dbtn.is-busy .dbtn__main .icon { visibility: hidden; }
.dbtn.is-busy .dbtn__main::before { content: ""; position: absolute; width: 18px; height: 18px; margin-inline-start: 0; border: 2px solid currentColor; border-block-start-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.dform__or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); }
.dform__or::before, .dform__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Payment step (Stripe embedded) */
.dpay { display: grid; gap: 14px; animation: rise 300ms var(--ease-out); }
.dpay__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.dpay__back { display: inline-flex; align-items: center; gap: .4em; min-height: 40px; padding: 0 .9em 0 .6em; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--title); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.dpay__back:hover { border-color: var(--title); }
.dpay__back .icon { width: 16px; height: 16px; }
.dpay__sum { display: flex; align-items: baseline; gap: .5em; color: var(--muted); font-size: var(--fs-sm); }
.dpay__sum strong { color: var(--title); font-family: "Readex Pro", var(--font-ui); font-size: 1.15rem; }
/* The spinner sits under Stripe's frame until the frame paints over it. */
.dpay__frame { position: relative; min-height: 460px; border-radius: 18px; background: #fff; }
.dpay__frame [data-checkout] { position: relative; z-index: 1; }
.dpay__loading { position: absolute; inset: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: .6em; min-height: 200px; color: #62667F; font-size: var(--fs-sm); }
.dform[hidden], .dpay[hidden] { display: none; }

.dsecure { display: flex; align-items: flex-start; gap: .55em; margin: 0; color: var(--muted); font-size: var(--fs-xs); line-height: 1.7; }
.dsecure .icon { flex: none; width: 16px; height: 16px; margin-block-start: .25em; color: var(--teal-ink); }

/* Thank-you card --------------------------------------------------------- */

.dthanks { justify-items: center; gap: 14px; padding-block: clamp(28px, 5vw, 44px); text-align: center; outline: none; }
.dthanks__seal { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: var(--tint-teal); animation: pop 600ms var(--ease-out) both; }
.dthanks__seal svg { width: 64px; height: 64px; fill: none; stroke: var(--teal-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.dthanks__seal circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 700ms var(--ease) 150ms forwards; }
.dthanks__seal path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 450ms var(--ease) 700ms forwards; }
.dthanks__title { color: var(--title); font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 400; }
.dthanks__text { max-width: 44ch; color: var(--text); font-size: var(--fs-md); line-height: 1.85; }
.dthanks__facts { display: grid; width: 100%; margin: 4px 0 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.dthanks__facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; text-align: start; }
.dthanks__facts > div + div { border-block-start: 1px solid var(--line); }
.dthanks__facts dt { color: var(--muted); font-size: var(--fs-sm); }
.dthanks__facts dd { margin: 0; color: var(--title); }
.dthanks__facts strong { font-family: "Readex Pro", var(--font-ui); font-size: 1.1rem; }
.dthanks__note { display: inline-flex; align-items: center; gap: .5em; color: var(--muted); font-size: var(--fs-sm); }
.dthanks__note .icon { width: 16px; height: 16px; }
.dthanks__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.dshare { display: grid; gap: 8px; width: 100%; margin-block: 6px; padding: 18px; border-radius: 20px; background: var(--tint-apricot); }
.dshare__title { color: var(--title); font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 400; }
.dshare__text { color: var(--text); font-size: var(--fs-sm); }
.dshare__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block-start: 6px; }
.dshare__btn { display: inline-flex; align-items: center; gap: .45em; min-height: 42px; padding: 0 1em; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--title); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast); }
.dshare__btn:hover { border-color: var(--title); color: var(--title); transform: translateY(-1px); }
.dshare__btn .icon { width: 18px; height: 18px; }
.dshare__btn--wa .icon { color: #1DA851; }
.dshare__btn--tg .icon { color: #229ED9; }
.dshare__btn--fb .icon { color: #1877F2; }
.dshare__btn.is-done { border-color: var(--teal-ink); color: var(--teal-ink); }

/* Story column ----------------------------------------------------------- */

.dsection__title { margin-block-end: 16px; color: var(--title); font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 400; }
.dimpact__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; list-style: none; }
.dimpact__item { display: grid; gap: 6px; align-content: start; padding: 20px; border-radius: 22px; color: var(--text); font-size: var(--fs-sm); line-height: 1.75; }
.dimpact__item strong { color: var(--title); font-size: var(--fs-base); }
.dimpact__item--apricot { background: var(--tint-apricot); }
.dimpact__item--teal { background: var(--tint-teal); }
.dimpact__item--peach { background: var(--tint-peach); }
.dimpact__icon { display: grid; place-items: center; width: 44px; height: 44px; margin-block-end: 6px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-1); }
.dimpact__icon .icon { width: 20px; height: 20px; }
.dimpact__item--apricot .dimpact__icon { color: #9A6A1F; }
.dimpact__item--teal .dimpact__icon { color: var(--teal-ink); }
.dimpact__item--peach .dimpact__icon { color: var(--peach-ink); }
.dfigures { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-block-start: 22px; padding-block-start: 20px; border-block-start: 1px solid var(--line); list-style: none; }
.dfigures li { display: grid; gap: 2px; }
.dfigures strong { color: var(--title); font-family: "Readex Pro", var(--font-ui); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 600; font-variant-numeric: tabular-nums; }
.dfigures span { color: var(--muted); font-size: var(--fs-sm); }

.dverse { position: relative; margin: 0; padding: clamp(24px, 4vw, 40px); border-radius: 26px; background: var(--paper); text-align: center; }
.dverse::before, .dverse::after { content: ""; display: block; width: 72px; height: 1px; margin: 0 auto 18px; background: linear-gradient(90deg, transparent, var(--peach), transparent); }
.dverse::after { margin: 18px auto 0; }
.dverse__text { margin: 0; color: var(--title); font-family: var(--font-quran); font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); line-height: 2.1; }
.dverse figcaption { margin-block-start: 10px; color: var(--muted); font-size: var(--fs-sm); }

.dways { display: grid; gap: 14px; }
.dways .dsection__title { margin: 0; }
.dways__bank { padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.dways__label { display: flex; align-items: center; gap: .5em; margin-block-end: 12px; color: var(--title); font-weight: 700; }
.dways__label .icon { width: 18px; height: 18px; color: var(--peach-ink); }
.dways__link { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--title); font-weight: 700; transition: border-color var(--t-fast); }
.dways__link:hover { border-color: var(--title); color: var(--title); }
.dways__link span { flex: 1; }
.dways__link .icon { width: 18px; height: 18px; color: #003087; }
.dways__link .icon:last-child { color: var(--muted); }

.dfaq__item { border-block-end: 1px solid var(--line); }
.dfaq__item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 16px; color: var(--title); font-weight: 700; list-style: none; cursor: pointer; }
.dfaq__item summary::-webkit-details-marker { display: none; }
.dfaq__item summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.dfaq__icon { flex: none; width: 18px; height: 18px; color: var(--muted); transition: transform var(--t) var(--ease); }
.dfaq__item[open] .dfaq__icon { transform: rotate(45deg); color: var(--peach-ink); }
.dfaq__item p { padding-block-end: 16px; color: var(--text); line-height: 1.85; }
.dfaq__item p + p { margin-block-start: -6px; }

@media (prefers-reduced-motion: reduce) {
	.dhint, .dded__body, .dpay, .dthanks__seal { animation: none; }
	.dthanks__seal circle, .dthanks__seal path { animation: none; stroke-dashoffset: 0; }
	.damount__value, .damount__field, .dbtn, .dshare__btn { transition: none; }
}
