.navmenu {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 20px;
    padding-left: 10%;
    background-color: #f4f4f4;
    position: fixed;
    top: 0;
    width: 100%;
    transition: padding 0.3s;
    z-index: 1000;
    box-sizing: border-box; 
}

.navmenu img {
    height: auto;
    width: 300px;
    transition: height 0.3s;
    padding-right: 30%;
}

/*导航栏变色*/
.navmenu nav {
    display: flex;
    flex: 1; /* Allow nav to take available space */
    justify-content: flex-start; 
    margin-left: 30%; /* Add left margin to move links left */
}


.navmenu a {
    text-decoration: none;
    color: #d7b065;
    padding: 0 15px;
    font-size: 18px;
    font-weight: bold;
    white-space: nowrap; /* Prevent wrapping */
    transition: color 0.3s;
}

.navmenu a:hover {
    color: rgb(156, 156, 156); /* Change to red on hover */
}

.navmenu.shrink {
    padding: 5px 20px;
}

.navmenu.shrink img {
    height: 40px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1100; /* Ensure the hamburger menu is above the overlay */
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: black;
    margin: 4px 0;
    transition: 0.4s;
}

/* Full-screen overlay for mobile menu */
.overlay-menu {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1000;
    top: 0;
    right: 0;
    background-color: rgba(129, 129, 129, 0.9); /* Dark background with transparency */
    overflow-x: hidden;
    transition: 0.5s;
}

.overlay-menu-content {
    position: relative;
    top: 25%;
    width: 100%;
    text-align: center;
    margin-top: 30px;
}

.overlay-menu-content a {
    padding: 8px;
    text-decoration: none;
    font-size: 25px;
    color: white;
    display: block;
    transition: 0.3s;
}

.overlay-menu-content a:hover {
    color: rgb(116, 113, 113);
}

.overlay-menu .closebtn {
    position: absolute;
    top: 20px;
    right: 45px;
    font-size: 60px;
}

/* Hide navmenu and show hamburger menu on smaller screens */
@media (max-width: 900px) {
    .navmenu nav {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .overlay-menu {
        width: 0;
    }

    .overlay-menu.open {
        width: 100%;
    }
}
