/* ===========================
   CUBE CSS - Navigation Bar
   =========================== */

/* COMPOSITION: Layout container with display: contents */

#navbar-container {
    display: block;
    min-height: 0;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* BLOCK: Navbar sticky component */

.navbar {
    background: white;
    padding: 20px 0;
    position: relative;
}

.navbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -12px;
    height: 12px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0));
}

/* LAYOUT: Logo | Hamburger | Menu | Button */
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* BLOCK: Logo component - leftmost */

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
    order: 1;
}

.logo img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.logo img.brand-image {
    object-fit: cover;
    object-position: 50% 50%;
    transform-origin: center center;
    transform: scale(1);
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 16px;
    color: rgb(var(--color-dark));
    line-height: 0.95;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    letter-spacing: 0.2px;
}

.logo-text span {
    display: block;
}

/* BLOCK: Menu toggle button (hamburger) - hidden on desktop */

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 101;
    order: 2;
}

.menu-toggle:focus {
    outline: 2px solid rgb(var(--color-primary));
    outline-offset: 2px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: rgb(var(--color-dark));
    border-radius: 2px;
    transition: all var(--transition-base);
}

/* BLOCK: Navigation menu - center on desktop */

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    flex: 1;
    justify-content: center;
    margin: 0;
    padding: 0;
    order: 3;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: rgb(var(--color-text)) !important;
    font-weight: 500;
    transition: color var(--transition-base);
    display: inline-block;
    padding: 8px 0;
}

.nav-menu a:hover {
    color: rgb(var(--color-primary-dark)) !important;
}

/* UTILITY: Button override in navbar - rightmost */

.navbar .btn-primary {
    background: rgb(var(--color-primary));
    color: rgb(var(--color-white));
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-block;
    box-shadow: 0 4px 12px rgb(var(--color-black-rgb) / 0.12);
    white-space: nowrap;
    flex-shrink: 0;
    order: 4;
}

.navbar .btn-primary:hover {
    background: rgb(var(--color-primary-dark));
    color: rgb(var(--color-white));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(var(--color-black-rgb) / 0.2);
}

/* EXCEPTION - Tablet */
@media (max-width: 1024px) {
    .nav-wrapper {
        gap: 15px;
    }

    .nav-menu {
        gap: 25px;
    }

    .logo-text {
        font-size: 14px;
    }

    .navbar .btn-primary {
        padding: 11px 24px;
        font-size: 14px;
    }
}

/* EXCEPTION - Mobile */
@media (max-width: 768px) {
    .navbar {
        padding: 16px 0;
    }

    #navbar-container {
        min-height: 0;
        height: auto;
    }

    .nav-wrapper {
        gap: 10px;
    }

    /* Show hamburger on mobile */
    .menu-toggle {
        display: flex;
    }

    /* Hide menu text on desktop, show as dropdown on mobile */
    .nav-menu {
        display: none;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: white;
        padding: 20px 0;
        box-shadow: 0 8px 20px rgb(var(--color-black-rgb) / 0.15);
        margin: 0;
        list-style: none;
        z-index: 99;
        width: 100vw;
        justify-content: flex-start;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        padding: 15px 20px;
        border-bottom: 1px solid rgb(var(--color-light));
        margin: 0;
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        padding: 0;
        display: block;
    }

    .logo {
        gap: 5px;
    }

    .logo img {
        width: 40px;
        height: 40px;
    }

    .logo-text {
        font-size: 13px;
    }

    .navbar .btn-primary {
        padding: 10px 18px;
        font-size: 13px;
    }

    .menu-toggle span {
        width: 22px;
        height: 2.5px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 10px 0;
    }

    .nav-wrapper {
        gap: 8px;
    }

    .logo {
        gap: 4px;
    }

    .logo img {
        width: 35px;
        height: 35px;
    }

    .logo-text {
        font-size: 11px;
        line-height: 1.02;
    }

    .navbar .btn-primary {
        padding: 9px 16px;
        font-size: 12px;
    }

    .menu-toggle {
        padding: 6px;
    }

    .menu-toggle span {
        width: 20px;
        height: 2px;
        gap: 4px;
    }

    .nav-menu {
        top: 60px !important;
    }
}
