.nav-container input[type="checkbox"] {
    opacity: 0;
}

.nav-container {
        display: block;
        height: 60px;
        position: relative;
    }

.navbar .menu-items {
    display: flex;
}

.navbar .nav-container li {
    list-style: none;
}

.internal-links {
    position: relative;
}


/* ============================================================
   DESKTOP (min-width: 780px)
   ============================================================ */

@media screen and (min-width: 900px) {

    .navbar .nav-container a, .navbar .nav-container label {
        text-decoration: none;
        color: #044273;
        font-weight: 500;
        font-size: 25px;
        padding: 1.5rem;
    }

    .navbar .nav-container a:hover, .navbar .nav-container label:hover {
        font-weight: bolder;
    }


    .navbar .internal-links {
        padding: 1em 2em 0 2em;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50px;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(8px);
        border: 1px solid rgb(215, 196, 165);
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-top: 2vh;
        transition: transform 0.5s ease-in-out;
        position: fixed;
        top: 0;
        right: 2vh;
        z-index: 11;
    }

    .navbar .menu-items .internal-links li {
        margin-bottom: 1.2rem;
        font-size: 1.5rem;
        font-weight: 500;
    }

    .navbar .menu-items .external-links {
        display: none;
    }

    .navbar .menu-items .external-links a {
        padding: 0;
    }

    .navbar .menu-items .external-links li img {
        margin: 0.5em;
        min-height: 20px;
        max-height: 5vh;
        max-width: 50px;
        aspect-ratio: 1;
    }

    .submenu-checkbox {
        display: none;
    }

    .submenu-parent {
        position: relative;
    }

    .navbar .submenu {
        position: absolute;
        top: 200%;

        width: 100%;

        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        border-radius: 32px;
        border: 1px solid rgb(215, 196, 165);

        display: flex;
        flex-direction: column;
        align-items: center;

        padding: 15px;

        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transform: translateY(-10px);
        transition: all 0.3s ease-in-out;

        z-index: 999;
    }

    .submenu img {
        width: 30px;
        height: 30px;
        flex-shrink: 0;
    }

    .navbar .submenu a {
        padding: 10px 0 0 0;
        margin: 0;
        font-size: 18px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    
    .submenu ul {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .submenu li {
        margin: 0;
        width: 100%;
    }

    .submenu-checkbox:checked ~ .submenu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;

        transform: translateY(0);
    }

}

/* ============================================================
   MOBILE (max-width: 780px)
   ============================================================ */

@media screen and (max-width: 900px) {

    .nav-container .checkbox {
        position: fixed;
        display: block;
        height: 32px;
        width: 32px;
        top: 30px;
        right: 30px;
        z-index: 12;
        opacity: 0;
        cursor: pointer;
    }

    .nav-container .hamburger-lines {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: 26px;
        width: 32px;
        position: fixed;
        top: 30px;
        right: 30px;
        z-index: 11;
    }

    .nav-container .hamburger-lines .line {
        display: block;
        height: 4px;
        width: 100%;
        border-radius: 10px;
        background: #044273;
    }

    .nav-container .hamburger-lines .line1 {
        transform-origin: 0% 0%;
        transition: transform 0.4s ease-in-out;
    }

    .nav-container .hamburger-lines .line2 {
        transition: transform 0.2s ease-in-out;
    }

    .nav-container .hamburger-lines .line3 {
        transform-origin: 0% 100%;
        transition: transform 0.4s ease-in-out;
    }

    .navbar .menu-items {
        padding-top: 12vh;
        padding-bottom: 10vh;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 16px;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(8px);
        border: 1px solid  rgb(215, 196, 165);
        transform: translateX(120%);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin-top: 2vh;
        transition: transform 0.5s ease-in-out;
        position: fixed;
        right: 20px;
        left: 20px;
        bottom: 10px;
        top: 0;
        z-index: 10;
    }

    .nav-container .background_menu {
        position: fixed;
        top: 14px;
        right: 16px;
        height: 60px;
        width: 60px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 50px;
        box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(8px);
        border: 1px solid  rgb(215, 196, 165);
        z-index: 2;
    }

    .navbar .menu-items .internal-links li {
        font-size: 1.5rem;
        font-weight: 500;
    }

    .navbar .menu-items .external-links {
        position: fixed;
        bottom: 30px;
        display: flex;
    }

    .navbar .menu-items .external-links a {
        padding: 0;
    }

    .navbar .menu-items .internal-links a {
    color: #044273;
}

    .navbar .menu-items .external-links li img {
        margin: 0.5em;
        height: 3vh;
        max-width: 3vh;
        aspect-ratio: 1;
    }

.submenu-item {
    width: 100%;
}

.submenu-button {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

    width: 100%;

    padding: 1rem 0;

    color: #044273;
    font-size: 1.4rem;
}

.submenu-checkbox {
    display: none;
}

.navbar .submenu {
    position: static;

    width: 100%;

    max-height: 0;
    overflow: hidden;

    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: none;

    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;

    padding: 0;

    transition:
        max-height 0.35s ease,
        padding 0.35s ease;
}

.submenu ul {
    margin: 0;
    padding: 0 0 1rem 0;

    list-style: none;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 0.4rem;

    width: 100%;
}

.submenu a {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;

    width: 100%;
    max-width: 220px; /* keeps the block centered but not full width */

    margin: 0 auto; /* center the whole item */

    gap: 10px;

    padding: 0.8rem 3.5rem;

    font-size: 1rem;
    color: #044273;

    text-align: left;
}

.submenu img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.navbar .menu-items .internal-links li {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.navbar .menu-items .internal-links a {
    display: flex;
    justify-content: center;
    align-items: center;

    width: fit-content;
    padding: 1rem 0;
}

.submenu-checkbox:checked ~ .submenu {
    max-height: 500px;
    padding-top: 0.5rem;
}

    .nav-container input[type="checkbox"]:checked ~ .background_menu {
        opacity: 0;
    }

    .nav-container input[type="checkbox"]:checked ~ .menu-items {
        transform: translateX(0);
    }

    .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line1 {
        transform: rotate(45deg);
    }

    .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line2 {
        transform: scaleY(0);
    }

    .nav-container input[type="checkbox"]:checked ~ .hamburger-lines .line3 {
        transform: rotate(-45deg);
    }
}
