/* Layout */
:root {
    --page-max-width: 1100px;
    --sidebar-width: 260px;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    line-height: 1.6;
    background: #0f1115;
    color: #e6e6e6;
}

.container {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    align-items: center;
    margin-top: 2vh;
}

@media (min-width: 1100px) {
    .container {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    }
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: auto;
    padding: 1rem 1rem 2rem;
    border-right: 1px solid #23262d;
    background: #0c0e12;
}

.sidebar h2 {
    font-size: 0.95rem;
    margin: 0.25rem 0 0.75rem;
    color: #b9c0d0;
    letter-spacing: .02em;
}

.toc {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin: 0.25rem 0;
}

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

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

.content {
    padding: 2rem;
    max-width: var(--page-max-width);
}

/* GitHub markdown container */
.markdown-body {
    background: transparent;
    color: inherit;
}

.markdown-body a {
    color: #91b4ff;
}

/* Code blocks */
pre[class*="language-"] {
    border-radius: 10px;
}

pre.line-numbers {
    padding-left: 3.2em;
}

/* Headings with anchor offset */
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
    scroll-margin-top: 80px;
}

/* Auto dark-mode if System hat dark */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f1115;
        color: #e6e6e6;
    }
}

/* Grundstil für umgewandelte Listeneinträge */
.commit {
    list-style: none; /* Bullet aus */
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #141821;
    border: 1px solid #232836;
    position: relative;
    line-height: 1.55;
}

/* linke Farbleiste */
.commit::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    border-radius: 12px 0 0 12px;
    background: var(--commit-accent, #3a4157);
}

/* Hover-Feedback */
.commit:hover {
    background: #171c27;
    border-color: #2a3040;
}

/* Scope optisch anhängen: (scope) */
.commit[scope-data]::after {
    content: " (" attr(scope-data) ")";
    opacity: 0.75;
    font-weight: 500;
    margin-left: .35rem;
}

/* Farbschemata pro type-data */
.commit[type-data="feat"] {
    --commit-accent: #6aa9ff;
}

.commit[type-data="fix"] {
    --commit-accent: #65d38b;
}

.commit[type-data="change"],
.commit[type-data="chore"] {
    --commit-accent: #ffc857;
}

.commit[type-data="docs"] {
    --commit-accent: #9aa5b1;
}

.commit[type-data="refactor"] {
    --commit-accent: #b084ff;
}

.commit[type-data="perf"] {
    --commit-accent: #4ddbd3;
}

.commit[type-data="test"] {
    --commit-accent: #9aa5b1;
}

/* Fallback für unbekannte Typen */
.commit:not([type-data]) {
    --commit-accent: #3a4157;
}

/* Dark-friendly Linkfarbe innerhalb von commit-Items */
.commit a {
    color: #9db9ff;
}

/* === Admonitions (Dark Mode Only) === */

.note, .tip, .info, .warning, .danger {
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
    font-family: system-ui, Arial, sans-serif;
    position: relative;
    padding-top: 60px; /* space for icon */
    transition: background-color 0.3s, border-color 0.3s;
    color: #ddd;
}

/* Common icon area */
.note::before,
.tip::before,
.info::before,
.warning::before,
.danger::before {
    content: "";
    display: block;
    width: 28px;
    height: 28px;
    position: absolute;
    left: 18px;
    top: 16px;
    background-repeat: no-repeat;
    background-size: contain;
}

/* === NOTE === */
.note {
    background-color: #2b2b2b;
    border-left: 4px solid #888;
}

.note::before {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23aaa' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M96 0C60.7 0 32 28.7 32 64V448c0 35.3 28.7 64 64 64H352c35.3 0 64-28.7 64-64V160L288 0H96zM320 192V64l128 128H320z'/></svg>");
}

/* === TIP === */
.tip {
    background-color: #183321;
    border-left: 4px solid #34a853;
    color: #d8f6e4;
}

.tip::before {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2334a853' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M176 464a16 16 0 0016 16h128a16 16 0 0016-16v-48H176v48zM256 0C150 0 64 86 64 192c0 58.4 28.1 110.3 72 143.2V384a16 16 0 0016 16h208a16 16 0 0016-16v-48.8c43.9-32.9 72-84.8 72-143.2C448 86 362 0 256 0z'/></svg>");
}

/* === INFO === */
.info {
    background-color: #1e2b3a;
    border-left: 4px solid #2196f3;
    color: #d9eaff;
}

.info::before {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%232196f3' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 56C145.1 56 56 145.1 56 256s89.1 200 200 200 200-89.1 200-200S366.9 56 256 56zm0 96a24 24 0 110 48 24 24 0 010-48zm24 80v144h-48V232h48z'/></svg>");
}

/* === WARNING === */
.warning {
    background-color: #3b2e18;
    border-left: 4px solid #ffa500;
    color: #fff3d1;
}

.warning::before {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23ffa500' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 576 512'><path d='M569.5 440.6L327.4 40.6c-18.1-30.1-62.6-30.1-80.7 0L6.5 440.6C-11.6 470.7 10.9 512 48 512h480c37.1 0 59.6-41.3 41.5-71.4zM288 176c13.3 0 24 10.7 24 24v88c0 13.3-10.7 24-24 24s-24-10.7-24-24v-88c0-13.3 10.7-24 24-24zm0 216c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z'/></svg>");
}

/* === DANGER === */
.danger {
    background-color: #3a1e1e;
    border-left: 4px solid #e74c3c;
    color: #f5d7d7;
}

.danger::before {
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23e74c3c' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path d='M256 32C132.3 32 32 132.3 32 256s100.3 224 224 224 224-100.3 224-224S379.7 32 256 32zm-40 104h80v176h-80V136zm0 208h80v48h-80v-48z'/></svg>");
}

/* === Text Styling === */
.note p, .tip p, .info p, .warning p, .danger p {
    margin: 0;
    flex: 1;
}