/* GENERAL STYLES */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Old+English+Text+MT&display=swap');

body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    overflow-x: hidden; /* Prevents horizontal scroll from layout shifts */
}

/* Header */
header {
    background-color: #550d0b;
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-container {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Constrain header width */
    margin: 0 auto;
    justify-content: space-between; /* Distribute items horizontally */
}

.logo img {
    height: 80px;
    width: auto; /* Maintain aspect ratio */
    margin-right: 15px;
    border-radius: 50%; /* Make logo round */
    object-fit: cover;
}

.header-text h1 {
    font-family: "Old English Text MT", serif, 'Times New Roman';
    font-size: 2em;
    margin: 0;
    white-space: nowrap; /* Prevent title from wrapping */
}

.header-text p {
    font-size: 12px;
    margin: 0;
    white-space: nowrap; /* Prevent address from wrapping on one line if possible */
}

nav {
    margin-left: auto; /* Push navigation to the right */
    display: flex; /* Ensure links are flex items */
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin: 0 12px; /* Adjusted margin for slightly tighter spacing */
    font-weight: bold;
    font-size: 1.15rem;
    padding: 8px 12px; /* Increased padding for better touch targets */
    border-radius: 6px;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    position: relative;
    outline: none;
    white-space: nowrap; /* Prevent links from wrapping */
}

nav a:hover,
nav a:focus {
    background: #FFD700;
    color: #550d0b;
    transform: translateY(-2px); /* Slight lift on hover/focus */
}

nav a.active {
    background: #FFD700;
    color: #550d0b;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2); /* Softer shadow */
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none; /* Hidden by default, shown in media queries */
    background: none;
    border: none;
    color: white;
    font-size: 2.2em; /* Slightly larger icon */
    cursor: pointer;
    padding: 5px 10px;
    z-index: 101; /* Ensure it's above everything when active */
}

/* About Us Section */
.about-us {
    background: url('https://placehold.co/1920x1080/550d0b/ffb902?text=SJC+Background') no-repeat center center fixed; /* Placeholder for background image */
    background-size: cover;
    background-attachment: fixed;
    padding: 80px 20px;
    position: relative;
    color: white;
    text-align: center;
    overflow: hidden;
}

/* Add a semi-transparent overlay for better readability */
.about-us .overlay {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Slightly darker overlay for better contrast */
    z-index: 1;
}

/* Container for content */
.about-us-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap; /* Allows items to wrap to next line */
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Text Section */
.about-us-text {
    flex: 1; /* Allow text to grow and shrink */
    min-width: 300px; /* Minimum width before wrapping */
    padding: 20px;
    color: white;
}

.about-us-text h2 {
    font-size: 3rem;
    color: #ffb902;
    margin-bottom: 20px;
    font-weight: bold;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Add subtle shadow to title */
}

.about-us-text p {
    font-size: 1.1rem; /* Slightly smaller for mobile */
    line-height: 1.7;
    text-align: justify;
    margin: 0;
}

/* Image Section */
.about-us-image {
    flex: 1; /* Allow image to grow and shrink */
    min-width: 280px; /* Minimum width before wrapping */
    padding: 20px;
    text-align: center;
    /* Removed margin-top for flexible positioning by flexbox */
}

.about-us-image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4); /* Stronger shadow for depth */
    transition: transform 0.3s ease;
}

.about-us-image img:hover {
    transform: scale(1.03); /* Slightly less aggressive zoom on hover */
}

/* Footer Styles (New additions) */
.footer {
    background-color: #333;
    color: #fff;
    padding: 40px 20px;
    font-size: 0.9em;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    max-width: 1200px;
    margin: 0 auto;
    gap: 30px; /* Space between footer sections */
}

.footer-section {
    flex: 1;
    min-width: 250px; /* Minimum width for each section before wrapping */
    margin-bottom: 20px;
}

