/********** Global Styles **********/
/********** Body **********/

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    color: #ffffff;
    scroll-behavior: smooth;
    min-height: 100vh; /* Ensure html takes at least full viewport height */
    height: 100%; /* Ensure html stretches */
}

body {
    background-image: url('ConImg/Church.jpg');
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding-top: 100px; /* Adjusted to prevent content overlap by 100px fixed navbar */
    min-height: calc(100% - 100px); /* Ensure body content area can fill remaining space */
    box-sizing: border-box; /* Include padding in height calculation */
}

/* Accessibility utility: visually hidden but still available to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/********** Top Navigation Bar Styling **********/

.top-nav {
    background-color: rgba(0, 0, 0, 0.3);
    height: 100px;
    padding: 0 10px; /* Handles margins for logo and button */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Ensures logo and menu button are spaced out */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box; /* Ensures padding is included in width/height */
    z-index: 1000; /* Keeps navbar on top */
}

.nav-logo {
    height: 100px; /* Adjust as needed to fit well */
    width: auto;
}

/********** Menu Button Styling **********/

.menu-button {
    background-color: transparent;
    border: 2px solid black; /* Added border */
    padding: 5px; /* Added padding for space around lines */
    cursor: pointer;
    display: flex; /* Changed from none to flex to make it visible by default */
    flex-direction: column;
    justify-content: space-between;
    height: 45px; /* Adjusted for 4 lines (2px each) and 3 spaces (2px each) = 14px, with some extra for visual balance */
    width: 40px; 
    box-sizing: border-box; /* Ensure padding and border are included in the element's total width and height */
}

.menu-button span {
    display: block;
    width: 100%; 
    height: 4px; 
    background-color: #c46123; 
}

/********* Navigation Links Styling *********/

.nav-links {
    display: none; /* Hidden by default, shown when .active */
    flex-direction: column;
    width: min(340px, calc(100vw - 20px)); /* Responsive dropdown width */
    background-color: rgba(0, 0, 0, 0.85);
    position: absolute;
    top: 100px; /* Position below the nav bar (50px original + 50px additional) */
    left: auto; /* Remove left alignment */
    right: 10px; /* Keep some breathing room on small screens */
    padding-bottom: 10px;
    z-index: 999; 
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    border-radius: 5px; /* Added rounded corners */
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.nav-links.active {
    display: flex; /* Show when active (toggled by JS) */
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 10px 5px; /* Reduced horizontal padding to fit better in 50px */
    display: block;
    text-align: center; /* Centered text for dropdown items */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Separator for dropdown items */
    font-size: 1em; /* Reduced font size */
    white-space: normal; /* Allow full labels to wrap */
    overflow-wrap: anywhere;
    word-break: normal;
    overflow: visible;
    text-overflow: clip;
}

.nav-links a:last-child {
    border-bottom: none; /* No border for the last item */
}

.nav-links a:hover {
    background-color: rgb(196, 97, 35);
    border-radius: 0; /* Override previous border-radius if any, or keep if desired */
}

/* Desktop navigation: show links as horizontal tabs with centered, stacked text */
@media (min-width: 1400px) {
    .top-nav {
        /* Use a 2-column grid so the logo stays left and the tab bar starts after it */
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: 1fr 56px; /* bottom row is the "piano key" tab bar */
        align-items: center;
        column-gap: 150px;
    }

    .nav-logo {
        justify-self: start;
        grid-column: 1;
        grid-row: 1 / span 2;
        margin-left: 0;
    }

    .menu-button {
        display: none;
    }

    .nav-links {
        /* Piano-key tab bar along the bottom, starting AFTER the logo */
        grid-column: 2;
        grid-row: 2;

        display: flex;
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;

        position: static;
        width: 100%;
        height: 56px;
        padding: 0 50px 6px 350px;
        background-color: transparent;
        border-top: none;
        border-radius: 0;
        box-sizing: border-box;
    }

    .nav-links a {
        /* Each link behaves like a "key" */
        flex: 1 1 0;
        min-width: 0;
        height: 100%;
        padding: 2px; /* 2px padding around text */

        display: flex;
        align-items: center;
        justify-content: center;

        background-color: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-bottom: none;
        border-radius: 10px 10px 0 0;

        text-align: center;
        white-space: normal; /* allow multi-line */
        overflow: hidden;
        text-overflow: clip;
        line-height: 1.1;
        font-size: 0.9em;
        font-weight: 700;
    }

    .nav-links a + a {
        margin-left: 2px; /* small gap between keys */
    }

    .nav-links a:hover {
        background-color: rgba(196, 97, 35, 0.9);
        border-color: rgba(255, 255, 255, 0.22);
        border-radius: 10px 10px 0 0;
    }
}

/********** Hero Section **********/

.hero-section {
    /* Use min-height (not fixed height) so large hero text/buttons never overflow
       into the next section on shorter landscape viewports (e.g., Surface Pro). */
    min-height: 75vh;
    height: auto;
    padding: 40px 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    background-color: rgba(0, 0, 0, 0); /* Dark overlay for better text readability */
}

.hero-content h1 {
    font-size: 6em;
    margin-bottom: 0px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.75);
}

/* Accessibility: honor reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Keep the schedule manager file input hidden without inline styles */
#schedule-file-input-modal {
    display: none;
}

/* Hero title styling */
.hero-content h1 .hero-line {
    display: block;
    margin-bottom: 0.5em; /* Space between lines */
    white-space: nowrap; /* Ensures content of each line stays on a single line */
}

.hero-content h1 .hero-line:last-child {
    margin-bottom: 50px;
}

.hero-content .hero-subtitle {
    font-size: 0.6em; /* Roughly 2 sizes smaller than 1em, adjust as needed */
}

/********** Contact Button Styling **********/

.btn-contact {
    display: inline-block;
    padding: 7px 15px;
    background-color: #c46123; /* A welcoming purple, can be changed */
    color: white;
    text-decoration: none;
    font-size: 1.2em;
    border-radius: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Added transform to transition */
}

