/* Top navigation bar */
.topnav {
    background-color: #0066cc;
    position: fixed;
    z-index: 999;
    width: 100%;
    padding: 8px 0;
    box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}

.topnav::after {
    content: '';
    display: block;
    clear: both;
}

.topnav #myLinks {
    display: inline;
}

.topnav a.icon {
    display: none;
}

/* Logo — align left edge with the page wrapper */
.topnav img {
    margin-bottom: 0;
    margin-top: 10.5pt;
    margin-left: calc(50% - 423px);
}

/* Style the links inside the navigation bar */
.topnav a.normal {
    float: right;
    color: #f2f2f2;
    text-align: center;
    padding: 11px 10px;
    text-decoration: none;
    font-size: 18px;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    letter-spacing: 0.03em;
    position: relative;
    transition: color 0.2s ease;
}

.topnav a.normal::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 10px;
    right: 10px;
    height: 2px;
    background: #FFFFFF;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.topnav a.normal:hover {
    background-color: transparent;
    color: #fff;
}

.topnav a.normal:hover::after {
    transform: scaleX(1);
}

/* First nav item — align right edge with the page wrapper */
.topnav a.right {
    margin-right: 0;
}

.topnav .dropdown.right {
    margin-right: calc(50% - 480px);
}

/* Dropdown */
.topnav .dropdown {
    float: right;
    position: relative;
}

.topnav .dropdown .dropbtn {
    display: block;
    float: none;
    cursor: pointer;
    user-select: none;
}

.topnav .dropdown .dropdown-arrow {
    font-size: 11px;
    vertical-align: middle;
    margin-left: 1px;
}

.topnav .dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #13294B;
    min-width: 130px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    border-top: 2px solid #FF5F05;
    z-index: 1000;
}

.topnav .dropdown-content a {
    color: #f2f2f2;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 15px;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    text-align: left;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.topnav .dropdown-content a:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.08);
}

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

.topnav a.language-switch {
    margin-right: calc(50% - 480px);
}

/* Responsive: tablet / small desktop */
@media print, screen and (max-width: 1000px) {
    .topnav img { 
        margin-left: 16px; 
        margin-top: 10.5pt;
    }

    .topnav a.right { 
        margin-right: 16px; 
    }

    .topnav .dropdown.right { 
        margin-right: 16px; 
    }

    .topnav a.normal { 
        padding: 11px 7px; 
    }
}

/* Responsive: mobile (hamburger menu) */
@media print, screen and (max-width: 960px) {

    .topnav {
        min-height: 45px;
        box-sizing: border-box;
    }

    .topnav img { 
        margin-left: 35px; 
        margin-top: 10pt;}

    .topnav a.normal::after { display: none; }

    .topnav #myLinks {
        display: flex;
        flex-direction: column-reverse;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease-in-out;
    }

    .topnav #myLinks.open {
        max-height: 600px;
    }

    .topnav a.normal {
        color: white;
        float: none;
        padding: 14px 16px;
        text-decoration: none;
        font-size: 16px;
        display: block;
    }

    .topnav a.icon {
        color: white;
        display: block;
        padding: 10px 16px;
        font-size: 17px;
        position: absolute;
        float: right;
        right: 0;
        top: 0;
        margin-right: 5%;
    }

    .topnav a.icon .icon-wrap {
        position: relative;
        display: inline-block;
        width: 1em;
        height: 1em;
    }

    .topnav a.icon .icon-bars,
    .topnav a.icon .icon-xmark {
        position: absolute;
        top: 0;
        left: 0;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .topnav a.icon .icon-bars  { 
        opacity: 1; transform: rotate(0deg); 
    }

    .topnav a.icon .icon-xmark { 
        opacity: 0; transform: rotate(-90deg); 
    }

    .topnav a.icon.active .icon-bars  { 
        opacity: 0; transform: rotate(90deg); 
    }

    .topnav a.icon.active .icon-xmark { 
        opacity: 1; transform: rotate(0deg); 
    }

    .topnav a.right {
        color: white;
        float: none;
        padding: 14px 16px;
        text-decoration: none;
        font-size: 16px;
        display: block;
        margin-right: 0;
    }

    .topnav .dropdown {
        float: none;
        width: 100%;
    }

    .topnav .dropdown .dropbtn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        width: 100%;
        box-sizing: border-box;
        padding: 14px 16px;
    }

    .topnav .dropdown .dropdown-arrow {
        font-size: 13px;
        transition: transform 0.25s ease;
    }

    .topnav .dropdown.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    .topnav .dropdown-content {
        display: block;
        position: static;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: none;
        border-top: none;
        background-color: transparent;
        min-width: unset;
    }

    .topnav .dropdown.open .dropdown-content {
        max-height: 200px;
    }

    .topnav .dropdown-content a {
        padding: 10px 16px;
        font-size: 15px;
        color: rgba(242, 242, 242, 0.85);
        text-align: center;
    }

    .topnav .dropdown-content a:hover {
        color: #fff;
        background-color: transparent;
    }

    .topnav a.language-switch {
        margin-right: 0;
    }
}
