:root {
    --font-main: 'Georgia', serif;
    --font-heading: 'Georgia', serif;
    --max-width: 680px;
    --bg-color: #f0eee6; /* Warmes Papier-Weiß */
    --text-color: #222222;
    --heading-color: #111111;
    --link-color: #111111; /* Gleiche Farbe wie Überschriften */
    --muted-color: #777777;
    --code-bg: #e6e4dc;    /* Etwas dunkler als Background für Kontrast */
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1917; /* Wärmeres Dunkel */
        --text-color: #d1cdc7;
        --heading-color: #ffffff;
        --link-color: #ffffff;
        --muted-color: #888888;
        --code-bg: #2a2927;
    }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 1.15rem;
    line-height: 1.7;
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    overflow-wrap: break-word;
}

.container {
    position: relative;
    max-width: var(--max-width);
    width: 100%;
}

p {
    margin-top: 0;
    margin-bottom: 1.8rem; /* Etwas mehr Abstand für den Lesefluss */
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin: 2.5rem 0;
}

/* Inline code */
code {
    font-family: 'Consolas', 'Monaco', monospace;
    background-color: var(--code-bg);
    border-radius: 2px;
    font-size: 0.9rem;
    padding: 0.2rem 0.4rem;
}

/* Code blocks */
pre {
    background-color: var(--code-bg);
    border-radius: 2px;
    margin: 2.5rem 0;
    border: 1px solid rgba(0,0,0,0.05);
    overflow-x: auto;
    display: block;
    
    /* Scrollbar verstecken */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

pre::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

pre code {
    display: block; /* Erlaubt sauberes Scrolling im Block */
    padding: 1.2rem;
    background-color: transparent; /* Reset für den Block-Modus */
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre; /* Blöcke sollen nicht umbrechen */
    border-radius: 0;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--heading-color);
    font-weight: normal; /* Serif wirkt oft besser ohne extremen Bold-Weight */
    line-height: 1.25;
    margin-top: 3.5rem;
    margin-bottom: 1.2rem;
}

a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

nav {
    font-family: var(--font-heading);
}

/* TOC Positionierung */
.toc {
    position: absolute;
    left: -280px; /* Etwas näher am Text */
    width: 240px; /* Etwas schmaler */
    top: 0;
    bottom: 0; /* WICHTIG: Erlaubt sticky das Mitlaufen über die volle Höhe */
    font-size: 0.85rem;
    line-height: 1.4;
}

.toc-sticky {
    position: sticky;
    top: 4rem; /* Abstand zum oberen Rand beim Scrollen */
    max-height: 90vh;
    overflow-y: auto;
}

.toc-title {
    font-weight: bold;
    margin-bottom: 1.2rem;
    color: var(--heading-color);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05rem;
}

.toc nav ul, 
.toc nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc nav ul li,
.toc nav ol li {
    margin-bottom: 0.6rem;
}

.toc nav ul li a,
.toc nav ol li a {
    text-decoration: none;
    color: #8A8C9E;
    transition: all 0.2s ease;
    display: block;
    padding-left: 1rem; /* Basis-Padding für alle */
    border-left: 2px solid transparent; /* Transparenter Border verhindert Springen */
}

.toc nav ul li a.active,
.toc nav ol li a.active {
    color: var(--text-color);
    font-weight: bold;
    border-left: 2px solid var(--text-color);
}

.toc nav ul li a:hover,
.toc nav ol li a:hover {
    color: var(--text-color);
}

@media (prefers-color-scheme: dark) {
    .toc nav ul li a {
        color: #6a6c7e;
    }
    .toc nav ul li a.active {
        color: var(--text-color);
        border-left-color: var(--text-color);
    }
}

/* RESPONSIVE TOC */
@media (max-width: 1300px) {
    .toc {
        position: static;
        width: auto;
        margin-top: 3rem;
        margin-bottom: 3rem;
        padding: 1.5rem;
        background-color: var(--code-bg);
        border-radius: 4px;
        box-sizing: border-box;
    }
    .toc-sticky {
        position: static;
        max-height: none;
    }
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

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

.post-item {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.date {
    color: var(--muted-color);
    font-size: 0.85rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Home Page Layout */
.intro {
    margin-bottom: 5rem;
}

.intro h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.intro h2 {
    font-size: 1.2rem;
    color: var(--muted-color);
    margin-top: 0;
    margin-bottom: 2rem;
    letter-spacing: 0.02rem;
}
