:root {
    --primary: #2c3e50;
    --accent:  #3498db;
    --text:    #2c3e50;
    --muted:   #7f8c8d;
    --border:  #ecf0f1;
    --sidebar-bg: #f8f9fa;
}

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

body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #fff;
    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: var(--primary); 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,.6); }

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

/* ── 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: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-img { width: 100%; max-height: 320px; object-fit: contain; background: #f0f4f8; 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: .5; }

/* ── 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: #e8f0fe;
    color: #1a4b8c;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    transition: background .12s;
}
.tag:hover { background: #c5d8fc; color: #1a4b8c; }

.excerpt  { margin: 0 0 10px; }
.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 img  { max-width: 100%; }
.post-content pre  { background: #f0f4f8; padding: 14px; border-radius: 4px; overflow-x: auto; font-size: 13px; }
.post-content code { background: #f0f4f8; padding: 2px 5px; border-radius: 3px; font-size: .9em; }
.post-content blockquote { border-left: 4px solid var(--accent); margin: 0; padding: 6px 18px; color: var(--muted); font-style: italic; }
.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); }
.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); text-decoration: none; font-size: 13px; }
.pagination a:hover, .pagination a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 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: #c0c8d4; }

.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; }
.widget button { width: 100%; padding: 8px; background: var(--accent); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13.5px; font-family: inherit; }
.widget button:hover { opacity: .88; }

/* ── Series ──────────────────────────── */
.series-box {
    background: #f0f5ff;
    border: 1px solid #b8d0f5;
    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: var(--primary); 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: #aaa; }
.series-coming-soon { color: #aaa; font-style: italic; }
.series-badge-soon { font-size: 10px; background: #e2e8f0; color: #666; padding: 1px 6px; border-radius: 8px; margin-left: 6px; font-style: normal; vertical-align: middle; }
.series-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #c8daee; }
.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: var(--primary); color: rgba(255,255,255,.5); text-align: center; padding: 16px; font-size: 13px; }

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