/* --- Global Resets & Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
}

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

body {
    font-family: 'Open Sans', sans-serif; /* A popular, readable font. Consider importing from Google Fonts. */
    line-height: 1.6;
    color: #333; /* Dark grey for text for good readability */
    background: #f4f4f4; /* Light grey background for the entire page */
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

.container {
    width: 90%;
    max-width: 1200px; /* Limits the max width of content for large screens */
    margin: auto; /* Centers the container */
    padding: 20px 0; /* Add some vertical padding to content */
}

a {
    color: #007bff; /* A standard blue for links */
    text-decoration: none; /* Removes underline from links */
    transition: color 0.3s ease; /* Smooth transition for link color changes */
}

a:hover {
    color: #0056b3; /* Darker blue on hover */
    text-decoration: underline; /* Adds underline on hover for user feedback */
}

ul {
    list-style: none; /* Removes bullet points from lists */
}

/* --- Utility Classes --- */
.text-center {
    text-align: center;
}

.bold-text {
    font-weight: bold;
    color: #2c3e50; /* A stronger color for emphasis */
}

.small-text {
    font-size: 0.9em;
    color: #666;
}

.intro-paragraph {
    font-size: 1.15rem;
    max-width: 800px;
    margin: 0 auto 50px auto;
    line-height: 1.8;
    color: #555;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.btn-primary {
    background: #1abc9c; /* Teal */
    color: #fff;
    border: 2px solid #1abc9c;
}

.btn-primary:hover {
    background: #16a085; /* Darker teal on hover */
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #3498db; /* Blue */
    color: #fff;
    border: 2px solid #3498db;
}

.btn-secondary:hover {
    background: #2980b9; /* Darker blue on hover */
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}

.btn-small {
    padding: 8px 18px;
    font-size: 0.95rem;
}

/* --- Section Headings --- */
section {
    padding: 80px 0; /* Standard padding for all sections */
    text-align: center;
}

section:nth-child(odd) {
    background: #fff;
}

section:nth-child(even) {
    background: #f9f9f9;
}

section h3 {
    font-size: 2.8rem;
    margin-bottom: 40px;
    color: #2c3e50; /* Dark header color */
    position: relative;
    display: inline-block; /* Allows underline to fit content */
}

section h3::after {
    content: '';
    display: block;
    width: 70px;
    height: 5px;
    background: #1abc9c;
    margin: 15px auto 0;
    border-radius: 3px;
    transform: scaleX(0); /* Start hidden */
    transition: transform 0.4s ease-out; /* Animation for underline */
}

section h3:hover::after {
    transform: scaleX(1); /* Expand on hover */
}


/* --- Header Styles --- */
header {
    background: #2c3e50; /* Dark blue/grey background, common for headers */
    color: #fff; /* White text for contrast */
    padding: 1rem 0;
    position: sticky; /* Makes the header stick to the top when scrolling */
    top: 0;
    z-index: 1000; /* Ensures header is on top of other content */
    box-shadow: 0 2px 8px rgba(0,0,0,0.2); /* Subtle shadow for depth */
}

header .container {
    display: flex;
    justify-content: space-between; /* Puts logo on left, nav on right */
    align-items: center; /* Vertically aligns items */
    padding: 0 20px; /* Adjust padding for header specifically */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 55px; /* Adjust as needed for your logo size */
    margin-right: 12px;
	border-radius: 20%;
}

.logo h1 {
    font-size: 2rem;
    color: #fff;
    margin: 0;
}

.logo a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* --- Desktop Navigation Menu (Default State) --- */
/* These styles apply to your <nav> element when the screen is large enough */
nav ul {
    display: flex; /* Arranges nav items horizontally */
    list-style: none; /* Remove bullet points */
    margin: 0;
    padding: 0;
}

nav ul li {
    margin-left: 25px; /* Spacing between nav items */
}

nav ul li a {
    color: #fff; /* White links */
    font-weight: 500;
    padding: 8px 0;
    position: relative; /* For the underline effect */
    transition: color 0.3s ease;
    text-decoration: none; /* Ensure no default underline */
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: #1abc9c; /* Underline color */
    left: 0;
    bottom: 0;
    transition: width 0.3s ease-out;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover,
nav ul li a.active {
    color: #1abc9c; /* A vibrant teal color for hover/active state */
}


/* --- Mobile Menu Toggle (Hamburger Icon) --- */
.menu-toggle {
    display: none; /* Hidden by default on desktop. Media query will show it. */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* Ensure it's above the menu when open */
    position: relative; /* If you want to move it around */
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background: #fff; /* White bars (assuming dark header) */
    margin: 6px 0; /* Space between bars */
    transition: 0.3s; /* Smooth animation */
    border-radius: 2px;
}

/* Hamburger to X animation */
.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-7px, 6px); /* Adjust translate based on bar thickness/spacing */
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0; /* Middle bar fades out */
}

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


/* --- Media Queries for Responsive Behavior --- */

