/* --- General Styles --- */
body {
    font-family: 'Heebo', sans-serif;
}

/* =========================================
   1. GLOBAL SETTINGS
   ========================================= */
html,
body {
    overflow-x: hidden;
    /* Prevents horizontal scrollbar */
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Pushes content down so it doesn't hide behind the fixed header. */
body {
    padding-top: 140px;
}

/* =========================================
   2. HEADER SECTION (Container)
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1020;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);

    /* Spacing Fixes */
    padding-top: 15px;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
}

/* =========================================
   3. TOP ROW (Logo & Donate Button)
   ========================================= */
.flex-align {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
}

.logo {
    height: 60px;
    width: auto;
}

.btn {
    font-size: 16px;
    font-weight: 700;
    border-radius: 20px;
    padding: 8px 20px;
}

.btn-dark {
    color: #fff;
    background-color: #343a40;
    border-color: #343a40;
}

/* =========================================
   4. NAVBAR STYLING
   ========================================= */
.header .navbar-default {
    background-color: #2b6cb0;
    border-color: #2a4365;
    border: none !important;
    margin-bottom: 0 !important;
    min-height: 50px;
    border-radius: 0 !important;
}

/* Link Styling */
.navbar-default .navbar-nav>li>a {
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    padding: 15px 20px;
    line-height: 20px;
}

/* Hover Effects */
.navbar-default .navbar-nav>li>a:hover,
.navbar-default .navbar-nav>li>a:focus,
.navbar-default .navbar-nav>.open>a,
.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus {
    color: #ffffff;
    background-color: #4299e1;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}

.dropdown-menu>li>a {
    font-weight: 500;
    color: #333;
    padding: 10px 20px;
}

/* Center Nav on Desktop */
@media (min-width: 768px) {
    .navbar-nav.center-nav {
        float: none;
        margin: 0 auto;
        display: inline-block;
    }

    .navbar-default .container {
        text-align: center;
    }
}

/* =========================================
   5. MOBILE RESPONSIVENESS (The Fix)
   ========================================= */
@media (max-width: 767px) {

    /* --- A. Fix Top Row (Logo & Donate on one line) --- */
    .flex-align {
        display: flex !important;
        flex-wrap: nowrap !important;
        /* Forces them side-by-side */
        justify-content: space-between !important;
        padding-bottom: 5px;
    }

    /* Resize columns to fit content */
    .header .col-xs-6 {
        width: auto !important;
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Make logo smaller */
    .logo {
        height: 40px !important;
    }

    /* Make button smaller */
    .btn {
        font-size: 13px !important;
        padding: 6px 12px !important;
        margin-top: 0;
    }

    /* --- B. Fix Navbar (Hamburger & Collapsing) --- */

    /* Make Hamburger Lines White */
    .navbar-default .navbar-toggle .icon-bar {
        background-color: #fff;
    }

    .navbar-default .navbar-toggle {
        border-color: transparent;
        margin-right: 0;
    }

    .navbar-default .navbar-toggle:hover,
    .navbar-default .navbar-toggle:focus {
        background-color: #4299e1;
    }

    /* Navbar alignment fixes */
    .navbar-header {
        text-align: right;
        /* Puts hamburger on the right */
    }

    /* Collapsed Menu Styling */
    .navbar-nav.center-nav {
        margin: 0;
        text-align: left;
        /* Align links to left in menu */
    }

    .navbar-default .navbar-nav .open .dropdown-menu>li>a {
        color: #fff;
        /* White text inside mobile dropdown */
        padding: 10px 25px;
    }

    /* Reduce body padding for smaller header */
    body {
        padding-top: 110px !important;
    }
}



/* --- What We Do Banner Section --- */

.what-we-do-banner {
    position: relative;
    /* Establishes a positioning context for the text box */
    background-image: url('whatdowedoimage2.png');
    /* Corrected image name */
    background-size: cover;
    background-position: center center;
    min-height: 550px;
    /* Ensures the banner has enough height */
    color: #ffffff;
    /* Sets default text color for the section */
}

/* This creates the gradient overlay */
.what-we-do-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* This gradient has a blue tint on the left and gets dark on the right */
    background: linear-gradient(to right, rgba(43, 108, 176, 0.4) 0%, rgba(0, 0, 0, 0.9) 70%);
}

/* This is the container for your text, positioned directly */
.banner-text-content {
    position: absolute;
    /* Positions the text relative to the banner */
    top: 50%;
    /* Aligns the top of the text box to the middle */
    right: 5%;
    /* Positions the text box 5% from the right edge */
    transform: translateY(-50%);
    /* Perfectly centers the text box vertically */
    z-index: 2;
    /* Ensures text is on top of the gradient */
    width: 40%;
    /* Limits the width of the text box */
    max-width: 500px;
    /* Sets a max width for very large screens */
    padding: 20px;
    text-align: left;
}

.banner-text-content h2 {
    font-size: 48px;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.banner-text-content h2 strong {
    font-weight: 800;
}

.banner-text-content p {
    font-size: 18px;
    color: #e2e8f0;
    margin-bottom: 30px;
}

/* Lighter Button Style for dark background */
.btn-outline-light {
    color: #ffffff;
    background-color: transparent;
    border: 2px solid #ffffff;
    font-weight: 700;
    padding: 12px 25px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    color: #2b6cb0;
    background-color: #ffffff;
}

/* Responsive adjustments for mobile */
@media (max-width: 767px) {
    .what-we-do-banner {
        min-height: 450px;
        display: flex;
        /* Use flexbox for centering on mobile */
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .what-we-do-banner::before {
        /* Make the gradient cover more of the screen on mobile for readability */
        background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 100%);
    }

    .banner-text-content {
        position: static;
        /* Revert to normal positioning on mobile */
        transform: none;
        width: 90%;
        padding: 20px 0;
        text-align: center;
    }
}

/* --- Section Styling --- */
#Our-Programmes {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

#Our-Programmes .section-heading {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2b6cb0;
    margin-bottom: 50px;
    text-align: left;
}

/* --- Programme Cards Grid --- */
.programmes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

/* --- COMMON Programme Card Styling --- */
.programme-card {
    position: relative;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: transform 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease;
    /* The general background-image property has been removed from here */
}

/* --- Individual Card Backgrounds --- */
/* This is where you can now edit each card's background image */
.programme-card-1 {
    background-image: url('education3.jpg');
}

.programme-card-2 {
    background-image: url('woman2.png');
}

.programme-card-3 {
    background-image: url('community6.jpg');
}

.programme-card-4 {
    background-image: url('sustainable1.jpg');
}

.programme-card-5 {
    background-image: url('volunteer1.png');
}

.programme-card-6 {
    background-image: url('community3.jpg');
}


/* Dark overlay for text readability */
.programme-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Gradient from bottom for better text visibility */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 10%, rgba(0, 0, 0, 0) 60%);
    z-index: 1;
    transition: background-color 0.4s ease;
}

