/* Corporate Wars SRD
   Festes Layout ohne Theme-Umschalter. */

@font-face {
    font-family: "PxPlus IBM EGA 8x14";
    src: url("PxPlus_IBM_EGA_8x14.woff2") format("woff2");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --page: #000000;
    --paper: #000000;
    --panel: #000000;
    --panel-muted: #151515;

    --text: #aaaaaa;
    --text-muted: #777777;
    --panel-text: #aaaaaa;

    --accent: #aa00aa;
    --accent-dark: #aa00aa;
    --signal: #00aaaa;
    --line: #00aaaa;

    color-scheme: dark;
    --content-width: 920px;
    --sidebar-width: 280px;
    --shadow: 0 0.4rem 1.5rem rgb(24 29 35 / 18%);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-synthesis: none;
    line-height: 1.6;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-family: "IBM Plex Sans", Arial, serif;
}

a {
    color: var(--accent-dark);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

a:hover {
    color: var(--accent);
}

a:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--signal);
    outline-offset: 3px;
}

/* Navigation */

#sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    padding: 1.5rem 1rem 2rem;
    overflow-y: auto;
    color: var(--panel-text);
    background: var(--panel);
    border-right: 4px solid var(--accent);
    scrollbar-color: var(--accent) var(--panel-muted);
}

#sidebar > :first-child {
    margin-top: 0;
}

#sidebar > :last-child {
    margin-bottom: 0;
}

#TOC,
.toc-desktop nav,
.toc-mobile nav {
    font-family: "PxPlus IBM EGA 8x14", monospace;
    margin: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
}

#TOC ul,
.toc-desktop ul,
.toc-mobile ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#TOC ul ul,
.toc-desktop ul ul,
.toc-mobile ul ul {
    margin-left: 0.8rem;
    padding-left: 0.75rem;
    border-left: 1px solid rgb(255 255 255 / 18%);
}

#TOC li,
.toc-desktop li,
.toc-mobile li {
    margin: 0.2rem 0;
}

#TOC a,
.toc-desktop a,
.toc-mobile a {
    display: block;
    padding: 0.2rem 0.35rem;
    color: inherit;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
    border-radius: 2px;
}

#TOC a:hover,
.toc-desktop a:hover,
.toc-mobile a:hover {
    color: #fff;
    background: var(--panel-muted);
}

#TOC .toc-level-3,
.toc-desktop .toc-level-3,
.toc-mobile .toc-level-3 {
    color: var(--line);
    font-size: 0.92em;
}

#TOC .toc-level-4,
.toc-desktop .toc-level-4,
.toc-mobile .toc-level-4 {
    font-size: 0.86em;
}

#TOC .toc-level-5,
.toc-desktop .toc-level-5,
.toc-mobile .toc-level-5 {
    font-size: 0.82em;
}

.toc-mobile {
    display: none;
}

.toc-desktop {
    display: block;
}

/* Inhalt */

#content {
    width: min(var(--content-width), calc(100% - var(--sidebar-width) - 5rem));
    min-height: 100vh;
    margin-left: calc(var(--sidebar-width) + 2.5rem);
    padding: clamp(1.5rem, 4vw, 4rem);
    background: var(--paper);
    box-shadow: var(--shadow);
}

#content > :first-child {
    margin-top: 0;
}

#content > :last-child {
    margin-bottom: 0;
}

p,
li,
dd,
td,
th {
    overflow-wrap: break-word;
    hyphens: auto;
}

p {
    margin: 0 0 1rem;
}

ul,
ol {
    padding-left: 1.4rem;
}

li + li {
    margin-top: 0.2rem;
}

hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 2px solid var(--line);
}

/* Überschriften */

h1, #content h1,
#content h2,
#content h3,
#content h4,
#content h5,
#content h6 {
    color: var(--accent);
    font-family: "PxPlus IBM EGA 8x14", monospace;
    line-height: 1.15;
    text-wrap: balance;
    scroll-margin-top: 1.5rem;
}



h1, #content h1 {
    margin: 0 0 2rem;
    padding: 0 0 0.55rem;
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    border-bottom: 0.22rem solid var(--line);
}

#content h2 {
    margin: 4.5rem 0 1.5rem;
    padding-left: 0.7rem;
    font-size: clamp(1.7rem, 4vw, 2.35rem);
    font-weight: 850;
    letter-spacing: -0.02em;
    border-left: 0.32rem solid var(--line);
}