/* Breakpoint for Mobile/Tablet Screens (Example: max-width of 768px) */
@media (max-width: 768px) {
    /* Show the hamburger menu toggle */
    .menu-toggle {
        display: block; /* Show hamburger on smaller screens */
    }

    /* Styles for the Navigation Menu when it's acting as a mobile menu */
    header nav { /* Target the <nav> element directly as JS toggles 'active' on it */
        position: fixed; /* Fix the menu to the viewport */
        top: 0; /* Position from the top of the viewport */
        right: 0; /* Slide in from the right */
        width: 70%; /* Adjust width as needed, e.g., 70% of screen */
        max-width: 300px; /* Optional: max width for larger tablets */
        height: 100vh; /* Full viewport height */
        background-color: #111; /* Dark background for mobile menu */
        padding-top: 80px; /* Space from top for header/logo */
        box-shadow: -2px 0 10px rgba(0,0,0,0.5); /* Subtle shadow */
        z-index: 1000; /* Below the toggle, above content */

        /* Initial hidden state: Slide completely off-screen to the right */
        transform: translateX(100%);
        transition: transform 0.4s ease-out; /* Smooth slide animation */

        /* Layout for menu items inside the mobile nav */
        display: flex;
        flex-direction: column; /* Stack items vertically */
        align-items: center; /* Center items horizontally */
        justify-content: flex-start; /* Start items from the top */
        overflow-y: auto; /* Enable scrolling if menu items exceed height */
    }

    /* Style the <ul> inside the mobile <nav> */
    header nav ul {
        flex-direction: column; /* Ensure vertical stacking for links */
        width: 100%; /* Take full width of the mobile menu panel */
        text-align: center; /* Center the text */
        padding: 0;
    }

    header nav ul li {
        margin: 20px 0; /* More vertical spacing for mobile links */
    }

    header nav ul li a {
        font-size: 1.5em; /* Larger font size for mobile readability */
        color: #fff; /* Ensure links are white on the dark background */
        /* Remove underline from pseudo-element on mobile if you don't want it */
        &::after {
            display: none; /* Hide the underline on mobile for cleaner look */
        }
    }

    /* When the menu is active, slide it into view */
    header nav.active {
        transform: translateX(0); /* Slide fully into view */
    }
}

/* Breakpoint for Desktop Screens (Example: min-width of 769px) */
@media (min-width: 769px) {
    /* Hide the hamburger menu toggle on desktop */
    .menu-toggle {
        display: none;
    }

    /* Ensure the navigation is visible and correctly styled for desktop */
    header nav {
        position: static; /* Remove fixed positioning */
        background-color: transparent; /* No overlay background */
        width: auto; /* Revert width */
        height: auto; /* Revert height */
        box-shadow: none; /* Remove shadow */
        transform: none; /* Remove any transformations */
        padding: 0; /* Remove mobile padding */
        display: block; /* Or flex, depending on your header's flex setup */
        /* Ensure that the 'active' class on <nav> from mobile state doesn't interfere */
        /* You might want to remove the 'active' class via JS on resize for safety */
    }

    header nav ul {
        flex-direction: row; /* Ensure horizontal layout for desktop */
        align-items: center; /* Vertically align items if using flex on parent */
    }

    header nav ul li a {
        font-size: 1em; /* Revert font size to desktop size */
        color: #fff; /* Revert link color if it changed for mobile */
        /* Re-enable the underline for desktop if it was disabled for mobile */
        &::after {
            display: block; /* Show the underline on desktop */
        }
    }
}

/* --- Page Hero Sections (General) --- */
#page-hero {
    background-size: cover;
    background-position: center;
    color: #fff;
    text-align: center;
    padding: 120px 20px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 -5px 15px rgba(0,0,0,0.3);
}

#page-hero::before { /* Overlay for better text readability */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
    z-index: 1;
}

#page-hero .container {
    position: relative;
    z-index: 2;
    padding: 0; /* Remove container padding here */
}

#page-hero h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.7);
    animation: fadeInDown 1s ease-out; /* Animation */
}

#page-hero p {
    font-size: 1.4rem;
    margin-bottom: 0;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
    animation: fadeInUp 1s ease-out 0.3s backwards; /* Animation with delay */
}

/* Specific Page Hero Backgrounds */
/* Common styles for all Hero Sections */
/* These styles apply to the container itself and its content */
.hero-section {
    position: relative; /* Crucial: Establishes a positioning context for ::before and ::after */
    overflow: hidden; /* Hides any blur overflow that goes beyond the element's bounds */
    display: flex; /* Makes content inside flexible for centering */
    flex-direction: column; /* Stacks content vertically */
    align-items: center; /* Horizontally centers content (if column) */
    justify-content: center; /* Vertically centers content */
    text-align: center; /* Ensures text itself is centered */
    color: #fff; /* Default text color for hero content */
    z-index: 1; /* Ensures text content appears above the blurred background and overlay */
    padding: 100px 20px; /* Default padding for all hero sections */
    min-height: 450px; /* Default minimum height for all hero sections */
}

