/**
 * Fundraising gallery front-end styles.
 * Brand colours come from the theme design-system tokens (var(--hfch-navy) …).
 * Neutral tokens the stub design system does not yet define are declared here
 * with the --hfch- prefix (permitted by CLAUDE.md §5.1), so no bare hex is used
 * in the component rules below.
 */

:root {
    --hfch-gallery-page-bg:    #FBF7EF;
    --hfch-gallery-card-bg:    #FFFFFF;
    --hfch-gallery-border:     #E4E7EC;
    --hfch-gallery-text-muted: #667085;
    --hfch-gallery-shadow:     0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.06);
    --hfch-gallery-shadow-hover: 0 12px 24px rgba(16, 24, 40, 0.14);
    --hfch-gallery-overlay:    rgba(10, 20, 40, 0.92);
}

/* ── Wrapper & filters ───────────────────────────────────────── */

.hfch-fundraiser-wrap {
    font-family: var(--hfch-font-body);
    background: var(--hfch-gallery-page-bg);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.hfch-fundraiser-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hfch-fundraiser-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border: 1px solid var(--hfch-gallery-border);
    border-radius: 999px;
    background: var(--hfch-gallery-card-bg);
    color: var(--hfch-navy);
    font-family: var(--hfch-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hfch-fundraiser-filter:hover {
    border-color: var(--hfch-navy);
}

.hfch-fundraiser-filter.is-active {
    background: var(--hfch-navy);
    border-color: var(--hfch-navy);
    color: var(--hfch-white);
}

.hfch-fundraiser-filter-count {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
}

.hfch-fundraiser-filter.is-active .hfch-fundraiser-filter-count {
    background: rgba(255, 255, 255, 0.22);
}

/* ── Event sections ──────────────────────────────────────────── */

.hfch-fundraiser-event {
    margin-bottom: 2.5rem;
}

.hfch-fundraiser-event-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--hfch-gallery-border);
}

.hfch-fundraiser-event-title {
    font-family: var(--hfch-font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--hfch-navy);
    margin: 0;
}

.hfch-fundraiser-event-meta {
    font-size: 0.85rem;
    color: var(--hfch-gallery-text-muted);
    margin: 0;
}

/* ── Photo grid & cards ──────────────────────────────────────── */

.hfch-fundraiser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.hfch-fundraiser-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--hfch-gallery-card-bg);
    box-shadow: var(--hfch-gallery-shadow);
    cursor: pointer;
    outline-offset: 3px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hfch-fundraiser-card:hover,
.hfch-fundraiser-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: var(--hfch-gallery-shadow-hover);
}

/* Fixed aspect-ratio box holds layout (CLS ~ 0) before the image decodes. */
.hfch-fundraiser-card-image {
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--hfch-gallery-border);
}

.hfch-fundraiser-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hfch-fundraiser-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--hfch-white);
    color: var(--hfch-navy);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--hfch-gallery-shadow);
}

.hfch-fundraiser-empty {
    color: var(--hfch-gallery-text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

/* ── Load More ───────────────────────────────────────────────── */

.hfch-fundraiser-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.hfch-fundraiser-load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border: 1px solid var(--hfch-navy);
    border-radius: 999px;
    background: var(--hfch-white);
    color: var(--hfch-navy);
    font-family: var(--hfch-font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.hfch-fundraiser-load-more:hover {
    background: var(--hfch-navy);
    color: var(--hfch-white);
}

.hfch-fundraiser-load-more.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.hfch-fundraiser-load-more.is-loading svg {
    animation: hfch-fundraiser-spin 0.8s linear infinite;
}

@keyframes hfch-fundraiser-spin {
    to { transform: rotate(360deg); }
}

/* ── Lightbox ────────────────────────────────────────────────── */

.hfch-fundraiser-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--hfch-gallery-overlay);
}

.hfch-fundraiser-lightbox.is-open {
    display: flex;
}

.hfch-fundraiser-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.hfch-fundraiser-lightbox-img {
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 6px;
}

.hfch-fundraiser-lightbox-caption {
    color: var(--hfch-white);
    margin-top: 0.75rem;
}

.hfch-fundraiser-lightbox-title {
    font-family: var(--hfch-font-display);
    font-size: 1.1rem;
    margin: 0;
}

.hfch-fundraiser-lightbox-meta {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0.2rem 0 0;
}

.hfch-fundraiser-lightbox-close,
.hfch-fundraiser-lightbox-prev,
.hfch-fundraiser-lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: var(--hfch-white);
    border: none;
    cursor: pointer;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.hfch-fundraiser-lightbox-close:hover,
.hfch-fundraiser-lightbox-prev:hover,
.hfch-fundraiser-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.28);
}

.hfch-fundraiser-lightbox-close { top: 1.2rem; right: 1.2rem; }
.hfch-fundraiser-lightbox-prev  { left: 1.2rem;  top: 50%; transform: translateY(-50%); }
.hfch-fundraiser-lightbox-next  { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1024px) {
    .hfch-fundraiser-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
    .hfch-fundraiser-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .hfch-fundraiser-event-title { font-size: 1.25rem; }
    .hfch-fundraiser-lightbox-prev { left: 0.5rem; }
    .hfch-fundraiser-lightbox-next { right: 0.5rem; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .hfch-fundraiser-card,
    .hfch-fundraiser-filter,
    .hfch-fundraiser-load-more {
        transition: none;
    }
    .hfch-fundraiser-card:hover,
    .hfch-fundraiser-card:focus-visible {
        transform: none;
    }
    .hfch-fundraiser-load-more.is-loading svg {
        animation: none;
    }
}
