/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-size: 1rem;
    word-wrap: break-word;
    hyphens: none;
}

/* Touch-friendly base styles */
button, a, input, textarea, select {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    outline: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Improve touch targets */
button, .btn, .nav-link, .contact-button {
    min-height: 44px;
    min-width: 44px;
    position: relative;
    overflow: hidden;
}

/* Loading states and transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth scrolling for older browsers */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* /* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    z-index: 1000;
    transition: all 0.3s ease;
    will-change: transform;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 48px; /* Ensures consistent height for alignment */
}

.nav-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0; /* Reset margins for consistent alignment */
    line-height: 1.5rem; /* Matches nav-link for vertical centering */
}

.nav-logo-link {
    text-decoration: none;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    margin: 0; /* Reset margins */
    padding: 0; /* Reset padding */
}

.nav-link {
    text-decoration: none;
    color: #1a1a1a;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    line-height: 1.5rem; /* Matches logo and donate button for vertical centering */
    padding: 8px 0; /* Adds vertical padding for alignment and clickable area */
}

.nav-link:hover {
    color: #2563eb;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-donate {
    background: #2563eb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-align: center;
    min-width: 100px;
    font-size: 0.9rem;
    flex-shrink: 0;
    line-height: 1.5rem; /* Matches nav-link for vertical centering */
}

.nav-donate:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: #1a1a1a;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}
/* Hero Section */
.hero {
    min-height: 100vh;
    background: url('Images/hero.jpg') center 20% / cover no-repeat;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4) 0%, rgba(118, 75, 162, 0.4) 100%);
}

