﻿:root {
    --impact-primary: #0d47a1;
    --impact-accent: #c62828;
    --impact-muted: #6c757d;
    --impact-bg: #f8f9fa;
    --impact-border: #e0e0e0;
    --impact-radius: 14px;
    --impact-shadow: 0 8px 20px rgba(0,0,0,.08);
}

/* ================= LIST ================= */

.impact-list {
    padding: 2rem 0;
}

.impact-card {
    position: relative; /* ✅ ADD THIS */
    background: #fff;
    border-radius: var(--impact-radius);
    overflow: hidden;
    box-shadow: var(--impact-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}


/* 🔒 IMAGE NORMALIZATION — THIS IS THE KEY */
.impact-card-img {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #f1f1f1;
}

    .impact-card-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* BADGE */
.impact-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 20px;
    color: #fff;
    background: var(--impact-primary);
    z-index: 2;
}

    .impact-badge.social {
        background: var(--impact-accent);
    }

/* BODY */
.impact-card-body {
    padding: .9rem 1rem;
    flex-grow: 1;
}

.impact-card-title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: .35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.impact-card-meta {
    font-size: .75rem;
    color: var(--impact-muted);
}

/* ================= DETAILS ================= */

.impact-details {
    padding: 2.5rem 0;
}

.impact-details-hero {
    border-radius: var(--impact-radius);
    overflow: hidden;
    box-shadow: var(--impact-shadow);
}

    .impact-details-hero img {
        width: 100%;
        height: 420px;
        object-fit: cover;
    }

.impact-details-type {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 6px 16px;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 30px;
    background: var(--impact-primary);
    color: #fff;
}

.impact-details-title {
    margin-top: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

.impact-details-meta {
    margin-top: .6rem;
    font-size: .9rem;
    color: var(--impact-muted);
}

.impact-details-content h5 {
    font-weight: 600;
    margin-bottom: .5rem;
}

.impact-details-content p {
    font-size: .95rem;
    line-height: 1.7;
}

.impact-details-footer {
    background: var(--impact-bg);
    padding: 1.5rem;
    border-radius: var(--impact-radius);
}

/* ================= RELATED ================= */

/* ================= RELATED (COMPACT) ================= */

/* ================= RELATED (WITH BADGE) ================= */

.related-card {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--impact-shadow);
    text-decoration: none;
    color: inherit;
}

/* Image wrapper */
.related-thumb {
    position: relative;
    width: 72px; /* ~1 inch */
    height: 72px;
    flex-shrink: 0;
}

    .related-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
    }

/* Badge on image */
.related-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 6px;
    font-size: .6rem;
    font-weight: 600;
    border-radius: 10px;
    color: #fff;
    background: var(--impact-primary);
    z-index: 2;
}

    .related-badge.social {
        background: var(--impact-accent);
    }

/* Text area */
.related-body {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-directorate {
    font-size: .65rem;
    color: var(--impact-muted);
    margin-bottom: 2px;
}

.related-date {
    font-size: .6rem;
    color: var(--impact-muted);
}
/* ================= HERO BADGE ================= */

/* ================= HERO BADGE ================= */

/* HERO container */
.impact-details-hero {
    position: relative;
    overflow: hidden;
}

/* TEXT BADGE */
.impact-hero-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .3px;
    border-radius: 999px;
    color: #fff;
    white-space: nowrap;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.35);
    pointer-events: none;
}

    /* SOCIAL IMPACT */
    .impact-hero-badge.social {
        background: linear-gradient(135deg, #0d47a1, #1565c0);
    }

    /* SUCCESS STORY */
    .impact-hero-badge.success {
        background: linear-gradient(135deg, #ef6c00, #f57c00);
    }


.impact-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
}

    .impact-nav a {
        font-weight: 600;
        color: var(--impact-primary);
        text-decoration: none;
    }
/* ================= FILTER BAR ================= */

.impact-filter {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: minmax(140px, auto);
    align-items: center;
    gap: .75rem;
    background: #fff;
    padding: 1rem 1.25rem;
    border-radius: var(--impact-radius);
    box-shadow: var(--impact-shadow);
    margin-bottom: 1.5rem;
}

    /* Inputs & selects */
    .impact-filter input,
    .impact-filter select {
        height: 38px;
        padding: .45rem .6rem;
        font-size: .85rem;
        border: 1px solid var(--impact-border);
        border-radius: 6px;
        width: 100%;
    }

    /* Buttons */
    .impact-filter .btn-filter,
    .impact-filter .btn-clear {
        height: 38px;
        padding: 0 1rem;
        font-size: .85rem;
        font-weight: 600;
        border-radius: 6px;
        white-space: nowrap;
    }

    /* Filter button */
    .impact-filter .btn-filter {
        background: var(--impact-primary);
        color: #fff;
        border: none;
    }

    /* Clear button */
    .impact-filter .btn-clear {
        background: transparent;
        color: var(--impact-primary);
        border: 1px solid var(--impact-border);
        text-decoration: none;
    }

/* ================= RESPONSIVE ================= */

@media (max-width: 1200px) {
    .impact-filter {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .impact-filter {
        grid-template-columns: 1fr;
    }
}

/* ================= GRID TIGHTEN ================= */

@media (min-width: 992px) {
    .impact-list .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}
/* ================= PAGINATION ================= */

.impact-pagination .page-link {
    color: var(--impact-primary);
    border-radius: 6px;
}

.impact-pagination .page-item.active .page-link {
    background: var(--impact-primary);
    border-color: var(--impact-primary);
    color: #fff;
}
