/*********************************************************
 * Screen & Browser Styles
 *********************************************************/

html {
    background-color: var(--color-screen-background);
    padding-left: 25vw;
}
body {
    background-color: var(--color-background);
    margin: auto;
    margin-top: 1cm;
    padding: 2cm;
    max-width: 21cm;
    text-align: initial;
}

.toc {
    background-color: var(--color-background);
    position: fixed;
    left: 0;
    top: 0;
    overflow: hidden;
    height: 100%;
    width: 25vw;
    min-width: 25vw;
    max-width: 75vw;
    padding-right: 8pt;
    border-right: 5pt solid var(--color-screen-background);
    transition: width 0.3s;
    box-sizing: border-box;
    z-index: 1;
}

.toc:hover {
    overflow: scroll;
    width: 12cm;
}

.toc > ul {
    padding-left: 1em;
}

.toc li {
    position: relative;
}

.toc li.closed > ul {
    display: none;
}

.toc li.open > ul,
.toc.open-all ul {
    display: block !important;
}

.toc a.highlight {
    font-weight: bold;
    color: var(--color-primary);
}

.toc .subchapters > a::after {
    content: "\25B8";
    position: absolute;
    left: -1em;
}

.toc .subchapters.open > a::after,
.toc.open-all .subchapters > a::after {
    content: "\25BE";
}

.toc .controls {
    display: flex;
    justify-content: flex-end;
    margin-top: -1em;
}

.toc .control {
    cursor: pointer;
    font-size: 0.75em;
    opacity: 0.5;
    width: 2em;
    text-align: center;
    position: relative;
    z-index: 1;
}

.toc .control:hover {
    opacity: 1;
}

.toc .control::before {
    content: "[\002B]";
}

.toc.open-all .control::before {
    content: "[\2212]";
}

@media (max-width: 36cm) {
    body {
        padding: 5vw;
        overflow-wrap: break-word;
    }
}

.toc {
    padding-left: 8pt;
    white-space: nowrap;
}
.toc h1::before{
    font-size: 11pt;
    position: absolute;
    top: 8pt;
}

.toc h1 {
    font-size: 2em;
    
}

.toc table {
    margin-bottom: 1cm;
}

.toc table * {
    background-color: var(--color-background);
    position: relative;
}

.toc a:hover {
    background-color: var(--color-screen-background);
}
    
.toc a::before {
    content: "\00a0" attr(data-counter);
}

[data-role=toc_chapter] > a,
[data-role=toc_appendix] > a {
    font-weight: bold;
}

.footnote {
    display: none;
}

.bookinfo > .title {
    font-size: 24pt;
}
.bookinfo figure img {
    width: 16cm !important;
}

[data-condition='documentation'] .classname[data-condition]::before {
    content: attr(data-condition) ".";
}
[data-width] {
    width: attr(data-width) !important;
}

body > section:not(.simple) > h1, 
.toc > h1,
.preface > h1 {
    margin-top: 2cm;
}

h1 {
    text-align: left;
}

h1,
.title,
dt[id] {
    position: relative;
}

a.linkIcon {
    position: absolute;
    opacity: 0.1;
    left: -1em;
    top: 0;
    padding-right: 0.5em;
    font-weight: normal;
    font-style: normal;
    font-family: var(--font-family-primary);
}

h1:hover a.linkIcon,
.title:hover a.linkIcon,
caption:hover a.linkIcon {
    opacity: 1;
}

a[href]:hover {
    text-decoration: underline;
}

#frameworkSupportTable td, #frameworkSupportTable th {
    border-left: unset;
}

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Tabs
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

.note .tabs,
.important .tabs {
    margin-left: 2mm;
}

.tabs {
    border-left: 1.5pt solid var(--color-primary);
}

.tabs [data-lang] {
    display: none;
}

.tabs [data-lang][data-active] {
    display: block;
}

.tabs nav {
    display: flex;
    font-size: 0.8em;
    margin-top: 2.5mm;
}

.tabs nav .tab {
    padding: 0.2em 0.5em;
    border-style: solid;
    border-color: var(--color-primary);
    border-left-width: 0pt;
    border-top-width: 1pt;
    border-bottom-width: 1pt;
    border-right-width: 1pt;
}

.tabs > nav :first-child {
    border-left: none;
}

.tabs nav .tab[data-active] {
    color: var(--color-text-inverted);
    background-color: var(--color-primary);
}

.tabs p {
    padding-left: 1mm;
}

.tabs pre {
    margin-top: 0;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Transliteration values list
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

#transliterateList {
    width: 100%;
    height: 10em;
    height: 40vh;
    overflow: auto;
}

#transliterateList > span {
    display: table-row;
}

#transliterateList > span:hover {
    background-color: var(--color-contrast-dark);
}

#transliterateList > span > span {
    display: table-cell;
    padding-right: 0.5em;
}

/* Chapter "PDF Output" */

/* 
    Don't display forms in browser, display screenshots instead.
*/
#AcroFormTable .acroForm > input,
#AcroFormTable .acroForm > select,
#AcroFormTable .acroForm > button,
#AcroFormTable .acroForm > textarea {
    display: none;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * External Links
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

a[href^="https://"][rel] {
    padding-right: 1em;
    background-image: url(../resources/external-link.png);
    background-size: 0.75em;
    background-repeat: no-repeat;
    background-position: calc(100% - 1px) 50%;
}


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Footnotes
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

.footnoteCall {
    font-size: 80%;
    vertical-align: super;
    line-height: 0;
}

[data-highlight] {
    background-color: var(--color-primary-light);
}
