/*
 * Nasty Canuck
 * Global navigation and section-discovery layer
 */

/* ==========================================================
   Primary navigation
   ========================================================== */

.nc-sections-menu {
    position: relative;
}

.nc-sections-menu details {
    position: relative;
}

.nc-sections-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 5px 0;
    color: var(--nc-ink);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.6em;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.nc-sections-menu summary::-webkit-details-marker {
    display: none;
}

.nc-sections-menu summary::marker {
    content: "";
}

.nc-sections-menu summary::after {
    content: "";
    display: block;
    width: 0.48rem;
    height: 0.48rem;
    margin-top: -0.25rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
}

.nc-sections-menu details[open] summary::after {
    margin-top: 0.25rem;
    transform: rotate(225deg);
}


/* ==========================================================
   Desktop Sections panel
   ========================================================== */

.nc-sections-menu__panel {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    z-index: 500;

    min-width: 21rem;
    padding: 0.65rem;

    background: var(--nc-snowbone);
    border: 1px solid var(--nc-birch);

    box-shadow:
        0 14px 34px rgba(23, 36, 44, 0.14),
        0 3px 8px rgba(23, 36, 44, 0.08);

    transform: translateX(-50%);
}

.nc-sections-menu__panel::before {
    content: "";
    position: absolute;
    top: -0.45rem;
    left: 50%;

    width: 0.8rem;
    height: 0.8rem;

    background: var(--nc-snowbone);
    border-top: 1px solid var(--nc-birch);
    border-left: 1px solid var(--nc-birch);

    transform: translateX(-50%) rotate(45deg);
}

.nc-masthead__nav .nc-sections-menu__panel a {
    position: relative;
    z-index: 1;

    display: block;
    padding: 0.85rem 1rem;

    color: var(--nc-ink);

    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;

    text-decoration: none;
}

.nc-masthead__nav .nc-sections-menu__panel a:hover,
.nc-masthead__nav .nc-sections-menu__panel a:focus-visible {
    color: var(--nc-maple);
    background: rgba(200, 36, 50, 0.06);
    outline: none;
}


/* ==========================================================
   Clickable story / article section labels
   ========================================================== */

.nc-story-label a,
.nc-article-section a {
    color: inherit;
    text-decoration: none;
}

.nc-story-label a:hover,
.nc-story-label a:focus-visible,
.nc-article-section a:hover,
.nc-article-section a:focus-visible {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
}

.nc-article-section {
    margin: 0 0 1.3rem;

    color: var(--nc-maple);

    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.14em;

    text-align: center;
    text-transform: uppercase;
}


/* ==========================================================
   Burger reset
   ========================================================== */

.nc-masthead .gh-burger {
    padding: 0;
    border: 0;

    color: var(--nc-ink);
    background: transparent;
}


/* ==========================================================
   Mobile navigation
   ========================================================== */

@media (max-width: 800px) {

    body.gh-head-open {
        overflow: hidden;
    }

    body.gh-head-open .nc-site-header {
        position: fixed;
        inset: 0;
        z-index: 900;

        overflow-y: auto;

        background: var(--nc-snowbone);
    }

    body.gh-head-open .nc-masthead {
        align-items: start;
        grid-template-columns: 1fr auto;
    }

    body.gh-head-open .nc-masthead__nav {
        display: block;

        grid-column: 1 / -1;

        width: 100%;
        padding: 1rem 0 4rem;

        border-top: 1px solid var(--nc-birch);
    }

    body.gh-head-open .nc-masthead__nav .nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;

        width: 100%;
        gap: 0;
    }

    body.gh-head-open .nc-masthead__nav .nav > li {
        width: 100%;

        border-bottom: 1px solid var(--nc-birch);
    }

    body.gh-head-open .nc-masthead__nav .nav > li > a,
    body.gh-head-open .nc-sections-menu summary {
        display: flex;
        align-items: center;

        width: 100%;
        padding: 1.35rem 0;

        color: var(--nc-ink);

        font-size: 1.8rem;
        font-weight: 700;
        line-height: 1.25;

        text-decoration: none;
    }

    body.gh-head-open .nc-sections-menu summary {
        justify-content: space-between;
    }

    body.gh-head-open .nc-sections-menu__panel {
        position: static;

        min-width: 0;
        padding: 0 0 1.3rem 1.5rem;

        background: transparent;
        border: 0;

        box-shadow: none;
        transform: none;
    }

    body.gh-head-open .nc-sections-menu__panel::before {
        display: none;
    }

    body.gh-head-open
    .nc-masthead__nav
    .nc-sections-menu__panel
    a {
        padding: 0.75rem 0;

        color: var(--nc-boreal);

        font-size: 1.5rem;
        font-weight: 700;
    }

    body.gh-head-open
    .nc-masthead__nav
    .nc-sections-menu__panel
    a:hover,
    body.gh-head-open
    .nc-masthead__nav
    .nc-sections-menu__panel
    a:focus-visible {
        color: var(--nc-maple);
        background: transparent;
    }

}


/* ==========================================================
   Small-screen refinement
   ========================================================== */

@media (max-width: 520px) {

    body.gh-head-open .nc-masthead__nav .nav > li > a,
    body.gh-head-open .nc-sections-menu summary {
        font-size: 1.65rem;
    }

}