/* Etgarim Karmiel-Misgav — Community Website Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar but allow scroll */
body {
    overflow-x: hidden;
}

/* Scroll-triggered animations */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-right {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-left {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children animations */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }

/* Photo gallery infinite scroll */
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll {
    animation: scroll-left 30s linear infinite;
    width: max-content;
}

.animate-scroll:hover {
    animation-play-state: paused;
}

/* Parallax-like effect for hero */
#home {
    background-attachment: fixed;
}

/* Navbar scroll effect */
.navbar-scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

/* Team cards hover glow */
.team-card {
    position: relative;
    overflow: hidden;
}
.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height 0.3s ease;
}
.team-card:hover::before {
    height: 6px;
}

/* Story cards */
.story-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Form inputs focus glow */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* Button press effect */
button[type="submit"]:active {
    transform: scale(0.98);
}

/* Pulse animation for emojis */
@keyframes gentle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.animate-pulse {
    animation: gentle-pulse 2s ease-in-out infinite;
}

/* Counter animation */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
#mobile-menu.open {
    max-height: 400px;
    display: block;
}

/* Social icons hover */
footer a[aria-label] {
    transition: all 0.3s ease;
}

/* Active nav link indicator */
.nav-link.active {
    color: #F97316;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2rem !important; }

    .animate-scroll {
        animation-duration: 20s;
    }
}

/* Print styles */
@media print {
    nav, footer, #volunteer, .animate-scroll { display: none; }
    section { break-inside: avoid; }
}

/* ── Accessibility ─────────────────────────────────────── */

/* Visible focus indicator for all interactive elements */
:focus-visible {
    outline: 3px solid #F97316;
    outline-offset: 3px;
    border-radius: 4px;
}

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

    .animate-scroll {
        animation: none;
        /* Show all images statically instead of scrolling */
        flex-wrap: wrap;
    }

    .animate-bounce,
    .animate-pulse {
        animation: none;
    }

    .fade-up,
    .fade-right,
    .fade-left,
    .scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
