@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700');

/*
 * Shared navbar for the standalone Blog/<Topic>/index.html research tiles.
 * Reproduces the main-site (home) navbar — see application/views/head.php and
 * the .custom-navbar block in static/css/style.css — but every rule is scoped
 * under #navbar so it never leaks into the blog pages' own content styles.
 *
 * Behaviour mirrors the home page:
 *   - fixed to the top, overlaying the hero;
 *   - desktop: transparent with dark links at the top, turning gray with white
 *     links once scrolled (.top-nav-collapse, toggled by /static/js/blog-navbar.js);
 *   - mobile: always gray with white links, menu behind a hamburger toggle.
 *
 * Link colour rules deliberately follow the home page's specificity pattern so
 * the :hover / .active gold (#E3AE57) always wins over the state colours.
 *
 * Load with: <link rel="stylesheet" href="/static/css/blog-navbar.css" />
 */

#navbar .custom-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    margin-bottom: 0;
    background-color: #636363;   /* default (mobile, and before JS loads) */
    transition: background-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out;
}

#navbar .navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 52px 0 32px;
}

#navbar .navbar-header {
    display: flex;
    align-items: center;
}

#navbar .navbar-brand {
    display: block;
    width: 200px;
    height: 50px;
    margin: 0;
    padding: 0;
    background: url(../images/StatsML_Logo.jpg) no-repeat left center;
    background-size: contain;
    font-size: 0;
}

#navbar .navbar-toggle {
    display: none;
    border: none;
    background: transparent;
    padding: 9px 10px;
    cursor: pointer;
}

#navbar .navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    margin: 4px 0;
    background: #E3AE57;
    border-radius: 1px;
}

#navbar .nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

#navbar .custom-navbar .nav li a {
    display: block;
    padding: 0 15px;
    color: #fff;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 40px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.4s ease-in-out;
}

/* Hover / active gold — kept at higher specificity than the state colours below,
   exactly like the home navbar, so it always wins. */
#navbar .custom-navbar .nav li a:hover,
#navbar .custom-navbar .nav li a:focus,
#navbar .custom-navbar .nav li.active > a {
    background: transparent;
    color: #E3AE57;
}

/* Desktop: transparent over the hero at the top, gray once scrolled */
@media (min-width: 768px) {
    #navbar .custom-navbar {
        padding: 12px 0;
        background-color: transparent;
    }

    #navbar .custom-navbar .nav li a {
        color: #666;
    }

    #navbar .custom-navbar.top-nav-collapse {
        padding: 0;
        background-color: #636363;
        box-shadow: 0 2px 8px 0 rgba(50, 50, 50, 0.08);
    }

    #navbar .custom-navbar.top-nav-collapse li a {
        color: #fff;
    }
}

/* Mobile: collapse the menu behind a hamburger toggle (navbar stays gray) */
@media (max-width: 767px) {
    #navbar .navbar-container {
        flex-wrap: wrap;
        padding: 0 16px;
    }

    #navbar .navbar-header {
        width: 100%;
        justify-content: space-between;
    }

    #navbar .navbar-brand {
        order: -1;
        width: 160px;
        height: 44px;
    }

    #navbar .navbar-toggle {
        display: block;
    }

    #navbar .navbar-collapse {
        display: none;
        width: 100%;
    }

    #navbar .navbar-collapse.in {
        display: block;
    }

    #navbar .nav {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: 8px;
    }

    #navbar .custom-navbar .nav li a {
        line-height: 44px;
        padding: 0 4px;
    }
}
