/* Madina Core: campaign popup.
   Version "split": photo + giving card (after New Minds Studio's "Common Ground" donation UX).
   Version "story": full-bleed photo story (after Cozmiq's "Impact Through Kindness").
   Madina type and colour: Inter, Instrument Serif italic, deep teal, gold. */

.mcp-root[hidden], .mcp[hidden] { display: none !important; }
html.mcp-lock { overflow: hidden; } /* html only: locking body too un-sticks the bar and header */

.mcp { position: fixed; inset: 0; z-index: 9990; display: grid; place-items: center; padding: 24px; font-family: var(--sans, Inter, system-ui, sans-serif); }
.mcp__scrim { position: absolute; inset: 0; background: rgba(6, 34, 31, .52); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .4s ease; }
.mcp__box { position: relative; width: min(940px, 100%); max-height: calc(100vh - 48px); border-radius: 28px; overflow: hidden; background: #F2F7F6; box-shadow: 0 50px 120px -40px rgba(3, 30, 27, .65), 0 0 0 1px rgba(255, 255, 255, .5) inset; opacity: 0; transform: translateY(26px) scale(.985); transition: opacity .45s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }
.mcp.is-in .mcp__scrim { opacity: 1; }
.mcp.is-in .mcp__box { opacity: 1; transform: none; }
.mcp__box:focus { outline: none; }

.mcp__x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .9); color: #0B4A43; box-shadow: 0 4px 14px rgba(0, 0, 0, .08); transition: transform .2s; padding: 0; }
.mcp__x:hover { transform: rotate(90deg); }
.mcp__x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Split: photo + giving card ---------- */
.mcp--split .mcp__box { display: grid; grid-template-columns: 1.08fr .92fr; min-height: 560px; }
.mcp__media { position: relative; margin: 0; min-height: 100%; }
.mcp__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcp__media figcaption { position: absolute; inset: auto 0 0 0; padding: 120px 36px 36px; color: #fff; background: linear-gradient(180deg, rgba(7, 44, 39, 0) 0%, rgba(7, 44, 39, .55) 40%, rgba(5, 33, 29, .9) 100%); }
.mcp__media h2 { margin: 0 0 12px; color: #fff; font-size: clamp(34px, 3.8vw, 48px); line-height: 1.02; letter-spacing: -1.5px; font-weight: 800; }
.mcp__media h2 em, .mcp__story h2 em { font-family: var(--serif, "Instrument Serif", Georgia, serif); font-style: italic; font-weight: 400; letter-spacing: -.5px; }
.mcp__media p { margin: 0; max-width: 34ch; color: rgba(255, 255, 255, .86); font-size: 15.5px; line-height: 1.5; }

.mcp__panel { position: relative; margin: 14px; padding: 34px 30px 22px; background: #fff; border-radius: 20px; border: 1px solid #E2ECEA; display: flex; flex-direction: column; overflow-y: auto; }
.mcp__panel .mcp__x { top: 12px; right: 12px; background: #F2F7F6; box-shadow: none; }
.mcp__panel-t { margin: 0 44px 18px 0; color: #0B4A43; font-size: 27px; line-height: 1.08; letter-spacing: -.8px; font-weight: 800; }
.mcp__money { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mcp__money b { color: #141414; font-size: 34px; letter-spacing: -1px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mcp__money span { color: #5C5C5C; font-size: 14px; }
.mcp__bar { height: 6px; margin: 12px 0 8px; border-radius: 99px; background: #E3EDEB; overflow: hidden; }
.mcp__bar i { display: block; height: 100%; border-radius: inherit; background: #0B4A43; transform-origin: left; animation: mcp-grow 1.1s .5s cubic-bezier(.2, .8, .2, 1) both; }
.mcp:not(.is-in) .mcp__bar i { animation: none; }
@keyframes mcp-grow { from { transform: scaleX(0); } }
.mcp__meta { display: flex; justify-content: space-between; gap: 12px; color: #5C5C5C; font-size: 13px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #EDF2F1; }

.mcp__seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: #EEF4F3; margin-bottom: 14px; }
.mcp__seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: #4F4F4F; font: 600 14.5px var(--sans, Inter, sans-serif); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .2s, color .2s, box-shadow .2s; }
.mcp__seg button.is-on { background: #fff; color: #0B4A43; box-shadow: 0 2px 8px rgba(11, 74, 67, .12); }
.mcp__seg svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.mcp__seg button.is-on svg { fill: #FFD028; stroke: #8F6A00; }

.mcp__chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.mcp__chip { min-height: 48px; border-radius: 12px; border: 1px solid #D9E4E2; background: #fff; color: #141414; font: 600 15px var(--sans, Inter, sans-serif); cursor: pointer; display: grid; place-items: center; text-decoration: none; transition: border-color .2s, background .2s, transform .15s; padding: 0 4px; }
.mcp__chip:hover { border-color: #0B4A43; color: #141414; }
.mcp__chip:active { transform: scale(.97); }
.mcp__chip.is-on { border: 1.5px solid #0B4A43; background: #EAF5F2; color: #0B4A43; }
.mcp__chip--other { color: #4F4F4F; font-weight: 500; }

.mcp__impact { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; color: #4F4F4F; font-size: 13.5px; line-height: 1.45; }
.mcp__impact svg { flex: none; width: 20px; height: 20px; fill: none; stroke: #008F7E; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

.mcp__go { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 20px 0 22px; border-radius: 15px; background: #0B4A43; color: #fff !important; text-decoration: none !important; font: 600 16.5px var(--sans, Inter, sans-serif); transition: background .2s, transform .2s; }
.mcp__go:hover { background: #083A35; transform: translateY(-1px); }
.mcp__go svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.mcp__go:hover svg { transform: translate(2px, -2px); }
.mcp__later { margin: 10px auto 0; padding: 8px; border: 0; background: none; color: #5C5C5C; font: 500 14px var(--sans, Inter, sans-serif); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.mcp__safe { margin: 4px 0 0; text-align: center; color: #8A8A8A; font-size: 12px; }

/* ---------- Story: full photo ---------- */
.mcp--story .mcp__box { min-height: 580px; display: flex; align-items: flex-end; background: #0B4A43; }
.mcp__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transition: transform 1.6s cubic-bezier(.2, .8, .2, 1); }
.mcp.is-in .mcp__bg { transform: none; }
.mcp--story .mcp__box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 36, 32, .94) 0%, rgba(5, 36, 32, .8) 38%, rgba(5, 36, 32, .15) 75%), linear-gradient(0deg, rgba(5, 36, 32, .6), rgba(5, 36, 32, 0) 45%); }
.mcp__story { position: relative; z-index: 2; width: min(500px, 100%); padding: 48px; color: #fff; }
.mcp__story h2 { margin: 0 0 16px; color: #fff; font-size: clamp(38px, 4.4vw, 56px); line-height: 1; letter-spacing: -2px; font-weight: 800; }
.mcp__story h2 em { color: #FFD028; }
.mcp__story p { margin: 0 0 24px; color: rgba(255, 255, 255, .85); font-size: 16px; line-height: 1.55; }
.mcp__story .mcp__money b { color: #fff; }
.mcp__story .mcp__money span, .mcp__story .mcp__meta { color: rgba(255, 255, 255, .72); }
.mcp__story .mcp__bar { background: rgba(255, 255, 255, .18); }
.mcp__story .mcp__bar i { background: #FFD028; }
.mcp__story .mcp__meta { border-bottom-color: rgba(255, 255, 255, .14); }
.mcp__acts { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; }
.mcp__story .mcp__go { background: #FFD028; color: #0B4A43 !important; border-radius: 999px; min-height: 54px; padding: 0 22px 0 26px; gap: 14px; }
.mcp__story .mcp__go:hover { background: #FFDC55; }
.mcp__alt { color: #fff !important; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.mcp--story .mcp__x { background: rgba(255, 255, 255, .14); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---------- Side tab (after closing) ---------- */
.mcp-tab { position: fixed; left: 16px; bottom: 16px; z-index: 80; display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px 11px 12px; border: 0; border-radius: 999px; background: #0B4A43; color: #fff; font: 600 14px var(--sans, Inter, sans-serif); cursor: pointer; box-shadow: 0 16px 34px -14px rgba(5, 36, 32, .7); transform: translateX(calc(-100% - 24px)); transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.mcp-tab.is-in { transform: none; }
.mcp-tab[hidden] { display: none; }
.mcp-tab i { width: 26px; height: 26px; border-radius: 50%; background: #FFD028 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230B4A43' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 20V11a6 6 0 0 1 12 0v9M4 20h16M10 20v-4a2 2 0 0 1 4 0v4'/%3E%3C/svg%3E") center / 16px no-repeat; }
.mcp-tab:hover { background: #083A35; }

@media (max-width: 760px) {
	.mcp { padding: 0; place-items: end stretch; }
	.mcp__box { width: 100%; max-height: 94vh; border-radius: 26px 26px 0 0; transform: translateY(60px); }
	.mcp--split .mcp__box { display: block; min-height: 0; overflow-y: auto; }
	.mcp__media { height: 220px; }
	.mcp__media figcaption { padding: 70px 20px 18px; }
	.mcp__media h2 { font-size: 32px; margin-bottom: 6px; }
	.mcp__media p { font-size: 14px; }
	.mcp__panel { margin: 0; border: 0; border-radius: 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); overflow: visible; }
	.mcp__panel .mcp__x { position: absolute; top: -206px; right: 14px; background: rgba(255, 255, 255, .92); }
	.mcp__panel-t { font-size: 23px; margin: 0 0 12px; }
	.mcp__money b { font-size: 28px; }
	.mcp__chips { gap: 6px; }
	.mcp__chip { min-height: 46px; font-size: 14px; }
	.mcp--story .mcp__box { min-height: 84vh; }
	.mcp--story .mcp__box::after { background: linear-gradient(0deg, rgba(5, 36, 32, .97) 0%, rgba(5, 36, 32, .82) 45%, rgba(5, 36, 32, .1) 85%); }
	.mcp__story { padding: 26px 22px calc(26px + env(safe-area-inset-bottom)); }
	.mcp__story h2 { font-size: 40px; letter-spacing: -1.4px; }
	.mcp-tab { left: 12px; bottom: 12px; padding: 9px; }
	.mcp-tab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.mcp-tab i { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
	.mcp__box, .mcp__bg, .mcp-tab { transition: opacity .2s; transform: none !important; }
	.mcp__bar i { animation: none; }
}
