/* Navigation */
nav {
    background: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 15px 25px;
    transition: background 0.3s;
    position: relative;
}

/* Hamburger Menu Button - Hidden by default */
#hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

#hamburger span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: center;
}

/* Hamburger animation when open - X in center */
#hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

#hamburger.open span:nth-child(2) {
    opacity: 0;
}

#hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    #hamburger span,
    nav a,
    button,
    .button {
        transition: none;
    }
}

/* ACCESSIBILITY NOTE: White text on --primary (#6482b8) background may not meet 
   WCAG AA contrast ratio of 4.5:1. Consider using a darker primary color 
   (e.g., #4a5f8c) or lighter text for better accessibility. */

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Focus state for keyboard navigation */
nav a:focus {
    outline: 3px solid white;
    outline-offset: -3px;
    background: rgba(255, 255, 255, 0.2);
}

/* Active/current page indicator */
nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 3px solid var(--accent);
    font-weight: bold;
}

nav a.button {
    background: var(--secondary);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
}

nav a.button:hover {
    background: var(--accent);
    color: var(--dark-text);
}

nav a.button:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ==========================================
   RESPONSIVE NAVIGATION
   ========================================== */

/* Tablets and smaller (max-width: 768px) */
@media screen and (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        padding: 10px 0;
    }
    
    nav a {
        padding: 12px 15px;
        font-size: 0.95em;
    }
    
    nav a.button {
        padding: 10px 20px;
    }
}

/* Mobile phones (max-width: 480px) */
@media screen and (max-width: 480px) {
    /* Show hamburger menu centered */
    #hamburger {
        display: flex;
        margin: 10px auto;
    }
    
    /* Hide navigation by default on mobile */
    nav {
        flex-direction: column;
        align-items: center;
        padding: 0;
    }
    
    nav a {
        display: none;
        width: 100%;
        text-align: center;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Show links when menu is open */
    nav.open a {
        display: block;
    }
    
    /* Adjust button styling in mobile menu */
    nav a.button {
        background: var(--secondary);
        margin: 10px 15px;
        border-radius: 5px;
        width: calc(100% - 30px);
    }
    
    /* Add padding for hamburger button */
    nav {
        min-height: 50px;
    }
    
    /* Active page indicator for mobile */
    nav a[aria-current="page"] {
        background: rgba(255, 255, 255, 0.25);
        border-left: 4px solid var(--accent);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Focus styles for mobile */
    #hamburger:focus {
        outline: 3px solid white;
        outline-offset: 3px;
    }
}

