header {
    background-color: white;
    margin: 0;
    display: grid;
    grid-template-columns: auto 1fr auto;
}

header .menu {
    padding: 0 var(--s-text-padding);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5em;
}

header a {
    color: var(--c-ocean);
}

a.menu-link {
    position: relative;
    font-family: "Montserrat", sans-serif;
    text-transform: uppercase;
    font-weight: 800;
}

a:hover.menu-link {
    text-decoration: none;
    color: var(--c-coral);
}

a.menu-link:hover::after {
    background-size: 123px 5px;
    height: 5px;
}

header a.menu-lang {
    font-weight: 600;
    font-family: "Montserrat", sans-serif;
}

header a.menu-lang.selected {
    color: var(--c-coral);
}

/* Dropdown */
.dropdown {
    display: block;
    position: relative;
}

.menu-dropdown-parent {
    padding: 0.5em 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    padding: 0.2em;
    flex-direction: column;
    padding-bottom: 0.5em;
}

.dropdown-content a {
    padding: 0.5em 0.5em;
    display: block;
}

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

.page-logo {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem;
    margin: 0;
}

.page-logo a {
    height: 3em;
}

a.dam-logo {
    min-height: 0.6cm;
    height: 1.5em;
}

@media (min-width: 71rem) {
    header {
        grid-template-columns: 1fr calc(var(--s-text-width) + 2 * var(--s-text-padding)) 1fr;
    }
}

/* Mobile menu styles */
@media (orientation: portrait) {
    header {
        grid-template-columns: auto 1fr;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    header .mobile-menu-toggle {
        display: none;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5em;
        align-self: center;
        margin-left: auto;
        margin-right: var(--s-text-padding);
    }

    header .mobile-menu-toggle-line {
        display: block;
        width: 24px;
        height: 3px;
        background-color: var(--c-ocean);
        margin: 4px 0;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    header .mobile-chevron {
        display: inline-block;
        float: right;
        margin-left: 10px;
        transition: transform 0.3s ease;
    }

    header .menu {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0;
        background-color: white;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        display: none;
        max-height: calc(100vh - 3.5em);
        overflow-y: auto;
    }

    header .menu .dropdown {
        width: 100%;
    }

    header .menu .menu-dropdown-parent {
        padding: 1em var(--s-text-padding);
        cursor: pointer;
    }

    header .menu .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        background-color: #f9f9f9;
        flex-direction: column;
    }

    header .menu .dropdown-content .menu-dropdown-child,
    header .menu .dropdown-content .menu-link {
        padding: 0.75em var(--s-text-padding) 0.75em 2em;
        display: block;
    }

    header .menu a.menu-link {
        padding: 1em var(--s-text-padding);
        display: block;
    }

    header .page-logo {
        justify-content: flex-start;
        padding: 0.5em var(--s-text-padding);
    }

    header .page-logo a {
        height: 2.5em;
    }

    header.mobile-mode .mobile-menu-toggle {
        display: block;
    }

    header.mobile-mode .menu {
        display: none;
    }

    header.mobile-open .menu {
        display: flex !important;
    }

    header.mobile-mode .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    header.mobile-mode .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line:nth-child(2) {
        opacity: 0;
    }

    header.mobile-mode .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-toggle-line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .dropdown-content.dropdown-open {
        display: flex !important;
    }

    header.mobile-mode .dropdown:hover .dropdown-content {
        display: none !important;
    }
}
