
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* VARIABLES ---------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

:root {
    
    --grid-max-column-width: 88px;
    --header-height: 120px;

    --font-sans: "IBM Plex Sans", sans-serif;
    --font-serif: "IBM Plex Serif", serif;
    --font-mono: "IBM Plex Mono", monospace;
    --font-icon: 'Font Awesome 6 Pro';
    --font-icon-custom: 'Font Awesome Kit';

    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-grey-01: #87888B;
    --color-grey-02: #E4E4E4;
    --color-grey-03: #F5F5F5;
    --color-neutral: #F8F3E4;
    --color-green: #488D60;
    --color-light-green: #D2E082;
    --color-blue: #142B5A;
    --color-light-blue: #90C2F4;
    --color-plum: #722D5C;
    --color-light-plum: #CB76AF;
    --color-yellow: #FBB32C;
    --color-light-yellow: #FFE174;

    --size-column-gap: 16px;
    
}

/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* DEFAULTS / GLOBAL STYLES ------------------------------------------------- */
/* -------------------------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

::selection {
    background-color: var(--color-light-yellow);
    color: var(--color-black);
}

html {
    font-family: var(--font-sans);
    font-weight: 400;
    font-size: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    overflow-y: scroll;

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    image-rendering: crisp-edges;
}

body {
    margin: 0;
    min-height: 100vh;
    
    display: grid;
    grid-template-columns:
      [page-start] minmax(20px, auto)
      [c1 grid-start] minmax(0, var(--grid-max-column-width))
      [c2] minmax(0, var(--grid-max-column-width))
      [c3] minmax(0, var(--grid-max-column-width))
      [c4] minmax(0, var(--grid-max-column-width))
      [c5 text-start] minmax(0, var(--grid-max-column-width))
      [c6] minmax(0, var(--grid-max-column-width))
      [c7] minmax(0, var(--grid-max-column-width))
      [c8] minmax(0, var(--grid-max-column-width))
      [c9] minmax(0, var(--grid-max-column-width))
      [c10] minmax(0, var(--grid-max-column-width))
      [c11 text-end] minmax(0, var(--grid-max-column-width))
      [c12] minmax(0, var(--grid-max-column-width))
      [grid-end] minmax(20px, auto) [page-end];
    grid-template-rows: auto 1fr auto;
    column-gap: var(--size-column-gap);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 400;
    line-height: 1.2;
    outline: none;

    grid-column: grid-start / grid-end;
}

h1 {
    font-size: 56px;
}

h2 {
    font-size: 40px;
    margin-bottom: 40px;
}

h3 {
    font-size: 24px;
    line-height: 1.6;
    margin-bottom: 20px;
}

p, ul, ol, dl, pre {
    margin: 0 0 20px 0;
    line-height: 1.5;
}

p {
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

code, pre {
    font-size: 1rem;
    font-family: var(--font-mono);
}

ul {
    list-style: none;
    padding-left: 20px;
    line-height: 1.5;

    li {
        position: relative;
        padding-left: 20px;
        margin-bottom: 10px;

        &::before {
            content: '\2022';
            position: absolute;
            left: 0;
        }
    }
}

ol {
    list-style: none;
    counter-reset: list_item;
    padding-left: 10px;

    li {
        position: relative;
        padding-left: 30px;
        margin-bottom: 10px;

        &::before {
            counter-increment: list_item;
            content: counter(list_item) '.';
            position: absolute;
            right: calc(100% - 20px);
            text-align: right;
        }

        p {
            display: inline;
        }
    }
}

dl {

    dt {
        font-style: italic;
        margin-bottom: 10px;
    }

    dd {
        margin-bottom: 20px;
        line-height: 1.5;
    }
}

strong {
    font-weight: 600;
}

blockquote {
    margin: 0 40px 10px 40px;
    font-size: .9rem;
    text-align: justify;

    p {
        margin-bottom: 10px;
    }
}

figure {
    margin: 40px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;

    figcaption {
        font-size: .9rem;
        font-family: var(--font-serif);
    }
}

table {
    width: 100%;
    border-collapse: collapse;

    th, td {
        padding: 0 20px 20px 0;
        text-align: left;
        vertical-align: top;
    }
}

hr {
    display: block;
    grid-column: grid-start / grid-end;
    width: 100%;
    border: none;
    border-top: 1px solid var(--color-grey-02);
    margin: 0 0 80px 0;
}

/* Add bottom margin to preceeding elements. */
*:not(hr):has(+ hr) {
    margin-bottom: 80px !important;
}

input {
    border: none;
    outline: none;
    background-color: transparent;
    font-family: var(--font-sans);
}

input:focus,
input:hover {
    background-color: var(--color-white);
}

