/**
 * Mosadiotsile Charitable Society - Layout Fix
 * Addresses specific layout issues with overlapping elements and backgrounds
 */

/* Remove problematic background colors */
.charity-section {
    background-color: #ffffff !important; /* Force white background */
}

/* Fix card overlapping by reducing hover transform and adding proper margins */
.impact-card,
.involvement-card,
.charity-about-image,
.contact-info-item {
    transform: none !important; /* Remove any transform that might cause overlap */
    margin-bottom: 30px; /* Add space between cards */
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    transition: box-shadow 0.3s ease; /* Only animate shadow, not position */
}

/* Gentler hover effect that doesn't cause overlap */
.impact-card:hover,
.involvement-card:hover,
.charity-about-image:hover,
.contact-info-item:hover {
    transform: none !important; /* Ensure no transform on hover */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15); /* Slightly stronger shadow on hover */
}

/* Fix the pink background sections */
.impact-card,
.involvement-card,
.donate-section,
.volunteer-section,
.partner-section,
.beneficiary-section,
.confidence-closet,
.youth-empowerment,
.nationwide-support {
    background-color: #ffffff !important; /* Force white background */
    padding: 20px; /* Ensure consistent padding */
    margin: 0 0 30px 0; /* Add bottom margin for spacing */
    border-radius: 8px; /* Rounded corners */
    overflow: hidden; /* Ensure content stays within borders */
    position: relative; /* For proper stacking */
    z-index: 1; /* Ensure proper z-index stacking */
}

/* Add proper spacing between sections */
.section-header {
    margin-bottom: 40px; /* More space after headers */
}

/* Create proper card container structure */
.impact-grid,
.involvement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Increased gap between cards */
    margin: 40px 0; /* Space above and below grid */
}

/* Fix the section titles and icons */
.impact-icon,
.involvement-icon {
    background-color: rgba(156, 48, 57, 0.1);
    color: #9C3039;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

/* Add subtle accent to cards instead of full background */
.impact-card::before,
.involvement-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #9C3039;
}

/* Fix specific section styling */
#volunteer-section,
#partner-section,
#donate-section,
#refer-section,
.confidence-closet-section,
.youth-empowerment-section,
.nationwide-support-section {
    padding: 30px 0;
    clear: both; /* Prevent floating issues */
    overflow: hidden; /* Contain floated children */
}

/* Add subtle separator between sections */
.charity-section + .charity-section {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Fix section content wrappers */
.volunteer-content,
.partner-content,
.donate-content,
.refer-content,
.impact-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Fix container width and padding */
.container {
    max-width: 1140px;
    padding: 0 15px;
    margin: 0 auto;
}

/* Increase section padding for better spacing */
.charity-section {
    padding: 60px 0;
}

/* Fix button styles */
.btn {
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: none;
    display: inline-block;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    margin: 5px;
}

.btn-primary {
    background-color: #9C3039;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #852b33;
    color: #ffffff;
}

.btn-tertiary {
    background-color: transparent;
    color: #9C3039;
    border: 2px solid #9C3039;
}

.btn-tertiary:hover {
    background-color: rgba(156, 48, 57, 0.1);
    color: #9C3039;
}

/* Fix button container */
.cta-buttons,
.involvement-card .btn {
    margin-top: 20px;
    display: inline-block;
}

/* Adjust vertical alignment of icons with text */
.involvement-card h3,
.impact-card h3 {
    display: block;
    margin: 15px 0;
    text-align: center;
    font-size: 1.25rem;
}

/* Fix padding in the involvement and impact cards */
.involvement-card,
.impact-card {
    padding: 25px 20px;
}

/* Fix icon sizes */
.involvement-icon i,
.impact-icon i {
    font-size: 1.5rem;
}

/* Make section cards consistent height */
.impact-card,
.involvement-card {
    height: calc(100% - 30px); /* Account for margin */
    display: flex;
    flex-direction: column;
}

.impact-card p,
.involvement-card p {
    flex-grow: 1; /* Let the paragraph take available space */
    margin-bottom: 20px;
}

/* Fix .section-header styling */
.section-header h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.section-header .divider {
    margin-bottom: 20px;
}

.section-header p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 30px;
}

/* Fix long-term vision section */
.long-term-vision {
    margin-bottom: 40px;
}

/* Remove any problematic animation effects */
.animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* Fix white space between sections */
@media (min-width: 768px) {
    .impact-grid,
    .involvement-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .impact-grid,
    .involvement-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .charity-section {
        padding: 40px 0;
    }
}