/** THEME SYSTEM **/
/* Three themes: auto (system), light, dark */
/* Applied via data-theme attribute on <html>, set by script.js */

:root {
    --bg:           #ffffff;
    --fg:           #111111;
    --header-bg:    #111111;
    --header-fg:    #ffffff;
    --header-a:     orange;
    --td-border:    #000000;
    --other-variant:#c8e6f5;
    --other-car:    #ff9800;
    --other-ann:    #ffee44;
    --select-bg:    #333333;
    --select-fg:    #ffffff;
    --select-bd:    #666666;
}

/* Dark theme overrides */
[data-theme="dark"] {
    --bg:           #222222;
    --fg:           #e0e0e0;
    --header-bg:    #1a1a1a;
    --header-fg:    #ffffff;
    --header-a:     orange;
    --td-border:    #444444;
    --other-variant:#1e3a4c;
    --other-car:    #b25900;
    --other-ann:    #665c00;
}

/* System preference auto mode — dark OS */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --bg:           #222222;
        --fg:           #e0e0e0;
        --header-bg:    #1a1a1a;
        --header-fg:    #ffffff;
        --header-a:     orange;
        --td-border:    #444444;
        --other-variant:#1e3a4c;
        --other-car:    #b25900;
        --other-ann:    #665c00;
    }
}

/** OVERALL STYLE **/

body {
    font-family: sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}
.theme-colors {
    font-family: monospace;
    background: var(--header-bg);
    color: var(--header-fg);
    font-size: 1rem;
}
.theme-colors a {
    color: var(--header-a);
    text-decoration: none;
}
.theme-colors a:hover {
    text-decoration: underline;
}
.header {
    padding: 1rem;
    line-height: 1.8;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.header-left {
    flex: 1;
    min-width: 0;
}
.theme-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0.85;
}
.theme-select-wrapper label {
    color: var(--header-fg);
    opacity: 0.7;
}
#theme-select {
    background: var(--select-bg);
    color: var(--select-fg);
    border: 1px solid var(--select-bd);
    border-radius: 3px;
    padding: 1px 4px;
    font-family: monospace;
    font-size: 0.85rem;
    cursor: pointer;
}
.footer {
    padding: 1rem;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    width: 100%;
}
.main {
    padding: 0 1rem 5rem 1rem;
    max-width: 50rem;
}
.breadcrumb-part {
    white-space: nowrap;
}

/** FOLDERS **/

.folder-icon {
    height: 20px;
    width: 20px;
    margin-right: 5px;
}
li {
    line-height: 1.3;
    list-style-image: none; /** prevent inheritance if inside folder **/
}
.li-folder {
    list-style-image: url('icons/folder.svg');
}
.li-folder.li-folder-open {
    list-style-image: url('icons/folder-open.svg');
}
.hidden {
    display: none;
}
.selected {
    background: rgba(255, 0, 0, 0.5);
}

/** INDENTATION **/

.indent-1 { white-space: pre; tab-size: 2; }
.indent-2 { white-space: pre; tab-size: 4; }
.indent-3 { white-space: pre; tab-size: 6; }
.indent-4 { white-space: pre; tab-size: 8; }
.indent-5 { white-space: pre; tab-size: 10; }
.indent-6 { white-space: pre; tab-size: 12; }
.indent-7 { white-space: pre; tab-size: 14; }
.indent-8 { white-space: pre; tab-size: 16; }
.indent-9 { white-space: pre; tab-size: 18; }
.indent-right-align { white-space: pre; tab-size: 100; }

/** HIGHLIGHTED REGIONS **/

.oxe-image {
    position: relative;
    display: inline-block;
    max-width: none;
}
.oxe-image .big-img {
    max-width: none !important;
    width: initial !important;
}
.oxe-region {
    position: absolute;
    display: block;
    background: rgba(25,122,250,.3);
}

/** TABLES **/
table {
    border-collapse: collapse;
}
td, th {
    border: 1px solid var(--td-border);
    padding: .4rem;
}

/** IMAGES **/

.big-img {
    max-width: 50rem;
}
@media only screen and (hover: none) {
    html .big-img {
        max-width: 100%;
    }
}

/** LEMON **/
.clsEmphBOLD { font-weight: bold; }
.NOTE { font-style: italic; }
.NOTE_label { font-weight: bold; }
.ICON { height: 1em; }
.imageHolder { margin-top: 1em; }
.imageCaption { font-size: 1.5em; }
.imageHolder img {
    display: block;
    max-width: 50rem;
}
.svgImageHolder {
    page-break-before: always;
    page-break-after: always;
}
.clsArticleSvg { width: 80rem; }
@media only screen and (max-width: 75rem) {
    .imageHolder img.clsArticleSvg { width: 50rem; }
}
@media only screen and (hover: none) {
    html .imageHolder img.clsArticleSvg { width: 100%; }
    html .imageHolder img { max-width: 100%; }
}

.other-warning {
    padding: 1rem;
    margin: 1rem;
    border-radius: 0 6px 0 6px;
}
.other-variant  { background: var(--other-variant); }
.other-car      { background: var(--other-car); }
.other-announcement { background: var(--other-ann); }

/** ABOUT PAGE **/
.about-body { padding: 2rem 5vw; }
.about-h1 { font-size: 6rem; font-weight: normal; }
.about-content {
    line-height: 1.5;
    min-width: 6rem;
    max-width: 100%;
    width: 30rem;
    font-size: 1.5em;
    margin-bottom: 1.5rem;
    margin-left: 3vw;
    text-justify: justify;
}