button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: inherit;
    outline: none;
    box-shadow: none;
    appearance: none;
    cursor: pointer;

    &:focus {
        outline: none;
        box-shadow: none;
    }

    &::-moz-focus-inner {
        border: 0;
        padding: 0;
    }
}

.button {
    display: block;
    width: fit-content;
    border-radius: 4px;
    border: 1px solid var(--color-black);
    padding: 10px 15px;
    /* font-size: .9rem; */
    /* font-weight: 500; */
    color: var(--color-black);

    background-color: var(--color-neutral);
    &:hover {
        background-color: var(--color-light-blue);
        text-decoration: none;
    }

    &.black {
        background-color: var(--color-black);
        color: var(--color-white);
        &:hover {
            background-color: var(--color-black);
        }
    }

}

section {

    grid-column: grid-start / grid-end;

    display: grid;
    grid-template-columns: subgrid;

    margin-bottom: 80px;

    &.call-to-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;

        h2 {
            max-width: 650px;
        }
    }
}

.markdown-alert {
    grid-column: text-start / text-end;

    .markdown-alert-title {
        display: none;
    }

    background-color: var(--color-neutral);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;

    p:last-child {
        margin-bottom: 0;
    }
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* HINTS -------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* NEW / NOTEWORTHY --------------------------------------------------------- */

.noteworthy::after {
    content: "*";
    color: var(--color-yellow);
    margin-left: 0.2em;
}

/* EXTERNAL LINKS ------------------------------------------------------------ */

.external::after {
    content: '\00a0\e09f';
    font-family: var(--font-icon);
    font-weight: 300;
    color: var(--color-grey-01);
}

/* ARROWED LINKS ------------------------------------------------------------ */

.arrowed::after {
    font-family: var(--font-icon-custom);
    content: '\e001';
    font-size: .7rem;
    /* display: inline-flex; */
    /* align-items: center; */
    margin-left: 10px;
    /* padding-bottom: 10px; */
    margin-top: 4px;
    position: absolute;
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* HEADER ------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

header {

    grid-column: page-start / page-end;

    display: grid;
    grid-template-columns: subgrid;

    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-white);
    
    height: fit-content;

    & > div {

        grid-column: grid-start / grid-end;
            
        display: grid;
        grid-template-columns: subgrid;
    
        .logo {
            grid-column: grid-start / c7;
            grid-row: 1 / 2;
            align-self: center;
            z-index: 900;

            display: block;
            width: 200px;
            height: auto;
            margin-left: -12px;

            img {
                display: block;
                width: 100%;
                height: auto;
            }
        }
    
        nav {

            grid-column: grid-start / grid-end;
            grid-row: 1 / 2;

            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            height: 100%;

            ul {
                list-style: none;
                margin: 0;
                padding: 0;
                display: flex;
                flex-direction: row;
                align-items: stretch;

            }
            
            li {
                display: flex;
                align-items: center;
                padding: 40px 0;
                margin: 0;
                
                &::before {
                    display: none;
                }

                &.has-menu {

                    a {
                        padding-right: 10px;
                    }
                
                    &::after {
                        content: '\e002';
                        font-family: var(--font-icon-custom);
                        font-size: .3rem;
                        display: flex;
                        align-items: baseline;
                        justify-content: flex-end;
                        padding-right: 20px;
                        margin-bottom: -2px;
                    }
                }
            
            }

            a {
                display: flex;
                align-items: center;
                color: var(--color-black);
                padding: 0 20px;
            }
        }

        .header-actions {
            grid-column: c12 / grid-end;
            grid-row: 1 / 2;
            justify-self: end;
            display: flex;
            align-items: center;
            gap: 8px;
            z-index: 900;
            font-size: 1rem;

            button {
                padding: 40px 0 40px 20px;
                align-items: center;
                justify-content: center;
            }
        }

        .search {
            display: flex;
            
            gap: 8px;

            kbd {
                font-family: var(--font-mono);
                font-size: .7rem;
                font-weight: 500;
                color: var(--color-grey-01);
                border: 1px solid var(--color-grey-02);
                border-radius: 5px;
                padding: 3px 7px;
                line-height: 1.4;
                margin-right: 5px;
                visibility: hidden;
            }

            &:hover kbd {
                visibility: visible;
            }
        }

        .hamburger {
            display: none;
        }
    }

    &.menu-open nav li:not(.active) {
        a, &::after {
            color: var(--color-grey-01);
        }
    }

}

.curtain {
    grid-column: page-start / page-end;

    z-index: 200;

    position: absolute;
    top: calc(100% - 20px);
    left: 0;
    right: 0;
    height: 0;
    overflow: hidden;
    background-color: var(--color-white);
    border-bottom: 1px solid transparent;
    transition: height 0.3s ease, border-color 0.3s ease;

    &.is-open {
        border-color: var(--color-black);
    }
}

.mega-menu {
    position: absolute;
    top: 0;
    display: none;

    & > div {
        min-width: 200px;
        display: flex;
        flex-direction: row;
    }

    span {
        display: block;
        padding: 10px 20px 5px 20px;
        font-weight: 300;
        color: var(--color-grey-01);
        cursor: default;

        &:first-child {
            padding-top: 5px;
        }
    }

    a {
        display: block;
        padding: 3px 20px;

        &:last-child {
            padding-bottom: 40px;
        }
    }
}


/* SEARCH ------------------------------------------------------------------- */

#search-overlay {
    display: none;
    grid-column: page-start / page-end;
    grid-template-columns: subgrid;
    align-content: start;
    padding: 80px 0;
    min-height: 80vh;
}