/* Pseudo-element for the blurred background image */
/* This element holds the background image and the blur filter */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat; /* Prevents the image from repeating */
    background-size: cover;      /* Ensures the image covers the entire area */
    background-position: center center; /* Centers the image */
    /* filter: blur(1px); Applies the blur effect to the background image only */
    transform: scale(1.02); /* Slightly scales up to hide blurry edges that appear from the blur filter */
    z-index: -1; /* Puts this layer behind everything else */
}

/* Pseudo-element for the semi-transparent overlay */
/* This goes between the blurred background and the text for better readability */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Semi-transparent black overlay */
    z-index: -1; /* Puts this layer between the blurred background (-2) and the content (1) */
}

/* Specific Hero Backgrounds - The background-image property now applies to the ::before pseudo-element */

#hero {
    /* Specific overrides for homepage hero, if any (e.g., more padding or height) */
    padding: 150px 20px; /* Adjust padding for home hero if needed */
    min-height: 500px;
	
}
/* Homepage Hero Content Animations */
.hero-title,
.hero-subtitle,
.hero-description, /* <-- ADD THIS CLASS HERE */
.hero-btn {
    opacity: 0; /* Initially hidden */
    animation: fadeInUp 1s ease-out forwards; /* Example animation */
}

/* Add delays for a staggered effect */
.hero-title {
    animation-delay: 0.5s;
}

.hero-subtitle {
    animation-delay: 0.8s;
	color: white;
}

.hero-description { /* <-- ADD THIS NEW DELAY RULE */
    animation-delay: 1.1s;
}

.hero-btn {
    animation-delay: 1.4s; /* Adjusted delay to follow the description */
}

/* Ensure you have the fadeInUp keyframes defined if not already */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
#hero::before {
    background-image: url('images/heroes/hero-index.jpg');
		background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
}

.about-hero::before {
    background-image: url('images/heroes/hero-about.jpg');
		background-repeat: no-repeat;
	background-size: cover;
}

.services-hero::before {
    background-image: url('images/heroes/hero-services.jpg');
		background-repeat: no-repeat;
	background-size: cover;
}

.gallery-hero::before {
    background-image: url('images/heroes/hero-gallery.jpg');
		background-repeat: no-repeat;
	background-size: cover;
}

.events-hero::before {
    background-image: url('images/heroes/hero-events.jpg');
		background-repeat: no-repeat;
	background-size: cover;
}

.sermons-hero::before {
    background-image: url('images/heroes/hero-sermons.jpg');
		background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
}

.joinus-hero::before {
    background-image: url('images/heroes/hero-joinus.jpg');
		background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
}

.donations-hero::before {
    background-image: url('images/heroes/hero-donations.png');
		background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
}

.contact-hero::before {
    background-image: url('images/heroes/hero-contact.jpg');
	background-repeat: no-repeat;
	background-size: cover;
}

/* --- Homepage Specific Sections --- */
#hero .hero-content h2 {
    font-size: 4rem; /* Larger for home page */
}
#hero .hero-content h3 {
    font-size: 2rem;
    margin-bottom: 25px;
}
#hero .hero-content p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 40px;
}

/* Our Mission Section (from index.html) */
.mission-points {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.mission-item {
    flex: 1;
    min-width: 280px;
    max-width: 350px;
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    animation: fadeInUp 0.8s ease-out forwards; /* Animation */
    opacity: 0; /* Start hidden */
}
.mission-item:nth-child(1) { animation-delay: 0.1s; }
.mission-item:nth-child(2) { animation-delay: 0.2s; }
.mission-item:nth-child(3) { animation-delay: 0.3s; }

.mission-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.mission-item h4 {
    font-size: 1.6rem;
    color: #3498db;
    margin-bottom: 15px;
}

/* Latest Events Section (from index.html) */
.event-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.event-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    width: 100%;
    max-width: 380px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards; /* Animation */
    opacity: 0; /* Start hidden */
}
.event-card:nth-child(1) { animation-delay: 0.1s; }
.event-card:nth-child(2) { animation-delay: 0.2s; }
.event-card:nth-child(3) { animation-delay: 0.3s; }

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.event-card img {
    width: 100%;
    height: 220px; /* Fixed height for event images */
    object-fit: cover;
}

.event-card h4 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 18px 18px 10px;
}

.event-card p {
    font-size: 1rem;
    color: #666;
    margin: 0 18px 20px;
}

.event-card .btn {
    display: block;
    margin: 0 18px 18px;
}

.view-all-events {
    margin-top: 50px;
}

/* Quick Links Section (from index.html) */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.quick-link-item {
    background: #fdfdfd;
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    animation: zoomIn 0.6s ease-out forwards; /* Animation */
    opacity: 0;
}
.quick-link-item:nth-child(1) { animation-delay: 0.1s; }
.quick-link-item:nth-child(2) { animation-delay: 0.15s; }
.quick-link-item:nth-child(3) { animation-delay: 0.2s; }
.quick-link-item:nth-child(4) { animation-delay: 0.25s; }
.quick-link-item:nth-child(5) { animation-delay: 0.3s; }
.quick-link-item:nth-child(6) { animation-delay: 0.35s; }

