/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

/* --------------------------------------------------------------------------
   LARGE TABLETS & SMALL DESKTOPS (Max Width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    :root {
        --container-width: 960px;
        --section-padding: 80px 0;
    }

    h1 { font-size: clamp(2.5rem, 4vw, 3.5rem); }
    h2 { font-size: clamp(2rem, 3vw, 2.5rem); }

    .hero-title { font-size: 3.5rem; }
    
    .programs-grid { gap: 1.5rem; }
}

/* --------------------------------------------------------------------------
   TABLETS (Max Width: 992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    :root {
        --container-width: 100%;
    }

    /* --- NAVIGATION & HEADER --- */
    .hamburger { 
        display: block; 
        position: relative;
        z-index: 1001;
    }

    .header-actions .btn { 
        display: none; /* Hide donate button in header on mobile to save space */
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-white);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }
    
    .nav-links.nav-active { 
        right: 0; 
    }

    /* Force links to be dark when mobile menu is open */
    .nav-links a, 
    .site-header .nav-links a { 
        color: var(--text-dark) !important; 
        font-size: 1.5rem; 
        font-weight: 600;
    }

    /* --- GRIDS & LAYOUT --- */
    .grid-2-col, 
    .stats-grid, 
    .programs-grid, 
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    /* Modify specific grids for tablet viewing */
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* --- HERO SECTIONS --- */
    .hero-content { 
        text-align: center; 
        margin: 0 auto;
    }

    .hero-buttons { 
        justify-content: center; 
    }

    .floating-stat-card {
        display: none; /* Hide on smaller screens to prevent clutter */
    }

    /* --- PAGE SPECIFIC --- */
    .mission-image, 
    .story-image, 
    .contact-info, 
    .contact-form-wrapper {
        order: 0; /* Reset ordering if previously altered */
    }
}

/* --------------------------------------------------------------------------
   PHONES (Max Width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --section-padding: 60px 0;
    }

    h1 { font-size: clamp(2rem, 8vw, 2.8rem); }
    h2 { font-size: clamp(1.8rem, 6vw, 2.2rem); }

    /* --- HERO SECTIONS --- */
    .hero-title { font-size: 2.5rem; }
    .hero-text { font-size: 1.1rem; margin-bottom: 2rem; }
    .page-hero { height: 50vh; min-height: 350px; }

    .hero-buttons { 
        flex-direction: column; 
        width: 100%;
        gap: 1rem;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    /* --- GRIDS --- */
    .stats-grid { 
        grid-template-columns: 1fr; 
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    /* --- UI COMPONENTS --- */
    .cta-box {
        padding: 3rem 1.5rem;
    }

    .newsletter-form { 
        flex-direction: column; 
        gap: 1rem;
    }

    .newsletter-form .btn {
        width: 100%;
    }

    /* Contact & Volunteer Forms */
    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }

    /* Increase touch targets for mobile accessibility */
    .form-control {
        padding: 16px 20px;
        font-size: 16px; /* Prevents iOS auto-zoom on inputs */
    }

    .btn {
        padding: 16px 32px;
    }
}

/* --------------------------------------------------------------------------
   SMALL PHONES (Max Width: 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
    .preset-amounts {
        flex-direction: column;
        width: 100%;
    }

    .preset-amounts button,
    .preset-amounts input {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }

    .radio-group {
        flex-direction: column;
        width: 100%;
    }

    .radio-btn {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    /* Fix internal grid gaps on small screens */
    form .grid-2-col {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}