/* Utility modifier: adds top spacing when a button is used inline in text */
.btn-contact.btn-contact--spaced {
    margin-top: 10px;
}

.btn-contact:hover {
    background-color: #c46123; /* Darker shade on hover */
    transform: scale(1.25); /* Increase size by 25% */
}

/* Touch/pen devices can end up in a "stuck" hover-like state; avoid scaling that
   can visually overlap nearby content on those devices. */
@media (hover: none) {
    .btn-contact:hover {
        transform: none;
    }
}

.btn-contact:active {
    color: black; /* Black text on click */
}

/********** Main Content Area **********/

main {  /***** Center area behind containers *****/
    background-color: rgba(0, 0, 0, 0); 
    padding-top: 75px;
    margin-left: auto; /* Center main content */
    margin-right: auto; /* Center main content */
    max-width: 1350px; /* Set a max-width for main content area */
    width: 90%; /* Allow it to be responsive */
}

/********** Section Styling **********/

section {
    padding: 5px;
    text-align: center;
    margin-bottom: 50px; 
    border-radius: 15px; 
    background-color: #000;
    /* Removed fixed height, section will now size to content */
}

section:last-of-type {
    border-bottom: none;
}

section h2 {    /*Section Names*/
    font-size: 3em;
    margin-bottom: 5px;
    color: #ffffff;
}

/* Home page: orange section label headings */
.home section h2 {
    color: rgb(196, 97, 35);
}

/* Home page: orange labels inside the Times section */
.home #times .worship-day {
    color: rgb(196, 97, 35);
}

/* Home page: keep actual time values white */
.home #times .time-slot {
    color: #ffffff;
}

/* Home page: Upcoming Events label in orange */
.home #events > h2 {
    color: rgb(196, 97, 35);
}

/* ======================================================================
   Combined Times container (Worship left, Ministries right)
   ====================================================================== */

#times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
}

#times .times-column {
    background-color: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
}

#times .times-column > h2 {
    margin-top: 0;
    color: rgb(196, 97, 35);
}

/* Reduce event block padding inside the combined Times container */
#times .service-block {
    padding: 4px;
}

section div {   /*Days Container*/
    background-color: rgba(0, 0, 0, 0); /* Simplified from #c4238100 */
    margin: 0;
    padding: 5px 5px 5px 5px;
    border-radius: 15px;
    max-width: 1350px; /* Match main content width */
}

section div p {
    font-size: 1.1em;
    line-height: 1.6;
}

/********** Worship Times Styling **********/

.worship-day {
    text-align: center;
    font-size: 2em; /* Made Sunday a bit larger */
    margin-bottom: 0px;
    font-weight: bold; /* Make day names bold */
}

.service-times-row {
    display: flex;
    justify-content: space-around; /* Evenly space the time slots -> Changed to center */
    align-items: flex-start; /* Align time slots to the top of this container */
    margin-top: 0px; /* Space below "Sunday" */
    gap: 5.25rem; /* Ensures a minimum space between time slots */
}

.time-slot {    /*Individual times*/
    font-size: 1.3em; /* Style for the times */
    color: #ffffff;
    margin: 0 0 5px; /* Provides space around each time, allowing more to be added */
    padding: 2px 5px;
    background-color: #c4612380;
    border-radius: 5px;
    border: 1px solid #bd5f25;
}

/********** Day Container Styling **********/

.days-container {
    display: flex;
    justify-content: space-around; 
    align-items: stretch; /* Makes all .day items in a row the same height */
    gap: 20px; 
    flex-wrap: wrap; /* Allows items to wrap */
}

.day {
    padding: 0px 10px 0px 10px; 
    background-color: rgba(0, 0, 0, 0); 
    border-radius: 15px;
    flex: 1; /* Allows day blocks to grow and shrink equally to fill space */
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center; 
    justify-content: flex-start; /* ADDED: Aligns items to the top of the .day container */
}

/* ======================================================================
   Schedule layout (Worship Times + Weekly Ministry Times)
   Days down the left, events on the right
   ====================================================================== */

#worship-times .days-container,
#ministries .days-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
}

#worship-times .day,
#ministries .day {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px 14px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(196, 97, 35, 0.35);
}

#worship-times .day-label,
#ministries .day-label {
    display: flex;
    align-items: center;
    justify-content: center;
}

#worship-times .day-label .worship-day,
#ministries .day-label .worship-day {
    text-align: center;
    margin: 2px 0 0;
    font-size: 1.8em;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.65);
}

#worship-times .day-events,
#ministries .day-events {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Generic time + event row */
.simple-event-row,
#worship-times .sunday-event-group,
#ministries .thursday-event-group {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    align-items: center;
}

.simple-event-row .time-slot,
#worship-times .sunday-event-group .time-slot,
#ministries .thursday-event-group .time-slot {
    margin: 0;
    justify-self: center;
}

/* When an event has multiple blocks (e.g., Wednesday ministries, Thursday 6pm) */
.event-service-blocks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.event-service-blocks-row .service-block {
    flex: 1;
    min-width: 240px;
}

/* Tablet-ish widths (e.g., Surface Pro): stack multi-block rows to avoid overflow */
@media (max-width: 1400px) and (min-width: 981px) {
    #times .event-service-blocks-row {
        flex-direction: column;
    }

    #times .event-service-blocks-row .service-block {
        min-width: 0;
        width: 100%;
    }
}

/* Stack Day → Time → Events earlier to prevent overflow while resizing */
@media (max-width: 980px) {
    #worship-times .day,
    #ministries .day {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
    }

    #worship-times .day-label,
    #ministries .day-label {
        justify-content: center;
    }

    .simple-event-row,
    #worship-times .sunday-event-group,
    #ministries .thursday-event-group {
        grid-template-columns: 1fr;
        gap: 8px;
        align-items: start;
        min-width: 0;
    }

    .simple-event-row .time-slot,
    #worship-times .sunday-event-group .time-slot,
    #ministries .thursday-event-group .time-slot {
        justify-self: center;
        width: fit-content;
    }

    .event-service-blocks-row {
        flex-direction: column;
    }

    .event-service-blocks-row .service-block {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    #times {
        grid-template-columns: 1fr;
    }

    #worship-times .day,
    #ministries .day {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .simple-event-row,
    #worship-times .sunday-event-group,
    #ministries .thursday-event-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .event-service-blocks-row .service-block {
        min-width: 0;
    }
}

