/* Header Styles */

/* Basic header layout */
.header {
    align-items: center;
    background-color: #202542;
    color: #fff;
    display: flex;
    flex-direction: row;
    gap: 2rem;
    justify-content: space-between;
    padding: 2rem 3.2rem;
    position: relative;
}

.header a {
    color: #fff;
    text-decoration: none;
    text-wrap: nowrap;
}

/* Homepage link */
.header .homepage-link {
    align-items: center;
    display: flex;
}

.header .homepage-link a {
    align-items: center;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    font-size: 1.5rem;
    font-style: normal;
    padding: 0.5rem 1rem;
}

.header .homepage-link img {
    width: 34px;
}

/* Navigation styles */
.header .main-nav {
    align-items: center;
    display: flex;
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: #202542;
    z-index: 999;
    justify-content: center;
}

.header .main-nav.nav-open {
    left: 0;
    transition: left 0.3s ease;
}

/* Disable transitions during viewport changes to prevent unwanted animations */
.header .main-nav.resizing {
    transition: none !important;
}

.header .main-nav ul {
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.header .main-nav li {
    margin: 0;
}

.header .main-nav a {
    display: block;
    font-size: 1.5rem;
    padding: 1rem 2rem;
    border-radius: 0.25rem;
    text-align: center;
    transition: background-color 0.2s ease;
}

.header .main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hamburger menu */
.header .hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.header .hamburger-menu.active {
    position: fixed;
    top: 2.55rem;
    right: 3.2rem;
}

.header .hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.header .hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.header .hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.header .hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Desktop navigation styles */
@media (min-width: 1025px) {
    .header .main-nav {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        left: 0 !important;
        display: block !important;
    }

    .header .main-nav ul {
        flex-direction: row;
        gap: .5rem;
    }

    .header .main-nav a {
        font-size: 1.2rem;
        padding: 0.5rem 1rem;
    }

    .header .hamburger-menu {
        display: none !important;
    }
}
