/*
 * TAMSYA donation campaigns: 10 designs, each with an Islamic geometric pattern and colours that
 * match its intention. Patterns are inline SVG (no image files). Mobile-first.
 * A design is applied with .cmp-d-{key}; the admin may override the accent (--c2) per campaign.
 */

.cmp { --c1: #0f5132; --c2: #c9a227; --c-ink: #ffffff; --pat: none; }

/* ─── Patterns ─────────────────────────────────────────────────────────── */
.cmp-pat-khatam   { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.2'%3E%3Cpath d='M32 6l7.6 18.4L58 32l-18.4 7.6L32 58l-7.6-18.4L6 32l18.4-7.6z'/%3E%3Crect x='19' y='19' width='26' height='26' transform='rotate(45 32 32)'/%3E%3Ccircle cx='32' cy='32' r='5'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-lantern  { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M58 14a10 10 0 1 0 6 18 12 12 0 1 1-6-18z'/%3E%3Cpath d='M20 40h12l-2 16h-8z'/%3E%3Cpath d='M26 34v6M22 56l4 6 4-6'/%3E%3Ccircle cx='66' cy='60' r='1.5'/%3E%3Ccircle cx='10' cy='18' r='1.2'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-girih    { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M36 4l10 14h18l-6 16 6 16H46L36 64 26 50H8l6-16-6-16h18z'/%3E%3Cpath d='M36 18l8 8v12l-8 8-8-8V26z'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-arabesque{ --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='70' height='70' viewBox='0 0 70 70'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M35 10c8 8 8 17 0 25-8-8-8-17 0-25zM35 35c8 8 8 17 0 25-8-8-8-17 0-25zM10 35c8-8 17-8 25 0-8 8-17 8-25 0zM35 35c8-8 17-8 25 0-8 8-17 8-25 0z'/%3E%3Ccircle cx='35' cy='35' r='3'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-arches   { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M6 56V30a24 24 0 0 1 48 0v26'/%3E%3Cpath d='M16 56V32a14 14 0 0 1 28 0v24'/%3E%3Cpath d='M30 6v6'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-hexagon  { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M28 2l26 15v30L28 62 2 47V17z'/%3E%3Cpath d='M28 22c-4-6-12-2-9 4 2 4 9 9 9 9s7-5 9-9c3-6-5-10-9-4z'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-eid      { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Ccircle cx='38' cy='38' r='22'/%3E%3Cpath d='M38 16l4 14 14 8-14 8-4 14-4-14-14-8 14-8z'/%3E%3Ccircle cx='38' cy='38' r='4'/%3E%3C/g%3E%3C/svg%3E"); }
.cmp-pat-waves    { --pat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='56' viewBox='0 0 80 56'%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.1'%3E%3Cpath d='M0 40c10-8 20-8 30 0s20 8 30 0 20-8 20-8'/%3E%3Cpath d='M0 50c10-8 20-8 30 0s20 8 30 0 20-8 20-8'/%3E%3Cpath d='M56 6l3 6 6 3-6 3-3 6-3-6-6-3 6-3z'/%3E%3C/g%3E%3C/svg%3E"); }

/* ─── Designs (colours + pattern) ──────────────────────────────────────── */
.cmp-d-swadaqat        { --c1: #0f5132; --c2: #c9a227; }
.cmp-d-ramadhan_iftar  { --c1: #14213d; --c2: #f4c95d; }
.cmp-d-zakat_fitr      { --c1: #7a4b00; --c2: #f2b134; }
.cmp-d-hijab_dignity   { --c1: #6b2d5c; --c2: #f0a6ca; }
.cmp-d-masjid_build    { --c1: #0b4f5c; --c2: #7fd1b9; }
.cmp-d-quran_education { --c1: #283593; --c2: #9fa8da; }
.cmp-d-orphan_care     { --c1: #8a3b12; --c2: #f6b98b; }
.cmp-d-emergency_relief{ --c1: #9b1c1c; --c2: #fca5a5; }
.cmp-d-udhiyah         { --c1: #5c1a1b; --c2: #d4a373; }
.cmp-d-water_well      { --c1: #0c4a6e; --c2: #7dd3fc; }

/* ─── Campaign hero ────────────────────────────────────────────────────── */
.cmp-hero { position: relative; color: var(--c-ink); background: var(--c1); overflow: hidden; padding: 3.5rem 0 5.5rem; }
.cmp-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--pat); opacity: .14; }
.cmp-hero::after { content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--c2) 35%, transparent), transparent 55%),
                linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, .25)); }
.cmp-hero.has-image { background: #111; }
.cmp-hero .cmp-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.cmp-hero > .container { position: relative; z-index: 2; }
.cmp-hero .cmp-eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem; border-radius: 999px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); color: var(--c2); font-weight: 700;
    font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(4px); }
.cmp-hero h1 { color: #fff; font-weight: 800; font-size: clamp(1.8rem, 5vw, 3rem); margin: .9rem 0 .6rem; line-height: 1.15; }
.cmp-hero .cmp-tagline { color: rgba(255, 255, 255, .88); font-size: clamp(1rem, 2.4vw, 1.2rem); max-width: 640px; }
.cmp-hero .cmp-crumb a { color: rgba(255, 255, 255, .8); text-decoration: none; }
.cmp-hero .cmp-crumb { font-size: .85rem; color: rgba(255, 255, 255, .65); }
.cmp-motif { position: absolute; right: 6%; bottom: 18%; font-size: clamp(4rem, 14vw, 9rem); color: var(--c2); opacity: .22; z-index: 1; }
.cmp-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1rem; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.cmp-meta i { color: var(--c2); }

/* Progress */
.cmp-progress { background: #fff; border-radius: 18px; padding: 1.1rem 1.25rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .08); border: 1px solid rgba(15, 23, 42, .06); }
.cmp-progress .bar { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--c1) 12%, #fff); overflow: hidden; }
.cmp-progress .bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c1), color-mix(in srgb, var(--c1) 55%, var(--c2))); transition: width .8s ease; }
.cmp-progress .raised { font-size: 1.4rem; font-weight: 800; color: var(--c1); }
.cmp-hero-progress { margin-top: 1.4rem; max-width: 520px; }
.cmp-hero-progress .bar { background: rgba(255, 255, 255, .2); }
.cmp-hero-progress .bar > span { background: var(--c2); }

/* Story aside */
.cmp-story { border-radius: 22px; background: #fff; padding: 1.5rem; border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.cmp-story h3 { font-weight: 800; }
.cmp-story .cmp-story-text { color: #475569; white-space: pre-line; line-height: 1.7; }
.cmp-share { display: flex; flex-wrap: wrap; gap: .5rem; }
/* With a campaign story above it, the "Your impact" panel must not stretch to the column height */
.cmp-story + .donate-aside { height: auto; }
.cmp-share .btn { border-radius: 999px; }

/* Amount: fixed + quantity */
.cmp-fixed { text-align: center; padding: 1.1rem; border-radius: 16px; border: 2px dashed color-mix(in srgb, var(--c1) 35%, #fff); background: color-mix(in srgb, var(--c1) 5%, #fff); }
.cmp-fixed strong { display: block; font-size: 1.8rem; color: var(--c1); }
.cmp-qty { display: flex; align-items: center; justify-content: center; gap: .75rem; }
.cmp-qty button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--c1); color: #fff; font-size: 1.3rem; line-height: 1; }
.cmp-qty input { width: 90px; text-align: center; font-size: 1.5rem; font-weight: 800; border-radius: 12px; }
.cmp-qty-presets { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: .75rem; }
.cmp-qty-presets .btn { border-radius: 999px; }

/* Offline accounts */
.cmp-account { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1rem; border-radius: 14px;
    background: #fff; border: 1px solid rgba(15, 23, 42, .08); margin-bottom: .75rem; }
.cmp-account .mark { width: 48px; height: 48px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .7rem;
    color: #fff; background: var(--c1); text-align: center; line-height: 1.1; padding: 2px; }
.cmp-paid-btn { border-radius: 999px; }

/* Campaign cards (listing) */
.cmp-grid-title { font-weight: 800; }
.cmp-card { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: 20px; overflow: hidden; background: #fff;
    border: 1px solid rgba(15, 23, 42, .07); box-shadow: 0 8px 24px rgba(15, 23, 42, .06); transition: transform .2s ease, box-shadow .2s ease; }
.cmp-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 23, 42, .12); }
.cmp-card .cmp-card-top { position: relative; height: 150px; background: var(--c1); color: #fff; overflow: hidden; }
.cmp-card .cmp-card-top::before { content: ""; position: absolute; inset: 0; background-image: var(--pat); opacity: .18; }
.cmp-card .cmp-card-top img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmp-card .cmp-card-top .motif { position: absolute; right: 14px; bottom: 8px; font-size: 3.2rem; color: var(--c2); opacity: .5; }
.cmp-card .cmp-card-top .tag { position: absolute; top: 12px; left: 12px; background: rgba(0, 0, 0, .35); padding: .2rem .65rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em; backdrop-filter: blur(4px); }
.cmp-card .cmp-card-top .pin { position: absolute; top: 12px; right: 12px; background: var(--c2); color: var(--c1); border-radius: 999px; padding: .15rem .55rem; font-size: .7rem; font-weight: 800; }
.cmp-card .cmp-card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.cmp-card h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: .35rem; }
.cmp-card p { color: #64748b; font-size: .9rem; flex: 1; }
.cmp-card .cmp-progress { padding: 0; box-shadow: none; border: 0; margin-bottom: .9rem; }
.cmp-card .cmp-progress .raised { font-size: 1rem; }
.cmp-card .btn-donate { background: var(--c1); color: #fff; border-radius: 999px; font-weight: 700; }
.cmp-card .btn-donate:hover { filter: brightness(1.1); color: #fff; }
.cmp-card .days-left { font-size: .78rem; color: #64748b; }

/* Closed / not found */
.cmp-closed { text-align: center; padding: 3rem 1rem; }
.cmp-closed .icon { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 1rem; display: grid; place-items: center; font-size: 2rem;
    background: color-mix(in srgb, var(--c1) 12%, #fff); color: var(--c1); }

/* Card checkout inside the site */
.card-checkout-modal .modal-dialog { max-width: 560px; }
.card-checkout-modal .modal-content { border-radius: 18px; overflow: hidden; }
.card-checkout-modal iframe { width: 100%; height: min(78vh, 720px); border: 0; display: block; background: #fff; }
@media (max-width: 575.98px) {
    .card-checkout-modal .modal-dialog { margin: 0; max-width: 100%; min-height: 100%; }
    .card-checkout-modal .modal-content { border-radius: 0; min-height: 100vh; }
    .card-checkout-modal iframe { height: calc(100vh - 120px); }
}

@media (max-width: 767.98px) {
    .cmp-hero { padding: 2.25rem 0 4.5rem; }
    .cmp-motif { bottom: 8%; right: 4%; }
    .cmp-account { flex-wrap: wrap; }
    .cmp-account .btn { width: 100%; }
}

/* ─── Donate hub (/donate) ─────────────────────────────────────────────── */
.cmp-hub-hero { padding: 2.75rem 0 4.25rem; }
.cmp-hub-hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
.cmp-hub-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.1rem; color: rgba(255, 255, 255, .85); font-size: .9rem; }
.cmp-hub-stats strong { color: var(--c2); font-size: 1.05rem; }
.cmp-hub { margin-top: -2.75rem; position: relative; z-index: 3; }
.cmp-chips { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding-bottom: 2px; }
.cmp-chips::-webkit-scrollbar { display: none; }
.cmp-chip { flex: 0 0 auto; border: 1px solid rgba(15, 23, 42, .12); background: #fff; color: #334155; border-radius: 999px; padding: .38rem .9rem; font-size: .82rem; font-weight: 600; transition: .15s; }
.cmp-chip:hover { border-color: var(--t-primary, #1e3a8a); color: var(--t-primary, #1e3a8a); }
.cmp-chip.active { background: var(--t-primary, #1e3a8a); border-color: var(--t-primary, #1e3a8a); color: #fff; }
.cmp-hub-note { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.2rem; border-radius: 16px; background: #fff; border: 1px solid rgba(15, 23, 42, .07); color: #475569; font-size: .92rem; }
.cmp-hub-note > i { color: #16a34a; font-size: 1.3rem; margin-top: .1rem; }

/* Card pieces shared by both layouts */
.cmp-card h4 a { color: inherit; text-decoration: none; }
.cmp-card h4 a:hover { color: var(--c1); }
.cmp-card .cmp-card-text { color: #64748b; font-size: .9rem; margin-bottom: .85rem; }
.cmp-card .cmp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; }
.cmp-card .cmp-card-meta { font-size: .8rem; color: #64748b; min-width: 0; }
.cmp-card .btn-share { width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid rgba(15, 23, 42, .12); color: #475569; background: #fff; }
.cmp-card .btn-share:hover { color: var(--c1); border-color: var(--c1); }
.cmp-card .cmp-card-top .tag i { color: var(--c2); }

/* Featured: large; image beside the text on wide screens */
.cmp-card-featured { box-shadow: 0 18px 44px rgba(15, 23, 42, .12); }
.cmp-card-featured .cmp-card-top { height: 220px; }
.cmp-card-featured .cmp-card-top .motif { font-size: 5rem; right: 22px; bottom: 14px; }
.cmp-card-featured h4 { font-size: 1.35rem; }
.cmp-card-featured .cmp-card-body { padding: 1.3rem 1.4rem 1.4rem; }
@media (min-width: 992px) {
    .col-12:not(.col-lg-6) > .cmp-card-featured { flex-direction: row; }
    .col-12:not(.col-lg-6) > .cmp-card-featured .cmp-card-top { height: auto; min-height: 260px; flex: 0 0 46%; }
    .col-12:not(.col-lg-6) > .cmp-card-featured .cmp-card-body { padding: 2rem; justify-content: center; }
    .col-12:not(.col-lg-6) > .cmp-card-featured h4 { font-size: 1.6rem; }
}

/* Phones: standard cards become compact rows so many campaigns fit on one screen */
@media (max-width: 575.98px) {
    .cmp-hub { margin-top: -2.25rem; }
    .cmp-hub-hero { padding: 2rem 0 3.5rem; }
    .cmp-hub-stats { font-size: .82rem; gap: .35rem 1rem; }
    .cmp-card-featured .cmp-card-top { height: 150px; }
    .cmp-card-featured h4 { font-size: 1.15rem; }
    .cmp-card-compact { flex-direction: row; border-radius: 16px; }
    .cmp-card-compact .cmp-card-top { height: auto; min-height: 118px; flex: 0 0 34%; }
    .cmp-card-compact .cmp-card-top .tag { top: 8px; left: 8px; font-size: .62rem; padding: .15rem .45rem; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cmp-card-compact .cmp-card-top .motif { font-size: 2.2rem; right: 8px; bottom: 6px; }
    .cmp-card-compact .cmp-card-body { padding: .7rem .85rem; }
    .cmp-card-compact h4 { font-size: .98rem; margin-bottom: .2rem; }
    .cmp-card-compact .cmp-card-text { font-size: .8rem; margin-bottom: .45rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .cmp-card-compact .cmp-progress { margin-bottom: .45rem; }
    .cmp-card-compact .cmp-progress .raised { font-size: .85rem; }
    .cmp-card-compact .btn-share { display: none; }
    .cmp-card-compact .btn-donate { padding: .25rem .75rem; font-size: .8rem; }
}
/* Featured card: text block sized to its content (no empty gap), footer just below it */
.cmp-card-featured .cmp-card-text { flex: 0 0 auto; }
.cmp-card-featured .cmp-card-foot { margin-top: .5rem; }
/* "of TZS 1,200,000" next to the raised amount; wraps under it on narrow cards */
.cmp-card .cmp-goal { font-size: .78rem; white-space: nowrap; }
@media (max-width: 575.98px) { .cmp-card-compact .cmp-goal { display: block; line-height: 1.2; } }
