:root {
    --primary: #064232;
    --secondary: #568F87;
    --dark: #67C090;
    --light: #f8f9fa;
    --container-padding: 1rem;
    --section-spacing: 2rem;
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
}

/* Ensure all rows respect container width */
.row {
  margin-right: 0;
  margin-left: 0;
}

/* Fix for blog/article flex widths */
main {
  display: flex;
  flex-wrap: wrap;
}
.blog-container,
.article-section {
  flex: 1 1 100%;  /* Default: full width on small screens */
  max-width: 100%;
}
@media (min-width: 992px) {
  .blog-container { flex: 0 0 65%; max-width: 65%; }
  .article-section { flex: 0 0 30%; max-width: 30%; }
}

/* Stop images from overflowing */
img {
  max-width: 100%;
  height: auto;
}


* {
    font-family: Nunito, sans-serif;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

/* Improved responsive base */
body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* Mobile-first responsive improvements */
.gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary);
    z-index: 1;
}

.carousel-item .container {
    position: relative;
    z-index: 2;
}

/* Responsive about section */
.about {
    display: flex;
    flex-direction: column;
    gap: var(--section-spacing);
}

@media (min-width: 768px) {
    .about {
        flex-direction: row;
    }
}

.working-areas .list-group-item {
    background-color: #f8f9fa;
    border: none;
    padding: 10px 15px;
    margin-bottom: 5px;
    font-size: 1rem;
}

.card {
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background-color: var(--secondary);
}

.card:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link.active {
    font-weight: bold;
    color: #198754 !important;
}

.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    z-index: 99;
}

.navbar-nav .nav-link:hover {
    color: #198754;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Improved responsive main layout */
main {
    display: flex;
    flex-direction: column;
    gap: var(--section-spacing);
    padding: var(--container-padding);
    max-width: 1200px;
    margin: auto;
}

/* Responsive blog layout */
.blog-container {
    width: 100%;
    background: white;
    padding: var(--container-padding);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.article-section {
    width: 100%;
    background: white;
    padding: var(--container-padding);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    order: -1; /* Move sidebar above content on mobile */
}

@media (min-width: 992px) {
    main {
        flex-direction: row;
    }
    
    .blog-container {
        width: 65%;
    }
    
    .article-section {
        width: 32%;
        order: 0; /* Reset order for desktop */
    }
}

/* Blog post improvements */
.blog-post {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.blog-post img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    max-width: 100%;
}

.blog-post h2 {
    font-size: 1.5rem;
    margin: 0.5rem 0;
    line-height: 1.3;
}

.blog-post .date {
    color: #555;
    font-size: 0.9rem;
}

.blog-post a {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #198754;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Responsive banner */
.banner {
    text-align: center;
    margin: 1rem;
    padding: 2rem;
    color: white;
    background-size: cover;
    background-position: center;
}

@media (min-width: 768px) {
    .banner {
        padding: 4rem 2rem;
        margin: 2rem;
    }
}

.donate-hover:hover {
    color: #e5ff00;
}

/* Improved responsive typography */
h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

@media (min-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.75rem;
    }
}

/* Improved responsive navigation */
.navbar-dark .navbar-nav .nav-link {
    padding: 1rem 0;
    font-size: 1rem;
}

@media (max-width: 991.98px) {
    .navbar-dark .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding: 0.5rem 0;
    }
}

/* Project section improvements */
.project-header {
    background: #f7f9fa;
    padding: 2rem 0;
    text-align: center;
}

.project-image {
    max-height: 300px;
    object-fit: cover;
    width: 100%;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .project-header {
        padding: 4rem 0;
    }
    
    .project-image {
        max-height: 500px;
    }
}

.project-description {
    font-size: 1rem;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .project-description {
        font-size: 1.1rem;
    }
}

/* Service item improvements */
.service-item {
    position: relative;
    height: auto;
    min-height: 250px;
    padding: 1.5rem;
    transition: .5s;
}

@media (min-width: 768px) {
    .service-item {
        height: 300px;
        padding: 0 30px;
    }
}

/* Testimonial improvements */
.testimonial-carousel .owl-dots {
    margin-top: 1rem;
}

/* Team section improvements */
.team-item {
    margin-bottom: 2rem;
}

/* Footer improvements */
@media (max-width: 767.98px) {
    .footer-about {
        margin-bottom: 2rem;
    }
}

/* Utility classes for responsiveness */
.hidden-mobile {
    display: none;
}

.visible-mobile {
    display: block;
}

@media (min-width: 768px) {
    .hidden-mobile {
        display: block;
    }
    
    .visible-mobile {
        display: none;
    }
}

/* Improved spacing for mobile */
.mobile-spacing {
    padding: 1rem;
}

@media (min-width: 768px) {
    .mobile-spacing {
        padding: 2rem;
    }
}

/* Ensure images are always responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Improved button responsiveness */
.btn {
    white-space: nowrap;
    min-width: auto;
}

@media (max-width: 576px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-square,
    .btn-sm-square,
    .btn-lg-square {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Improved carousel for mobile */
@media (max-width: 576px) {
    .carousel-caption {
        padding: 1rem;
    }
    
    .carousel-caption h5 {
        font-size: 0.875rem;
    }
    
    .carousel-caption h1 {
        font-size: 1.5rem;
    }
}

/* Prevent horizontal scrolling */
body {
    overflow-x: hidden;
}