.article-content {
    margin: var(--size-l) var(--viewport-margin);
}


.article-content figure {
    margin: 0 0 var(--size-s) 0;
}

.article-content figure figcaption {
    position: relative;
    margin-left: var(--size-s);
    font-size: var(--text-s);
    line-height: var(--size-s);
}


nav.article-navigation {
    position: sticky;
    bottom: var(--size-s);
    z-index: 1000;
    margin: 0 var(--viewport-margin);
}

nav.article-navigation .nav-links {
    display: flex;
    justify-content: flex-end;
    gap: var(--size-2xs);
    height: auto;
    padding: 0;
    width: 100%;
}

nav.article-navigation > .nav-links > a.nav-link {
    display: flex;
    gap: var(--size-2xs);

    flex-grow: 0;
    min-width: 0;
}

nav.article-navigation > .nav-links > a.nav-link:hover {
    background: var(--foreground);
    color: var(--background);
}

nav.article-navigation > .nav-links > a.nav-link .nav-label {
    display: none;
}

nav.article-navigation > .nav-links > a.nav-link .nav-title {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

nav.article-navigation > .nav-links > a.nav-prev .nav-title {
    display: none;
}

nav.article-navigation > .nav-links > a.nav-next .nav-title {
}

.contents-toggle {

    display: flex;
    align-items: baseline;
}

.contents-toggle-input {
    display: none;
}

.contents-toggle-button {
    display: inline-block;
    text-transform: uppercase;
}

.contents-toggle-button:hover {
    background: var(--foreground);
    color: var(--background);
}

.contents-toggle-content {
    display: none;
    height: 0;

    position: absolute;
    bottom: var(--size-m);
    left: 0;
    right: 0;

    transition: max-height 0.3s ease-out;

    font-size: var(--text-s);
    line-height: var(--size-s);
    border-radius: var(--size-xs);
    background: var(--background);
    
    border: var(--border);
    padding: var(--size-xs);

    overflow: hidden;
}

.contents-toggle-input:checked ~ .contents-toggle-content {
    display: block;
    height: auto;

    max-height: 90vh;
    transition: max-height 0.3s ease-in;
    overflow: auto;
}

.contents-toggle-input:checked ~ .contents-toggle-button {
    background: var(--foreground);
    color: var(--background);
}

body:has(.contents-toggle-input:checked) {
    overflow: hidden;
}

.list--thesis-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list--thesis-contents ul li {
    line-height: var(--size-m);
    font-size: var(--text-m);
} 

.list--thesis-contents a.current-page {
    color: var(--highlight);
}

/* Bibliography */

.csl-entry {
    max-width: 91vw;
    word-wrap: break-word;
    font-size: var(--text-xs);
    line-height: var(--size-s);
    margin-bottom: var(--size-xs);
}

.footnote-ref sup{
    text-decoration: none;
    display: inline-block;
    vertical-align: baseline;
    cursor: pointer;

    top: -0.25em;

    color: var(--foreground);
    font-size: 70%;
    line-height: var(--size-2xs);

    
    border-radius: var(--size-xs);
    background: var(--background);
    border: var(--border);
    padding: calc(var(--size-2xs) * 0.7);
}

.footnote-ref sup:hover {
    background: var(--foreground);
    color: var(--background);
}

.footnote-back {
    text-decoration: none;
    color: var(--foreground);
    display: inline-block;

    color: var(--foreground);
    font-size: 69%;
    line-height: var(--size-2xs);

    border-radius: var(--size-xs);
    background: var(--background);
    border: var(--border);
    padding: calc(var(--size-2xs) * 0.7) calc(var(--size-2xs) * 0.2) calc(var(--size-2xs) * 0.3) calc(var(--size-2xs) * 0.2);

    margin-left: var(--size-2xs);
}

.footnote-back:hover {
    background: var(--foreground);
    color: var(--background);
}

.footnotes ol {
    padding-left: var(--size-xs);
    margin: var(--size-m) 0;
}

.footnotes ol li {
    font-size: var(--text-xs);
    line-height: var(--size-s);
}

.footnotes p {
    font-size: var(--text-xs);
    line-height: var(--size-s);
    margin-bottom: var(--size-xs);
    max-width: 92%;
}

.article-content hr {
    display: none;
}


@media screen and (min-width: 900px) {
    body {
        --viewport-margin: 22vw;
    }

    nav.article-navigation .nav-links {
        justify-content: flex-start;
    }

    nav.article-navigation > .nav-links > a.nav-link .nav-label {
        display: inline-block;
    }

    nav.article-navigation > .nav-links > a.nav-prev .nav-title {
        display: inline-block;
        max-width: 16ch;
    }
    
    nav.article-navigation > .nav-links > a.nav-next .nav-title {
        max-width: 24ch;
    }

    .contents-toggle-content {
        padding: var(--size-xs);
    }

    .csl-entry {
        max-width: 48vw;
    }
    
    .contents-toggle-input:checked ~ .contents-toggle-content {
        
    max-height: 87vh;
    }
}