/* ── Public Blog Styles ──────────────────────────────────────────────────── */

/* Dark body — same pattern as fin.css, gs.css etc. */
body {
    background-color: #0f1117 !important;
    color: #d1d5db;
}

.blog-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #2a3140;
}

.blog-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f0f3f6;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */

.blog-filters {
    background: #161b22;
    border: 1px solid #2a3140;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.blog-filters .form-control,
.blog-filters .form-select {
    background: #0f1117;
    color: #d1d5db;
    border-color: #3b4048;
    font-size: .875rem;
}

.blog-filters .form-control:focus,
.blog-filters .form-select:focus {
    background: #0f1117;
    color: #d1d5db;
    border-color: #58a6ff;
    box-shadow: 0 0 0 2px rgba(88, 166, 255, .15);
}

/* ── Post cards ──────────────────────────────────────────────────────────── */

.blog-card {
    background: #161b22;
    border: 1px solid #2a3140;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    border-color: #58a6ff;
    box-shadow: 0 4px 24px rgba(88, 166, 255, .08);
}

.blog-card-cover {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.blog-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: .75rem;
    font-size: .78rem;
    color: #8b949e;
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f0f3f6;
    margin-bottom: .5rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}
.blog-card-title a:hover {
    color: #79c0ff;
}

.blog-card-excerpt {
    font-size: .875rem;
    color: #8b949e;
    line-height: 1.55;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.blog-tag {
    display: inline-block;
    padding: .15rem .55rem;
    background: #21262d;
    border: 1px solid #3b4048;
    border-radius: 4px;
    font-size: .72rem;
    color: #8b949e;
    text-decoration: none;
}
.blog-tag:hover {
    border-color: #58a6ff;
    color: #79c0ff;
}

.blog-type-badge {
    font-size: .72rem;
    padding: .15rem .5rem;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid transparent;
}
.blog-type-article    { background: #0d1117; border-color: #58a6ff; color: #58a6ff; }
.blog-type-note       { background: #0d1117; border-color: #8b949e; color: #8b949e; }
.blog-type-news       { background: #0d1117; border-color: #f78166; color: #f78166; }
.blog-type-prompt     { background: #0d1117; border-color: #bc8cff; color: #bc8cff; }
.blog-type-link       { background: #0d1117; border-color: #39d353; color: #39d353; }
.blog-type-collection { background: #0d1117; border-color: #e3b341; color: #e3b341; }

.blog-read-btn {
    font-size: .8rem;
    padding: .3rem .8rem;
    border-radius: 5px;
    white-space: nowrap;
}

/* ── Single post page ────────────────────────────────────────────────────── */

.blog-post-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #2a3140;
    margin-bottom: 2rem;
}

.blog-post-title {
    font-size: 2rem;
    font-weight: 700;
    color: #f0f3f6;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    font-size: .85rem;
    color: #8b949e;
}

.blog-post-cover {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 2rem;
    max-height: 420px;
    object-fit: cover;
}

/* Markdown content */
.blog-post-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #d1d5db;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    color: #f0f3f6;
    margin-top: 2rem;
    margin-bottom: .75rem;
    font-weight: 600;
}

.blog-post-content h1 { font-size: 1.6rem; }
.blog-post-content h2 { font-size: 1.35rem; border-bottom: 1px solid #2a3140; padding-bottom: .35rem; }
.blog-post-content h3 { font-size: 1.15rem; }
.blog-post-content h4 { font-size: 1rem; }

.blog-post-content p { margin-bottom: 1.2rem; }

.blog-post-content a {
    color: #58a6ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.blog-post-content a:hover { color: #79c0ff; }

.blog-post-content code {
    background: #161b22;
    border: 1px solid #2a3140;
    border-radius: 4px;
    padding: .15rem .4rem;
    font-size: .9em;
    color: #e3b341;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.blog-post-content pre {
    background: #0d1117;
    border: 1px solid #2a3140;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.blog-post-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #d1d5db;
    font-size: .875rem;
}

.blog-post-content blockquote {
    border-left: 4px solid #58a6ff;
    margin: 0 0 1.5rem;
    padding: .75rem 1.25rem;
    background: #161b22;
    border-radius: 0 6px 6px 0;
    color: #8b949e;
    font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
    margin-bottom: 1.25rem;
    padding-left: 1.75rem;
}

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

.blog-post-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 1rem 0;
}

.blog-post-content hr {
    border: none;
    border-top: 1px solid #2a3140;
    margin: 2rem 0;
}

.blog-post-content del {
    color: #8b949e;
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: .9rem;
}

.blog-post-content th,
.blog-post-content td {
    border: 1px solid #2a3140;
    padding: .5rem .75rem;
    color: #d1d5db;
}

.blog-post-content th {
    background: #161b22;
    font-weight: 600;
    color: #f0f3f6;
}

/* ── Source link ─────────────────────────────────────────────────────────── */

.blog-source-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #161b22;
    border: 1px solid #2a3140;
    border-radius: 6px;
    padding: .5rem 1rem;
    font-size: .875rem;
    color: #58a6ff;
    text-decoration: none;
    margin-bottom: 1.5rem;
}
.blog-source-link:hover {
    border-color: #58a6ff;
    color: #79c0ff;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #8b949e;
}

.blog-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: .5;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.blog-pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

/* ── Related posts ───────────────────────────────────────────────────────── */

.blog-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #2a3140;
}

.blog-related-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f0f3f6;
    margin-bottom: 1rem;
}

/* ── Preview pane (admin) ────────────────────────────────────────────────── */

.blog-preview-content {
    color: #d1d5db;
    font-size: 1rem;
    line-height: 1.7;
}
