/* =============================================================================
   Charity Journal — Ongoing Projects Showcase
   cjop-assets/ongoing-projects.css  |  v1.1.0
   ============================================================================= */

/* ── Custom Properties ──────────────────────────────────────────────────────── */
.cjop-section {
    --cjop-radius:       14px;
    --cjop-radius-sm:    8px;
    --cjop-gap:          20px;
    --cjop-font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --cjop-dark:         #1a1a2e;
    --cjop-mid:          #3d3d5c;
    --cjop-muted:        #6b6b8a;
    --cjop-light:        #f4f4f8;
    --cjop-border:       #e2e2ec;
    --cjop-white:        #ffffff;
    --cjop-shadow-sm:    0 2px 10px rgba(0,0,0,.07);
    --cjop-shadow-hover: 0 14px 36px rgba(0,0,0,.13);
    --cjop-transition:   0.27s cubic-bezier(.4,0,.2,1);

    /* per-card accent — overridden inline by PHP */
    --cjop-cat-color: #185fa5;
    --cjop-cat-bg:    #e8f0fb;

    font-family: var(--cjop-font);
    margin: 3rem 0;
    container-type: inline-size;
}

/* ── Section Header ─────────────────────────────────────────────────────────── */
.cjop-section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.cjop-section-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: .65rem;
}

.cjop-eyebrow-line {
    display: block;
    width: 38px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cjop-muted), transparent);
    border-radius: 2px;
}

.cjop-eyebrow-text {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--cjop-muted);
}

.cjop-section-title {
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 800;
    color: var(--cjop-dark);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -.02em;
}

/* ── Grid ───────────────────────────────────────────────────────────────────── */
.cjop-grid {
    display: grid;
    gap: var(--cjop-gap);
    margin-bottom: 1.75rem;
}

/* Always 4-up on wide screens regardless of how many cards exist */
.cjop-grid--1 { grid-template-columns: minmax(0, 420px); justify-content: center; }
.cjop-grid--2 { grid-template-columns: repeat(2, 1fr); }
.cjop-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cjop-grid--4 { grid-template-columns: repeat(4, 1fr); }

@container (max-width: 900px) {
    .cjop-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .cjop-grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@container (max-width: 520px) {
    .cjop-grid { grid-template-columns: 1fr !important; }
}

/* ── Card ───────────────────────────────────────────────────────────────────── */
.cjop-card {
    background: var(--cjop-white);
    border-radius: var(--cjop-radius);
    border: 1px solid var(--cjop-border);
    box-shadow: var(--cjop-shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition:
        transform var(--cjop-transition),
        box-shadow var(--cjop-transition);
}

.cjop-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--cjop-shadow-hover);
}

/* ── Coloured top accent band ───────────────────────────────────────────────── */
.cjop-card-accent {
    height: 90px;
    background:
        linear-gradient(
            135deg,
            var(--cjop-cat-color) 0%,
            color-mix(in srgb, var(--cjop-cat-color) 68%, #000) 100%
        );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* Subtle radial glow behind icon */
.cjop-card-accent::before {
    content: '';
    position: absolute;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Diagonal stripe overlay */
.cjop-card-accent::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent 0,
        transparent 12px,
        rgba(255,255,255,.06) 12px,
        rgba(255,255,255,.06) 24px
    );
}

.cjop-accent-icon {
    font-size: 2.4rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.2));
    animation: cjop-float 3.2s ease-in-out infinite;
}

@keyframes cjop-float {
    0%, 100% { transform: translateY(0);    }
    50%       { transform: translateY(-6px); }
}

/* ── Card Body ──────────────────────────────────────────────────────────────── */
.cjop-card-body {
    padding: 1.1rem 1.2rem 1.3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

/* Category pill */
.cjop-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 11px 3px 7px;
    border-radius: 20px;
    background: var(--cjop-cat-bg);
    color: var(--cjop-cat-color);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    align-self: flex-start;
    border: 1px solid color-mix(in srgb, var(--cjop-cat-color) 22%, transparent);
}

.cjop-cat-icon { font-size: .85rem; line-height: 1; }

/* Title */
.cjop-card-title {
    font-size: .98rem;
    font-weight: 800;
    color: var(--cjop-dark);
    margin: 0;
    line-height: 1.35;
    letter-spacing: -.01em;
}