/* New styles for Sunday service blocks */
.sunday-services .service-block {
    display: flex;
    flex-direction: column; /* Stack time and details vertically by default */
    align-items: center; /* Center items within the block */
    width: 100%; /* Ensure blocks take full width of their container */
    margin-bottom: 15px; /* Space between service blocks */
}

.sunday-services .service-block:last-child {
    margin-bottom: 0;
}

.sunday-services .service-details p {
    margin: 2px 0; /* Adjust spacing around service detail text */
    text-align: center; /* Center text within Sunday service details paragraphs on mobile */
}

/********** Styling for side-by-side divs A and B **********/

.side-by-side-divs {
    display: flex;
    justify-content: space-around; /* Or space-between, or center, depending on desired spacing -> Changed to center */
    margin-top: 0px; /* Add some space above these divs */
    padding: 0; /* ADDED to negate padding from 'section div' */
}

.side-by-side-divs > div { /* Style for direct children (divA and divB) */
    flex-basis: 45%; /* Example: each div takes up slightly less than half, allowing for some space between */
    /* padding: 0px 0px 0px 10px; */
    background-color: #c4612380; /* Light grey background for distinction */
    border: 1px solid #bd5f25;
    border-radius: 5px;
}

/* Added rule for when a .side-by-side-divs container has only one child div */
.side-by-side-divs > div:only-child {
    box-sizing: border-box; /* Ensures padding and border are included in the width */
    flex-basis: auto;       /* Override the 45% basis */
    width: calc(100% - 30px); /* Makes the element 15px narrower on each side than its parent .side-by-side-divs. With 15px margins, this results in 25px from .day's border (10px .day padding + 15px item margin). */
    margin-left: 15px;      /* Adjusted from 10px to 15px */
    margin-right: 15px;     /* Adjusted from 10px to 15px */
}

/********** Pastor Section Styling **********/

.pastor-container {
    position: relative; 
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.025); /* User's preference */
    overflow: hidden; /* Changed from auto to hidden to remove scrollbar */
    margin: 0; 
    max-width: none; 
    box-shadow: none; 
}

.pastor-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0;
    float: none;
    border-radius: 15px;
}

/********** FAQ Section Styling **********/

.faq-section-wrapper {
    display: flex;
    justify-content: space-between; /* Adjust as needed: space-around, center, etc. */
    align-items: center; /* Align items to the top */
    gap: 200px; /* Space between FAQ list and image container */
}

.faq-container {
    flex: 1; /* FAQ container takes more space */
    max-width: 50%; /* Adjust as needed */
    margin-left: 100px; /* Centering is now handled by flex wrapper */
    text-align: center;
}

.faq-image-stack-container {
    flex: 2; /* Image container takes less space */
    display: flex;
    flex-direction: column; /* Default: stack vertically */
    align-items: center; /* Center images horizontally within this container */
    justify-content: space-around; /* Center stack vertically if container is taller */
    gap: 10px; /* Space between the two images */
    min-width: 200px; /* Minimum width, adjust as needed */
    max-width: 100%; /* Adjust as needed */
    padding-top: 0px; /* Add some padding to visually center/adjust if needed */
    padding-bottom: 0px; /* Add some padding */
}

/* ======================================================================
   Homepage FAQ collage (main image + overlapping thumbnail)
   ====================================================================== */

.faq-image-collage {
    position: relative;
    display: block;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 10px;
    padding-bottom: 120px; /* space for the overlapping thumbnail */
    overflow: visible;
}

