/* Group 312 Chicago - shared header / navigation (used by every page) */
:root { --header-h: 64px; }

header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    height: var(--header-h);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

nav {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo is a normal flex item, so it can never be overlapped */
.logo {
    flex: 0 0 auto;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.nav-menu {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    white-space: nowrap;
}

.nav-links a {
    position: relative;
    display: block;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

/* Thin underline that grows from the centre on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    left: 0.8rem;
    right: 0.8rem;
    bottom: 0.25rem;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
    transform: scaleX(1);
}

.lang-switcher { flex: 0 0 auto; }

.lang-switcher a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    transition: background 0.2s, border-color 0.2s;
}

.lang-switcher a:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: #fff;
}

/* Hamburger (hidden on desktop) */
.hamburger {
    display: none;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.hamburger:hover { background: rgba(255, 255, 255, 0.1); }

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.2s;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Menu collapses BEFORE the links can reach the logo */
@media (max-width: 1120px) {
    .logo { order: 1; margin-right: auto; }
    .nav-menu { order: 0; flex: 0; position: static; }
    .lang-switcher { order: 2; }
    .hamburger { order: 3; display: flex; margin-right: -0.5rem; }

    .nav-links {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 1.5rem 1rem;
        background: #1e3a8a;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-links li + li { border-top: 1px solid rgba(255, 255, 255, 0.12); }

    .nav-links a {
        font-size: 1.05rem;
        padding: 0.95rem 0.25rem;
        border-radius: 0;
    }

    .nav-links a::after { display: none; }
    .nav-links a:hover, .nav-links a:focus-visible { background: rgba(255, 255, 255, 0.06); }
}

@media (max-width: 480px) {
    nav { padding: 0 1rem; gap: 0.75rem; }
    .logo { font-size: 1.1rem; }
    .nav-links { padding: 0.5rem 1rem 1rem; }
    .lang-switcher a { padding: 0.35rem 0.7rem; }
}

/* Current page marker (set by /js/site.js) */
.nav-links a[aria-current="page"] { color: #fff; }
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