.footer-section h3 {
    color: #ffb902;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.footer-section p {
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li a {
    color: #fff;
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #ffb902;
}

.social-links a {
    color: white;
    font-size: 1.5em;
    margin-right: 15px;
    transition: color 0.2s;
}

.social-links a:hover {
    color: #ffb902;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
}

/* Backdrop for mobile menu (new) */
.backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99; /* Below sidebar, above content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}


/* --- Media Queries for Responsiveness --- */

/* For screens smaller than 1024px (Laptops, large tablets) */
@media (max-width: 1024px) {
    .header-text h1 {
        font-size: 1.8em;
    }
    .header-text p {
        font-size: 11px;
    }

    nav a {
        margin: 0 8px;
        font-size: 1rem;
        padding: 6px 10px;
    }

    .about-us {
        padding: 60px 15px;
    }
    .about-us-text h2 {
        font-size: 2.5rem;
    }
    .about-us-text p {
        font-size: 1em;
    }

    .footer-section {
        min-width: 200px;
    }
}

/* For screens smaller than 768px (Tablets & Mobile) */
@media (max-width: 768px) {
    header {
        flex-direction: row; /* Keep logo/text on one row, push toggle to right */
        justify-content: space-between;
        padding: 10px 15px;
    }

    .header-container {
        flex-wrap: nowrap; /* Prevent header text from wrapping */
        justify-content: flex-start;
    }

    .logo img {
        height: 60px; /* Smaller logo */
    }

    .header-text {
        margin-right: auto; /* Allow text to take space before toggle */
        flex-shrink: 1; /* Allow text to shrink */
    }
    .header-text h1 {
        font-size: 1.5em; /* Smaller title */
    }
    .header-text p {
        font-size: 10px; /* Smaller address */
        white-space: normal; /* Allow address to wrap */
    }

    nav {
        display: none; /* Hide desktop navigation */
        flex-direction: column; /* Stack links vertically for mobile */
        position: fixed;
        top: 0;
        left: 0;
        width: 250px; /* Width of the off-canvas menu */
        height: 100%;
        background-color: #550d0b; /* Same as header */
        padding-top: 80px; /* Space for header if it's not transparent */
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        z-index: 100; /* Ensure sidebar is above backdrop */
        transform: translateX(-100%); /* Initially hide it off-screen */
        transition: transform 0.3s ease-in-out;
        align-items: flex-start; /* Align links to the left */
        border-right: 3px solid #ffb902; /* Add border */
    }

    nav.is-open {
        transform: translateX(0); /* Slide in when open */
    }

    nav a {
        width: 100%; /* Full width links */
        padding: 12px 20px; /* Larger touch targets */
        margin: 5px 0;
        font-size: 1.1em;
        text-align: left;
    }
    nav a:hover,
    nav a:focus {
        transform: none; /* Remove hover transform for mobile menu links */
    }

    .mobile-menu-toggle {
        display: block; /* Show hamburger menu on smaller screens */
        margin-left: 20px; /* Space from header text */
    }

    .about-us-container {
        flex-direction: column; /* Stack text and image vertically */
        padding: 15px;
    }

    .about-us-text, .about-us-image {
        padding: 15px;
        min-width: unset; /* Remove min-width to allow full shrinking */
        flex: none; /* Allow full shrinking */
        width: 100%; /* Take full width */
    }

    .about-us-text h2 {
        font-size: 2rem;
    }
    .about-us-text p {
        font-size: 1em;
    }

    .about-us-image {
        margin-top: 20px; /* Add a small margin when stacked */
    }

    .about-us-image img {
        width: 90%; /* Adjust image width in column layout */
        max-width: 400px; /* Keep image from becoming too wide */
    }

    .footer-container {
        flex-direction: column; /* Stack footer sections */
        align-items: center; /* Center items when stacked */
        gap: 20px;
    }

    .footer-section {
        min-width: 100%; /* Full width when stacked */
        text-align: center; /* Center text */
    }

    .footer-section ul {
        display: flex; /* Make links horizontal */
        justify-content: center;
        flex-wrap: wrap; /* Allow links to wrap */
    }
    .footer-section ul li {
        margin: 0 10px 5px; /* Spacing for horizontal links */
    }
    .footer-section ul li a {
        font-size: 0.9em;
    }

    .social-links {
        margin-top: 15px;
    }
}

/* For screens smaller than 480px (Mobile Phones) */
@media (max-width: 480px) {
    header {
        padding: 8px 10px;
    }
    .logo img {
        height: 50px;
    }
    .header-text h1 {
        font-size: 1.3em;
    }
    .header-text p {
        font-size: 9px;
    }
    .mobile-menu-toggle {
        font-size: 2em;
    }

    nav {
        width: 220px; /* Slightly narrower sidebar */
        padding-top: 70px;
    }

    nav a {
        font-size: 1em;
        padding: 10px 15px;
    }

    .about-us {
        padding: 40px 10px;
    }
    .about-us-text h2 {
        font-size: 1.8rem;
    }
    .about-us-text p {
        font-size: 0.9em;
    }

    .footer {
        padding: 30px 15px;
    }
    .footer-section h3 {
        font-size: 1.1em;
    }
    .footer-bottom {
        margin-top: 20px;
        padding-top: 15px;
    }
}