.hero-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content {
    text-align: center;
    color: white;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-title-accent {
    display: block;
    color: #204dd5;
    margin-top: 0.5rem;
}

.hero-description {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.95;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: #2563eb;
    color: white;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #2563eb;
    transform: translateY(-3px);
}

.btn-donate {
    background: white;
    color: #2563eb;
    font-size: 1.2rem;
    padding: 18px 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.btn-donate:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.btn-icon {
    font-size: 1.2em;
}

/* About Section */
.about {
    padding: 120px 0;
    background: white;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 2rem;
    color: #1a1a1a;
}

.about-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #4b5563;
}

.about-text p {
    margin-bottom: 1.5rem;
}

.image-container {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.rebbe-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.image-container:hover .rebbe-image {
    transform: scale(1.05);
}

.image-caption {
    position: absolute;
    bottom: -30px;
    right: -30px;
    background: #2563eb;
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.3);
}

.caption-small {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.caption-large {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Programs Section */
.programs {
    padding: 120px 0;
    background: #f8fafc;
}

.programs-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-description {
    font-size: 1.3rem;
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.features {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.feature-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}

.feature-row.reverse .feature-image { order: 2; }
.feature-row.reverse .feature-content { order: 1; }

.feature-image .image-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.feature-photo {
    width: 100%;
    height: auto;
    display: block;
}

.feature-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.feature-text {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1.8;
}

.feature-content {
    max-width: 600px;
}

.feature-text + .feature-text {
    margin-top: 1rem;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.program-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.program-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: all 0.3s ease;
}

/* removed tefillin icon styling as icons were removed */

.torah-icon {
    background: rgba(37, 99, 235, 0.1);
}

.community-icon {
    background: rgba(16, 185, 129, 0.1);
}

.leadership-icon {
    background: rgba(139, 92, 246, 0.1);
}

.spiritual-icon {
    background: rgba(245, 101, 101, 0.1);
}

.program-card:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.card-description {
    color: #6b7280;
    line-height: 1.6;
}

/* Donate Section */
.donate-section {
    padding: 120px 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    text-align: center;
}

.donate-content {
    max-width: 800px;
    margin: 0 auto;
}

.white-text {
    color: white;
}

.donate-note {
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Newsletter Section */
.newsletter {
    padding: 120px 0;
    background: #ffffff;
}

.newsletter-header {
    text-align: center;
    margin-bottom: 4rem;
}

.newsletter-carousel {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-button:hover {
    background: #f8fafc;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.carousel-button.prev {
    left: 0;
}

.carousel-button.next {
    right: 0;
}

.newsletters-container {
    overflow: hidden;
    margin: 0 -10px;
    padding: 20px 10px;
}

.newsletters-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease;
}

.newsletter-item {
    min-width: 300px;
    max-width: 350px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.newsletter-info {
    text-align: center;
    width: 100%;
}

.newsletter-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.newsletter-date {
    color: #6b7280;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.pdf-preview {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    display: block;
    text-decoration: none;
    cursor: pointer;
    aspect-ratio: 3/4;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.newsletter-coming-soon {
    background: #f8fafc;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.coming-soon-content {
    color: #6b7280;
}

.coming-soon-content i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.coming-soon-content h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

.coming-soon-content p {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .newsletter-carousel {
        padding: 0 30px;
    }

    .newsletter-item {
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .newsletter-carousel {
        padding: 0 20px;
    }

    .newsletter-item {
        min-width: 200px;
    }

    .carousel-button {
        width: 30px;
        height: 30px;
    }
}

.newsletter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    padding: 15px 30px;
}

.newsletter-btn i {
    font-size: 1.2rem;
}

.pdf-preview {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.preview-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.preview-overlay i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.preview-overlay span {
    font-size: 1.1rem;
    font-weight: 600;
}

.pdf-preview:hover {
    transform: translateY(-10px);
}

.pdf-preview:hover .preview-overlay {
    opacity: 1;
}

.pdf-preview:hover .preview-image {
    transform: scale(1.05);
}

/* Mobile Responsiveness for Newsletter */
@media (max-width: 768px) {
    .newsletter-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .newsletter-info {
        text-align: center;
        margin: 0 auto;
        padding: 0 20px;
    }

    .newsletter-text {
        font-size: 1.1rem;
    }

    .newsletter-btn {
        width: 100%;
        justify-content: center;
        max-width: 320px;
    }

    .pdf-preview {
        margin: 0 20px;
    }
}

@media (max-width: 480px) {
    .newsletter {
        padding: 80px 0;
    }

    .newsletter-text {
        font-size: 1rem;
        padding: 0 10px;
    }

    .newsletter-btn {
        font-size: 1rem;
        padding: 12px 24px;
    }

    .pdf-preview {
        margin: 0 15px;
    }
}

/* Contact Section */
.contact {
    padding: 120px 0;
    background: #f9fafb;
}

.contact-header {
    text-align: center;
    margin-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

/* Contact split layout */
.contact-split {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.map-embed {
    position: relative;
    width: 100%;
    padding-top: 60%; /* 5:3 aspect */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.map-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.contact-details .detail + .detail {
    margin-top: 2rem;
}

.contact-link {
    color: #dbeafe;
    text-decoration: none;
}

.contact-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.contact-item {
    text-align: center;
}

.contact-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.contact-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.contact-info {
    color: #4b5563;
    line-height: 1.6;
}

/* Light-theme overrides inside contact */
.contact .white-text {
    color: #1a1a1a;
}

.contact .section-description.white-text {
    color: #4b5563;
}

.contact .contact-link {
    color: #2563eb;
}

.contact .contact-link:hover {
    color: #1d4ed8;
}

.contact-button {
    display: inline-block;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.contact-button:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

/* Footer */
.footer {
    padding: 2rem 0;
    background: #000;
    text-align: center;
}

.footer-text {
    color: #9ca3af;
}

/* Mobile-First Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .nav-container {
        padding: 0 20px;
    }
    
    .hero-container {
        padding: 0 20px;
    }
    
    .about-grid {
        gap: 3rem;
    }
    
    .feature-row {
        gap: 2.5rem;
    }
    
    .contact-split {
        gap: 2.5rem;
    }
}

@media (max-width: 768px) {
    @media (max-width: 768px) {
        /* Navigation */
        .nav-menu {
            position: fixed;
            left: -100%;
            top: 70px;
            flex-direction: column;
            background: rgba(255, 255, 255, 0.2);
            -webkit-backdrop-filter: blur(16px) saturate(140%);
            backdrop-filter: blur(16px) saturate(140%);
            width: 100%;
            text-align: center;
            transition: all 0.3s ease;
            box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
            padding: 2rem 0;
            z-index: 999;
            gap: 1rem;
        }
      
        .nav-menu.active {
            left: 0;
        }
      
        .nav-toggle {
            display: flex;
            padding: 8px;
            border-radius: 8px;
            transition: background 0.3s ease;
        }
      
        .nav-toggle:hover {
            background: rgba(0, 0, 0, 0.05);
        }
      
        .nav-toggle.active .bar:nth-child(2) {
            opacity: 0;
        }
      
        .nav-toggle.active .bar:nth-child(1) {
            transform: translateY(8px) rotate(45deg);
        }
      
        .nav-toggle.active .bar:nth-child(3) {
            transform: translateY(-8px) rotate(-45deg);
        }
      
        /* Navigation Links - always visible with white text */
        .nav-link {
            padding: 12px 20px;
            font-size: 1.1rem;
            display: block;
            border-radius: 8px;
            margin: 4px 20px;
            background: rgba(37, 99, 235, 0.6); /* optional subtle highlight */
            color: rgb(53, 26, 174); /* always visible */
            transition: background 0.3s ease, color 0.3s ease;
        }
      
        /* Donate Button - always visible like hovered */
        .nav-donate {
            margin: 8px 20px;
            padding: 10px 18px;
            font-size: 0.9rem;
            min-height: 48px;
            white-space: nowrap;
            text-align: center;
            width: auto;
            min-width: 90px;
            background: rgba(37, 99, 235, 0.6);
            color: white; /* text always visible */
            border-radius: 8px;
            transition: background 0.3s ease, color 0.3s ease;
        }
      }
      

    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding: 80px 0 40px;
    }
    
    .hero-title {
        margin-bottom: 1.2rem;
    }
    
    .hero-description {
        margin-bottom: 2.5rem;
        padding: 0 10px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0 20px;
    }

    .btn {
        width: 100%;
        max-width: 320px;
        padding: 16px 24px;
        font-size: 1.1rem;
        min-height: 56px;
        justify-content: center;
    }
    
    .btn-donate {
        font-size: 1.2rem;
        padding: 18px 32px;
        min-height: 60px;
    }

    /* About Section */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .about-text {
        font-size: 1.1rem;
        padding: 0 10px;
    }
    
    .image-container {
        margin: 0 10px;
    }

    /* Programs Section */
    .feature-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .feature-row.reverse .feature-image,
    .feature-row.reverse .feature-content {
        order: initial;
    }
    
    .feature-content {
        text-align: center;
        margin: 0 auto;
        padding: 0 20px;
    }
    
    .feature-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .feature-text {
        font-size: 1rem;
        line-height: 1.7;
    }
    
    .feature-image {
        padding: 0 20px;
    }

    /* Contact Section */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .map-embed {
        padding-top: 50%;
        margin: 0 20px;
    }
    
    .contact-details {
        padding: 0 20px;
    }
    
    .contact-button {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Reduce vertical spacing on sections for tablets/phones */
    .about { padding: 80px 0; }
    .programs { padding: 80px 0; }
    .contact { padding: 80px 0; }
    .donate-section { padding: 80px 0; }
}

@media (max-width: 480px) {
    /* Extra small phones */
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
        height: 65px;
    }
    
    .nav-logo h1 {
        font-size: 1.3rem;
    }
    
    .nav-menu {
        top: 65px;
        padding: 1.5rem 0;
    }
    
    .nav-link {
        padding: 10px 15px;
        font-size: 1rem;
        margin: 2px 15px;
    }
    
    .nav-container {
        padding: 0 15px;
        gap: 0.3rem;
    }
    
    .nav-menu {
        gap: 0.8rem;
    }
    
    .nav-donate {
        margin: 6px 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
        min-height: 44px;
        white-space: nowrap;
        text-align: center;
        width: auto;
        min-width: 80px;
    }

    /* Hero adjustments */
    .hero {
        padding: 70px 0 30px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: clamp(1rem, 2vw, 1.2rem);
        margin-bottom: 2rem;
        padding: 0 5px;
    }
    
    .hero-buttons {
        padding: 0 15px;
        gap: 0.8rem;
    }
    
    .btn {
        max-width: 280px;
        padding: 14px 20px;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .btn-donate {
        font-size: 1.1rem;
        padding: 16px 28px;
        min-height: 56px;
    }

    /* About section */
    .about-text {
        font-size: 1rem;
        padding: 0 5px;
    }
    
    .image-container {
        margin: 0 5px;
    }

    /* Programs section */
    .feature-content {
        padding: 0 15px;
    }
    
    .feature-title {
        font-size: 1.6rem;
    }
    
    .feature-text {
        font-size: 0.95rem;
    }
    
    .feature-image {
        padding: 0 15px;
    }

    /* Contact section */
    .map-embed {
        margin: 0 15px;
        padding-top: 45%;
    }
    
    .contact-details {
        padding: 0 15px;
    }
    
    .contact-button {
        padding: 10px 18px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    /* Section spacing */
    .about { padding: 60px 0; }
    .programs { padding: 60px 0; }
    .contact { padding: 60px 0; }
    .donate-section { padding: 60px 0; }
    
    /* Typography adjustments */
    .section-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
        margin-bottom: 1.5rem;
    }
    
    .section-description {
        font-size: 1.1rem;
        padding: 0 10px;
    }
}

/* Advanced Mobile Optimizations */
@media (max-width: 360px) {
    /* Very small phones */
    .container {
        padding: 0 12px;
    }
    
    .nav-container {
        padding: 0 12px;
        height: 60px;
    }
    
    .nav-logo h1 {
        font-size: 1.2rem;
    }
    
    .hero-title {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }
    
    .btn {
        max-width: 260px;
        padding: 12px 18px;
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: clamp(1.8rem, 4vw, 2.2rem);
    }
}

/* Landscape mobile optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 60px 0 20px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3rem);
        margin-bottom: 0.8rem;
    }
    
    .hero-description {
        font-size: clamp(0.9rem, 1.8vw, 1.1rem);
        margin-bottom: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    .btn {
        max-width: 200px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .navbar {
        border-bottom-width: 0.5px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: rgba(0, 0, 0, 0.2);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .navbar.scrolled {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .nav-logo h1,
    .nav-link {
        color: #ffffff;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-buttons,
    .btn {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .about,
    .programs,
    .contact {
        padding: 1rem 0;
    }
}

/* SVG Icons */
.carousel-button svg,
.preview-overlay svg,
.newsletter-btn svg {
    width: 24px;
    height: 24px;
    color: currentColor;
}

.preview-overlay svg {
    margin-right: 8px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.program-card {
    animation: fadeInUp 0.6s ease forwards;
}

.program-card:nth-child(1) { animation-delay: 0.1s; }
.program-card:nth-child(2) { animation-delay: 0.2s; }
.program-card:nth-child(3) { animation-delay: 0.3s; }
.program-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading state for donate button */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal (donation) styles previously injected by JS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    animation: modalFade 0.3s ease-out;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 95%;
    position: relative;
    margin: 20px;
    animation: modalSlide 0.3s ease-out;
}

/* PDF modal (inline reader) */
.pdf-modal-content {
    background: transparent;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    /* portrait-style modal: taller, constrained width to show one page at a time */
    max-width: 640px;
    width: 92%;
    max-height: 96vh; /* nearly full viewport height */
    position: relative;
    margin: 8px auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-items: center;
    /* do not add extra bottom padding - controls will overlay the canvas */
    padding-bottom: 0;
}

.pdf-modal-header {
    display: flex;
    justify-content: flex-end;
    /* take header out of document flow so it doesn't create a visible top "lip" */
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0;
    background: transparent;
    width: 100%;
    pointer-events: none; /* enable on hover via parent rules */
    z-index: 25;
}

.pdf-close-btn {
    /* overlay the canvas: transparent by default so the image edge is clean */
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.9);
    font-size: 26px;
    line-height: 1;
    z-index: 30;
    transition: background 180ms ease, transform 180ms ease, color 180ms ease;
}

/* PDF nav controls inside header */
.pdf-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    padding-left: 8px;
}

.pdf-nav-button {
    background: rgba(255,255,255,0.95);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.pdf-page-indicator {
    font-size: 0.95rem;
    color: #374151;
    background: rgba(255,255,255,0.92);
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
/* hide the page indicator - user requested only two arrows centered */
.pdf-page-indicator { display: none; }

/* Move nav to bottom center of the modal */
.pdf-nav {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(calc(-50% - 24px)); /* shift more to the left */
    /* start transparent so the canvas edge is clean; the pill background appears on hover */
    background: transparent;
    padding: 0;
    margin: 0; /* reset any auto margins from earlier rules so the group centers correctly */
    border-radius: 0;
    gap: 48px; /* spacing between the two arrows */
    justify-content: center;
    align-items: center;
    z-index: 20;
}

/* Reveal a subtle frosted pill behind the controls when hovering the modal */
.pdf-modal-content:hover .pdf-nav,
.pdf-modal-content:focus-within .pdf-nav {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: none;
}

.pdf-nav-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: #1f2937; /* dark chevrons per user request */
    background: transparent; /* transparent circle by default */
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 20px;
    transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.pdf-nav-button svg {
    color: inherit;
    width: 32px;
    height: 32px;
}

/* Slight hover feedback for each arrow (subtle translucent circle) */
.pdf-nav-button:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px) scale(1.03);
}

@media (max-width: 480px) {
    .pdf-modal-content { padding-bottom: 64px; }
    .pdf-nav { bottom: 12px; }
    .pdf-nav-button { width: 38px; height: 38px; }
}

/* Hide controls by default on pointer devices; reveal on hover/focus */
.pdf-nav,
.pdf-close-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    transform: translateY(6px);
}
.pdf-modal-content:hover .pdf-nav,
.pdf-modal-content:focus-within .pdf-nav,
.pdf-modal-content:hover .pdf-close-btn,
.pdf-modal-content:focus-within .pdf-close-btn,
.modal:hover .pdf-close-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* On touch devices (no hover), always show controls */
@media (hover: none) {
    .pdf-nav,
    .pdf-close-btn {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    /* show a subtle header on touch so the close button has space */
    .pdf-modal-header {
        background: rgba(255,255,255,0.04);
        padding: 8px;
    }
    /* ensure the arrows are visible on touch devices with the frosted pill */
    .pdf-nav {
        background: rgba(255,255,255,0.1);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        padding: 8px 16px;
        border-radius: 999px;
        box-shadow: none;
    }
}

/* Reveal header background/padding when hovering the modal */
.pdf-modal-content:hover .pdf-modal-header,
.pdf-modal-content:focus-within .pdf-modal-header {
    background: rgba(255,255,255,0.04);
    padding: 8px;
    pointer-events: auto;
}

.pdf-iframe {
    /* keep the iframe narrow and very tall so each PDF page displays like a physical page */
    width: 100%;
    max-width: 640px;
    height: calc(96vh - 56px); /* header + small gap accounted for */
    border: 0;
    display: block;
    background: white;
}

/* PDF.js canvas container */
.pdf-canvas-container {
    width: 100%;
    max-width: 640px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.pdf-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

/* Mobile: use almost full viewport but keep portrait impression */
@media (max-width: 600px) {
    .pdf-modal-content {
        width: 96%;
        max-width: 96vw;
        max-height: 96vh;
    }
    .pdf-iframe {
        height: calc(92vh - 56px);
    }
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.donation-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px 0;
    padding: 18px 20px;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 16px;
    min-height: 56px;
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.donation-link:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.donation-link img { height: 24px; width: auto; filter: brightness(0) invert(1); }
.cashapp { background: linear-gradient(135deg, #00D632, #00B82A); }
.cashapp:hover { background: linear-gradient(135deg, #00B82A, #009620); }
.zelle { background: linear-gradient(135deg, #6C1EB5, #5A1A9A); }
.zelle:hover { background: linear-gradient(135deg, #5A1A9A, #481580); }
.venmo { background: linear-gradient(135deg, #3D95CE, #2E7BB8); }
.venmo:hover { background: linear-gradient(135deg, #2E7BB8, #1F63A2); }
.paypal { background: linear-gradient(135deg, #0070BA, #005EA6); }
.paypal:hover { background: linear-gradient(135deg, #005EA6, #004A92); }

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-btn:hover { color: #1f2937; transform: rotate(90deg); }

/* Ripple effect (previously injected) */
.btn { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,0.3); transform: scale(0); animation: ripple-animation 0.6s linear; pointer-events: none; }
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }

/* Program card JS-controlled initial state - use classes rather than inline styles */
.program-card.hidden { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease, transform 0.6s ease; }
.program-card.visible { opacity: 1; transform: translateY(0); }