.faq-image-collage .faq-collage-main {
    width: 100%;
    max-width: 980px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.faq-image-collage .faq-collage-thumb {
    position: absolute;
    left: 15%;
    bottom: 46px; /* anchors to the bottom edge, slightly overlapping */
    transform: translateX(-50%);
    width: min(64%, 520px); /* a little bigger than before */
    height: auto;
    border-radius: 14px;
    border: 6px solid #ffffff;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

@media (max-width: 820px) {
    .faq-image-collage {
        padding-bottom: 100px;
    }

    .faq-image-collage .faq-collage-thumb {
        width: min(64%, 520px);
        bottom: 46px;
    }
}

@media (max-width: 600px) {
    .faq-image-collage {
        padding-bottom: 10px;
    }

    .faq-image-collage .faq-collage-thumb {
        position: static;
        transform: none;
        width: min(92%, 520px);
        margin: 14px auto 0;
        border-width: 4px;
    }
}

.stacked-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 15px;
    padding-left: 0;
    display: block;
    margin: 0 auto;
   /* box-shadow: 0 1px 3px rgba(0,0,0,0.3); */
}

.faq-item {
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    border-radius: 10px;
    border: 1px solid #c46123;
}

.faq-question {
    padding: 16px;
    margin: 0;
    cursor: pointer;
    font-size: 1.2em;
    color: #ffffff;
    background-color: rgba(196, 97, 35, 0.5); /* Semi-transparent accent color */
    border-radius: 10px 10px 10px 10px; /* Round top corners if answer is hidden initially */
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background-color: rgba(196, 97, 35, 0.7);
}

.faq-answer {
    padding: 0 4px; /* Add padding only to sides initially */
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out; /* Smooth transition for height and padding */
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px 10px 10px 10px; /* Round bottom corners */
}

.faq-answer p {
    padding: 15px 0; /* Add vertical padding when answer is shown */
    margin: 0;
    color: #f0f0f0; /* Lighter text for answer */
    font-size: 1em;
    line-height: 1.6;
}

/***** Style for when the FAQ item is active/open *****/

.faq-item.active .faq-answer {
    max-height: 500px; /* Adjust as needed to fit content */
    padding: 0 15px; /* Ensure side padding is maintained */
}

.faq-item.active .faq-question {
    background-color: rgba(196, 97, 35, 0.8);
    border-radius: 10px 10px 10px 10px;
}

/********** Footer Styles **********/

footer {
    background-color: #121212;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center; 
    gap: 20px;
    text-align: center; /* Removed, alignment handled by flex children */
}

.footer-top-row {   /* Top row with logo and text */
    display: flex;
    flex-direction: row; /* Arrange logo and text side-by-side */
    justify-content: center; /* Center the logo-text pair */
    align-items: center; /* Vertically align logo and text block */
    gap: 20px; /* Gap between logo and text block */
    width: 100%;
}

.footer-logo {
    height: 100px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.footer-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align text to the start (left) of its container */
    text-align: left; /* Align text to the left within its block */
    max-width: none;
    flex: 1;
}

.footer-bottom-row {
    display: flex;
    justify-content: space-around; /* Distribute link sections */
    width: 100%;
    max-width: 1350px; /* Match main content width */
    gap: 20px; /* Space between link sections */
    padding-top: 20px;
}

.footer-links-section {
    background-color: #ffffff0d; /* Transparent div background */
    padding: 10px; /* Reduced padding */
    border-radius: 8px;
    text-align: center; /* Changed from left to center for h4 */
    flex: 1; /* Make sections equal width */
    display: flex; /* Enable flex for vertical alignment of children */
    flex-direction: column; /* Stack h4 and ul vertically */
}

.footer-links-section h4 {
    margin-top: 0;
    margin-bottom: 8px; /* Reduced margin */
    color: #c46123;
    border-bottom: 1px solid #c46123;
    padding-bottom: 4px; /* Reduced padding */
    font-size: 1.1em; /* Slightly adjust font size if needed */
}

.footer-links-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    flex-grow: 1; /* Allow ul to grow and fill space */
    justify-content: center; /* Center items if not enough to space-around */
    gap: 4px; /* Added gap between li items */
}

.footer-links-section ul li a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.85em; /* Slightly reduced font size */
    line-height: 1.6; /* Adjusted line height */
    display: flex; /* Changed to flex for icon and text alignment */
    align-items: center; /* Vertically align icon and text */
    padding: 1px 0; /* Reduced padding */
}

.footer-links-section ul li a .link-icon {
    margin-right: 5px; /* Restored original space */
    display: inline-block; /* Or inline-flex */
    width: 14px; /* Slightly reduced icon size */
    height: 14px; /* Slightly reduced icon size */
    vertical-align: left; /* Helps align image with text */
}

/* Comment related to YouTube icon spacing removed */

.footer-links-section ul li a .link-text {
    display: inline-block;
}

.footer-links-section ul li a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-copyright-row {
    text-align: center; /* Horizontally center the copyright text */
    padding: 10px 0;
    border-top: 1px solid #444; /* Optional: adds a separator line */
    margin-top: 20px; /* Optional: adds some space above the copyright line */
}

/* Desktop: align footer content to main/body margins */
@media (min-width: 1025px) {
    .footer-top-row,
    .footer-bottom-row,
    .footer-copyright-row {
        width: 90%;
        max-width: 1350px;
        margin-left: auto;
        margin-right: auto;
    }
}

.footer-copyright-row p {
    margin: 0; /* Remove default paragraph margins */
    font-size: 0.9em; /* Adjust font size as needed */
    color: #ccc; /* Lighter text color for the copyright */
}

/********** Events Section Styles **********/

#events {
    background-color: #000;
    padding: 10px 10px 10px 10px; /* Padding around the section */
    border-radius: 15px;
}

#events h2 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 20px;
}

#events .events-container {
    display: flex;
    gap: 10px;
    align-items: stretch; /* Ensures children are of equal height */
    width: 100%;
    max-width: none; /* Override global section div max-width */
    padding: 4px; /* Override global section div padding */
}

#events .event-image-container {
    flex: 1 1 0; /* Equal width columns; allow shrinking */
    min-width: 0; /* Prevent overflow from long content */
    display: flex; /* To allow image to fill height */
    flex-direction: column; /* Stack content vertically if any */
    /* Removed max-width to allow flex to control width */
    max-width: none; /* Override global section div max-width */
    padding: 0;
    border-radius: 15px;
    overflow: hidden; /* Clip image to match schedule panel shape */
}

/* Homepage: match the schedule panel height on desktop */
@media (min-width: 981px) {
    .home #events .event-image-container {
        height: 420px;
    }
}

#events .event-image {
    width: 100%;
    height: 100%; /* Makes the image take the full height of its container */
    object-fit: cover; /* Ensures the image covers the area, maintaining aspect ratio */
    border-radius: 0;
}

#schedule-display-area {
    flex: 1 1 0; /* Equal width columns; allow shrinking */
    min-width: 0; /* Prevent overflow from long content */
    display: flex; /* Added to allow its content to be flex-managed if needed */
    flex-direction: column; /* Align content within this area */
    max-width: none; /* Override global section div max-width */
    padding: 0;
}

/* Modal Styles */
.modal-hidden {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 2000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
}

.modal-content {
    background-color: #2c2c2c; /* Dark background for modal */
    color: #f1f1f1;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 25px;
    border: 1px solid #555;
    width: 60%; /* Could be more or less, depending on screen size */
    max-width: 700px; /* Max width */
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.close-modal-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-modal-button:hover,
.close-modal-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

/* Content Pages Styling */
.content-section {
    padding: 5px;
    max-width: none;
    width: 100%;
    margin: 0 0 50px;
    background-color: #000;
    border-radius: 15px;
    color: #ffffff; /* Updated for consistency with homepage sections */
}

.content-section h1, .content-section h2 {
    color: #c46123; /* Theme color for headers */
    border-bottom: 2px solid #c46123;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.content-section p, .content-section li {
    line-height: 1.6;
    margin-bottom: 10px;
}

.content-section ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-subnav {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.content-subnav a {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #c46123;
    border-radius: 20px;
    text-decoration: none;
    color: #ffffff;
    background-color: rgba(196, 97, 35, 0.2);
}

.content-subnav a:hover {
    background-color: #c46123;
}

.content-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin: 10px 0 25px;
}

.content-image-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid rgba(196, 97, 35, 0.6);
}

