/* ==========================
   Fundraiser Cards Grid (with Safari and equal width fixes)
========================== */

.fundraiser-cards-container {
    display: flex !important; /* force flex even inside parent flex */
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between; /* left and right alignment */
    align-items: stretch; /* equal height */
    width: 100%;
    min-width: 0; /* Safari fix for nested flex items */
}

/* Each card link wrapper */
.fundraiser-card-link {
    display: flex;
    flex: 0 0 calc(50% - 20px); /* two cards per row minus half gap */
    text-decoration: none; /* remove default underline */
    color: inherit;
    height: 100%; /* ensures equal height for flex children */
}

/* Remove underlines for all children */
.fundraiser-card-link * {
    text-decoration: none !important;
    color: inherit;
}

/* Single card */
.fundraiser-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.fundraiser-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

/* Image */
.fundraiser-card-image {
    flex: 0 0 150px;
    height: auto;
}

.fundraiser-card-image img {
    width: 100%;
    height: auto;
    object-fit: contain; /* scale fully, no clipping */
}

/* Card details */
.fundraiser-card-details {
    flex: 1;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Title & meta */
.fundraiser-card-title {
    font-size: 1rem;
    font-weight: bold;
    margin: 0;
}

.fundraiser-meta {
    font-size: 0.85rem;
    margin: 2px 0;
}

.fundraiser-card-description {
    font-size: 0.9rem;
    flex: 1; /* ensures description takes available space */
}

/* Progress bar wrapper */
.fundraiser-progress-wrapper {
    margin-top: auto;
    width: 100%;
}

.progress-bar-bg {
    position: relative;
    width: 100%;
    height: 20px;
    background: #ddd;
    border-radius: 10px;
    overflow: visible;
}

.progress-fill-goal {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #28a745;
    border-radius: 10px 0 0 10px;
    z-index: 1;
}

.progress-fill-over {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: gold;
    border-radius: 0 10px 10px 0;
    z-index: 2;
}

.progress-goal-line {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background-color: #000;
    z-index: 3;
    transform: translateX(-50%);
}

/* Labels */
.progress-label-zero,
.progress-label-raised,
.progress-goal-label {
    position: absolute;
    z-index: 10;
    font-weight: normal;
    font-size: 0.7rem;
}

.progress-label-zero {
    left: 0;
    top: -20px;
}

.progress-label-raised {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
}

.progress-label-raised.amount-overlap-gold {
    color: #000;
}

.progress-goal-label {
    top: -25px;
    font-size: 0.7rem;
    color: #000;
    background: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    transform: translateX(-50%);
}

.progress-goal-label::after {
    content: '';
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #000;
}

.progress-goal-label.hide-arrow::after {
    display: none;
}

.progress-percentage {
    margin-top: 3px;
    font-size: 0.7rem;
    text-align: right;
}

/* Responsive */
@media (max-width: 1024px) {
    .fundraiser-card-link {
        flex: 0 0 48%; /* 2 cards per row on tablet */
    }
}

@media (max-width: 768px) {
    .fundraiser-card-link {
        flex: 0 0 100%; /* 1 card per row on mobile */
    }
}
