/* Left-hand "sections on this page" navigation (see js/sectionNav.js) */

/* The fixed site navbar is 61px tall; this clears it by a comfortable margin
   and lines the first link up with the top of the section content. */
#section-nav {
    position: fixed;
    top: 80px;
    left: 28px;
    z-index: 4;
    font-family: 'Tenor Sans', sans-serif;
    font-size: 15px;
    max-width: 150px;
}

#section-nav-list {
    list-style: none;
    margin: 0;
    padding: 2px 0 2px 15px;
}

/* Spacing between items only, so the first link starts flush with the top */
#section-nav-list li + li {
    margin-top: 13px;
}

.section-nav-link {
    position: relative;
    display: block;
    color: rgba(25, 25, 25, 0.5);
    line-height: 1.25;
    text-decoration: none;
    transition: color 0.2s ease;
}

.section-nav-link:hover,
.section-nav-link:focus {
    color: #115035;
    text-decoration: none;
}

.section-nav-link.is-active {
    color: #115035;
    font-weight: 700;
}

/* Marks the section you're reading. There's no rule running down the list any
   more, so this segment stands on its own, flush with the nav's left edge. */
.section-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -15px;
    top: -1px;
    bottom: -1px;
    width: 3px;
    border-radius: 2px;
    background-color: #115035;
}

.section-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: #115035;
    color: white;
    font-size: 18px;
    line-height: 44px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.section-nav-toggle:hover,
.section-nav-toggle:focus {
    color: rgb(255, 158, 151);
}

/* Too narrow for the list to sit beside the content, so it collapses away
   entirely. The site navbar already has a hamburger at this width, and a
   second one bottom-left was one too many.

   The rules below dress the list as a pop-up panel above its own toggle. They
   are inert while #section-nav is hidden — delete the `display: none` and
   restore `.section-nav-toggle { display: block }` to bring that back. */
@media screen and (max-width: 1200px) {
    #section-nav {
        display: none;
        top: auto;
        bottom: 24px;
        left: 20px;
        max-width: 220px;
    }

    #section-nav-list {
        display: none;
        margin-bottom: 12px;
        padding: 14px 18px 14px 30px;
        border-radius: 4px;
        background-color: #fff8f2;
        box-shadow: 0 2px 14px rgba(0, 0, 0, 0.2);
    }

    #section-nav.is-open #section-nav-list {
        display: block;
    }

    #section-nav-list li + li {
        margin-top: 10px;
    }
}