#content h3 {
    margin: 3rem 0 1rem;
    font-size: clamp(1.35rem, 3vw, 1.7rem);
    font-weight: 800;
}

#content h4 {
    margin: 2.4rem 0 0.8rem;
    color: var(--line);
    font-size: 1.25rem;
    font-weight: 800;
}

#content h5,
#content h6 {
    margin: 1.8rem 0 0.6rem;
    color: var(--line);
    font-size: 1.05rem;
    font-weight: 800;
}

/* Medien und Textblöcke */

#content img,
#content svg,
#content video {
    display: block;
    max-width: 100%;
    height: auto;
}

figure {
    margin: 1.5rem 0;
}

figcaption {
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    background: rgb(25 169 184 / 9%);
    border-left: 0.28rem solid var(--signal);
}

blockquote > :last-child {
    margin-bottom: 0;
}

code,
kbd,
samp {
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.92em;
}

code {
    padding: 0.12em 0.3em;
    background: rgb(23 29 36 / 8%);
    border-radius: 3px;
}

pre {
    max-width: 100%;
    padding: 1rem;
    overflow: auto;
    color: var(--panel-text);
    background: var(--panel);
    border-left: 4px solid var(--signal);
}

pre code {
    padding: 0;
    color: inherit;
    background: transparent;
}

/* Tabellen */

#content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: 0.94rem;
}

#content caption {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
}

#content th,
#content td {
    padding: 0.55rem 0.65rem;
    vertical-align: top;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

#content thead th {
    color: var(--panel-text);
    font-weight: 800;
    background: var(--panel);
    border-color: var(--panel);
}

#content tbody tr:nth-child(even) {
    background: rgb(23 29 36 / 4%);
}

#content tbody tr:hover {
    background: rgb(25 169 184 / 9%);
}

/* Formulare und Details */

button,
input,
select,
textarea {
    max-width: 100%;
    font: inherit;
}

details {
    margin: 1rem 0;
}

summary {
    cursor: pointer;
    font-weight: 800;
}

/* Mobile Navigation */

@media (max-width: 900px) {
    html {
        scroll-padding-top: 4.5rem;
    }

    .toc-desktop {
        display: none;
    }

    #sidebar {
        position: sticky;
        inset: 0 auto auto 0;
        z-index: 30;
        display: block;
        width: 100%;
        height: auto;
        max-height: 70vh;
        padding: 0.75rem 1rem;
        overflow-y: auto;
        border-right: 0;
        border-bottom: 4px solid var(--accent);
    }

    #sidebar details {
        margin: 0;
    }

    #sidebar summary {
        padding: 0.25rem 0;
        list-style-position: inside;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    #sidebar details[open] summary {
        margin-bottom: 0.75rem;
    }

    .toc-mobile {
        position: sticky;
        top: 0;
        z-index: 30;
        display: block;
        max-height: 70vh;
        margin: 0;
        padding: 0.75rem 1rem;
        overflow-y: auto;
        color: var(--panel-text);
        background: var(--panel);
        border-bottom: 4px solid var(--accent);
    }

    .toc-mobile summary {
        padding: 0.25rem 0;
        list-style-position: inside;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .toc-mobile[open] summary {
        margin-bottom: 0.75rem;
    }

    #content {
        width: 100%;
        min-height: 0;
        margin: 0;
        padding: clamp(1rem, 5vw, 2rem);
        box-shadow: none;
    }

    #content h1 {
        margin-bottom: 1.5rem;
    }

    #content h2 {
        margin-top: 3.2rem;
    }

    #content h3 {
        margin-top: 2.4rem;
    }

    #content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    #content th,
    #content td {
        min-width: 7rem;
        hyphens: none;
    }
}

@media (max-width: 520px) {
    #content {
        font-size: 0.96rem;
    }

    #content h1 {
        font-size: 2rem;
    }

    #content h2 {
        font-size: 1.6rem;
    }

    #content th,
    #content td {
        padding: 0.45rem 0.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Druckansicht */

@media print {
    :root {
        --paper: #fff;
        --text: #000;
    }

    @page {
        margin: 18mm;
    }

    body {
        background: #fff;
    }

    #sidebar,
    .toc-desktop,
    .toc-mobile {
        display: none !important;
    }

    #content {
        width: auto;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    #content h1,
    #content h2,
    #content h3,
    #content h4 {
        break-after: avoid;
    }

    #content table,
    #content figure,
    #content blockquote,
    #content pre {
        break-inside: avoid;
    }

    a {
        color: inherit;
        text-decoration: none;
    }
}