.quick-link-item:hover {
    background: #ecf0f1;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

.quick-link-item img {
    width: 70px; /* Size for quick link icons */
    height: 70px;
    margin-bottom: 15px;
    object-fit: contain;
}

.quick-link-item h4 {
    font-size: 1.25rem;
    color: #2c3e50;
    margin: 0;
}


/* --- About Page Specific Sections --- */
#our-story .content-wrapper {
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
    margin-top: 50px;
}

#our-story .content-wrapper .text-content {
    flex: 2; /* Text takes more space */
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

#our-story .content-wrapper .image-content {
    flex: 1; /* Image takes less space */
    min-width: 300px;
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

#our-story .content-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#our-story p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

#mission-vision-values .m-v-v-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#mission-vision-values .m-v-v-item {
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#mission-vision-values .m-v-v-item:nth-child(1) { animation-delay: 0.1s; }
#mission-vision-values .m-v-v-item:nth-child(2) { animation-delay: 0.2s; }
#mission-vision-values .m-v-v-item:nth-child(3) { animation-delay: 0.3s; }


#mission-vision-values .m-v-v-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#mission-vision-values .m-v-v-item h4 {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 18px;
    position: relative;
}

#mission-vision-values .m-v-v-item h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px;
    width: 50px;
    height: 3px;
    background-color: #1abc9c;
    border-radius: 2px;
}

#mission-vision-values .m-v-v-item p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #555;
}

#mission-vision-values .m-v-v-item ul {
    margin-top: 15px;
    padding-left: 20px;
    list-style: disc; /* Use discs for list items */
    color: #555;
}

#mission-vision-values .m-v-v-item ul li {
    margin-bottom: 10px;
    font-size: 1.05rem;
}

#meet-the-team .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#meet-the-team .team-member {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#meet-the-team .team-member:nth-child(1) { animation-delay: 0.1s; }
#meet-the-team .team-member:nth-child(2) { animation-delay: 0.2s; }
#meet-the-team .team-member:nth-child(3) { animation-delay: 0.3s; }
#meet-the-team .team-member:nth-child(4) { animation-delay: 0.4s; }


#meet-the-team .team-member:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#meet-the-team .team-member img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid #1abc9c;
    box-shadow: 0 0 0 5px rgba(26, 188, 156, 0.3); /* Subtle glow */
}

#meet-the-team .team-member h4 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

#meet-the-team .team-member p:nth-of-type(1) {
    font-style: italic;
    color: #3498db;
    margin-bottom: 15px;
}

#meet-the-team .team-member p:nth-of-type(2) {
    font-size: 0.95rem;
    color: #666;
}

.call-to-action-join {
    margin-top: 60px;
}

.call-to-action-join p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: #555;
}

/* --- Services Page Specific Sections --- */
#service-overview .services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#service-overview .service-item {
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#service-overview .service-item:nth-child(1) { animation-delay: 0.1s; }
#service-overview .service-item:nth-child(2) { animation-delay: 0.2s; }
#service-overview .service-item:nth-child(3) { animation-delay: 0.3s; }
#service-overview .service-item:nth-child(4) { animation-delay: 0.4s; }
#service-overview .service-item:nth-child(5) { animation-delay: 0.5s; }
#service-overview .service-item:nth-child(6) { animation-delay: 0.6s; }


#service-overview .service-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#service-overview .service-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    object-fit: contain;
}

#service-overview .service-item h4 {
    font-size: 1.7rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

#service-overview .service-item p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.7;
}

#how-we-serve .serve-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#how-we-serve .serve-item {
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: zoomIn 0.7s ease-out forwards;
    opacity: 0;
}
#how-we-serve .serve-item:nth-child(1) { animation-delay: 0.1s; }
#how-we-serve .serve-item:nth-child(2) { animation-delay: 0.2s; }
#how-we-serve .serve-item:nth-child(3) { animation-delay: 0.3s; }


#how-we-serve .serve-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#how-we-serve .serve-item h4 {
    font-size: 1.8rem;
    color: #3498db;
    margin-bottom: 15px;
}

#how-we-serve .serve-item p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.7;
}

#get-in-touch-services {
    margin-top: 60px;
}

#get-in-touch-services p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}

/* --- Gallery Page Specific Sections --- */
.gallery-grid, .video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.gallery-item, .video-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.8s ease-out forwards; /* Simple fade in */
    opacity: 0;
}
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
/* ... continue for all items, or apply a general stagger with JS */


.gallery-item:hover, .video-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px; /* Fixed height for consistency */
    object-fit: cover;
    display: block; /* Remove extra space below image */
}

.gallery-caption, .video-caption {
    padding: 18px;
}

.gallery-caption h4, .video-caption h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.gallery-caption p, .video-caption p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

