:root {
    --toc-width: 16%;
    --center-content-toc-shift: calc(-1 * var(--toc-width) / 3);
}

.nav-chapters {
    /* adjust width of buttons that bring to the previous or the next page */
    min-width: 40px;
}

.previous {
    /*
    adjust the space between the left sidebar or the left side of the screen 
    and the button that leads to the previous page
    */
    margin-left: var(--page-padding);
}


@media only screen and (max-width:1705px) {
    .sidetoc {
        display: none;
    }
}

@media only screen and (min-width:1705px) {
    main {
        position: relative;
    }
    .sidetoc {
        margin-left: auto;
        margin-right: auto;
        margin-top: auto;
        left: calc(100% + (var(--content-max-width))/5 - 140px);
        position: absolute;
    }
    .pagetoc {
        position: fixed;
        width: 200px;
        height: calc(100vh - var(--menu-bar-height) - 0.67em * 4);
        overflow: auto;
    }
    .pagetoc a {
        border-left: 2px solid var(--sidebar-bg);
        border-right: 2px solid var(--sidebar-bg);
        border-bottom: 1px dashed var(--icons);
        color: var(--fg) !important;
        display: block;
        padding-bottom: 5px;
        padding-top: 10px;
        padding-left: 10px;
        text-align: left;
        text-decoration: none;
    }
    .pagetoc a:last-child {
        border-bottom: 2px solid var(--sidebar-bg);
    }
    .pagetoc a:first-child {
        border-top: 2px solid var(--sidebar-bg);
    }
    .pagetoc a:hover,
    .pagetoc a.active {
        background: var(--sidebar-bg);
        color: var(--sidebar-fg) !important;
    }
    .pagetoc .active {
        background: var(--sidebar-bg);
        color: var(--sidebar-fg);
    }
    .pagetoc .pagetoc-H2 {
        padding-left: 20px;
    }
    .pagetoc .pagetoc-H3 {
        padding-left: 40px;
    }
    .pagetoc .pagetoc-H4 {
        padding-left: 60px;
    }
    .pagetoc .pagetoc-H5 {
        display: none;
    }
    .pagetoc .pagetoc-H6 {
        display: none;
    }
    
    a[class^='pagetoc-H']:only-child {
        display: none;
      }
}