/**
 * Main design styles for page content.
 */


/*____________ section indenting ____________*/

.nb .page h1 {
	text-align: left;
}

.nb .page li {
	margin-bottom: .5rem;
}

.nb .page li > ul {
	margin-top: .5rem;
}

/*.nb .page  h2 {margin-left: .666em;}
.nb .page  h3 {margin-left: 1.776em;}
.nb .page  h4 {margin-left: 3em;}
.nb .page  h5 {margin-left: 4.5712em;}
.nb .page  div.level1 {margin-left: 0;}
.nb .page  div.level2 {margin-left: 1em;}
.nb .page  div.level3 {margin-left: 2em;}
.nb .page  div.level4 {margin-left: 3em;}
.nb .page  div.level5 {margin-left: 4em;}

[dir=rtl] .nb .page h1 {margin-left: 0; margin-right: 0;}
[dir=rtl] .nb .page h2 {margin-left: 0; margin-right: .666em;}
[dir=rtl] .nb .page h3 {margin-left: 0; margin-right: 1.776em;}
[dir=rtl] .nb .page h4 {margin-left: 0; margin-right: 3em;}
[dir=rtl] .nb .page h5 {margin-left: 0; margin-right: 4.5712em;}
[dir=rtl] .nb .page div.level1 {margin-left: 0; margin-right: 0;}
[dir=rtl] .nb .page div.level2 {margin-left: 0; margin-right: 1em;}
[dir=rtl] .nb .page div.level3 {margin-left: 0; margin-right: 2em;}
[dir=rtl] .nb .page div.level4 {margin-left: 0; margin-right: 3em;}
[dir=rtl] .nb .page div.level5 {margin-left: 0; margin-right: 4em;}
*/
/* hx margin-left = (1 / font-size) * .levelx-margin */

/*____________ links to wiki pages (addition to _links) ____________*/

/* existing wikipage */
.nb a.wikilink1 {
    color: #F0A9B8;
    background-color: inherit;
}
/* not existing wikipage */
.nb a.wikilink2 {
    color: #f30;
    background-color: inherit;
}


/*____________ images ____________*/

/* embedded images */
.nb img.media {
    margin: .2em 0;
}
.nb img.medialeft {
    margin: .2em 1.5em .2em 0;
}
.nb img.mediaright {
    margin: .2em 0 .2em 1.5em;
}
.nb img.mediacenter {
    margin: .2em auto;
}


/*____________ tables ____________*/

/* div before each table */
.nb div.table {
}

.nb table.inline {
    min-width: 50%;
}
.nb table.inline tr:hover td {
    background-color: #1e1a2d;
}
.nb table.inline tr:hover th {
    background-color: #333;
}


/*____________ code ____________*/

/* fix if background-color hides underlining */
.nb em.u code {
    text-decoration: underline;
}

/* filenames for downloadable file and code blocks */
.nb dl.code,
.nb dl.file {
}

.nb dl.code dt,
.nb dl.file dt {
    background-color: #1e1a2d;
    border: solid #333;
    border-width: 1px 1px 0;
    color: inherit;
    display: inline;
    padding: .1em .5em .2em;
    margin-left: 1em;
}
[dir=rtl] .nb dl.code dt,
[dir=rtl] .nb dl.file dt {
    margin-left: 0;
    margin-right: 1em;
}
.nb dl.code dt a,
.nb dl.file dt a {
}

.nb dl.code dd,
.nb dl.file dd {
    margin: 0;
}

/* for code in <file> */
.nb pre.file,
.nb dl.file pre,
.nb dl.file dt {
    border-color: #eee;
}


/*____________ JS popup ____________*/

.JSpopup {
    background-color: #1e1a2d;
    color: #ccc;
    border: 1px solid #333;
    line-height: 1.2;
    padding: 0 .2em;
}

.JSpopup ul,
.JSpopup ol {
    padding-left: 0;
}
[dir=rtl] .JSpopup ul,
[dir=rtl] .JSpopup ol {
    padding-right: 0;
}

/* Table of Contents */
#toc {
    background: #2d2842;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

#toc h2 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #F0A9B8;
}

#toc ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

#toc ul ul {
    padding-left: 1.5rem;
}

#toc li {
    margin: 0.25rem 0;
}

#toc a {
    color: #eee;
    text-decoration: none;
}

#toc a:hover {
    color: #F0A9B8;
    text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.breadcrumbs li {
    display: inline;
    margin: 0 0.25rem 0 0;
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: #666;
}

.breadcrumbs a {
    color: #F0A9B8;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs li.active {
    color: #ccc;
}

/* Sitemap */
.sitemap-content {
    margin-top: 2rem;
}

.sitemap-section {
    margin-bottom: 3rem;
}

.sitemap-section h2 {
    color: #F0A9B8;
    border-bottom: 2px solid #4e348a;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.sitemap-section h2 a {
    color: inherit;
    text-decoration: none;
}

.sitemap-section h2 a:hover {
    text-decoration: underline;
}

.sitemap-section ul {
    list-style: none;
    padding-left: 1.5rem;
}

.sitemap-section li {
    margin-bottom: 0.5rem;
}

.sitemap-section li a {
    color: #eee;
    text-decoration: none;
}

.sitemap-section li a:hover {
    color: #F0A9B8;
    text-decoration: underline;
}