.content-image-grid img.content-image-grid__hero {
    height: clamp(280px, 38vw, 520px);
}

/* =====================================================================
   Facility Rental: Image-first gallery
   ===================================================================== */

.rental-gallery {
    width: 100%;
    margin: 12px 0 22px;
}

.rental-gallery img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 14px;
    border: 2px solid rgba(196, 97, 35, 0.55);
    box-shadow: 0 10px 24px rgba(0,0,0,0.55);
    transform: translateZ(0);
    transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.rental-gallery img:hover {
    transform: scale(1.02);
    filter: saturate(1.05) contrast(1.02);
    box-shadow: 0 14px 34px rgba(0,0,0,0.65);
}

.rental-gallery__hero {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    margin: 0 0 12px;
}

.rental-gallery__hero img:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
    min-height: clamp(300px, 32vw, 520px);
}

.rental-gallery__hero img:nth-child(2),
.rental-gallery__hero img:nth-child(3) {
    min-height: clamp(144px, 16vw, 254px);
}

.rental-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.rental-gallery__grid img {
    aspect-ratio: 4 / 3;
}

@media (max-width: 820px) {
    .rental-gallery__hero {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .rental-gallery__hero img:nth-child(1) {
        grid-column: auto;
        grid-row: auto;
        min-height: clamp(240px, 52vw, 420px);
    }

    .rental-gallery__hero img:nth-child(2),
    .rental-gallery__hero img:nth-child(3) {
        min-height: clamp(180px, 42vw, 320px);
    }
}

.content-media-right {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
    margin: 10px 0 15px;
}

/* Float-right image that allows surrounding text to flow down the photo */
.content-float-right {
    float: right;
    width: min(42%, 420px);
    max-width: 420px;
    height: auto;
    margin: 4px 0 10px 18px;
    border-radius: 15px;
    border: 2px solid rgba(196, 97, 35, 0.6);
    object-fit: cover;
}

.content-media-right > p {
    flex: 1 1 620px;
    margin: 0;
}

.content-media-right__image {
    flex: 0 1 420px;
    width: 100%;
    height: auto;
    border-radius: 15px;
    border: 2px solid rgba(196, 97, 35, 0.6);
    object-fit: cover;
}

.content-figure {
    margin: 20px auto;
    max-width: 1350px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
}

/* Caption overlay (top-right) variant used on Church History */
.content-figure--caption-overlay {
    position: relative;
    max-width: 935px;
    display: block;
    margin: 18px auto;
}

.content-figure--caption-overlay .content-figure-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    border: 2px solid rgba(196, 97, 35, 0.6);
    object-fit: cover;
}

.content-figure--caption-overlay figcaption {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: min(62%, 520px);
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.78em; /* subscript-like */
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.96);
    text-align: left;
}

.content-figure-image {
    flex: 1 1 720px;
    width: 100%;
    height: auto;
    display: block;
    border-radius: 15px;
    justify-self: center;
    border: 2px solid rgba(196, 97, 35, 0.6);
}

.content-figure figcaption {
    flex: 0 1 420px;
    margin-top: 0;
    font-size: clamp(0.85em, 1.4vw, 0.95em);
    font-style: italic;
    line-height: 1.5;
    color: #ffffff;
    text-align: left;
}

@media (max-width: 768px) {
    .content-media-right {
        flex-direction: column;
        align-items: center;
    }

    .content-float-right {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 10px 0 12px;
        display: block;
    }

    .content-media-right > p {
        margin: 0;
    }

    .content-media-right__image {
        max-width: 100%;
    }

    .content-figure {
        flex-direction: column;
        align-items: center;
    }

    .content-figure figcaption {
        text-align: center;
    }

    .content-figure--caption-overlay figcaption {
        position: static;
        max-width: 100%;
        margin-top: 10px;
        font-size: 0.88em;
        text-align: left;
    }
}

.hidden {
    display: none;
}

/* =====================================================================
   Basic form styles (Contact + Facility Rental)
   ===================================================================== */

.contact-form {
    max-width: 900px;
    margin: 18px auto 0;
    text-align: left;
    padding: 14px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.contact-form h2 {
    text-align: center;
    margin-top: 12px;
}

.form-note {
    max-width: 900px;
    margin: 10px auto;
    font-style: italic;
    opacity: 0.9;
}

/* =====================================================================
   Contact: Get In Touch cards
   ===================================================================== */

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 12px 0 14px;
}

.contact-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

.contact-card__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.55));
}

.contact-card__body {
    min-width: 0;
}

.contact-card__label {
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffffff;
    margin-bottom: 4px;
}

