:root {
    --main-bg: #f6f8fa;
    --main-text: #1f2328;
    --primary: #0969da;
    --cat-bg: #ddf4ff;
    --cat-text: #0969da;
    --gray: #ffffff;
    --white: #ffffff;
    --border: rgba(31, 35, 40, 0.12);
    --shadow: 0 8px 24px rgba(149, 157, 165, 0.1);
    --radius: 20px;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

[data-theme="dark"] {
    --main-bg: #0d1117;
    --main-text: #e6edf3;
    --primary: #2f81f7;
    --cat-bg: #033d8b;
    --cat-text: #cae8ff;
    --gray: #161b22;
    --white: #0d1117;
    --border: #30363d;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--main-bg);
    color: var(--main-text);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: all 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* --- Header & Navigation --- */
header {
    padding: 3rem 0 2rem;
    text-align: center;
    background: var(--main-bg);
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

nav {
    display: inline-flex;
    background: var(--border);
    padding: 4px;
    border-radius: 14px;
    gap: 2px;
}

nav button {
    background: transparent;
    border: none;
    color: var(--main-text);
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}

nav button.active {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- Content Areas (Clean Unity) --- */
main {
    max-width: 680px;
    margin: 0 auto 4rem;
    padding: 0 1.2rem;
}

article, .about-section, .contact-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.post-header {
    display: flex;
    align-items: center; 
    gap: 12px;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.post-header h2 {
    margin: 0; 
    font-size: 1.4rem;
    line-height: 1.2;
}

.category-label {
    display: inline-flex;
    align-items: center;
    background: var(--cat-bg);
    color: var(--cat-text);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.meta {
    color: #6e7781;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

article {
    scroll-margin-top: 100px; 
}

.article-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1.2rem;
    border: 1px solid var(--border);
}

p { margin-bottom: 1rem; color: var(--main-text); opacity: 0.9; }
h2 { font-weight: 700; letter-spacing: -0.01em; }
code { font-size: 0.9rem; background: var(--cat-bg); padding: 2px 6px; border-radius: 4px; }

.category-filter-bar {
    margin: 0.5rem 0 2.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
}

/* Container für Dropdown (Many Mode) */
.category-dropdown-group {
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 6px 12px 6px 18px;
    border-radius: 100px; /* Vollrund */
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.category-label-dropdown {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--cat-text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 12px;
}

.category-dropdown {
    appearance: none;
    background-color: var(--gray);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--main-text);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 34px 6px 16px;
    transition: all 0.2s ease;
    outline: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236e7781' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
}

.category-dropdown:hover, .category-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.category-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--main-text);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.category-btn:hover {
    background: var(--cat-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
}

.category-filter-bar.few .category-btns { display: flex; }
.category-filter-bar.few .category-dropdown-group { display: none; }

.category-filter-bar.many .category-btns { display: none; }
.category-filter-bar.many .category-dropdown-group { display: flex; }

[data-theme="dark"] .category-dropdown {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e6edf3' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
}



.theme-transition,
.theme-transition *,
.theme-transition *:before,
.theme-transition *:after {
    transition: background-color 0.4s ease, color 0.5s ease !important;
    transition-delay: 0 !important;
}


.theme-switch-wrapper {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
}

.theme-switch {
    width: 54px;
    height: 28px;
    position: relative;
    display: inline-block;
}

.theme-switch input { 
    display: none; 
}

ul {
    list-style-type: disc;
    margin-bottom: 0.5rem;
    margin-left: 1.5rem;
}
ul ul {
    list-style-type: circle;
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}
li {
    margin-bottom: 0.5rem;
}

#checkbox {
    display: none;
}

.theme-switch {
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}
.icon.sun,
.icon.moon {
    font-size: 0.85rem;
    display: none;
    background-color: var(--main-text);
    color: var(--main-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 5px;
}

[data-theme="dark"] .icon.sun { display: inline-block;}
[data-theme="dark"] .icon.moon { display: none; }

[data-theme="light"] .icon.sun { display: none; }
[data-theme="light"] .icon.moon { display: inline-block; }

footer {
    text-align: center;
    padding: 4rem 0;
    font-size: 0.85rem;
    color: #6e7781;
}

.tab-content { display: none; animation: slideUp 0.4s ease-out; }
.tab-content.active { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    header { padding: 4rem 0 2rem; }
    article, .about-section, .contact-section { padding: 1.5rem; }
    .post-header h2 { font-size: 1.2rem; }
}