/* --- Container --- */
.give-org-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    padding: 0;
    /* Removes default gaps so they split width perfectly */
}

/* --- Individual Card --- */
.give-org-item {
    position: relative;
    /* Flex-grow 1 makes them share available width equally */
    flex: 1; 
    /* Ensures they don't get too squashed before wrapping */
    min-width: 250px; 
    height: 875px; 
    overflow: hidden;
    font-family: inherit; /* Inherit your theme font */
}

/* --- Background Image --- */
.give-org-bg {
    position: absolute;
    inset: 0; /* Modern shorthand for top/left/right/bottom: 0 */
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

.give-org-item:hover .give-org-bg {
    transform: scale(1.1);
}

/* --- Overlay Gradient --- */
.give-org-overlay {
    position: absolute;
    inset: 0;
    /* 1. Base Gradient (Normal State) */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    z-index: 2;
    /* Remove transition on background here, it won't work */
}

/* 2. Create the Hover Gradient on a pseudo-element */
.give-org-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    /* The Hover Gradient */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, rgba(0,0,0,0.1) 100%);
    
    /* Start invisible */
    opacity: 0;
    z-index: -1; /* Keep it behind any text if the overlay has text inside, or match parent z-index logic */
    
    /* 3. Transition the Opacity */
    transition: opacity 0.3s ease;
}

/* 4. On Hover, make the pseudo-element visible */
.give-org-item:hover .give-org-overlay::after {
    opacity: 1;
}

/* --- Details Container --- */
.give-org-details {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
}

/* --- Title Styling (Updated) --- */
.give-org-title {
    font-size: 28px;
    font-weight: 600;
    line-height: 48px;
    color: #fff !important;
    margin: 0;
    /* No bottom margin needed because the desc-wrapper handles spacing */
}

/* --- Dynamic Height Animation (The Grid Trick) --- */
.give-org-desc-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s ease-out, margin-bottom 0.5s ease;
    margin-bottom: 0; /* No space when closed */
}

.give-org-item:hover .give-org-desc-wrapper {
    grid-template-rows: 1fr; /* Animate to full height of content */
    margin-bottom: 20px; /* Add space between text and button on open */
}

.give-org-desc-inner {
    overflow: hidden;
    color: #fff;
    font-size: 20px !important;
    line-height: 28px !important;
    opacity: 0;
	text-align: justify;
    transition: opacity 0.4s ease 0.1s; /* Slight delay so it fades in while opening */
}

.give-org-item:hover .give-org-desc-inner {
    opacity: 1;
}

/* --- Button Styling (Updated) --- */
.give-org-btn {
    display: inline-block;
    background-color: #007CAD; /* Blue */
    color: #ffffff !important; /* Force white text */
    
    font-size: 16px;
    font-weight: 500;
    line-height: 48px; /* Serves as height/vertical alignment */
    
    padding: 0 32px; /* Horizontal padding */
    border-radius: 10px;
    text-decoration: none;
    align-self: flex-start; /* Keeps button fitted to text width */
    transition: background-color 0.3s ease;
}

/* Hover State: Red Background */
.give-org-btn:hover {
    background-color: #004563;
    color: #fff !important;
}

/* --- Mobile Responsive Rules --- */

/* Tablet/Mobile Landscape: 2 items per row */
@media (max-width: 992px) {
    .give-org-item {
        flex: 0 0 50%; /* Force exactly 50% width */
        max-width: 50%;
    }
}

/* Small Mobile: 1 item per row (optional, usually better for UX) */
@media (max-width: 480px) {
    .give-org-item {
        flex: 0 0 100%;
        max-width: 100%;
        height: 500px; /* Slightly shorter on phone */
    }
    
    .give-org-title {
        font-size: 24px; /* Slightly smaller title on phone */
        line-height: 1.4;
    }
}