﻿
.dropdown-menu {
    margin-top: 0;
   
}
#topNavOuterDiv {
    /* Put the navbar in the same "fixed" stacking context as dat.gui */
   
    /* Ensure it's on top of dat.gui (which is often ~1000) */
    z-index: 1050;
    
}
    .dropdown-menu .dropdown-toggle::after {
        vertical-align: middle;
        border-left: 4px solid;
        border-bottom: 4px solid transparent;
        border-top: 4px solid transparent;
    }

    .dropdown-menu .dropdown .dropdown-menu {
        left: 100%;
        top: 0%;
        margin: 0 20px;
        border-width: 0;
    }

    .dropdown-menu > li a:hover,
    .dropdown-menu > li.show, .dropdown-menu > li:hover {
        background: #007bff;
        color: white;
    }

        .dropdown-menu > li.show > a {
            color: white;
           
        }

@media (min-width: 768px) {
    .dropdown-menu .dropdown .dropdown-menu {
        margin: 0;
        border-width: 1px;
    }
}


@media (min-width: 768px) {

    /* 1. L2 Menu Container (UL): 
       Make it a shrink-wrap, horizontal flex-box only when shown. */
    .dropdown-menu .dropdown .dropdown-menu.show {
        display: inline-flex;
        /* Allow wrapping if it gets too long */
        /* Safety net for very long menus */
        max-width: 700px;
        padding-right: 0.5rem;
    }

    /* 2. L2 Menu List Items (LI): 
       We remove the padding from here. */
    .dropdown-menu .dropdown .dropdown-menu li {
        /* Override the inline padding script from index-test.html */
        padding: 0.02rem !important;
    }

        /* 3. L2 Menu Links (A): 
       THIS IS THE REAL FIX. */
        .dropdown-menu .dropdown .dropdown-menu li > a.dropdown-item {
            /* * Bootstrap's ".dropdown-item" is 'display: block' and 'width: 100%'.
        * We override that here to make it horizontal.
        */
            /* === Fixed Sizing === */
            /* Give every item a fixed width and height */
            width: 100px;
            height: 75px;
            /* === Centering === */
            /* Change to inline-flex to center the image inside */
            display: inline-flex;
            align-items: center; /* Vertical centering */
            justify-content: center; /* Horizontal centering */
            /* === Spacing === */
            /* Use margin for spacing between items */
            margin: 0.1rem;
            padding: 0; /* Remove padding, we use flex to center */
        }
}