.contact-card__value {
    color: #ffffff;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.contact-card__value a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Contact page: never show bullet markers in the main content area */
#contact-form-section ul {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

/* =====================================================================
   Contact: YouTube showcase
   ===================================================================== */

.youtube-live-placeholder {
    margin: 10px 0 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
}

.youtube-live-placeholder__inner {
    max-width: 900px;
    margin: 0 auto;
}

.youtube-live-placeholder__title {
    font-size: clamp(1.05em, 2.1vw, 1.35em);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.youtube-live-placeholder__text {
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.45;
    margin-bottom: 10px;
}

.youtube-live-placeholder__button,
.youtube-section__button {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(196, 97, 35, 0.65);
    background: rgba(196, 97, 35, 0.22);
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

.youtube-live-placeholder__button:hover,
.youtube-section__button:hover {
    background: rgba(196, 97, 35, 0.35);
}

.youtube-section {
    margin: 8px 0 18px;
}

.content-section .youtube-section__title {
    color: #c46123;
    border-bottom: 2px solid #c46123;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.youtube-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.youtube-card {
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(196, 97, 35, 0.35);
    background: rgba(0, 0, 0, 0.20);
    box-shadow: 0 12px 26px rgba(0,0,0,0.55);
}

.youtube-embed {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
}

.youtube-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.youtube-section__cta {
    text-align: center;
    margin-top: 12px;
}

/* =====================================================================
   Facility Rental: Non-member hero (pricing + rules)
   ===================================================================== */

.rental-hero {
    width: 100%;
    max-width: none;
    margin: 12px 0 16px;
    padding: 18px 14px;
    text-align: left;
    border-radius: 14px;
    border: 1px solid rgba(196, 97, 35, 0.35);
    background: rgba(196, 97, 35, 0.10);
}

.rental-hero__inner {
    max-width: 1100px;
    margin: 0 auto;
}

.content-section .rental-hero__title,
.content-section .rental-hero__subtitle {
    color: #ffffff;
    border-bottom: none;
    padding-bottom: 0;
    margin: 0 0 10px;
}

.rental-hero__title {
    font-size: clamp(1.15em, 2.2vw, 1.55em);
    font-weight: 700;
    letter-spacing: 0.2px;
}

.rental-hero__subtitle {
    font-size: clamp(1.0em, 1.8vw, 1.2em);
    margin-top: 14px;
}

.rental-hero__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    align-items: start;
}

.rental-hero__card {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.22);
}

.rental-hero__rates {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rental-hero__rates li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.rental-hero__rates li:last-child {
    border-bottom: none;
}

.rental-hero__rates li span:last-child {
    font-weight: 700;
    white-space: nowrap;
}

.rental-hero__rules {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.rental-hero__rules p {
    margin: 0 0 10px;
    font-style: normal;
}

.rental-hero__bullets {
    margin: 6px 0 0;
    padding-left: 22px;
}

.rental-hero__bullets li {
    margin-bottom: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 14px;
    margin: 10px 0 14px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field--full {
    grid-column: 1 / -1;
}

.form-field--right {
    align-items: flex-end;
}

.form-field--right > label {
    text-align: right;
}

.form-field--right > label.form-label--center {
    align-self: stretch;
    text-align: center;
}

.form-field--center {
    align-items: center;
}

.form-field--center .form-checklist {
    align-self: center;
    margin-left: auto;
    margin-right: auto;
}

.form-field label {
    font-weight: 600;
}

.form-field input:not([type="checkbox"]):not([type="radio"]),
.form-field select,
.contact-form textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-color: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    box-sizing: border-box;
}

/* Prevent checkbox/radio inputs from inheriting text-input sizing */
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    background: transparent;
}

.contact-form textarea {
    resize: vertical;
}

.form-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background-color: rgba(0, 0, 0, 0.20);
}

/* Reduce whitespace inside option boxes */
.form-checklist--tight {
    gap: 5px 10px;
    padding: 8px 10px;
}

/* Shrink bordered option box to its content (still responsive) */
.form-checklist--fit {
    display: inline-grid;
    width: fit-content;
    max-width: 100%;
    justify-self: start;
    justify-content: start;
    justify-items: start;
    grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
}

/* For short option sets (e.g., Yes/No): keep items packed to the left */
.form-checklist--compact {
    grid-template-columns: repeat(auto-fit, minmax(90px, max-content));
    justify-content: start;
    justify-items: start;
}

.form-check {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 500;
    text-align: left;
}

.form-checklist--tight .form-check {
    gap: 4px;
}

/* Extra-tight checkbox/radio to text spacing (per option) */
.form-check.form-check--tight {
    gap: 2px;
}

.form-check input {
    margin: 0;
}

/* One-row options that wrap to the next row on overflow */
.form-checklist.form-checklist--rowwrap {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.form-checklist--rowwrap .form-check {
    white-space: nowrap;
    gap: 4px;
}

.form-checklist--rowwrap .form-check.form-check--nextrow {
    flex: 0 0 100%;
    width: 100%;
    order: 999;
}

/* Hard override: Members form #9 must wrap, and Dressing Room must be on row 2 */
#facilityRentalMembersForm .form-checklist[aria-label="Facility selection"] {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    gap: 6px 14px;
}

#facilityRentalMembersForm .form-checklist[aria-label="Facility selection"] .form-check {
    white-space: nowrap;
    gap: 4px !important;
}

#facilityRentalMembersForm .form-checklist[aria-label="Facility selection"] .form-check.form-check--nextrow,
#facilityRentalMembersForm .form-checklist[aria-label="Facility selection"] > label:nth-child(4) {
    flex: 0 0 100% !important;
    width: 100% !important;
    order: 999 !important;
}

/* Force 3 items on first row, remaining wraps to next row */
.form-checklist--three-up {
    grid-template-columns: repeat(3, max-content);
}