/* Hover Effect: Remove grayscale, darken overlay, and scale up */
.programme-card:hover {
    filter: grayscale(0%);
    /* Remove grayscale on hover */
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.programme-card:hover::before {
    background-color: rgba(0, 0, 0, 0.6);
    /* Darker tint on hover */
}

/* Card Content (Text & Button) */
.card-content {
    position: relative;
    z-index: 2;
}



.programme-card h3 {
    margin: 0 0 8px 0;
    font-size: 2rem;
    font-weight: 600;
}

.programme-card p {
    margin: 0 0 25px 0;
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* --- Professional Button Style --- */
.card-button {
    display: inline-block;
    background-color: transparent;
    color: white;
    padding: 12px 24px;
    border: 2px solid white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    /* The button is now visible by default */
    opacity: 1;
    transform: translateY(0);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* This rule is no longer needed to show the button, but provides a nice lift effect on direct hover */
.card-button:hover {
    background-color: white;
    color: #2b6cb0;
    transform: translateY(-2px);
}

.card-button span {
    margin-right: 8px;
}

/* =========================================
   1. The Background Overlay
   ========================================= */
.modal {
    display: none;
    position: fixed;
    /* Stays in place when scrolling */
    z-index: 9999;
    /* Sits on top of everything */
    left: 0;
    top: 0;
    width: 100vw;
    /* Full screen width */
    height: 100vh;
    /* Full screen height */
    overflow: hidden;
    /* Hide scrollbars on the background */
    background-color: rgba(0, 0, 0, 0.7);
    /* Darker background */
    backdrop-filter: blur(5px);

    /* Center the box */
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex !important;
    /* Force flexbox when active */
}

/* =========================================
   2. The White Box (CRITICAL FIX HERE)
   ========================================= */
.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: auto;

    /* --- FORCE WIDTH --- */
    /* We use !important to override any other conflicting styles */
    width: 90% !important;
    max-width: 1100px !important;
    /* ------------------- */

    display: flex !important;
    flex-direction: column !important;
    max-height: 90vh;
    /* Don't go taller than screen */
    overflow: hidden;
    /* Keep content inside rounded corners */
}

/* =========================================
   3. The Layout (Left: Images, Right: Text)
   ========================================= */
.modal-body {
    display: flex !important;
    flex-direction: row !important;
    /* Side-by-side layout */
    padding: 0;
    /* Remove padding here, we add it to children */
    height: 100%;
    overflow: hidden;
    /* Prevent double scrollbars */
}

/* --- Left Column: Images --- */
.modal-images {
    flex: 1;
    /* Takes 40% of space */
    background-color: #f4f4f4;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    /* Allow images to scroll if needed */
}

.modal-images img {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* --- Right Column: Text --- */
.modal-text {
    flex: 1.5;
    padding: 40px;
    overflow-y: auto;
    text-align: left !important;
    /* CRITICAL FIX: Left align is much easier to read */
}

.modal-text h2 {
    margin-top: 0;
    color: #1a5c9e;
    /* Slightly darker blue for contrast */
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

.modal-text p {
    font-size: 1.15rem;
    /* Increased size (approx 18px) */
    line-height: 1.8;
    /* More space between lines */
    color: #222;
    /* Darker text (High Contrast) */
    margin-bottom: 20px;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
    letter-spacing: 0.3px;
    /* Slight spacing makes text airy */
}

/* =========================================
   4. Close Button
   ========================================= */
.close-button {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #333;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    line-height: 1;
    background: white;
    width: 40px;
    height: 40px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.close-button:hover {
    background: #f0f0f0;
    color: #d00;
}

/* =========================================
   5. Mobile Responsiveness
   ========================================= */
@media (max-width: 850px) {
    .modal-body {
        flex-direction: column !important;
        /* Stack vertically on tablets/phones */
    }

    .modal-content {
        width: 95% !important;
        max-height: 95vh;
    }

    .modal-images {
        flex-direction: row;
        overflow-x: auto;
        /* Horizontal scroll for images on mobile */
        padding: 15px;
        flex: none;
        /* Do not expand */
        height: auto;
    }

    .modal-images img {
        width: 150px;
        /* Small thumbnails on mobile */
        height: 120px;
        flex-shrink: 0;
    }

    .modal-text {
        padding: 20px;
    }
}



/* --- Steps Section General --- */
.steps-section {
    padding: 60px 0;
    background-color: #e6eff7;
    /* Slightly darker blue background */
    font-family: 'Heebo', sans-serif;
    overflow-x: hidden;
}

/* FLEXBOX FIX: This forces the columns to be equal height and allows vertical centering */
.steps-section .row {
    display: flex;
    flex-wrap: wrap;
    /* Allows stacking on mobile if needed */
}

.section-title {
    text-align: center;
    font-weight: 800;
    color: #2b6cb0;
    font-size: 36px;
    margin-bottom: 40px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Central Steps Styling --- */
.steps-container {
    padding: 0 15px;
    position: relative;
    z-index: 5;
}

.step-box {
    background: #ffffff;
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-left: 6px solid #2b6cb0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(43, 108, 176, 0.15);
}

.step-number {
    font-size: 28px;
    font-weight: 900;
    color: #2b6cb0;
    margin-right: 25px;
    min-width: 40px;
    text-align: center;
}

.step-content {
    font-size: 16px;
    color: #4a5568;
    line-height: 1.5;
    font-weight: 500;
}

/* --- Side Images (Vertically Centered & Overlapping) --- */
.side-images-col {
    /* REMOVED: padding-top: 60px; (This was pushing them down manually) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* CRITICAL: This centers the stack vertically */
    align-items: center;
    /* Centers images horizontally in the column */
    height: auto;
    /* Flexbox row makes this column full height automatically */
}

.photo-card {
    background: #fff;
    padding: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    width: 80%;
    max-width: 250px;
    transition: all 0.4s ease;
    position: relative;
}

/* Overlap Logic */
.photo-card+.photo-card {
    margin-top: -60px;
    /* Creates the overlapping stack effect */
}

/* Stacking Order */
.photo-card:nth-child(1) {
    z-index: 1;
}

.photo-card:nth-child(2) {
    z-index: 2;
}

.photo-card:nth-child(3) {
    z-index: 3;
}

/* Hover Effect */
.photo-card:hover {
    z-index: 50;
    transform: scale(1.1) rotate(0deg) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.photo-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

/* --- Rotation Effects --- */
.tilt-left {
    transform: rotate(-6deg);
}

.tilt-right {
    transform: rotate(6deg);
}

/* Specific adjustments for "messy stack" look */
.left-col .photo-card:nth-child(2) {
    margin-left: 30px;
}

.right-col .photo-card:nth-child(2) {
    margin-right: 30px;
}

/* --- Responsive Code --- */
@media (max-width: 991px) {
    .side-images-col {
        display: none;
        /* Hide images on mobile/tablet */
    }

    /* Disable Flexbox on mobile so columns stack normally */
    .steps-section .row {
        display: block;
    }
}




/* Responsive Hide for Mobile (Bootstrap handles this with hidden-sm hidden-xs, 
   but just in case you want custom breakpoints) */
@media (max-width: 991px) {
    .side-images-col {
        display: none;
        /* Hide images on tablets/mobile to focus on text */
    }
}



/* --- Site Footer Existing Styles --- */
.site-footer {
    background-color: #1A202C;
    color: #A0AEC0;
    padding-top: 60px;
    font-size: 15px;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 15px;
}

.footer-tagline {
    font-style: italic;
    margin-bottom: 25px;
}

.footer-contact-info p {
    margin-bottom: 10px;
}

.footer-contact-info a {
    color: #A0AEC0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-contact-info a:hover {
    color: #ffffff;
}

.footer-contact-info .glyphicon {
    margin-right: 10px;
    color: #4299e1;
}

.footer-social-icons {
    margin-top: 25px;
}

.footer-social-icons a img {
    height: 32px;
    width: 32px;
    margin-right: 15px;
    opacity: 0.8;
    transition: all 0.2s ease-in-out;
}

.footer-social-icons a:hover img {
    opacity: 1;
    transform: translateY(-2px);
}

.site-footer h4 {
    color: #ffffff;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #A0AEC0;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.developer-credit {
    text-align: right;
    font-style: italic;
    color: #A0AEC0;
}

/* Make the name clickable */
#dev-credit-link {
    color: #4299e1;
    /* Light Blue to show it is clickable */
    text-decoration: none;
    border-bottom: 1px dashed #4299e1;
    cursor: pointer;
}

#dev-credit-link:hover {
    color: #ffffff;
    border-bottom: 1px solid #ffffff;
}

.footer-bottom-bar {
    padding: 20px 0;
    margin-top: 40px;
    border-top: 1px solid #2D3748;
    text-align: center;
    font-size: 13px;
    color: #718096;
}

/* Responsive adjustments for mobile */
@media (max-width: 991px) {
    .site-footer {
        text-align: center;
    }

    .footer-logo {
        margin-left: auto;
        margin-right: auto;
    }

    .col-md-2,
    .col-md-3,
    .col-md-4 {
        margin-bottom: 40px;
    }

    .developer-credit {
        text-align: center;
    }
}

/* --- NEW: Modal Popup Styles --- */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent black */
    backdrop-filter: blur(2px);
    /* Slight blur effect */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    /* 15% from the top and centered */
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    /* Max width of the popup card */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideDown 0.3s ease-out;
    font-family: 'Heebo', sans-serif;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header (Blue part) */
.modal-header {
    background-color: #2b6cb0;
    /* Your theme blue */
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.close-modal {
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-modal:hover {
    color: #e2e8f0;
}

/* Body (White part) */
.modal-body {
    padding: 25px 20px;
    text-align: center;
    color: #333;
}

.modal-subtitle {
    color: #718096;
    font-weight: 500;
    margin-bottom: 20px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-contact-item {
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-contact-item a {
    color: #2b6cb0;
    text-decoration: none;
    font-weight: 600;
}

.modal-contact-item a:hover {
    text-decoration: underline;
}

.modal-contact-item .glyphicon {
    color: #4a5568;
}

/* Instagram Icon Area */
.modal-icon-area {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-insta-logo {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s;
}

.modal-insta-logo:hover {
    transform: scale(1.1);
}