:root {
    --navbar-height: 70px;
    --header-img-height: 50px;
    --header-img-width: 95px;
    --navbar-background: #8830a3;
    --nav-link-color: #FFFFFF;
    --nav-link-hover-color: #e6e6ee;
    --nav-dropdown-content-hover-color: #000000;
    --nav-link-active-underline: #FFD700;
    --text-color: #333333;
    --card-background: #FFFFFF;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* General Page Setup */
body,
html {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--page-background);
    color: var(--text-color);
}

body {
    padding-top: var(--navbar-height); /* Account for fixed navbar */
}

a:link {
    color: #2548B1;
  }
a:visited {
  color: #662D91;
}
a:active {
  color: #0F2050;
}

a#skip-to-main-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 2000;
    transition: top 0.3s;
}
a#skip-to-main-link:focus {
    top: 10px;
}
@media (prefers-reduced-motion: reduce) {
    a#skip-to-main-link {
        transition: none;
    }
}

summary {
    cursor: pointer;
    font-weight: bold;
}

iframe.youtube-embed {
    border: none;
}

/* Navigation Bar */
.l1 {
    list-style-type: none;
    margin: 0;
    padding: 0 20px;
    overflow: visible;
    background-image: linear-gradient(to bottom right, #562774, #431f58);
    height: var(--navbar-height);
    width: 100%;
    position: fixed; /* Keep only one position property */
    top: 0;
    left: 0;
    right: 0;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.l1.nav-hidden {
    transform: translateY(-100%);
}

.nav-toggle {
    display: none;
    margin-left: auto;
    margin-right: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle svg {
    width: 28px;
    height: 28px;
    stroke: var(--nav-link-color);
    transition: transform 0.2s ease;
}

.l1.nav-open .nav-toggle svg {
    transform: rotate(90deg);
}

/* Logo specific container if needed, or direct style on <a> */
a:has(img#ElginParkOrcaImage) { /* Logo link */
    display: flex; /* For aligning image if text was next to it */
    align-items: center;
    height: 100%;
    flex: 0 0 auto; /* Prevent logo from growing or shrinking */
    z-index: 2; /* Ensure logo stays above other elements */
}

#ElginParkOrcaImage {
    height: var(--header-img-height);
    width: var(--header-img-width);
    /* Removed position: absolute, padding-top, padding-left */
    /* Margin might be needed if not perfectly aligned by flex */
    margin-right: 0; /* Remove margin since logo positioning is now independent */
}

.NavItem {
    position: absolute; /* Take it out of normal flow */
    left: 0;
    right: 0;
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center; /* Center the navigation items */
    flex-wrap: wrap; /* Add this to handle wrapping */
    padding: 0; /* Reset any padding */
    pointer-events: none; /* Allow clicks to pass through the container */
}

.NavItem > li {
    pointer-events: auto; /* Re-enable clicks on the actual buttons */
}

.l1 li {
    margin: 0 5px;
    height: var(--navbar-height); /* Add fixed height */
    display: flex; /* Add flex display */
    align-items: center; /* Center items vertically */
}

.NavItem .top-level {
    border: none;
    padding: 0px 15px; /* Vertical padding is handled by line-height/height of parent */
    display: flex; /* Change from inline-block to flex */
    align-items: center; /* Center text vertically */
    justify-content: center; /* Center text horizontally */
    color: var(--nav-link-color);
    text-align: center;
    font-size: 16px; /* Adjusted font size */
    text-decoration: none;
    cursor: pointer;
    background-color: transparent; /* Buttons should be transparent on navbar */
    height: 100%; /* Take full height of parent */
    line-height: normal; /* Reset line-height */
    transition: color 0.2s ease-in-out, border-bottom-color 0.2s ease-in-out;
    border-bottom: 3px solid transparent; /* For active/hover effect */
    font-family: var(--font-family);
}

.NavItem .top-level:hover {
    color: var(--nav-link-hover-color);
    border-bottom-color: var(--nav-link-hover-color);
}

.l1 li a:hover {
    color: var(--nav-dropdown-content-hover-color);
    border-bottom-color: var(--nav-dropdown-content-hover-color);
}


.l1 li .active-link {
    border-bottom-color: var(--nav-link-active-underline);
    font-weight: bold;
}


/* Dropdown Menu */
li.dropdown {
    display: inline-block; /* Keeps it in flow */
    position: relative; /* Needed for absolute positioning of dropdown-content */
}

.dropdown-content {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: absolute; /* Changed from fixed to be relative to parent li.dropdown */
    background-color: #f9f9f9;
    min-width: 200px; /* Give it a minimum width */
    /* width: 100%; Removed, let it size by content or set a max-width */
    left: 0;
    top: var(--navbar-height); /* Position below the navbar */
    z-index: 1001; /* Ensure it's above other nav items but below navbar scroll */
    padding: 10px 0; /* Adjusted padding */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    display: grid; /* Can keep grid or simplify to block */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0px; /* No gap if items are full width */
    opacity: 0;
    visibility: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
}

.dropdown-content a {
    transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    text-align: left;
    cursor: pointer;
    padding: 12px 20px;
}

.dropdown-content a:hover {
    background-color: #e9e9e9;
    color: var(--navbar-background);
}


@media (max-width: 900px) {
    :root {
        --navbar-height: 60px;
    }

    .l1 {
        padding: 0 16px;
    }

    .NavItem {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        z-index: 999;
        height: auto;
        background-image: linear-gradient(to bottom right, #562774, #431f58);
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: flex-start;
        padding: 10px 0;
        max-height: calc(100vh - var(--navbar-height));
        overflow-y: auto;
        display: none;
        pointer-events: auto;
        gap: 0;
    }

    .l1.nav-open .NavItem {
        display: flex;
    }

    .NavItem > li {
        width: 100%;
        height: auto;
        margin: 0;
    }

    li:has(.top-level) {
        width: 100%;
        justify-content: left;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1002;
    }

    .l1 > a {
        z-index: 1002;
    }

    .dropdown {
        width: 100%;
        display: block;
        position: static;
    }

    .dropdown-content {
        position: static;
        background-color: #f4f2f7;
        box-shadow: none;
        padding: 0;
        grid-template-columns: 1fr;
        opacity: 1;
        visibility: visible;
        display: none;
    }

    .dropdown.open .dropdown-content {
        display: block;
    }

    .dropdown-content a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        color: var(--text-color);
    }

    .l1 li .active-link,
    .l1 li a:hover,
    .NavItem .top-level:hover {
        border-bottom-color: transparent;
    }
}


/* Footer */
.site-footer {
    background-image: linear-gradient(to bottom right, #5a217e, #431f58);
    color: var(--nav-link-color);
    text-align: center;
    padding: 20px 15px;
    margin-top: 0px;
    font-size: 0.9em;
    font-family: var(--font-family);
}

.site-footer h4,
.site-footer .footer-address,
.site-footer a {
    margin-top: 4px;
    margin-bottom: 4px;
}

.site-footer a {
    color: var(--nav-link-active-underline);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.footer-credit {
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 20px;
    font-style: italic;
}