@media (max-width: 768px) {
    .form-checklist--three-up {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 14px;
}

.submit-btn {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.4);
    background-color: #c46123;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.submit-btn.secondary {
    background-color: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.submit-btn:hover {
    filter: brightness(1.05);
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.ministry-category, .leadership-profile {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #4a4a4a; /* Card background */
    border-radius: 6px;
}

.leadership-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #c46123;
}

/* Optional: Make content pages match homepage section sizing */
.content-section--wide {
    box-sizing: border-box;
}

/* Make profile images larger to use the extra horizontal space */
.content-section--wide .profile-image {
    width: clamp(220px, 22vw, 320px);
    height: clamp(220px, 22vw, 320px);
}

.content-section--wide .leadership-profile {
    gap: 30px;
    align-items: flex-start;
    padding: 20px;
}

/* SMALLER WINDOW VIEWS */

@media (max-width: 768px) {
    .content-section--wide .leadership-profile {
        flex-direction: column;
        text-align: center;
    }

    .content-section--wide .profile-image {
        width: 220px;
        height: 220px;
    }
}

.profile-details h2 {
    border-bottom: none;
    margin-bottom: 10px;
}

/* Navigation Menu Styles */

/* General Responsive Styles */

/* Medium screens (e.g., tablets) */
@media (max-width: 1024px) {
    main {
        width: 85%; /* Adjusted from fixed margins */
    }

    .hero-content h1 {
        font-size: 5em;
    }

    section h2 {
        font-size: 2.5em;
    }

    .pastor-image {
        width: 100%;
        max-width: 100%;
    }

    .faq-section-wrapper {
        flex-direction: column; /* Stack FAQ items and image */
        align-items: center;
        gap: 25px; /* Reduce space between FAQ questions and images */
    }

    .faq-image-stack-container {
        margin-top: 20px;
        padding-top: 0; /* Reset padding as it\'s stacked now */
        max-width: 80%;
    }

    #events .events-container {
        flex-direction: column; /* Stack event image and schedule app */
        align-items: stretch; /* Fill the container width when stacked */
    }

    #events .event-image-container,
    #events #schedule-display-area {
        max-width: 100%; /* Allow them to take full width when stacked */
        width: 100%; /* Ensure they take full width */
    }

    #events .event-image-container {
        margin-bottom: 20px; /* Add space when stacked */
        height: auto; /* Allow height to adjust based on content or aspect ratio */
    }
}