.video-item iframe {
    width: 100%;
    height: 250px; /* Adjust height for video embeds */
    display: block;
}

.view-more-media {
    margin-top: 60px;
}

.view-more-media p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}


/* --- Events Page Specific Sections --- */
#upcoming-events .events-list {
    display: grid;
    gap: 40px;
    margin-top: 50px;
}

#upcoming-events .event-item {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex; /* Arrange image and info side-by-side */
    align-items: center;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}
#upcoming-events .event-item:nth-child(odd) { animation-delay: 0.1s; }
#upcoming-events .event-item:nth-child(even) { animation-delay: 0.2s; animation-name: fadeInLeft; } /* Alternate animation */


#upcoming-events .event-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#upcoming-events .event-item.featured {
    border: 3px solid #1abc9c;
    box-shadow: 0 8px 25px rgba(26, 188, 156, 0.2);
}

#upcoming-events .event-item img {
    width: 35%; /* Image takes 35% width on larger screens */
    height: 250px;
    object-fit: cover;
    display: block;
    border-right: 1px solid #eee;
}

#upcoming-events .event-info {
    padding: 25px 30px;
    flex: 1; /* Info takes remaining space */
}

#upcoming-events .event-info h4 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 12px;
}

#upcoming-events .event-info p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

#upcoming-events .event-info .event-date,
#upcoming-events .event-info .event-time,
#upcoming-events .event-info .event-location {
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}
#upcoming-events .event-info .event-date i,
#upcoming-events .event-info .event-time i,
#upcoming-events .event-info .event-location i {
    margin-right: 8px;
    color: #1abc9c;
}

#upcoming-events .event-info .event-description {
    margin-top: 15px;
    margin-bottom: 25px;
}

#upcoming-events .event-info .btn {
    margin-right: 15px;
    margin-bottom: 10px; /* For stacking on smaller screens */
}

.event-note {
    font-style: italic;
    color: #777;
    margin-top: 50px;
    font-size: 1rem;
}

#past-events .past-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#past-events .past-event-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#past-events .past-event-card:nth-child(1) { animation-delay: 0.1s; }
#past-events .past-event-card:nth-child(2) { animation-delay: 0.15s; }
#past-events .past-event-card:nth-child(3) { animation-delay: 0.2s; }
#past-events .past-event-card:nth-child(4) { animation-delay: 0.25s; }


#past-events .past-event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#past-events .past-event-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

#past-events .past-event-card h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 15px 15px 5px;
}

#past-events .past-event-card p {
    font-size: 0.95rem;
    color: #666;
    margin: 0 15px 15px;
}

#past-events .past-event-card .btn {
    margin-bottom: 20px;
}

.view-all-gallery {
    margin-top: 50px;
}

#submit-event p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}


/* --- Sermons Page Specific Sections --- */
#latest-sermons .latest-sermon-highlight {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: row; /* Default for desktop */
    margin-top: 50px;
    text-align: left;
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

#latest-sermons .sermon-media {
    flex: 2; /* Takes more space for video */
    min-width: 400px; /* Minimum width for video */
    background: #000; /* Background for video area */
}

#latest-sermons .sermon-media iframe,
#latest-sermons .sermon-media audio {
    width: 100%;
    height: 100%;
    min-height: 350px; /* Ensure a good minimum height for video/audio */
    display: block;
}

#latest-sermons .sermon-details {
    flex: 1; /* Takes remaining space */
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#latest-sermons .sermon-details h4 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.3;
}

#latest-sermons .sermon-details .sermon-meta {
    font-style: italic;
    color: #555;
    font-size: 1rem;
    margin-bottom: 20px;
}

#latest-sermons .sermon-details p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 30px;
}

#latest-sermons .sermon-details .btn {
    margin-right: 15px;
    margin-bottom: 10px;
}

#sermon-archive .sermon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#sermon-archive .sermon-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#sermon-archive .sermon-card:nth-child(1) { animation-delay: 0.1s; }
#sermon-archive .sermon-card:nth-child(2) { animation-delay: 0.15s; }
#sermon-archive .sermon-card:nth-child(3) { animation-delay: 0.2s; }
#sermon-archive .sermon-card:nth-child(4) { animation-delay: 0.25s; }


#sermon-archive .sermon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#sermon-archive .sermon-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

#sermon-archive .sermon-card-content {
    padding: 18px;
}

#sermon-archive .sermon-card h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

#sermon-archive .sermon-card .sermon-meta {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

#sermon-archive .sermon-card p {
    font-size: 1rem;
    color: #777;
    margin-bottom: 15px;
    line-height: 1.5;
}

.sermon-channel-link {
    margin-top: 50px;
}

.sermon-channel-link p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}


/* --- Join Us Page Specific Sections --- */
#why-join .content-wrapper {
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
    margin-top: 50px;
}

#why-join .content-wrapper .text-content {
    flex: 2;
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

#why-join .content-wrapper .image-content {
    flex: 1;
    min-width: 300px;
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