body.search-active #search-overlay {
    display: grid;
}

body.search-active .search kbd {
    visibility: visible;
}

body.search-active .hamburger {
    display: none !important;
}

body.search-active > :not(header):not(#search-overlay):not(footer):not(script) {
    display: none !important;
}

#search-input {
    grid-column: grid-start / grid-end;
    font-size: 40px;
    font-weight: 400;
    padding: 20px 0;
    border: none;
    border-bottom: 1px solid var(--color-black);
    background: transparent;
    outline: none;

    &::placeholder {
        color: var(--color-grey-02);
    }

    &:focus,
    &:hover {
        background: transparent;
    }
}

#search-results {
    grid-column: page-start / page-end;
    padding-top: 20px;

    a {
        grid-column: grid-start / grid-end;
        padding: 10px;

        &:hover,
        &.selected {
            background-color: var(--color-grey-03);
        }
    }

    .date { grid-column: c1 / c3; }
    .title { grid-column: c3 / grid-end; }
    .source { grid-column: c3 / grid-end; }
}

.search-empty,
.search-error {
    grid-column: grid-start / grid-end;
    color: var(--color-grey-01);
    padding: 20px 0;
}


/* MENU (MOBILE) ----------------------------------------------------------- */

.mobile-menu {

    display: block;
    
    grid-column: page-start / page-end;

    z-index: 200;
    
    position: absolute;
    top: calc(100% - 20px);
    left: 0;
    right: 0;
    
    height: 0;
    overflow: hidden;
    overflow-y: auto;

    padding: 0 40px;
    
    background-color: var(--color-white);
    border-bottom: 1px solid transparent;
    transition: height 0.3s ease, border-color 0.3s ease;
    
    &.is-open {
        border-color: var(--color-black);
    }

    & > nav {
        display: block;
        height: auto;

        padding: 20px 0;

        & > a {
            font-size: 1.6rem;
            padding: 0px 0 20px 0;

            &:hover {
                color: var(--color-plum);
            }
        }
    }

    nav.rows {
        margin-bottom: 40px;
    }


}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* FOOTER ------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