/* Tablet Viewports (e.g., portrait tablets) */
@media (max-width: 768px) {
    body {
        padding-top: 40px; /* Adjusted for new nav height */
        background-size: contain;
        background-repeat: repeat-y; /* Repeat background vertically only */
        background-size: auto 50%;   /* Make the image repeat exactly twice vertically */
        background-position: top center;
        background-attachment: scroll;
    }

    .top-nav {
        height: 40px; /* Shrink nav height by 50% */
        padding: 0 10px; /* Set padding for logo and menu button spacing */
        justify-content: space-between; /* Ensure logo and menu button are at opposite ends */
    }

    .nav-logo {
        height: 40px; /* Shrink nav logo by 50% */
        margin-left: 0; /* Reset margin, padding on parent handles spacing */
    }

    .menu-button {
        height: 25px; /* Shrink button height */
        width: 25px;  /* Shrink button width */
        padding: 3px; /* Reduce padding */
        border-width: 1px; /* Make border thinner */
        margin-right: 0; /* Reset margin, padding on parent handles spacing */
    }

    .menu-button span {
        height: 2px; /* Make lines inside button thinner */
    }

    .nav-links {
        top: 40px; /* Position below the adjusted nav bar */
        right: 10px; /* Align with new padding */
        width: 200px; /* Slightly wider for tablet */
    }

    .hero-content h1 {
        font-size: 2.5em; /* From older rules, smaller */
    }

    .hero-content .hero-subtitle {
        font-size: 0.7em; /* From older rules, smaller */
    }
    
    .btn-contact { /* From older rules */
        font-size: 1em;
        padding: 8px 12px;
    }

    main {
        width: 95%;
        padding-top: 15px;
    }

    section {
        padding: 15px;
        margin-bottom: 20px; /* Added from older rules */
    }

    section h2 {
        font-size: 2em; /* From older rules, smaller */
        margin-bottom: 20px; /* From older rules, smaller */
    }

    /* Assuming 'contact' is the ID for your contact section */
    section#contact {
        margin-bottom: 25px; /* Specific margin for contact section on mobile */
    }    /* Ensure Sunday service blocks can be side-by-side in mobile view */
    
    /* Center text within Sunday service details paragraphs on mobile */

    /* New Styles for Sunday Schedule similar to Thursday */
    .sunday-schedule .sunday-event-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 20px; /* Space between event groups */
        width: 100%;
        text-align: center;
        gap: 10px; /* Consistent spacing between children (time-slot and service-block) */
    }

    .sunday-schedule .sunday-event-group:last-child {
        margin-bottom: 0;
    }

    #worship-times .sunday-schedule .time-slot {
        position: static;
        left: auto;
        display: inline-block;
        /* margin-bottom will be handled by gap on parent .sunday-event-group */
        /* General .time-slot styles (background, padding, font-size) will apply */
    }

    .sunday-schedule .service-block {
        width: calc(100% - 30px); /* Corrected for 25px margin from .day edge (10px day padding + 15px here) */
        text-align: center;
        padding: 8px 15px; /* Consistent padding with Thursday blocks */
        background-color: #c4612380;
        border: 1px solid #bd5f25;
        border-radius: 8px;
        box-sizing: border-box;
        display: flex; /* Added for vertical centering */
        flex-direction: column; /* Added for vertical centering */
        justify-content: center; /* Added for vertical centering */
        min-height: 50px; /* Ensure a minimum height for visual consistency, adjust as needed */
    }

    .sunday-schedule .service-block .service-details {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Vertically center content within service-details */
        width: 100%;
        flex-grow: 1; /* Allow service-details to take available space for centering */
    }

    .sunday-schedule .service-block .service-details p {
        margin: 0; /* Remove default margins for better centering control */
    }

    /* General behavior for .service-times-row and .side-by-side-divs */
    /* MODIFIED for row/wrap behavior */
    .service-times-row {
        flex-direction: row; /* Items in a row */
        flex-wrap: wrap; /* Allow wrapping */
        justify-content: center; /* Center wrapped items */
        align-items: flex-start; /* Align to top */
        gap: 10px; /* Space between items */
        width: 100%; /* ADDED: Ensure full width for content alignment */
        box-sizing: border-box; /* ADDED: Include padding/border in width calculation */
    }

    /* MODIFIED for row/wrap behavior */
    .side-by-side-divs {
        flex-direction: row; /* Items in a row */
        flex-wrap: wrap; /* Allow wrapping */
        justify-content: space-around; /* Distribute items */
        align-items: stretch; /* Stretch items if they have different heights */
        gap: 10px; /* Space between items */
        width: 100%; /* ADDED: Ensure full width for content alignment */
        box-sizing: border-box; /* ADDED: Include padding/border in width calculation */
    }

    /* MODIFIED for row/wrap behavior */
    .side-by-side-divs > div {
        flex-grow: 1;
        flex-shrink: 1;
        /* Adjust flex-basis for wrapped items. e.g., two items per row considering gap: */
        flex-basis: calc(50% - 10px); /* Assumes a 10px gap between two items */
        margin-bottom: 10px; /* Spacing for wrapped items */
    }

    .time-slot {
        margin: 5px 0; /* Stack vertically */
        font-size: 1.1em; /* From older rules */
    }

    .thursday-schedule .time-slot { /* UPDATED SELECTOR */
        position: static; /* Remove relative positioning */
        left: auto;       /* Remove left offset */
        display: inline-block; /* Allows centering via parent\'s align-items: center */
        margin-bottom: 8px; /* Space between time and the details below it */
        /* Other general .time-slot styles (background, padding, font-size) will apply */
    }

    .days-container {
        flex-direction: column; /* Stack days vertically */
        align-items: stretch; /* Stretch to full width */
    }

    .day {
        flex-basis: 100%; /* Full width for each day */
        margin-bottom: 10px; /* Space between days */
        /* align-items: stretch; REMOVED to inherit align-items: center from global .day style */
    }

    /* ADDED: FAQ spacing adjustments for mobile - REVISED */
    .faq-container {
        order: 2; 
        max-width: 95%; 
        padding-left: 10px; 
        padding-right: 10px;
        margin-left: auto; 
        margin-right: auto; 
        margin-top: 0; /* Image container will be above with margin-bottom */
        margin-bottom: 20px; /* Keep some space below FAQ text */
    }    /* REVERTED: Use the original image stack container */
    .faq-image-stack-container {
        display: flex; /* Re-enable display, it's flex by default for internal stacking */
        /* flex-direction, align-items, gap are inherited from general styles */
        order: 1; /* Place image stack before FAQ items */
        width: auto; /* Let content or max-width define it */
        /* max-width: 80%; is inherited from 1024px styles, which is good for mobile */
        margin: 0 auto; /* Let .faq-section-wrapper gap control spacing */
        /* padding-top: 0; is inherited from 1024px styles */
    }

    /* ADDED: Footer logo and text wrapping for mobile */
    .footer-top-row {
        display: flex; /* Use flex for centering logo */
        flex-direction: column; /* Stack logo and text vertically */
        align-items: center; /* Center items horizontally */
    }

    .footer-logo {
        height: 100px; /* Double logo size from 50px to 100px */
        width: auto;
        /* float: none; Removed as flex handles layout */
        margin: 0 0 -15px 0; /* Adjusted bottom margin */
    }

    .footer-text-content {
        /* overflow: visible; Removed, not strictly necessary here */
        /* display: block; Flex child, block is default for non-replaced */
        text-align: center; /* Center the text */
        margin-left: 10px; /* Add 10px margin from left */
        margin-right: 10px; /* Add 10px margin from right */
        max-width: 100%; /* Ensure it doesn\'t overflow small screens */
    }

    .pastor-image {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        margin: 0;
        float: none;
        border-radius: 15px;
    }

    /* Thursday schedule specific adjustments for mobile */
    .thursday-schedule .thursday-event-group {
        display: flex;
        flex-direction: column;
        align-items: center; /* Center time-slot and service-block */
        margin-bottom: 20px; /* Space between event groups */
        width: 100%; /* Ensure the group takes full width for centering */
        text-align: center; /* Added to help center inline-block children like time-slot */
        gap: 10px; /* ADDED: Consistent spacing between children */
    }

    /* UPDATED: Ensured this rule is specific enough and correctly placed for mobile */
    #ministries .thursday-schedule .time-slot {
        position: static; 
        left: auto;       
        display: inline-block; 
        /* margin-bottom: 8px; REMOVED: Replaced by gap on parent */
        /* margin-left and margin-right will be auto if text-align:center on parent doesn't center it, 
           but for inline-block, text-align:center on parent is the primary method. */    }    .thursday-schedule .service-block {
        width: 100%; /* Full width to match other containers */
        text-align: center;
        padding: 8px 15px; /* Consistent padding with Thursday blocks */
        background-color: #c4612380;
        border: 1px solid #bd5f25;
        border-radius: 8px; 
        box-sizing: border-box;
    }

    .thursday-schedule .service-block .service-details {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%; /* Ensure details take full width of the block */
    }

    /* Adjust footer icon spacing for mobile */
    .footer-links-section ul li a .link-icon {
        margin-right: 2px; /* Reduced space for mobile */
    }
}

/* ==========================================================================
   Service Blocks (Worship Times, Ministry Times)
   ========================================================================== */

/* Base style for service blocks - applies to both mobile and desktop */
.service-block {
    background-color: #c4612380; /* orange-brown, semi-transparent */
    border: 1px solid #bd5f25;   /* darker orange-brown border */
    border-radius: 8px;
    padding: 15px; /* Base padding, can be adjusted in media queries */
    color: #fff; /* Assuming light text on this background */
    text-align: center; /* Center text within the block by default */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.service-block .service-details p {
    margin: 0; /* Remove default paragraph margins */
    line-height: 1.6; /* Improve readability */
}

.service-details {
    display: flex;
    flex-direction: column;
    align-items: center;     /* Horizontally centers child elements (like the <p> block) */
    justify-content: center; /* Vertically centers child elements if .service-details has intrinsic height or min-height */
    width: 100%;             /* Ensures .service-details spans the .service-block width */
}

.thursday-schedule .thursday-event-group .event-service-blocks-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
}

.thursday-schedule .event-service-blocks-row .service-block {
    flex: 1;
    min-width: 45%; /* Ensure two blocks can fit side by side */
    margin: 0;
}