#why-join .content-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#why-join p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

#why-join ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 25px;
}

#why-join ul li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #555;
}

#roles-needed .roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#roles-needed .role-item {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: zoomIn 0.7s ease-out forwards;
    opacity: 0;
}
#roles-needed .role-item:nth-child(1) { animation-delay: 0.1s; }
#roles-needed .role-item:nth-child(2) { animation-delay: 0.15s; }
#roles-needed .role-item:nth-child(3) { animation-delay: 0.2s; }
#roles-needed .role-item:nth-child(4) { animation-delay: 0.25s; }
#roles-needed .role-item:nth-child(5) { animation-delay: 0.3s; }
#roles-needed .role-item:nth-child(6) { animation-delay: 0.35s; }
#roles-needed .role-item:nth-child(7) { animation-delay: 0.4s; }
#roles-needed .role-item:nth-child(8) { animation-delay: 0.45s; }


#roles-needed .role-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#roles-needed .role-item h4 {
    font-size: 1.7rem;
    color: #3498db;
    margin-bottom: 12px;
}

#roles-needed .role-item p {
    font-size: 1.05rem;
    color: #666;
    line-height: 1.7;
}

#application-form .join-us-form {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 50px auto 0;
    text-align: left;
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

#application-form .join-us-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1rem;
}

#application-form .join-us-form input[type="text"],
#application-form .join-us-form input[type="email"],
#application-form .join-us-form input[type="tel"],
#application-form .join-us-form select,
#application-form .join-us-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#application-form .join-us-form input:focus,
#application-form .join-us-form select:focus,
#application-form .join-us-form textarea:focus {
    border-color: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
    outline: none;
}

#application-form .join-us-form select[multiple] {
    height: 150px; /* Adjust height for multiple selection */
    overflow-y: auto;
}

#application-form .join-us-form .btn-primary {
    width: auto; /* Override 100% width for button */
    padding: 15px 30px;
    font-size: 1.2rem;
    display: block; /* Make it full width for consistency */
    margin-top: 20px;
}

#application-form .form-note {
    margin-top: 20px;
    font-size: 0.9em;
    color: #777;
    text-align: center;
}


/* --- Donations Page Specific Sections --- */
#why-give .content-wrapper {
    display: flex;
    align-items: center;
    gap: 50px;
    text-align: left;
    margin-top: 50px;
}

#why-give .content-wrapper .text-content {
    flex: 2;
    animation: fadeInLeft 0.8s ease-out forwards;
    opacity: 0;
}

#why-give .content-wrapper .image-content {
    flex: 1;
    min-width: 300px;
    animation: fadeInRight 0.8s ease-out forwards;
    opacity: 0;
}

#why-give .content-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#why-give p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

#why-give ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 25px;
}

#why-give ul li {
    margin-bottom: 10px;
    font-size: 1.05rem;
    color: #555;
}

#giving-options .giving-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#giving-options .giving-option-item {
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
}
#giving-options .giving-option-item:nth-child(1) { animation-delay: 0.1s; }
#giving-options .giving-option-item:nth-child(2) { animation-delay: 0.2s; }
#giving-options .giving-option-item:nth-child(3) { animation-delay: 0.3s; }


#giving-options .giving-option-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#giving-options .giving-option-item img {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    object-fit: contain;
}

#giving-options .giving-option-item h4 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

#giving-options .giving-option-item p {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.6;
}

#giving-options .giving-option-item ul {
    list-style: none; /* Remove default list style */
    margin-top: 15px;
}
#giving-options .giving-option-item ul li {
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: #555;
}

#giving-options .giving-option-item .instruction {
    font-size: 0.95rem;
    font-style: italic;
    color: #777;
    margin-top: 15px;
}

#contact-giving p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #555;
}


/* --- Contact Us Page Specific Sections --- */
#contact-info .contact-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

#contact-info .contact-card {
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: zoomIn 0.7s ease-out forwards;
    opacity: 0;
}
#contact-info .contact-card:nth-child(1) { animation-delay: 0.1s; }
#contact-info .contact-card:nth-child(2) { animation-delay: 0.2s; }
#contact-info .contact-card:nth-child(3) { animation-delay: 0.3s; }


#contact-info .contact-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

#contact-info .contact-card img {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    object-fit: contain;
}

#contact-info .contact-card h4 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

#contact-info .contact-card p {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.6;
}

#contact-info .contact-card a {
    display: block; /* Make links take full width */
    margin-top: 5px;
    font-weight: bold;
}

#contact-info .contact-card .btn {
    margin-top: 15px;
}

#contact-form-section .contact-form {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 700px;
    margin: 50px auto 0;
    text-align: left;
    animation: fadeIn 1s ease-out forwards;
    opacity: 0;
}

#contact-form-section .contact-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    font-size: 1.1rem;
}

#contact-form-section .contact-form input[type="text"],
#contact-form-section .contact-form input[type="email"],
#contact-form-section .contact-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#contact-form-section .contact-form input:focus,
#contact-form-section .contact-form textarea:focus {
    border-color: #1abc9c;
    box-shadow: 0 0 0 3px rgba(26, 188, 156, 0.2);
    outline: none;
}

