.hamburger {
    display: none;
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 100;
    padding: 10px;
    background: none;
    border: none;
}

.bar {
    display: block;
    width: 28px;
    height: 2px;
    margin-bottom: 6px;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

.bar:last-child {
    margin-bottom: 0;
}

@media screen and (max-width: 650px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 0;
        width: 46px;
        height: 46px;
        background: #c4abb4;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .bar {
        width: 22px;
        margin-bottom: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(196, 171, 180, 0.98); /* Institutional pink */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        z-index: 90;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        display: flex;
        padding: 0;
    }

    .navbar.active {
        transform: translateX(0);
    }

    .navbar #navbarmain,
    .navbar .menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 0;
        list-style: none;
    }

    .navbar #navbarmain li,
    .navbar .menu li {
        margin: 0;
        width: 100%;
        text-align: center;
    }

    .navbar #navbarmain li a,
    .navbar .menu li a {
        display: block;
        padding: 22px 40px;
        font-size: 28px;
        color: white;
        text-decoration: none;
        font-family: 'Lusitana', serif;
        letter-spacing: 1px;
        transition: background-color 0.2s ease;
    }

    .navbar #navbarmain li a:hover,
    .navbar .menu li a:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }

    #logo1 {
        display: block; /* Show on mobile */
        position: static; /* Flow in flex container above menu items */
        margin-bottom: 40px; /* Increased space between logo and menu */
        text-align: center;
        width: 100%;
        padding-top: 0;
        z-index: 100;
        height: auto;
        transform: none; /* Reset transform from style.css */
    }

    #logo1 img {
        height: 200px !important; /* Force enlarged logo for mobile menu */
        width: auto !important;
        max-width: 80vw; /* Ensure it doesn't overflow screen width */
        display: inline-block;
        filter: brightness(0) invert(1); /* Make logo white */
        object-fit: contain;
    }

    /* Submenu: inline, no absolute positioning */
    .menu-item-has-children > ul.sub-menu {
        position: static !important;
        background: transparent !important;
        box-shadow: none !important;
        min-width: unset !important;
        border-radius: 0 !important;
        padding: 0 !important;
        display: none;
        width: 100%;
    }

    .menu-item-has-children > ul.sub-menu::before {
        display: none !important;
    }

    .menu-item-has-children.open > ul.sub-menu {
        display: block;
    }

    .menu-item-has-children > ul.sub-menu li a {
        font-size: 20px !important;
        padding: 14px 40px !important;
        color: rgba(255, 255, 255, 0.80) !important;
        font-family: 'Lusitana', serif !important;
        letter-spacing: 0.5px;
        border-top: none;
    }

    .menu-item-has-children > ul.sub-menu li a:hover {
        background-color: rgba(255, 255, 255, 0.12) !important;
        color: white !important;
    }

    .navbar .social {
        position: static;
        margin-top: 30px;
    }

    .navbar .social ul {
        display: flex;
        justify-content: center;
        gap: 15px;
        padding: 0;
    }

    .social #fb,
    .social #ig,
    .social #lnkd,
    .social #git {
        filter: invert(1) brightness(2);
        opacity: 0.9;
    }
}