/* Article List (section index pages) */
.page-list {
    margin-top: 2rem;
}

.page-list h2 {
    color: #F0A9B8;
    border-bottom: 2px solid #4e348a;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.article-list {
    list-style: none;
    padding: 0;
}

.article-list li {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #2d2842;
    border-left: 4px solid #4e348a;
    border-radius: 0.25rem;
    transition: border-left-color 0.2s;
}

.article-list li:hover {
    border-left-color: #F0A9B8;
}

.article-list a {
    display: block;
    text-decoration: none;
}

.article-title {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #F0A9B8;
    margin-bottom: 0.5rem;
}

.article-summary {
    display: block;
    color: #ccc;
    line-height: 1.6;
}

.article-list a:hover .article-title {
    text-decoration: underline;
}

/* Pagination (prev/next navigation) */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
}

.pagination a {
    color: #F0A9B8;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: #2d2842;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.pagination a:hover {
    background: #4e348a;
}

.pagination .prev {
    margin-right: auto;
}

.pagination .next {
    margin-left: auto;
}

/* Page footer (back to top link) */
.page-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #252035;
}

.back-to-top {
    color: #F0A9B8;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-to-top:hover {
    text-decoration: underline;
}

/* Filenames for code blocks */
dl.code,
dl.file {
    margin: 0.5rem 2rem 1rem 2rem;
    max-width: 100%;
}

dl.code dt,
dl.file dt {
    background-color: #15121F;
    border-radius: 0.5rem 0.5rem 0 0;
    color: #ccc;
    display: inline-block;
    padding: 0.3em 0.5em;
    margin-left: 0;
    font-family: "Cascadia Code", Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace;
    font-size: 0.9em;
}

dl.code dd,
dl.file dd {
    margin: 0;
}

dl.code dd .highlight,
dl.file dd .highlight {
    margin: 0;
    border-radius: 0 0.5rem 0.5rem 0.5rem;
}

/* Code blocks */
pre,
code,
samp,
kbd {
    font-family: "Cascadia Code", Consolas, "Andale Mono WT", "Andale Mono", "Bitstream Vera Sans Mono", "Nimbus Mono L", Monaco, "Courier New", monospace;
    font-size: 1em;
    background-color: #15121F;
    color: #ccc;
    direction: ltr;
    text-align: left;
}

pre {
    margin: 0.5rem 2rem 1rem 2rem;
    border: 1px solid #333;
    border-radius: 0.5rem;
    padding: 0.5em 1em;
    overflow-x: auto;
    overflow-y: visible;
    word-wrap: normal;
    line-height: 1.4;
}

/* Inline code */
p code,
li code,
td code,
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
    background-color: #15121F;
    padding: 0.1em 0.3em;
    border-radius: 0.25rem;
}

/* Remove padding for code inside syntax highlighted blocks */
.highlight code {
    padding: 0;
    background-color: transparent;
}

/* Code blocks with syntax highlighting */
.highlight {
    margin: 0.5rem 2rem 1rem 2rem;
    border-radius: 0.5rem;
    background-color: #15121F;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.highlight pre {
    background: transparent;
    border: none;
    margin: 0;
    padding: 0.5em 1em;
    overflow: visible;
}

/* Override Chroma's background */
.chroma {
    background-color: #15121F;
}

/* Line numbers table - remove all borders and fix alignment */
.highlight .lntable {
    border-spacing: 0;
    padding: 0;
    margin: 0;
    border: 0;
    width: 100%;
    max-width: 100%;
    display: table;
    table-layout: fixed;
}

.highlight .lntd {
    padding: 0;
    margin: 0;
    border: 0 !important;
    vertical-align: top;
}

/* Line numbers column */
.highlight .lnt,
.highlight .ln,
.chroma .lnt,
.chroma .ln {
    color: #555;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    text-align: right;
    display: block;
}

/* Line numbers column - fixed width */
.highlight .lntd:first-child {
    width: 4em;
    white-space: nowrap;
    text-align: right;
}

/* Code column */
.highlight .lntd:last-child {
    width: auto;
}

.highlight .lntd:last-child pre {
    padding-left: 0;
    white-space: pre;
}

/*____________ WIP notice banner ____________*/

.wip-notice {
    background: #2d2842;
    border-left: 4px solid #F0A9B8;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

.wip-notice strong {
    color: #F0A9B8;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1em;
}

.wip-notice p {
    margin: 0;
    color: #ccc;
}

.wip-notice p:last-child {
    margin-bottom: 0;
}

/*____________ Math rendering (KaTeX) ____________*/

/* Block math (display mode) */
.math-block {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 1.5em 0;
    padding: 0;
    text-align: center;
}

/* Inline math */
.math-inline {
    display: inline-block;
    vertical-align: middle;
}

/* KaTeX base styles - copied from KaTeX minimal CSS */
.katex {
    font: normal 1.21em KaTeX_Main, "Times New Roman", serif;
    line-height: 1.2;
    text-indent: 0;
    text-rendering: auto;
}

.katex * {
    -ms-high-contrast-adjust: none !important;
    border-color: currentColor;
}

.katex .katex-html {
    display: inline-block;
}

/* Math error fallback */
.math-error {
    color: #F0A9B8;
    border: 1px dashed #F0A9B8;
    padding: 0.5em;
    font-family: monospace;
    background-color: rgba(240, 169, 184, 0.1);
}

