:root {
    --col-width: 720px;
    --col-nav-margin: 50px;
    --nav-width: 600px;
    --nav-win-size: 1370px;
}
html {
    line-height: 1.6;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        "Open Sans",
        "Helvetica Neue",
        sans-serif;
    /* font-family: Barlow,  sans-serif; */
    font-size: 20px;
    color: #1a1a1a;
    background-color: white;
}
body {
    margin: 0 auto 0 auto;

    hyphens: auto;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    font-kerning: normal;
}
body #contentcolumn {
    max-width: var(--col-width);
    padding-right: 0px;
    padding-top: 50px;
    padding-bottom: 50px;
}
nav {
    position: static;
    display: none;
}
@media (max-width: 720px) {
    body {
        font-size: 0.9em;
    }
}
@media (max-width: 1198px) {
    .menu nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: white;
        z-index: 99;
        max-width: 100%;
        overflow-y: auto;
        /* don't scroll body when scrolling menu */
        overscroll-behavior: contain;
        /*width: 100%;*/
    }
    /*center menu*/
    .menu nav > ul {
        max-width: var(--col-width);
        margin: 0 auto;
    }
    body {
        padding: 15px;
    }
    h1 {
        font-size: 1.8em;
    }
    #diagram_conclusion {
        margin-left: calc(-1em - 40px);
    }

    table,
    svg,
    figure,
    div[data-custom-style="Figure"] {
        /*make the svg and images max 2x the column width (if space allows) */
        margin: 15px -15px;
        width: calc(100vw) !important;
        max-width: 100vw;
    }
    #navbar {
    }
}

@media (min-width: 1199px) {
    :root {
        --nav-width: min(calc(100vw - 800px), 600px);
    }

    nav {
        display: block;
        position: fixed;
        left: 50px;
        height: 100%;
        overflow-y: auto;
        top: 0;
        bottom: 0;
        right: auto;
        max-width: var(--col-width);
    }
    body {
        margin-left: calc(var(--nav-width) + 70px);
        margin-right: 0;
    }
    #menutoggle {
        display: none;
    }
    table,
    svg,
    figure,
    div[data-custom-style="Figure"] {
        /*make the svg and images max 2x the column width (if space allows) */
        margin: 15px -15px;
        width: calc(100vw - var(--nav-width) - 70px) !important;
        max-width: calc(36em * 2 + 30px) !important;
    }
    #navbar {
        width: calc(100vw - var(--nav-width) - 70px - 30px) !important;
        max-width: calc(36em * 2) !important;
    }
}

table,
svg,
figure,
div[data-custom-style="Figure"] {
    margin-top: 2em;
}
svg,
figure,
div[data-custom-style="Figure"] {
    font-style: italic;
    text-align: center;
}

h1,
h2,
h3,
#references,
p {
    max-width: var(--col-width);
}
h1,
h2,
h3 {
    padding-top: 60px;
    /*margin-top: 150px;*/
    font-weight: normal;
}
h1 {
    font-size: 1.6em;
    font-weight: bold;
}
#diagram_conclusion {
    height: calc(min(100vh, 100vw) - 10em);
    width: 100vw;
    margin-left: calc((-100vw + 36em) / 2 - 50px);
}

@media print {
    body {
        background-color: transparent;
        color: black;
        font-size: 12pt;
    }
    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }
    h2,
    h3,
    h4 {
        page-break-after: avoid;
    }
}
p {
    margin: 1em 0 0 0;
}
p + p {
    margin: 0 0 0 0;
    text-indent: 1.5em;
}
a {
    color: blue;
    text-decoration: none;
}
a:visited {
    color: blue;
}
a:hover {
    text-decoration-color: red;
    text-decoration-line: underline;
    text-decoration-style: wavy;
}
img,
video {
    max-width: 100%;
}
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 2.4em;
    hyphens: none;
}
h5,
h6 {
    font-size: 1em;
    font-style: italic;
}
h6 {
    font-weight: normal;
}
ol,
ul {
    padding-left: 1.7em;
    margin-top: 1em;
}
li > ol,
li > ul {
    margin-top: 0;
}
blockquote {
    margin: 1em 0 1em 1.7em;
    padding-left: 1em;
    border-left: 2px solid #e6e6e6;
    color: #606060;
}
code {
    font-family:
        "Maple Mono", Menlo, Monaco, "Lucida Console", Consolas, monospace;
    font-size: 85%;
    margin: 0;
}
p > code {
    color: red;
}
pre {
    margin: 1em 0;
    overflow: auto;
}
pre code {
    padding: 0;
    overflow: visible;
    overflow-wrap: normal;
}
.sourceCode {
    background-color: transparent;
    overflow: visible;
}
hr {
    /*hide hr, but keep margin*/
    background-color: white;
    border: none;
    height: 1px;
    margin: 1em 0;
}
table {
    /*margin: 1em 0;*/
    border-collapse: collapse;
    width: 100%;
    overflow-x: auto;
    display: block;
    font-variant-numeric: lining-nums tabular-nums;
}
table caption {
    margin-bottom: 0.75em;
}
tbody {
    margin-top: 0.5em;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}
th {
    border-top: 1px solid #1a1a1a;
    padding: 0.25em 0.5em 0.25em 0.5em;
    text-align: left;
    hyphens: none;
}
td {
    padding: 0.125em 0.5em 0.25em 0.5em;
}
header {
    margin-bottom: 4em;
    text-align: left;
}
header p {
    text-indent: 0;
}
#TOC li {
    list-style: none;
}
#TOC ul {
    padding-left: 1.3em;
}
#TOC > ul {
    padding-left: 0;
}
#TOC a:not(:hover) {
    text-decoration: none;
}
#TOC > ul > li {
    margin-top: 10px;
}

