:root {
    --bg: #0a0a0f;
    --text: #e0e0e0;
    --text-secondary: #999;
    --accent: #00d4ff;
    --accent-pink: #FF1A75;
    --border: #222;
    --code-bg: #111;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.8;
    font-size: 17px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono); /* Lab-style typography */
    font-size: 1.5rem;
    font-weight: 800; /* Extra bold wie Lab */
}

.site-logo img { border-radius: 8px; }
.site-logo .domain { color: var(--text); font-weight: 400; }

.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--accent); font-family: var(--font-mono); font-size: .9rem; text-decoration: none; }
.site-nav a:hover { color: var(--accent); }

.site-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.post-card {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.post-card:last-child { border-bottom: none; }

.post-card-title a {
    color: var(--text);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-card-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin: 1rem 0;
    line-height: 1.6;
}

.read-more {
    color: var(--accent-pink);
    font-weight: 600;
}

/* Single Post */
.post-header { margin-bottom: 3rem; }

.post-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.author-avatar { border-radius: 50%; }
.author-name { font-weight: 700; font-size: 1.1rem; }
.author-bio { color: var(--text-secondary); font-size: 0.9rem; }

.post-title {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.post-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.post-tags { margin-top: 1rem; }
.tag {
    display: inline-block;
    background: var(--code-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    color: var(--accent);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h1 {
    margin: 2.5rem 0 1.5rem;
    color: var(--text);
    font-size: 2rem;
    font-weight: 700;
}

/* Hide duplicate H1 (first one after post-header) */
.post-content > h1:first-child {
    display: none;
}

.post-content h2 {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--accent-pink);
    padding-bottom: 0.5rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.post-content h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.post-content p { 
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.post-content ul, .post-content ol { 
    margin: 1.5rem 0 1.5rem 2rem;
    line-height: 1.8;
}

.post-content li { margin-bottom: 0.5rem; }

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-pink);
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.7;
}

.post-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.post-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.post-nav a {
    color: var(--text-secondary);
    max-width: 45%;
}

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

.medina-signature {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.site-footer a { color: var(--accent); }
.powered-by { margin-top: 1rem; font-size: 0.8rem; opacity: 0.7; }

/* 404 */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--accent-pink);
    margin-bottom: 1rem;
}

.error-page h2 { font-size: 2rem; margin-bottom: 1rem; }
.back-home { color: var(--accent); font-weight: 600; }

/* Responsive */
@media (max-width: 768px) {
    .site-header { flex-direction: column; gap: 1rem; padding: 1rem; }
    .site-nav { flex-wrap: wrap; justify-content: center; }
    .site-main { padding: 2rem 1rem; }
    .post-title {
    font-family: var(--font-sans); font-size: 2rem; }
    .post-card-title a { font-size: 1.4rem; }
    .post-content { font-size: 1rem; }
}

/* Header Typography wie Lab */
.site-logo {
    font-family: var(--font-mono);
    font-weight: 800;
}

.site-logo .site-title {
    color: var(--accent); /* Medina in Accent-Farbe wie Lab */
}

.site-logo .domain {
    color: var(--text); /* .consults.de in Text-Farbe */
}

/* Referenzen — einheitliches Format */
ol.referenzen {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--accent-pink);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-left: 2rem;
}

ol.referenzen li {
    margin-bottom: 0.5rem;
}

ol.referenzen a {
    color: var(--accent);
    word-break: break-all;
}

#referenzen-title {
    font-size: 1.1rem;
    color: var(--text-secondary);
    border-bottom: none;
    margin-top: 3rem;
    margin-bottom: 0.5rem;
}

/* Referenz-Marker im Text: Space davor */
.post-content a[href="#referenzen"] {
    margin-left: 0.15em;
}

/* Referenzliste: Links auf eigener Zeile */
ol.referenzen li a {
    display: block;
    margin-top: 0.2rem;
}

/* Fix: Anker-Offset für sticky header */
#referenzen {
    scroll-margin-top: 100px;
}

/* Kein doppelter Strich: H2 vor Referenzliste */
h2#referenzen,
h2#referenzen-title {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 3rem;
}

/* Float images in articles */
.post-content img {
    max-width: 280px;
    float: right;
    margin: 0.2rem 0 1rem 1.5rem;
    border-radius: 8px;
}

.post-content img:nth-of-type(n+2) {
    max-width: 560px;
}

.post-content h2 {
    clear: both;
}

@media (max-width: 768px) {
    .post-content img {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}

/* Archive sidebar */
.archive-sidebar a:hover {
    color: var(--accent) !important;
}

@media (max-width: 768px) {
    .archive-sidebar {
        width: 100% !important;
        margin-top: 2rem;
        border-top: 1px solid var(--border);
        padding-top: 1.5rem;
    }
}

/* Layout wrapper for content + sidebar */
.content-with-sidebar {
    display: flex;
    gap: 2rem;
}

@media (max-width: 768px) {
    .content-with-sidebar {
        flex-direction: column;
    }
}