/* Description */
.cjop-card-desc {
    font-size: .84rem;
    color: var(--cjop-mid);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Expand toggle */
.cjop-expand-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: .78rem;
    font-weight: 600;
    color: var(--cjop-cat-color);
    cursor: pointer;
    align-self: flex-start;
    margin-top: -4px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cjop-expand-btn:hover { opacity: .75; }

/* ── Donate Pill ─────────────────────────────────────────────────────────────── */
.cjop-donate-bar {
    display: flex !important;
    justify-content: center !important;
    padding: .5rem 0 .25rem !important;
    background: none !important;
}

/* Use .cjop-section prefix throughout to beat any theme specificity */
.cjop-section a.cjop-donate-pill,
.cjop-section a.cjop-donate-pill:link,
.cjop-section a.cjop-donate-pill:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 640px !important;
    /* pill height via padding — not line-height, so themes can't squash it */
    padding: 17px 0 !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    text-decoration: none !important;
    position: relative !important;
    isolation: isolate;
    cursor: pointer !important;
    border: none !important;
    outline-offset: 3px;
    /* Orange gradient — forced */
    background: linear-gradient(
        100deg,
        #064e54 0%,
        #0d7377 28%,
        #14a89e 58%,
        #0eb8b0 100%
    ) !important;
    box-shadow:
        0 6px 28px rgba(13, 115, 119, .45),
        0 1px 0   rgba(255,255,255,.15) inset !important;
    transition:
        transform     0.26s cubic-bezier(.4,0,.2,1),
        box-shadow    0.26s cubic-bezier(.4,0,.2,1),
        filter        0.26s ease !important;
}

/* Shimmer sweep */
.cjop-section a.cjop-donate-pill::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: inherit !important;
    background: linear-gradient(
        105deg,
        transparent 25%,
        rgba(255,255,255,.20) 50%,
        transparent 75%
    ) !important;
    background-size: 200% 100% !important;
    animation: cjop-pill-shimmer 2.8s linear infinite !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

/* Top-edge gloss */
.cjop-section a.cjop-donate-pill::after {
    content: '' !important;
    position: absolute !important;
    top: 0; left: 0; right: 0 !important;
    height: 48% !important;
    border-radius: 999px 999px 0 0 !important;
    background: linear-gradient(to bottom, rgba(255,255,255,.16), transparent) !important;
    z-index: 0 !important;
    pointer-events: none !important;
}

@keyframes cjop-pill-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.cjop-section a.cjop-donate-pill:hover,
.cjop-section a.cjop-donate-pill:focus-visible {
    transform: translateY(-3px) scale(1.012) !important;
    box-shadow:
        0 16px 44px rgba(13, 115, 119, .55),
        0 1px 0 rgba(255,255,255,.18) inset !important;
    filter: brightness(1.07) !important;
    text-decoration: none !important;
    color: #fff !important;
    background: linear-gradient(
        100deg,
        #064e54 0%,
        #0d7377 28%,
        #14a89e 58%,
        #0eb8b0 100%
    ) !important;
}

.cjop-section a.cjop-donate-pill:active {
    transform: translateY(0) scale(0.998) !important;
}

/* Three animated dots — left */
.cjop-pill-dots {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 0 18px 0 24px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
}

.cjop-pill-dots span {
    display: block !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.55) !important;
    flex-shrink: 0 !important;
}

.cjop-pill-dots span:nth-child(1) { animation: cjop-dot-pulse 1.7s ease-in-out infinite 0s;   }
.cjop-pill-dots span:nth-child(2) { animation: cjop-dot-pulse 1.7s ease-in-out infinite .22s; }
.cjop-pill-dots span:nth-child(3) { animation: cjop-dot-pulse 1.7s ease-in-out infinite .44s; }

@keyframes cjop-dot-pulse {
    0%, 100% { opacity: .4;  transform: scale(1);    background: rgba(255,255,255,.55); }
    50%       { opacity: 1;  transform: scale(1.4);  background: #fff; }
}

/* Centre label */
.cjop-pill-label {
    flex: 1 !important;
    text-align: center !important;
    font-size: 1rem !important;
    font-weight: 800 !important;
    letter-spacing: .06em !important;
    color: #fff !important;
    text-transform: uppercase !important;
    line-height: 1 !important;
    position: relative !important;
    z-index: 1 !important;
    text-shadow: 0 1px 5px rgba(0,0,0,.22) !important;
    white-space: nowrap !important;
}

/* Arrow circle — right */
.cjop-pill-arrow {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 20px 0 14px !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    transition: transform 0.26s ease !important;
}

.cjop-section a.cjop-donate-pill:hover .cjop-pill-arrow {
    transform: translateX(5px) !important;
}

/* Inactive / no URL */
.cjop-section .cjop-donate-pill--inactive,
.cjop-section span.cjop-donate-pill--inactive {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 640px !important;
    padding: 17px 24px !important;
    border-radius: 999px !important;
    background: #e5e7eb !important;
    box-shadow: none !important;
    cursor: default !important;
    pointer-events: none !important;
}

.cjop-donate-pill--inactive .cjop-pill-label {
    color: #9ca3af !important;
    text-shadow: none !important;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .cjop-pill-label   { font-size: .8rem !important; letter-spacing: .04em !important; }
    .cjop-pill-dots    { padding: 0 12px 0 16px !important; }
    .cjop-pill-arrow   { padding: 0 14px 0 10px !important; }
}