footer {

    grid-column: page-start / page-end;
    height: fit-content;
    
    display: grid;
    grid-template-columns: subgrid;

    background-color: var(--color-neutral);
    padding: 40px 0;

    a.logo {
        display: block;
        grid-column: c1 / c9;
        
        width: fit-content;
        height: fit-content;
        
        img {
            width: 300px;
            height: auto;
            margin-left: -18px;
        }
    }

    nav.rows {
        grid-column: c9 / grid-end;
        margin-bottom: 40px;

        a:first-child {
            padding-top: 10px;
        }
    }

    .newsletter {
        display: block;
        grid-column: c9 / grid-end;
        margin-bottom: 20px;

        h3 {
            margin-bottom: 5px;
        }

        a.button {
            width: 100%;
            text-align: center;
        }
    }

    .socials {
        display: flex;
        flex-direction: row;
        grid-column: c1 / c4;
        margin-top: -20px;

        a {
            display: block;
            padding: 0 5px;
            color: var(--color-black);
            font-size: 1.9rem;

            &:first-child {
                padding-left: 0;
            }
        }
    }

    .email {
        display: block;
        grid-column: c9 / grid-end;
        text-align: right;
        font-size: .9rem;
        
        a {
            color: var(--color-grey-01);
        }
    }
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* HOMEPAGE ----------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

.hero {

    grid-column: grid-start / grid-end;
    
    display: grid;
    grid-template-columns: subgrid;

    padding: 80px 0 0 0;
    margin-bottom: 120px;

    .hero-text {
        grid-column: grid-start / c8;

        h1 {
            padding: 60px 0 0 0;
            margin: 0 0 40px 0;
            max-width: 600px;
        }

        p {
            max-width: 490px;
            margin-bottom: 50px;
        }

    }

    .hero-image {
        grid-column: c8 / grid-end;
        display: flex;
        justify-content: flex-end;
        align-items: center;
   

        img,
        video {
            display: block;
            width: 100%;
            max-width: 500px;
            max-height: 500px;
            height: auto;
            object-fit: contain;
        }
    }

}

.highlight {
    background-color: var(--color-light-yellow);
    white-space: nowrap;
}

.accordion {
    grid-column: grid-start / grid-end;

    display: grid;
    grid-template-columns: subgrid;

    --inactive-color: #bbb;

    .accordion-item {

        grid-column: grid-start / grid-end;
        display: grid;
        grid-template-columns: subgrid;

        border-top: 1px solid var(--color-black);
        /* transition: color 0.3s ease, border-color 0.3s ease; */

        &:last-child {
            border-bottom: 1px solid var(--color-black);
        }
    }

    .accordion-header {

        grid-column: grid-start / grid-end;

        font-size: 24px;
        padding: 20px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;

        &::after {
            content: '\e002';
            font-family: var(--font-icon-custom);
            font-size: 0.5rem;
            font-weight: 300;
            transition: transform 0.4s ease;
        }
    }

    .accordion-panel {

        grid-column: grid-start / grid-end;
        display: grid;
        grid-template-columns: subgrid;

        overflow: hidden;
        height: 0;
        transition: height 0.4s ease;

        /* background-color: var(--color-neutral); */

        p {
            grid-column: c1 / c5;

            color: var(--color-black);

            margin: 0;
            padding: 0 40px 20px 0;
        }

        .links {
            grid-column: c5 / grid-end;
            grid-row: 1 / 9;
        }
    }

    &:hover .accordion-item {
        color: var(--inactive-color);
        border-color: var(--inactive-color);
    }

    &.has-open .accordion-item:not(.is-open) {
        color: var(--inactive-color);
        border-color: var(--inactive-color);
    }

    &:not(.has-open) .accordion-item:hover,
    .accordion-item.is-open {
        color: var(--color-black);
        border-color: var(--color-black);

        + .accordion-item {
            border-top-color: var(--color-black);
        }
    }

}

a.card {
    display: grid;
    grid-column: span 4;
    grid-row: span 4;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    will-change: transform;
    
    padding: 40px;
    margin-bottom: var(--size-column-gap);
    border-radius: 10px;

    &.c1  { background-color: var(--color-light-yellow); }
    &.c2  { background-color: var(--color-light-green);  }
    &.c3  { background-color: var(--color-light-blue);   }
    

    &:hover {
        transform: scale(1.01);

        /* .button {
            background-color: var(--color-black);
            color: var(--color-white);
        } */
    }

    h3,
    p,
    .button {
        grid-column: span 4;
    }

    h3 {
        margin-bottom: 10px;
    }

    p {
        margin-bottom: 40px;
        line-height: 1.4;
    }

    .button {
        width: 100%;
        background-color: transparent;
        align-self: end;
    }

    img {
        grid-column: 1 / -1;
        display: block;
        width: 100%;
        max-height: 220px;
        margin: 0 auto 40px auto;
        object-fit: contain;
        align-self: center;
    }
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* POSTS / PAGES / SETS ----------------------------------------------------- */
/* -------------------------------------------------------------------------- */

article {

    grid-column: page-start / page-end;

    display: grid;
    grid-template-columns: subgrid;

    height: fit-content;

    margin-bottom: 80px;

    header {
    
        grid-column: grid-start / grid-end;
    
        display: grid;
        grid-template-columns: subgrid;
    
        position: relative;
        z-index: 1;

        background-color: transparent;
        border-bottom: 1px solid var(--color-grey-02);
        margin-bottom: 80px;

        padding: 80px 0 40px 0;

        h1 {
            grid-column: c1 / c9;
            font-size: 56px;
            margin-bottom: 40px;
        }

        .metadata {

            grid-column: c1 / c9;
            display: block;

            .authors {
                display: flex;
                gap: 3px 20px;
                flex-wrap: wrap;
                max-width: 500px;
                margin-bottom: 40px;
            }

            .dates {
                display: grid;
                grid-template-columns: auto 1fr;
                gap: 3px 20px;
                color: var(--color-grey-01);
            }
        
        }
    }

    h1, h2, h3,
    p,
    blockquote,
    ol, ul, dl,
    table, nav.rows {
        grid-column: text-start / text-end;
    }

    h1 {
        font-size: 40px;
        margin-bottom: 20px;
        margin-top: 40px;
    }
    
    h2 {
        font-size: 24px;
        line-height: 1.4;
        margin-bottom: 20px;
        margin-top: 40px;
    }

    h3 {
        font-size: 18px;
        line-height: 1.6;
        margin-bottom: 10px;
        margin-top: 10px;
    }

}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* LINK PATTERNS ------------------------------------------------------------ */
/* -------------------------------------------------------------------------- */

/* Default where we only need to reveal it's a link on hover. */

.mega-menu a:hover,
article header div.metadata .authors > a:hover,
.faq > h1 > a:hover,
.set section.subset h3 a:hover {
    color: var(--color-plum);
}


/* Default where we want to show it's a link, and also change on hover. */

article :is(p, li, blockquote, dl) a,
.endmatter :is(p, li, blockquote, dl) a,
.output-list a .title,
.accordion-panel p a {
    color: var(--color-plum);
}

article :is(p, li, blockquote, dl) a:hover,
.endmatter :is(p, li, blockquote, dl) a:hover,
.output-list a:hover .title > span,
.accordion-panel p a:hover {
    text-decoration: underline;
}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* PAGE ELEMENTS ------------------------------------------------------------ */
/* -------------------------------------------------------------------------- */

/* BACK LINK --------------------------------------------------------------- */

.back-link {
    color: var(--color-grey-01);
    display: flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    &::before {
        content: '\e001';
        font-family: var(--font-icon-custom);
        font-size: .6rem;
        display: inline-block;
        transform: scaleX(-1);
    }
    &:hover {
        color: var(--color-black);
    }
}


/* COVER IMAGES ------------------------------------------------------------- */

article {

    header {

        .cover {

            grid-column: c9 / grid-end;
            grid-row: span 10;
            
            display: flex;
            justify-content: flex-end;
            align-items: flex-start;
            
            padding-top: 40px;
            
            border-radius: 10px;
            
            img {
                display: block;
                max-width: 300px;
                max-height: 300px;
                width: auto;
                height: auto;
            }

            &[data-set="strategy"]          { background-color: var(--color-light-yellow); }
            &[data-set="capacity-building"] { background-color: var(--color-light-green);  }
            &[data-set="adoption"]          { background-color: var(--color-light-blue);   }
        
        }
    
    }

}

article.set {

    .cover {
        grid-column: c1 / c4;
        align-items: center;
        justify-content: center;

        width: 100%;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        padding: 40px;
        background-color: var(--color-neutral);
        
        img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
    }

}

/* TABLE OF CONTENTS -------------------------------------------------------- */

.toc {
    grid-column: c1 / c5;
    grid-row: span 999;
    position: sticky;
    top: var(--header-height);
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.5;

    ul {
        list-style: none;
        margin: 0;
        padding: 0;
        line-height: 1.4;
    }

    li {
        margin: 0;
        padding: 0;
        max-width: 300px;

        &::before {
            display: none;
        }

        &.active > a {
            color: var(--color-blue);
        }
    }

    a {
        display: block;
        color: var(--color-grey-01);
        padding-bottom: 10px;
        
        &:hover {
            color: var(--color-blue);
            text-decoration: none;
        }
    }

    li {
        padding-left: calc(var(--depth, 0) * 10px);
    }
}


/* FIGURES ------------------------------------------------------------------ */

.placeholder {
    background-color: var(--color-grey-03);

    padding: 20px;
    text-align: center;

    font-family: var(--font-mono);

    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-width {
    grid-column: grid-start / grid-end;
    z-index: 50;
}

.inset {
    grid-column: text-start / text-end;
}



/* SIDE NOTES --------------------------------------------------------------- */

article {

    counter-reset: sidenote-counter;

    .sidenote {
        width: calc((100% - 2 * var(--size-column-gap)) / 3);
               /* Deriving the width of two columns from
                  the width of the paragraph (6 columns). */
        margin-top: 0.3rem;
        margin-bottom: 0;
        font-size: .8rem;
        vertical-align: baseline;
        position: absolute;
        right: calc(-1 * (100% + var(--size-column-gap)) / 3);
        font-family: var(--font-serif);
        color: var(--color-grey-01);
        text-align: left;

        a {
            color: inherit;
            text-decoration: underline;
        }

        &:before {
            content: '[' counter(sidenote-counter) ']';
            font-size: .7rem;
            position: relative;
            vertical-align: text-top;
            background-color: var(--color-grey-03);
            color: var(--color-black);
            font-style: normal;
            margin-right: 5px;
            font-family: var(--font-sans);
        }

        &:hover {
            color: var(--color-black);
        }
    }

    .sidenote-number {
        cursor: pointer;

        &:after, &:before {
            position: relative;
            vertical-align: baseline;
        }

        &:after {
            counter-increment: sidenote-counter;
            content: '[' counter(sidenote-counter) ']';
            font-size: .7rem;
            top: -0.5rem;
            left: 0.1rem;
            background-color: var(--color-grey-03);
            color: var(--color-black);
        }
    }

    input.margin-toggle {
        display: none;
    }

    label.sidenote-number {
        display: inline;
    }

    label.margin-toggle:not(.sidenote-number) {
        display: none;
    }

    .sidenote-number:hover ~ .sidenote {
        color: var(--color-black);
    }

    @media (max-width: 1000px) {

        label.margin-toggle:not(.sidenote-number) {
            display: inline;
            cursor: pointer;
        }

        .sidenote {
            display: none;
            color: var(--color-black);
        }

        input.margin-toggle:checked + .sidenote {
            display: block;
            position: relative;
            right: auto;
            float: left;
            clear: both;
            width: calc(100% - 80px);
            margin: 20px 40px;
        }
    }

}


/* REFERENCES --------------------------------------------------------------- */

a.ref {
    color: var(--color-yellow);
    padding: 0 2px;
}

.hover-ref {
    position: fixed;
    z-index: 1000;
    padding: 12px 16px;
    background: var(--color-neutral);
    border: 1px solid var(--color-black);
    border-radius: 5px;
    font-size: 0.875rem;
    line-height: 1.5;

    .title {
        font-weight: 600;
    }

    a {
        color: inherit;
        display: block;
    }

    .hover-ref-entry + .hover-ref-entry {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--color-black);
    }
}


/* ENDMATTER ---------------------------------------------------------------- */

.endmatter {
    grid-column: grid-start / grid-end;
    display: grid;
    grid-template-columns: subgrid;

    border-top: 1px solid var(--color-grey-02);
    padding-top: 80px;
    font-size: 0.9rem;
    line-height: 1.5;

    margin: 0 0 80px 0;

    p, pre, ul, ol,
    .csl-bib-body {
        grid-column: text-start / text-end;
    }

    ul, ol {
        padding-left: 0;
    }

    pre {
        background-color: var(--color-grey-03);
        padding: 20px;
        font-size: 0.8rem;
        white-space: pre-wrap;
        overflow-wrap: break-word;
    }

    .copy-btn {
        grid-column: text-start / text-end;
        font-size: 0.8rem;
        color: var(--color-grey-01);
        text-align: right;
        font-weight: 400;
        margin-top: -20px;
        padding-top: 5px;
        &:hover {
            color: var(--color-black);
        }
    }

    .reference {
        a {
            display: block;
            color: inherit;

            &:hover {
                text-decoration: none;
            }

            &:hover .title > span {
                color: var(--color-plum);
            }
        }

        .title {
            font-weight: 600;
        }
    }
}


/* BLOCKS OF LINKS ----------------------------------------------------------- */

nav.rows {
    display: block;
    margin-bottom: 20px;

    a {
        display: flex;
        justify-content: space-between;
        color: var(--color-black);

        border-bottom: 1.5px solid var(--color-black);
        padding: 10px 0;

        &:first-child {
            padding-top: 0;
        }

        &::after {
            font-family: var(--font-icon-custom);
            content: '\e001';
            font-size: .7rem;
            display: flex;
            align-items: center;
            right: 0;
        }
    }

    &:hover a {
        opacity: .4;
    }

    &:hover a:hover {
        opacity: 1;
    }
}

.links {
    align-self: start;
            
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 20px;
    row-gap: 10px;
    padding: 0 0 20px 0;
    margin: 0;
    /* font-size: 1.2rem; */
    
    a {
        display: block;
        padding: 10px 15px;
        margin: 0;
        border-radius: 5px;
        background-color: var(--color-neutral);
        /* max-width: 240px; */
        border: 1px solid var(--color-black);
        color: var(--color-black);
        font-weight: 400;
        font-size: 1rem;
        &:hover {
            background-color: var(--color-light-blue);
        }


        &.more {
            background-color: transparent;
            border: transparent;
            span {
                color: var(--color-plum);
            }
            padding-left: 0;
            /* font-weight: 600; */
            &::after {
                content: '\e001';
                font-family: var(--font-icon-custom);
                font-size: .8rem;
                padding-left: 10px;
            }
            &:hover {
                background-color: transparent;
                span {
                    color: var(--color-plum);
                    text-decoration: underline;
                }
            }
        }
    }
}


/* OUTPUT LIST -------------------------------------------------------------- */

.output-list {
    grid-column: text-start / grid-end;
    display: grid;
    grid-template-columns: subgrid;
    margin-bottom: 40px;
    line-height: 1.5;

    a {
        grid-column: text-start / text-end;
        display: grid;
        grid-template-columns: subgrid;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .date {
        grid-column: c5 / c6;
        color: var(--color-grey-01);
    }

    .title {
        grid-column: c6 / c11;
    }

    .source {
        grid-column: c6 / c12;
        color: var(--color-grey-01);
        font-style: italic;
    }
}

section.subset {
    grid-column: text-start / grid-end;
    display: grid;
    grid-template-columns: subgrid;
    margin: 0 0 20px 0;
    padding: 0;

    & > h3,
    & > p {
        grid-column: text-start / text-end;
    }

    h3 {
        margin: 0 0 10px 0;
        font-size: 1.4rem;

        a {
            display: block;
        }
    }

}

section.subset::before,
section.subset + nav.output-list::before {
    display: block;
    content: '';
    grid-column: text-start / grid-end;
    border-top: 1px solid var(--color-grey-02);
    padding-top: 40px;
}

h2 + section.subset,
h2 + nav.output-list {
    &::before {
        display: none;
    }
}



/* PEOPLE GRID -------------------------------------------------------------- */

section.people {

    display: grid;
    grid-template-columns: subgrid;

    grid-column: c5 / grid-end;

    margin-bottom: 0;
    padding: 20px 0 0 0;

    & > div {
        grid-column: span 2;
        padding-bottom: 40px;

        img {
            display: block;
            width: 100%;
            height: auto;
            object-fit: cover;
            margin-bottom: 10px;

            filter: grayscale(100%);
        }

        span {
            display: block;
            font-size: 1rem;
            line-height: 1.5;
            color: var(--color-grey-01);
            
            &.name {
                font-weight: 600;
            }
        }

        &:hover img {
            filter: grayscale(0%);
        }
    }

}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* ADJUSTMENTS -------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

/* Move headings into left column. */

.page,
.set,
.endmatter {

    & > :is(h1, h2, h3) {
        grid-column: c1 / c5;
        font-size: 1rem;
        line-height: 1.2;
        color: var(--color-blue);
        margin-top: 0;
    }
}


/* Add margin before headings. */

.page,
.set {

    & > :has(+ :is(h1, h2, h3)) {
        margin-bottom: 80px;
    }
    
}

/* Move heading to main text columns. */

.set {
    header {
        h1 {
            grid-column: text-start / text-end;
            margin: 0 0 20px 0;
            font-size: 40px;
        }
    }
}

/* Narrower horizontal rules. */

.faq {
    hr {
        grid-column: c5 / grid-end;
    }
}

/* No top-margin on h1s. */

.faq {
    & > h1 {
        margin-top: 0;
    }
}


/* Greyed-out bibliography formatting. */

.faq {

    h3,
    .reference,
    .reference a {
        color: var(--color-grey-01);
    }

    .reference {
        a:hover {
            text-decoration: none;
            display: block;

            .title > span {
                text-decoration: underline;
            }
        }
    }

}


/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* RESPONSIVE --------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    .output-list,
    .subset .output-list {
        .date {
            grid-column: text-start / c7;
        }
        .title,
        .source {
            grid-column: c7 / text-end;
        }
    }

    section.subset::before {
        grid-column: text-start / grid-end;
    }
}

@media (max-width: 1000px) {

    body {
        grid-template-columns:
          [page-start] minmax(20px, auto)
          [c1 grid-start] minmax(0, var(--grid-max-column-width))
          [c2] minmax(0, var(--grid-max-column-width))
          [c3] minmax(0, var(--grid-max-column-width))
          [c4] minmax(0, var(--grid-max-column-width))
          [c5 text-start] minmax(0, var(--grid-max-column-width))
          [c6] minmax(0, var(--grid-max-column-width))
          [c7] minmax(0, var(--grid-max-column-width))
          [c8] minmax(0, var(--grid-max-column-width))
          [c9] minmax(0, var(--grid-max-column-width))
          [c10] minmax(0, var(--grid-max-column-width))
          [c11] minmax(0, var(--grid-max-column-width))
          [c12] minmax(0, var(--grid-max-column-width))
          [grid-end text-end] minmax(20px, auto) [page-end];
    }

    header {

        & > div:first-child nav,
        .curtain {
            display: none;
        }

        & > div {
            .hamburger {
                display: flex;
            }
        }

        kbd {
            display: none;
        }
    }

    .hero {

        padding-top: 0;

        .hero-text {
            grid-column: grid-start / grid-end;
        }
        .hero-image {
            display: none;
        }
    }

    .accordion {
        .accordion-panel {
            p {
                grid-column: grid-start / c7;
            }

            .links {
                grid-column: c7 / grid-end;
            }
        }
    }

    a.card {
        grid-column: span 6;

        h3,
        p,
        .button {
            grid-column: span 6;
        }
    }

    footer {

        .logo,
        .socials {
            grid-column: grid-start / c7;
        }

        .logo,
        nav.rows {
            grid-row: 1 / 2;
        }

        nav.rows,
        .newsletter,
        .email {
            grid-column: c7 / grid-end;
        }
        
    }

    article {
        header {
            h1 {
                grid-column: grid-start / grid-end;
            }
        }
    }

}

@media (max-width: 750px) {

    body {
        grid-template-columns:
          [page-start] minmax(20px, auto)
          [c1 grid-start text-start] minmax(0, var(--grid-max-column-width))
          [c2] minmax(0, var(--grid-max-column-width))
          [c3] minmax(0, var(--grid-max-column-width))
          [c4] minmax(0, var(--grid-max-column-width))
          [c5] minmax(0, var(--grid-max-column-width))
          [c6] minmax(0, var(--grid-max-column-width))
          [c7] minmax(0, var(--grid-max-column-width))
          [c8] minmax(0, var(--grid-max-column-width))
          [c9] minmax(0, var(--grid-max-column-width))
          [c10] minmax(0, var(--grid-max-column-width))
          [c11] minmax(0, var(--grid-max-column-width))
          [c12] minmax(0, var(--grid-max-column-width))
          [grid-end text-end] minmax(20px, auto) [page-end];
    }

    .hero {
        margin-bottom: 40px;

        .hero-text {
            grid-column: grid-start / grid-end;
            grid-row: 2 / 3;

            h1 {
                font-size: 3rem;
                padding: 40px 0 0 0;
                margin-bottom: 20px;
                max-width: 500px;
            }

            p {
                margin-bottom: 30px;
            }
        }
    
        .hero-image {
            
            grid-column: grid-start / grid-end;
            grid-row: 1 / 2;
            display: flex;
            justify-content: center;
            align-items: center;
            
            img,
            video {
                display: block;
                width: 100%;
                max-width: 400px;
                max-height: 400px;
                height: auto;
                object-fit: contain;
            }
            
            display: none;
        }

    }

    .accordion {
        .accordion-panel {
            p,
            .links {
                grid-column: grid-start / grid-end;
            }

            p {
                grid-row: 1 / 2;
            }

            .links {
                grid-row: 2 / 3;
            }
        }
    }

    a.card {
        grid-column: span 12;
        margin-bottom: 20px;

        h3,
        p,
        .button {
            grid-column: span 12;
        }
    }

    footer {

        nav.rows {
            grid-column: grid-start / grid-end;
            grid-row: 1 / 2;
        }

        .newsletter {
            grid-column: grid-start / grid-end;
            grid-row: 2 / 3;

            margin-bottom: 40px;
        }

        .logo {
            grid-column: grid-start / grid-end;
            grid-row: 3 / 4;
            
            margin-bottom: 40px;
        }
        
        .socials {
            grid-column: grid-start / grid-end;
            grid-row: 4 / 5;
            
            margin-bottom: 10px;
        }
        
        .email {
            grid-column: grid-start / grid-end;
            grid-row: 5 / 6;

            text-align: left;
        }
    }

    .toc {
        display: none;
    }

    article {
        header {
            padding-top: 0;
            padding-bottom: 40px;
            margin-bottom: 40px;

            h1 {
                font-size: 36px;
                grid-column: grid-start / grid-end;
            }
        }

        h1 {
            font-size: 32px;
        }
    }

    .faq {
        hr {
            grid-column: grid-start / grid-end;
        }
    }

    .page,
    .set,
    .endmatter {

        & > :is(h1, h2, h3) {
            grid-column: text-start / text-end;
            margin: 0 0 20px 0;
            font-size: 1.4rem;
        }
        & > *:has(+ :is(h1, h2, h3)) {
            margin-bottom: 40px;
        }
    }

    section.people {
        grid-column: text-start / text-end;

        & > div {
            grid-column: span 4;
        }
    }

    .output-list,
    .subset .output-list {
        .date {
            grid-column: text-start / c3;
        }
        .title,
        .source {
            grid-column: c3 / text-end;
        }
    }

    section.subset {
        grid-column: text-start / grid-end;
        & > h3,
        & > p {
            grid-column: text-start / text-end;
        }
        /* h3 {
            font-size: 1.3rem;
        } */
    }

    section.subset::before {
        grid-column: text-start / grid-end;
    }

    article.set {

        .cover {
            grid-column: c1 / c6;
            margin-bottom: 40px;
        }
    }

    section.subset::before,
    section.subset + nav.output-list::before {
        grid-column: text-start / grid-end;
    }
}

@media (max-width: 600px) {

    .hero {
        h1 {
            font-size: 2.4rem;
        }
    }

    section.people {
        & > div {
            grid-column: span 6;
        }
    }

    .output-list {
        .date {
            grid-column: text-start / c4;
        }
        .title,
        .source {
            grid-column: c4 / text-end;
        }
    }

    .output-list,
    .subset .output-list {
        .date {
            grid-column: text-start / c4;
        }
        .title,
        .source {
            grid-column: c4 / text-end;
        }
    }

    /* section.subset {
        grid-column: text-start / grid-end;
        & > h3,
        & > p {
            grid-column: text / text-end;
        }
    } */

    /* section.subset::before {
        grid-column: c4 / grid-end;
    } */

    article.set {
        .cover {
            grid-column: c1 / c8;
        }
    }

}

@media (max-width: 500px) {

    .hero {
        h1 {
            font-size: 2.4rem;
        }
    }

    section.people {
        & > div {
            grid-column: span 6;
        }
    }

    article.set {
        .cover {
            grid-column: grid-start / grid-end;
        }
    }

}