/* ==== HEADER / NAV WRAPPER ===================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    gap: 16px;
}

/* Fixed nav bar height so hover area is consistent */
.main-nav {
    display: flex;
    align-items: stretch;       /* children fill full height */
    gap: 12px;
    height: 44px;               /* nav bar height */
    flex-wrap: wrap;
}

/* ==== BRAND ==================================================== */

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* logos row: UNDP first, then Japan */
.brand-logos {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-logo.undp-logo {
    width: 42px;
    height: 42px;
}

.brand-logo.japan-logo {
    width: 38px;
    height: 38px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ==== TOP-LEVEL NAV LINKS ===================================== */

/* nav-item fills the full bar height */
.nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: stretch;
}

/* default router-links and Projects trigger */
.nav-link {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 14px;            /* horizontal padding only */
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: background 0.2s, color 0.2s;
}

/* Home / Contact / Blog / JSB Map can be plain router-links
   (not wrapped in .nav-item) – this still works */
.main-nav > .nav-link {
    align-self: stretch;
}

/* hover + active pill look */
.nav-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
}

/* caret icons */
.nav-caret {
    font-size: 1.5rem;
    line-height: 1;
    padding-left: 2px;
}

.caret-right {
    font-size: 1.2rem;
}

/* ==== DROPDOWN MENUS (HOVER) ================================== */

/* base dropdown box – no top/left here */
.dropdown-menu {
    position: absolute;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
    padding: 6px 0;
    margin: 0;
    list-style: none;
    z-index: 50;
    display: none;
}

/* ROOT MENU under "Projects" – attached to bottom of full-height nav item */
.nav-item.dropdown > .dropdown-menu.root-menu {
    top: 100%;        /* exactly flush with bottom of nav bar */
    left: 0;
    min-width: 220px;
}

/* show root menu when hovering the whole Projects item */
.nav-item.dropdown:hover > .dropdown-menu.root-menu {
    display: block;
}

/* first-level rows: Climate Promise / Food Security */
.dropdown-submenu {
    position: relative;
}

.dropdown-link {
    width: 100%;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: none;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    white-space: nowrap;
}

.dropdown-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

/* ==== SUB-MENUS (SECOND LEVEL) ================================ */

/* sub menu opens to the right, aligned with parent row, no gap */
.dropdown-submenu > .dropdown-menu.sub-menu {
    top: 0;           /* align with top of the parent row */
    left: 100%;       /* right edge of parent menu */
    min-width: 200px;
    margin-left: -1px; /* overlap 1px so there is ZERO gap */
    display: none;
}

/* show sub menu when hovering the row */
.dropdown-submenu:hover > .dropdown-menu.sub-menu {
    display: block;
}

/* submenu links */
.sub-dropdown-link {
    display: block;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

.sub-dropdown-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

/* ==== RESPONSIVE ============================================== */

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: wrap;
    }
    .main-nav {
        height: auto;           /* we’d rework mobile separately if needed */
        flex-wrap: wrap;
    }
}
