/* =========================================================
   BLOG (Medium-inspired)
   Requires: <body class="blog">
   ========================================================= */

body.blog {
    background: #ffffff;
    color: #111827;
}

/* Keep your marketing styles intact; make blog header clean */
body.blog .site-header.blog-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229,231,235,0.9);
}

body.blog .nav-link {
    color: rgba(17,24,39,0.72) !important;
}
body.blog .nav-link.active {
    color: rgba(17,24,39,0.95) !important;
    font-weight: 600;
}

/* Shell: narrow centered column like Medium */
.blog-shell {
    max-width: 740px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 0;
}

@media (max-width: 576px) {
    .blog-shell { padding: 1.75rem 1rem 0; }
}

/* Top header */
.blog-top {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(229,231,235,0.9);
    margin-bottom: 1.5rem;
}

.blog-title {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-size: clamp(2rem, 2vw + 1.3rem, 2.75rem);
    line-height: 1.05;
    margin: 0;
}

.blog-subtitle {
    margin: 0.75rem 0 0;
    color: rgba(107,114,128,0.95);
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 52ch;
}

/* Feed list */
.blog-feed {
    display: flex;
    flex-direction: column;
}

.post-preview {
    padding: 1.35rem 0;
    border-bottom: 1px solid rgba(229,231,235,0.9);
}

.post-preview-meta {
    font-size: 0.9rem;
    color: rgba(107,114,128,0.95);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.post-preview-meta .dot,
.article-meta .dot {
    opacity: 0.7;
}

/* Post title */
.post-preview-title {
    margin: 0.55rem 0 0.45rem;
    line-height: 1.18;
    letter-spacing: -0.02em;
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 500;
    font-size: 1.45rem;
}

.post-preview-title a {
    color: #111827;
    text-decoration: none;
}

.post-preview-title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Excerpt like Medium */
.post-preview-excerpt {
    margin: 0;
    color: rgba(55,65,81,0.92);
    font-size: 1.03rem;
    line-height: 1.65;
    max-width: 70ch;
}

/* Footer row */
.post-preview-footer {
    margin-top: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.post-readmore {
    color: rgba(17,24,39,0.9);
    font-weight: 600;
    text-decoration: none;
}
.post-readmore:hover { text-decoration: underline; }

/* Tag pills: subtle gray like Medium */
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(243,244,246,1);
    border: 1px solid rgba(229,231,235,1);
    color: rgba(17,24,39,0.82);
    font-size: 0.85rem;
    text-decoration: none;
}

.tag-pill:hover {
    background: rgba(249,250,251,1);
    border-color: rgba(209,213,219,1);
}

/* Pagination */
.blog-pagination {
    padding: 1.5rem 0 0.5rem;
}

body.blog .pagination {
    gap: .35rem;
}

body.blog .page-link {
    border-radius: 999px !important;
    border: 1px solid rgba(209,213,219,0.95);
    color: rgba(17,24,39,0.9);
    padding: 0.45rem 0.85rem;
    background: #fff;
}

body.blog .page-item.active .page-link {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

/* Article page */
.blog-back {
    display: inline-block;
    color: rgba(107,114,128,0.95);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.25rem;
}
.blog-back:hover { text-decoration: underline; }

.article-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(229,231,235,0.9);
    margin-bottom: 1.75rem;
}

.article-title {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 500;
    letter-spacing: -0.04em;
    font-size: clamp(2.1rem, 2.5vw + 1.2rem, 3.2rem);
    line-height: 1.05;
    margin: 0 0 0.85rem;
}

.article-meta {
    font-size: 0.95rem;
    color: rgba(107,114,128,0.95);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.article-author {
    color: rgba(17,24,39,0.92);
    text-decoration: none;
    font-weight: 700;
}
.article-author:hover { text-decoration: underline; }

.article-tags {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Prose (the important part) */
.blog-prose {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 1.15rem;
    line-height: 1.9;
    color: rgba(17,24,39,0.92);
    padding-bottom: 2.5rem;
}

/* Canvas HTML output styling */
.blog-prose p { margin: 0 0 1.2rem; }

.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
    font-family: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: rgba(17,24,39,0.96);
    letter-spacing: -0.02em;
    margin: 2.2rem 0 0.9rem;
}

.blog-prose h2 { font-size: 1.75rem; font-weight: 900; line-height: 1.15; }
.blog-prose h3 { font-size: 1.3rem; font-weight: 850; line-height: 1.22; }
.blog-prose h4 { font-size: 1.1rem; font-weight: 800; }

.blog-prose a {
    color: rgba(17,24,39,0.95);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.blog-prose a:hover {
    color: #111827;
    text-decoration-thickness: 2px;
}

/* Lists */
.blog-prose ul,
.blog-prose ol {
    padding-left: 1.35rem;
    margin: 0 0 1.25rem;
}
.blog-prose li { margin: 0.35rem 0; }

/* Blockquote like Medium */
.blog-prose blockquote {
    margin: 1.6rem 0;
    padding-left: 1.1rem;
    border-left: 3px solid rgba(17,24,39,0.85);
    color: rgba(17,24,39,0.86);
    font-style: italic;
}
.blog-prose blockquote p { margin-bottom: 0; }

/* Code */
.blog-prose pre {
    background: #0b1220;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 1rem 1.1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

.blog-prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
    background: rgba(17,24,39,0.06);
    border: 1px solid rgba(17,24,39,0.10);
    padding: 0.12rem 0.35rem;
    border-radius: 8px;
}

.blog-prose pre code {
    background: transparent;
    border: none;
    padding: 0;
}

/* Images should be centered and breathe */
.blog-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.8rem auto;
    border-radius: 14px;
}

/* HR */
.blog-prose hr {
    margin: 2.25rem 0;
    border: none;
    height: 1px;
    background: rgba(229,231,235,0.95);
}
