/* ================================
   Responsive Design
   Mobile First Approach
   ================================ */

/* Tablet (768px and below) */
@media (max-width: 768px) {

    /* Typography Adjustments */
    html {
        font-size: 14px;
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }

    /* Container */
    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Navigation */
    .nav {
        position: relative;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        gap: 0;
        box-shadow: var(--shadow-lg);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-link {
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--light-gray);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Hero Section */
    .hero {
        min-height: 500px;
        padding: var(--spacing-xl) 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

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

    /* Section Spacing */
    .section {
        padding: var(--spacing-xl) 0;
    }

    /* Vision Features */
    .vision-features {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Gallery Grid */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .gallery-item {
        aspect-ratio: 16 / 10;
    }

    .gallery-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
    }

    /* Donation Tiers */
    .donation-tiers {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .tier {
        padding: var(--spacing-md);
    }

    /* Donation Form */
    .donation-form-container {
        padding: var(--spacing-md);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Zeffy Integration */
    .zeffy-container iframe {
        min-height: 800px !important;
    }

    .zeffy-button {
        min-width: 100% !important;
        font-size: 1.1rem !important;
    }

    .zeffy-button-wrapper {
        padding: var(--spacing-md);
    }

    /* Donors Grid */
    .donors-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {

    /* Typography */
    html {
        font-size: 13px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.35rem; }

    /* Spacing */
    :root {
        --spacing-xs: 0.4rem;
        --spacing-sm: 0.8rem;
        --spacing-md: 1.2rem;
        --spacing-lg: 1.6rem;
        --spacing-xl: 2.4rem;
        --spacing-xxl: 3.2rem;
    }

    /* Hero */
    .hero {
        min-height: 400px;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .scroll-indicator {
        display: none;
    }

    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.95rem;
    }

    /* Vision Text */
    .vision-text p {
        text-align: right;
    }

    /* Feature Cards */
    .feature {
        padding: var(--spacing-md);
    }

    .feature-icon {
        font-size: 2.5rem;
    }

    /* Tier Cards */
    .tier-price {
        font-size: 2rem;
    }

    .tier-benefits {
        font-size: 0.9rem;
    }

    /* Form Elements */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Donation Form */
    .donation-form-container {
        padding: var(--spacing-sm);
        margin: 0 calc(-1 * var(--spacing-sm));
        border-radius: 0;
    }

    /* Donor Cards */
    .donor-card {
        padding: var(--spacing-md);
    }

    .donor-icon {
        font-size: 2rem;
    }
}

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    :root {
        --container-max-width: 1400px;
    }

    html {
        font-size: 18px;
    }

    .hero {
        min-height: 700px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .donation-tiers {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }

    .hero-content {
        padding: var(--spacing-md) 0;
    }

    .scroll-indicator {
        display: none;
    }
}

/* Print Styles */
@media print {
    .header,
    .hero-buttons,
    .scroll-indicator,
    .donate,
    .footer {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: var(--spacing-md) 0;
        background: var(--white);
        color: var(--black);
    }

    .section {
        padding: var(--spacing-md) 0;
        page-break-inside: avoid;
    }

    a {
        text-decoration: underline;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1E4159;
        --secondary-color: #B8894E;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .tier {
        border: 2px solid var(--primary-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Optional: Add dark mode styles if desired */
    /* For a religious website, you may want to keep it light */
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for touch devices */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        padding: var(--spacing-md);
    }

    /* Remove hover effects on touch devices */
    .feature:hover,
    .tier:hover,
    .donor-card:hover,
    .gallery-item:hover img {
        transform: none;
    }

    .gallery-overlay {
        transform: translateY(0);
    }
}

/* Very Small Devices (320px) */
@media (max-width: 320px) {
    html {
        font-size: 12px;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .donation-tiers,
    .gallery-grid,
    .donors-grid {
        gap: var(--spacing-sm);
    }
}
