/* --- Title Area Restructuring --- */
#titlearea {
    display: grid !important;
    /* Column 1: Hamburger, Column 2: Project Logo/Name, Column 3: Existing elements like search */
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto; /* Row 1: Header items, Row 2: Expanded Menu */
    align-items: center;
    padding: 10px 16px;
    position: relative;
}

#top-nav-list {
    gap: 24px;
}

/* Ensure project name/logo stays aligned on the top row, column 2 */
#titlearea > table {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
}

/* --- Hamburger Button Styling --- */
#custom-hamburger-btn {
    grid-column: 1;
    grid-row: 1;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--page-foreground-color, #333); /* Leverages Doxygen Awesome variables */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#custom-hamburger-btn:hover {
    background: var(--separator-color, rgba(0,0,0,0.1));
}

#custom-hamburger-btn.active {
    color: var(--primary-color, #4a90e2);
}

/* --- Dropdown Menu Styling (Appears Below Hamburger and Project Name) --- */
#custom-dropdown-menu {
    grid-column: 1 / -1; /* Spans across all grid columns full width */
    grid-row: 2;         /* Positions directly on the second row below header elements */
    display: none;       /* Hidden by default */
    width: 15%;
    background-color: var(--page-background-color, #ffffff);
    border-top: 1px solid var(--separator-color, #e0e0e0);
    border-bottom: 1px solid var(--separator-color, #e0e0e0);
    margin-top: 4px;
    padding: 8px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

#custom-dropdown-menu.open {
    display: block; /* Flips to block when JavaScript toggles class */
}

/* Dropdown link item formatting */
#custom-dropdown-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

#custom-dropdown-menu ul li a {
    display: block;
    padding: 10px 24px;
    color: var(--page-foreground-color, #333);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

#custom-dropdown-menu ul li a:hover {
    background-color: var(--primary-light-color, #f0f7ff);
    color: var(--primary-color, #4a90e2);
}

#top-nav-search{
    padding-left: 10px;
}