code {
    white-space: pre-wrap;
}
span.smallcaps {
    font-variant: small-caps;
}
span.underline {
    text-decoration: underline;
}
div.column {
    display: inline-block;
    vertical-align: top;
    width: 50%;
}
div.hanging-indent {
    margin-left: 1.5em;
    text-indent: -1.5em;
}
ul.task-list {
    list-style: none;
}
.display.math {
    display: block;
    text-align: center;
    margin: 0.5rem auto;
}
div.csl-bib-body {
}
div.csl-entry {
    clear: both;
}
.hanging div.csl-entry {
    margin-left: 2em;
    text-indent: -2em;
}
div.csl-left-margin {
    min-width: 2em;
    float: left;
}
div.csl-right-inline {
    margin-left: 2em;
    padding-left: 1em;
}
div.csl-indent {
    margin-left: 2em;
}

section {
    position: relative;
}
section > .players {
    position: sticky;
    top: 10px;
    float: right;
    right: 0px;
    /* margin-right: -500px; */
}
annotation-player {
    cursor: pointer;
    width: 100%;
    display: block;
    margin-top: 20px;
    position: relative;
}

annotation-player + annotation-player:before {
    margin-top: 20px;
    padding-top: 20px;
    width: 200px;
    border-top: solid 1px black;
}
div[data-custom-style="Caption"] {
    margin: 0 30px;
    width: calc(36em - 60px);
    max-width: 100vw;
    font-style: italic;
}
figure,
div[data-custom-style="Figure"] {
    margin: 50px -15px;
    width: calc(36em + 30px);
    max-width: 100vw;
    font-style: italic;
    text-align: center;
}

div[data-custom-style="Figure"] p {
    max-width: none;
}
/*figure {
    margin: 20px 0;
}*/
caption,
figcaption,
.listing > p {
    font-style: italic;
    margin: 0 70px;
    max-width: calc(var(--col-width) - (70px * 2));
    hyphens: none;
    text-align: left;
}
.listing {
    margin: 30px 0 0 0;
}
div.sourceCode {
    margin-bottom: 0;
}
.listing + .sourceCode {
    margin-top: 0px;
    border-top: dashed 2px darkgray;
}

#references p {
    margin: 0 0 0 1.5em;
    text-indent: -1.5em;
}

div[data-custom-style="Subheading"] {
    font-size: 20pt;
    margin-bottom: 30px;
}
div[data-custom-style="Subheading"] p {
    margin: 0;
}
div[data-custom-style="Meta"] {
    margin: 20px 40px;
    color: darkgray;
}
div[data-custom-style="Meta"] p + p {
    margin-top: 10px;
    text-indent: 0;
}

h1 {
    font-weight: bold;
    margin-bottom: 0;
}
h1.title {
    font-weight: normal;
    font-size: 30pt;
}
.subtitle {
    font-size: 20pt;
    margin-bottom: 150px;
}

nav {
    hyphens: none;
    max-width: var(--nav-width);
    /*color:orange;as*/
}
nav a.navactive {
    font-weight: bold;
    text-decoration-color: red !important;
    text-decoration-line: underline !important;
    text-decoration-style: wavy !important;
    /*text-decoration-thickness: 1px !important;*/
}

#navbar {
    position: sticky;
    top: 0px;
    height: auto;
    /*padding-bottom: 5px;*/
    margin: 0 -15px;
    padding: 0 15px 5px 15px;
    background: white;
    overflow: hidden;
    z-index: 999;
    width: calc(100vw - 30px);
    border-bottom: solid 1px black;
    hyphens: none;
    display: flex;
    flex-direction: row;
}
.menu #navbar {
    position: fixed;
    width: calc(100vw - 30px);
    /*left: 15px;*/
    max-width: 720px;
}
#breadcrumb {
    flex-grow: 1;
}
#menutoggle {
    flex-grow: 0;
    width: auto;
    cursor: pointer;
}
#menutoggle:hover {
    color: red;
}
#menutoggle:before {
    content: "contents";
}
.menu #menutoggle:before {
    color: red;
    /*content: "close";*/
}

.pref {
    display: none;
}

svg a text {
    fill: blue !important;
}
svg a:hover {
    text-decoration-line: underline;
    text-decoration-style: solid;
}

/*popover icon*/
/*[data-custom-style="Figure"] > p > img:hover {
    opacity: 0.4;
}*/
figure img,
[data-custom-style="Figure"] > p > img {
    cursor: zoom-in;
}
figure,
[data-custom-style="Figure"] > p {
    position: relative;
}
figure:hover::before,
[data-custom-style="Figure"] > p:hover::before {
    display: block;
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 20pt;
    line-height: 1;
    height: 40px;
    width: 40px;

    /*font-family: verdana;*/
    color: white;
    font-style: normal;

    content: "⤢";
}

/*Popover, native scroll on touch, dynamic move on mouse*/
.popover {
    display: none;
    background: white;
}
.popover.visible {
    display: block;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    cursor: zoom-out;

    overflow: hidden;
    overscroll-behavior: contain;
}
.popover.visible img {
    max-width: unset;
    position: absolute;
}

.popover.visible.scroller {
    overflow: auto;
}
.popover.visible.scroller img {
    position: static;
}
