:root {
    --primary:    #7c3aed;
    --accent:     #a855f7;
    --text:       #f3e8ff;
    --muted:      #a78bfa;
    --border:     #4c1d95;
    --sidebar-bg: #1e0a38;
    --bg:         #1a0a2e;
    --card-bg:    #240f42;
}

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

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 15px;
}

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

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ──────────────────────────── */
.site-header { background: #0f0520; color: #fff; padding: 16px 0 0; }
.header-inner { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; }
.site-name    { font-size: 21px; font-weight: bold; color: #fff; text-decoration: none; }
.site-tagline { font-size: 13px; color: rgba(255,255,255,.5); }

.site-nav { background: rgba(255,255,255,.05); border-top: 1px solid var(--border); }
.site-nav .container { display: flex; flex-wrap: wrap; padding-top: 0; padding-bottom: 0; }
.site-nav a { color: rgba(255,255,255,.72); text-decoration: none; padding: 10px 16px; font-size: 13.5px; transition: background .12s; }
.site-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── Two-column layout ───────────────── */
.layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 32px;
    padding: 32px 20px 40px;
}
.main { min-width: 0; }

/* ── Post cards ──────────────────────── */
.post-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-img { width: 100%; max-height: 320px; object-fit: contain; background: #1a0a2e; display: block; }
.card-img-link { display: block; margin: 12px -18px; }
.card-body { padding: 16px 18px 18px; }

.post-card h2 { margin: 0 0 8px; font-size: 20px; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }

.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.post-meta a { color: var(--muted); text-decoration: none; }
.breadcrumb-sep { margin: 0 3px; opacity: .4; }

/* ── Tags ────────────────────────────── */
.post-tags  { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
.tag-cloud  { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
    display: inline-block;
    padding: 2px 10px;
    background: #2e1065;
    color: #c084fc;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: background .12s;
    border: 1px solid #6d28d9;
}
.tag:hover { background: #3b0764; color: #d8b4fe; }

.excerpt  { margin: 0 0 10px; color: var(--muted); }
.read-more { font-size: 13.5px; color: var(--accent); font-weight: 600; text-decoration: none; }

/* ── Single article ──────────────────── */
.featured-img { width: 100%; border-radius: 6px; margin-bottom: 20px; }
.post-title   { font-size: 26px; margin: 0 0 10px; line-height: 1.3; }
.post-content { font-size: 15px; line-height: 1.85; }
.post-content h2, .post-content h3 { color: #e9d5ff; }
.post-content img  { max-width: 100%; }
.post-content pre  { background: #0f0520; border: 1px solid var(--border); padding: 14px; border-radius: 4px; overflow-x: auto; font-size: 13px; color: var(--text); }
.post-content code { background: #2e1065; padding: 2px 5px; border-radius: 3px; font-size: .9em; color: #f0abfc; }
.post-content pre code { background: transparent; color: var(--text); }
.post-content blockquote { border-left: 4px solid var(--accent); margin: 0; padding: 6px 18px; color: var(--muted); font-style: italic; background: rgba(168,85,247,.06); }
.post-content table { border-collapse: collapse; width: 100%; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.post-content th { background: #2e1065; color: #e9d5ff; }
.back-link { display: inline-block; margin-top: 20px; color: var(--accent); font-size: 14px; text-decoration: none; }

.archive-title { font-size: 18px; margin: 0 0 20px; padding-bottom: 8px; border-bottom: 2px solid var(--border); color: var(--text); }
.archive-title a { color: inherit; text-decoration: none; }
.archive-title a:hover { color: var(--accent); }

/* ── Pagination ──────────────────────── */
.pagination { display: flex; gap: 4px; padding: 12px 0; flex-wrap: wrap; }
.pagination a { display: inline-block; padding: 5px 13px; border: 1px solid var(--border); border-radius: 4px; color: var(--text); background: var(--card-bg); text-decoration: none; font-size: 13px; }
.pagination a:hover, .pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Sidebar ─────────────────────────── */
.sidebar { }
.widget {
    background: var(--sidebar-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 20px;
}
.widget h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text); text-decoration: none; flex: 1; }
.widget ul li a:hover { color: var(--accent); }
.widget ul li span { font-size: 12px; color: var(--muted); margin-left: 6px; }
.widget ul li.subcategory { padding-left: 16px; font-size: 13px; }
.widget ul li.subcategory::before { content: "↳"; margin-right: 5px; color: #6d28d9; }

.widget input[type=text] { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 13.5px; margin-bottom: 8px; font-family: inherit; background: #1a0a2e; color: var(--text); }
.widget input[type=text]::placeholder { color: var(--muted); }
.widget button { width: 100%; padding: 8px; background: var(--accent); color: #0f0520; border: none; border-radius: 4px; cursor: pointer; font-size: 13.5px; font-family: inherit; font-weight: 600; }
.widget button:hover { opacity: .88; }

/* ── Series ──────────────────────────── */
.series-box {
    background: #1e0a38;
    border: 1px solid #6d28d9;
    border-left: 4px solid var(--accent);
    border-radius: 5px;
    padding: 16px 18px;
    margin: 24px 0;
    font-size: 14px;
}
.series-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); font-weight: bold; margin-bottom: 3px; }
.series-title { font-size: 14px; font-weight: bold; margin-bottom: 10px; }
.series-title a { color: #d8b4fe; text-decoration: none; }
.series-title a:hover { text-decoration: underline; }
.series-parts { margin: 0 0 10px; padding-left: 20px; }
.series-parts li { margin-bottom: 4px; font-size: 13.5px; }
.series-part a { color: var(--accent); text-decoration: none; }
.series-part a:hover { text-decoration: underline; }
.series-part-current { color: var(--text); }
.series-part-placeholder { color: #6d28d9; }
.series-coming-soon { color: #6d28d9; font-style: italic; }
.series-badge-soon { font-size: 10px; background: #2e1065; color: #a78bfa; padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-style: normal; vertical-align: middle; border: 1px solid var(--border); }
.series-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #6d28d9; }
.series-nav-btn { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.series-nav-btn:hover { text-decoration: underline; }
.series-description { color: var(--muted); margin-bottom: 18px; }
.series-excerpt { font-size: 13px; color: var(--muted); margin: 3px 0 0; }

/* ── Footer ──────────────────────────── */
.site-footer { background: #0f0520; color: rgba(255,255,255,.3); text-align: center; padding: 16px; font-size: 13px; border-top: 1px solid var(--border); }

@media (max-width: 740px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { order: -1; }
}
