/* Header & Navigation */
header {
    background-color: #FFFFFF; /* White background for header */
    padding: 5px 0; /* Reduced padding to shrink header */
    border-bottom: 1px solid #E0E0E0; /* Subtle light gray border */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Soft shadow for prominence */
    position: -webkit-sticky; /* For Safari */
    position: sticky;
    top: 0;
    z-index: 500; /* Ensures header stays on top of other content */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.logo-and-contact-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    flex-grow: 1;
}

.logo {
    text-align: center; /* Center its content */
}

.logo img {
    max-width: 100%; /* Ensure responsiveness */
    display: inline-block; /* Allow text-align to work */
}

.header-contact-info {
    display: flex; /* Make it a flex container */
    flex-direction: row; /* Place items side-by-side */
    align-items: center; /* Vertically align items in the middle */
    font-size: 0.8em; /* Smaller font */
    line-height: 1.4;
    color: #333333;
}

.header-contact-info p {
    margin: 0;
    padding-right: 10px; /* Add spacing between items */
}

.header-contact-info a {
    font-weight: bold;
}

nav {
    /* Default desktop styles */
    display: block;
    width: auto;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

nav ul li {
    margin-left: 15px; /* Reduced margin */
}

nav ul li a {
    color: #333333; /* Dark text for navigation links */
    font-weight: bold;
    font-size: 1em; /* Slightly smaller font */
    padding: 5px 0;
    display: block; /* Make entire link clickable area */
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

nav ul li a[aria-current="page"] {
    background-color: #0077D4; /* Primary blue background for active page */
    color: #FFFFFF; /* White text for active page */
    border-bottom: 2px solid #0077D4; /* Keep the border for active page */
    border-radius: 5px;
    padding: 2px 5px;
    display: inline-block;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    left: 0; /* Align dropdown with the parent link */
    padding: 10px 0; /* Add some padding inside the dropdown */
    border-radius: 5px;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left; /* Align text to the left */
    font-weight: normal; /* Reset font-weight for dropdown items */
    border-bottom: none; /* Remove underline for dropdown items */
    white-space: nowrap; /* Prevent word wrapping */
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #0077D4; /* Highlight on hover */
}

.dropdown:hover .dropdown-content {
    display: block;
}

.hamburger {
    display: none; /* Hidden by default on desktop */
    cursor: pointer;
    padding: 15px;
    background-color: transparent;
    border: 0;
    z-index: 501; /* Ensure it's above other content */
}

.hamburger-box {
    width: 30px;
    height: 24px;
    display: inline-block;
    position: relative;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
    width: 30px;
    height: 4px;
    background-color: #333; /* Dark color for hamburger lines */
    border-radius: 4px;
    position: absolute;
    transition-property: transform;
    transition-duration: 0.15s;
    transition-timing-function: ease;
}

.hamburger-inner::before,
.hamburger-inner::after {
    content: "";
    display: block;
}

.hamburger-inner::before {
    top: -10px;
}

.hamburger-inner::after {
    bottom: -10px;
}

/* Hamburger active state (X icon) */
.hamburger.is-active .hamburger-inner {
    transform: translate3d(0, 10px, 0) rotate(45deg);
}

.hamburger.is-active .hamburger-inner::before {
    transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
    opacity: 0;
}

.hamburger.is-active .hamburger-inner::after {
    transform: translate3d(0, -20px, 0) rotate(-90deg);
}

/* Mobile Styles */
@media (max-width: 768px) {
    header .container {
        flex-wrap: nowrap; /* Prevent wrapping in header on mobile */
        justify-content: space-between; /* Space out logo, contact, and hamburger */
    }

    .header-contact-info {
        display: none; /* Hide contact info on mobile by default */
    }

    nav {
        display: none; /* Hide main nav by default */
        position: fixed; /* Overlay the content */
        top: 0; /* Position from top */
        left: 0; /* Position from left */
        width: 100%; /* Full width */
        height: 100%; /* Full height */
        background-color: #FFFFFF; /* White background for mobile nav */
        z-index: 499; /* Below hamburger, above content */
        overflow-y: auto; /* Enable scrolling for long menus */
        padding-top: 60px; /* Space for fixed header */
        box-sizing: border-box; /* Include padding in height */
    }

    nav.is-active {
        display: block; /* Show mobile nav when active */
    }

    nav ul {
        flex-direction: column; /* Stack links vertically */
        gap: 0; /* Remove gap between links */
    }

    nav ul li {
        margin-left: 0;
        border-bottom: 1px solid #E0E0E0; /* Separator for links */
    }

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

    nav ul li a {
        padding: 15px; /* Larger touch targets */
        font-size: 1.1em;
    }

    .hamburger {
        display: block; /* Show hamburger on mobile */
    }

    /* Adjust dropdowns for mobile */
    .dropdown-content {
        position: static; /* Remove absolute positioning */
        box-shadow: none; /* Remove shadow */
        background-color: #f1f1f1; /* Slightly different background for sub-items */
        width: 100%;
        padding-left: 20px; /* Indent sub-items */
    }

    .dropdown:hover .dropdown-content {
        display: none; /* Disable hover effect on mobile */
    }

    /* Add a class to toggle dropdown content with JS on mobile */
    .dropdown.is-active .dropdown-content {
        display: block;
    }
}