/* =============================================
   RESPONSIVE.CSS - COODU TRUST WEBSITE (FINAL)
   ============================================= */

/* =========== 1. LARGE TABLET / SMALL DESKTOP VIEW =========== */
/* Hides the full menu and shows the hamburger icon earlier due to more items */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }

    /* --- Hamburger Menu Activation --- */
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100px; /* Matches the new header height */
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        height: calc(100vh - 100px); /* Full height minus header */
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        gap: 0;
        align-items: stretch;
        overflow-y: auto; /* Allow scrolling if menu is long */
    }

    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        width: 100%;
    }

    .nav-link {
        display: block;
        padding: 18px;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.1rem;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .donate-link {
        background-color: transparent;
        color: var(--primary-green) !important;
        padding: 18px;
        border-radius: 0;
    }
    
    .donate-link:hover {
        background-color: var(--primary-green);
        color: var(--light-text) !important;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* --- Dropdown Menu Handling for Mobile --- */
    .dropdown .dropdown-menu {
        position: static; /* Remove absolute positioning */
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-top: 0;
        display: none; /* Hide by default, will be toggled by JS */
    }

    .dropdown-menu li a {
        background-color: var(--light-bg);
        padding-left: 40px; /* Indent dropdown items */
        font-size: 1rem;
        border-bottom: 1px solid #e0e0e0;
    }

    /* --- Nested Dropdown Mobile Handling --- */
    .dropdown-submenu-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        display: none; /* Hide by default, will be toggled by JS */
    }

    .dropdown-submenu > a::after {
        content: '▼';
        right: 20px;
    }

    .dropdown-submenu.open > a::after {
        content: '▲';
    }

    .dropdown-submenu-menu li a {
        background-color: #f0f0f0;
        padding-left: 60px; /* More indent for nested items */
        font-size: 0.9rem;
        border-bottom: 1px solid #e0e0e0;
        border-left: none;
    }

    .dropdown-submenu-menu li a:hover {
        background-color: var(--primary-green);
        color: var(--light-text);
    }
}


/* =========== 2. STANDARD TABLET VIEW =========== */
/* Applies to screens 992px wide or less */

@media (max-width: 992px) {
    :root {
        --section-padding: 60px 0;
    }

    .section-title {
        font-size: 2.5rem;
    }

    /* --- Homepage --- */
    .hero-title { font-size: 3.8rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .impact-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .programs-grid { grid-template-columns: 1fr; }
    .mission-grid { grid-template-columns: 1fr; gap: 40px; }
    .mission-content { text-align: center; }
    .mission-title { font-size: 3rem; }
    .stats-banner-container { flex-direction: column; gap: 30px; text-align: center; }
    .stats-intro { padding-right: 0; border-right: none; padding-bottom: 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.4); }
    .stats-grid { width: 100%; }

    /* --- About Us Page --- */
    .page-title { font-size: 3rem; }
    .timeline::after { left: 30px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 20px; text-align: left !important; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-dot { left: 20px; }
    .vision-mission-grid, .team-grid, .values-grid { grid-template-columns: repeat(2, 1fr); }

    /* --- Contact Us Page --- */
    .contact-grid { grid-template-columns: 1fr; gap: 40px; }

    /* --- Documents Page --- */
    .resources-layout { grid-template-columns: 1fr; }
    .resources-grid { grid-template-columns: repeat(2, 1fr); }
    
    /* --- Donate Page --- */
    .donation-layout { grid-template-columns: 1fr; }

    /* --- Media Page --- */
    .gallery-grid { column-count: 2; }

    /* --- General --- */
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .news-card { flex-direction: column; align-items: center; text-align: center; }
    .news-image { width: 100%; height: 250px; }
}


/* =========== 3. MOBILE VIEW =========== */
/* Applies to screens 768px wide or less */

@media (max-width: 768px) {
    :root {
        --section-padding: 50px 0;
    }
    
    body {
        font-size: 16px;
    }

    .section-title {
        font-size: 2.2rem;
    }
    
    .navbar {
        height: 80px;
    }
    
    .logo-img {
        height: 50px; /* Adjusted logo for mobile */
    }

    .logo-text {
        font-size: 1.4rem;
    }
    
    .nav-menu {
        top: 80px;
        height: calc(100vh - 80px);
    }

    /* --- Homepage --- */
    .hero-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .impact-grid { grid-template-columns: 1fr; }
    .mission-title { font-size: 2.5rem; }
    .stats-grid { grid-template-columns: 1fr; gap: 30px; }
    .stat-item { text-align: center; }
    
    /* --- About Us Page --- */
    .page-title { font-size: 2.5rem; }
    .vision-mission-grid { grid-template-columns: 1fr; }
    .values-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .team-photo { width: 120px; height: 120px; }

    /* --- Documents Page --- */
    .resources-grid { grid-template-columns: 1fr; }
    
    /* --- Donate Page --- */
    .donation-amounts { flex-wrap: wrap; }
    .amount-btn { flex-basis: calc(50% - 10px); }
    .donation-tabs { flex-wrap: wrap; }
    .tab-link { flex-basis: 100%; text-align: center; border-bottom: 2px solid var(--border-color); }
    .tab-link.active { border-bottom-color: var(--primary-green); }
    
    /* --- Media Page --- */
    .gallery-filter-bar { flex-direction: column; }
    .filter-btn { width: 100%; }
    .gallery-grid { column-count: 1; }
    
    /* --- Stats Banner --- */
    .stats-banner-container { 
        flex-direction: column; 
        text-align: center; 
        gap: 30px; 
    }
    .stats-intro { 
        flex-basis: auto; 
        padding-right: 0; 
        border-right: none; 
        border-bottom: 1px solid rgba(255, 255, 255, 0.4);
        padding-bottom: 20px;
    }
    .stats-grid { 
        flex-basis: auto; 
        grid-template-columns: repeat(2, 1fr); 
        gap: 25px 15px; 
    }
    .stat-number { font-size: 2rem; }
    .stat-label { font-size: 0.9rem; }

    /* --- General --- */
    .cta-container { flex-direction: column; }
    .cta-box h3 { font-size: 1.8rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-col { text-align: center; }
    .footer-about { margin: 0 auto; max-width: 350px; }
    .social-links { justify-content: center; }
}

/* =========== 3. EXTRA SMALL DEVICES (MOBILE < 480px) =========== */
@media (max-width: 480px) {
    /* --- Stats Banner Mobile --- */
    .stats-grid { 
        grid-template-columns: 1fr; 
        gap: 20px; 
        text-align: center;
    }
    .stat-number { 
        font-size: 1.8rem; 
        display: block;
        min-height: 50px;
        line-height: 1.3;
    }
    .stat-label { 
        font-size: 0.85rem; 
        display: block;
    }
    .stats-intro h4 { font-size: 1.5rem; }
}