#contact-form-section .contact-form .btn-primary {
    width: auto;
    padding: 15px 30px;
    font-size: 1.2rem;
    display: block;
    margin-top: 20px;
}

#google-map .map-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin-top: 50px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    animation: zoomIn 0.8s ease-out forwards;
    opacity: 0;
}

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

#social-connect .social-icons-large {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

#social-connect .social-icons-large img {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

#social-connect .social-icons-large img:hover {
    transform: scale(1.1) translateY(-5px);
}

#social-connect p {
    margin-top: 30px;
    font-size: 1.15rem;
    color: #555;
}


/* --- Footer Styles --- */
footer {
    background: #34495e; /* Darker blue/grey for footer */
    color: #ecf0f1; /* Light text color */
    padding: 60px 0 30px;
    font-size: 0.95rem;
}

footer .container {
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start; /* Align content to the top */
    gap: 40px; /* Space between footer columns */
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    flex-grow: 1; /* Allows content to grow */
    gap: 40px;
}

.footer-about,
.footer-links,
.footer-social {
    flex: 1; /* Allow columns to grow */
    min-width: 200px; /* Minimum width before wrapping */
}

footer h4 {
    font-size: 1.3rem;
    color: #1abc9c; /* Teal heading in footer */
    margin-bottom: 25px;
    position: relative;
}

footer h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background-color: #3498db;
    border-radius: 1px;
}

footer p {
    margin-bottom: 12px;
}

footer ul {
    padding: 0;
}

footer ul li {
    margin-bottom: 10px;
}

footer ul li a {
    color: #ecf0f1;
    transition: color 0.3s ease;
}

footer ul li a:hover {
    color: #1abc9c;
    text-decoration: none;
}

.footer-social a {
    display: inline-block;
    margin-right: 18px;
    margin-bottom: 10px;
}

.footer-social img {
    width: 32px; /* Size for social media icons */
    height: 32px;
    transition: transform 0.3s ease;
}

.footer-social img:hover {
    transform: translateY(-3px) scale(1.1);
}

.footer-credit {
    width: 100%;
    text-align: center;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    font-size: 0.9em;
}

/* --- Animations (Keyframes) --- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Responsive Design (Media Queries) --- */

/* Medium devices (tablets, 768px and up) */
@media (max-width: 992px) {
    #page-hero h2 {
        font-size: 2.8rem;
    }
    #page-hero p {
        font-size: 1.2rem;
    }

    section h3 {
        font-size: 2.3rem;
    }

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

    /* About Page */
    #our-story .content-wrapper,
    #why-join .content-wrapper,
    #why-give .content-wrapper {
        flex-direction: column; /* Stack image and text vertically */
        text-align: center;
    }
    #our-story .content-wrapper .image-content,
    #why-join .content-wrapper .image-content,
    #why-give .content-wrapper .image-content {
        order: -1; /* Move image above text */
        margin-bottom: 30px;
    }

    /* Events Page */
    #upcoming-events .event-item {
        flex-direction: column; /* Stack image and info vertically */
        text-align: center;
    }
    #upcoming-events .event-item img {
        width: 100%;
        height: 250px; /* Adjust height for stacked image */
        border-bottom: 1px solid #eee;
        border-right: none;
    }
    #upcoming-events .event-info {
        padding: 25px;
    }
    #upcoming-events .event-info .btn {
        margin: 0 10px 10px 0; /* Adjust button margins */
        display: inline-block; /* Keep them inline for some space */
    }

    /* Sermons Page */
    #latest-sermons .latest-sermon-highlight {
        flex-direction: column;
        text-align: center;
    }
    #latest-sermons .sermon-media {
        min-width: unset; /* Remove min-width */
        height: 300px; /* Fixed height for video on smaller screens */
    }
    #latest-sermons .sermon-media iframe,
    #latest-sermons .sermon-media audio {
        min-height: unset;
        height: 100%; /* Fill parent */
    }
    #latest-sermons .sermon-details {
        padding: 25px;
    }
    #latest-sermons .sermon-details .btn {
        margin: 0 10px 10px 0;
        display: inline-block;
    }

    /* Forms */
    #application-form .join-us-form,
    #contact-form-section .contact-form {
        padding: 30px;
    }

    /* Footer */
    footer .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-about,
    .footer-links,
    .footer-social {
        width: 100%;
        margin-bottom: 20px;
    }
    footer h4::after { /* Adjust underline for centered footer headings */
        left: 50%;
        transform: translateX(-50%);
    }
    .footer-social {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-right: 0; /* Reset margin */
    }
}


/* Small devices (phones, 767px and down) */
@media (max-width: 767px) {
    .container {
        width: 95%;
        padding: 15px 0;
    }

    section {
        padding: 50px 0;
    }

    section h3 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    section h3::after {
        width: 50px;
        height: 4px;
        margin: 10px auto 0;
    }

    /* Header */
    header .container {
        flex-wrap: wrap;
        justify-content: space-between;
        padding: 0 15px;
        position: relative; /* Add this if you use absolute positioning for nav */
    }

    .logo {
        margin-bottom: 0;
    }
    .logo h1 {
        font-size: 1.5rem;
    }
    .logo img {
        height: 45px;
    }

    /* --- IMPORTANT CHANGES FOR MOBILE NAV --- */
    nav {
        order: 3; /* Push nav below logo and toggle */
        width: 100%;
        /* Remove `display: none;` here */
        flex-direction: column; /* Stack nav items vertically */
        background: #2c3e50; /* Same as header background */
        padding-bottom: 15px;

        /* Use fixed position for a full-screen overlay or side menu */
        position: fixed; /* Changed to fixed for smooth animation */
        top: 0; /* Align to the very top */
        right: 0; /* Align to the right for a right-side slide-in menu */
        height: 100vh; /* Full viewport height */
        /* width: 100%; */ /* If you want it full width */
        width: 70%; /* Example: 70% width for a sidebar menu */
        max-width: 350px; /* Limit max width for larger screens */

        overflow-y: auto; /* Enable scrolling for long menus */
        padding-top: 80px; /* Push content down past header, adjust based on your header's actual height */
        box-shadow: 0 5px 10px rgba(0,0,0,0.3);
        z-index: 999; /* Ensure it's above other content */

        /* Initial hidden state: slide it off-screen to the right */
        transform: translateX(100%); /* Start off-screen */
        transition: transform 0.4s ease-out; /* Smooth slide animation */
        visibility: hidden; /* Hide it visually until active */
    }

    nav.active { /* Class added by JavaScript when menu is open */
        transform: translateX(0); /* Slide into view */
        visibility: visible; /* Make it visible */
    }

    nav ul {
        flex-direction: column;
        width: 100%;
    }

    nav ul li {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 15px 20px;
        text-align: center;
        font-size: 1.1rem;
        color: #fff; /* Ensure mobile links are white */
    }
    nav ul li a::after {
        display: none; /* Hide underline on mobile menu items */
    }
    nav ul li a:hover {
        background: rgba(255,255,255,0.1);
    }

    .menu-toggle {
        display: block; /* Show hamburger icon on mobile */
        /* Make sure its z-index is higher than nav's */
        z-index: 1001; /* Ensure it's clickable above the menu */
        position: relative; /* Or fixed, if you want it to scroll with content */
    }

    /* ... (rest of your existing mobile styles) ... */

    /* If you also have a desktop-first media query for min-width, ensure it resets mobile styles */
}

/* Extra small devices (less than 480px) */
@media (max-width: 480px) {
    /* ... (your existing extra-small device styles) ... */
    /* Ensure the `nav` related styles in this block don't conflict with the 767px block.
       They should generally be for specific adjustments, not overriding the core
       slide-in/out mechanism.
    */
}

/* --- Desktop Styles (Add this if you don't have it, or modify your existing min-width query) --- */
@media (min-width: 768px) {
    .menu-toggle {
        display: none; /* Hide hamburger on desktop */
    }

    /* Ensure desktop nav is visible and correctly positioned */
    nav {
        position: static; /* Reset to normal flow */
        width: auto; /* Reset width */
        height: auto; /* Reset height */
        background: transparent; /* No background overlay */
        padding: 0; /* No extra padding */
        box-shadow: none; /* No shadow */
        z-index: auto; /* Reset z-index */
        transform: none; /* Remove any transform */
        visibility: visible; /* Always visible on desktop */
        display: block; /* Or flex, if your header uses flexbox for nav */
    }

    nav ul {
        flex-direction: row; /* Ensure horizontal display for desktop links */
        /* Your desktop nav ul li a styles for color, underline etc. will apply */
    }
}

/* --- For Scroll-Triggered Animations (in style.css) --- */
/* The animated elements are initially hidden by CSS (opacity: 0 and animation-delay set in HTML).
   The JS makes them visible once in view.
   The 'animation' property itself handles the transition to opacity: 1.
   No extra class needed for the animation to play, but setting opacity: 1 with JS ensures it.
*/
/* Example of how an animated element might look in CSS: */
/*
.mission-item {
    opacity: 0; // Initial state set by CSS
    animation: fadeInUp 0.8s ease-out forwards; // Animation defined in CSS
    // Other styles...
}
.mission-item:nth-child(1) { animation-delay: 0.1s; } // Delay for stagger effect
*/


/* --- Back-to-Top Button Styles (Add this to style.css) --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #1abc9c; /* Teal */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transition: all 0.3s ease-in-out;
    z-index: 999; /* Below header */
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.back-to-top:hover {
    background-color: #16a085; /* Darker teal */
    transform: scale(1.05);
}

/* Font Awesome for the icon if you're using it */
.back-to-top i {
    pointer-events: none; /* Allows click to pass through to button */
}
