/* Marketing blog (/blog) - listing, cards, post page. Uses the marketing palette vars. */

.blog-wrap { background: #fff; }

/* Category filter chips */
.blog-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}
.blog-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.95rem;
    border: 1px solid #e4e4e7;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #52525b;
    text-decoration: none;
    transition: all 0.15s ease;
}
.blog-chip:hover { border-color: var(--sp-accent); color: var(--sp-accent); }
.blog-chip.active { background: var(--sp-accent); border-color: var(--sp-accent); color: #fff; }
.blog-chip-count { font-size: 0.75rem; opacity: 0.7; }
.blog-chip.active .blog-chip-count { opacity: 0.85; }

/* Post cards */
.blog-card {
    position: relative; /* anchors the title's .stretched-link (whole-card click target) */
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
/* The category link must stay clickable above the stretched title link. */
.blog-card-cat { position: relative; z-index: 1; }
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(24, 24, 27, 0.1);
    border-color: #ddd;
}
.blog-card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #ede9fe, #e0e7ff);
    overflow: hidden;
}
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 2.25rem;
    color: var(--sp-accent);
    opacity: 0.55;
}
.blog-card-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.blog-card-cat {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sp-accent);
    text-decoration: none;
    margin-bottom: 0.5rem;
}
.blog-card-cat:hover { text-decoration: underline; }
.blog-card-title { font-size: 1.15rem; font-weight: 700; line-height: 1.3; margin: 0 0 0.5rem; }
.blog-card-title a { color: #18181b; text-decoration: none; }
.blog-card-title a:hover { color: var(--sp-accent); }
.blog-card-excerpt { font-size: 0.9rem; color: var(--sp-text-muted); margin: 0 0 1rem; flex: 1; }
.blog-card-meta { font-size: 0.8rem; color: #a1a1aa; }

/* Pagination */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}
.blog-page-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--sp-accent);
    text-decoration: none;
}
.blog-page-link:hover { text-decoration: underline; }
.blog-page-status { font-size: 0.85rem; color: var(--sp-text-muted); }

/* Post page */
.blog-post { background: #fff; }
.blog-breadcrumb { font-size: 0.85rem; margin-bottom: 1rem; display: flex; gap: 0.5rem; align-items: center; }
.blog-breadcrumb a { color: var(--sp-text-muted); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--sp-accent); }
.blog-breadcrumb span { color: #d4d4d8; }
.blog-post-header { margin-bottom: 1.5rem; }
.blog-post-meta { margin-top: 0.85rem; font-size: 0.9rem; color: var(--sp-text-muted); display: flex; flex-wrap: wrap; gap: 0.4rem; }
.blog-post-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; margin-bottom: 2rem; }
.blog-resources { margin: 2.5rem 0 1.5rem; padding: 1rem 1.25rem; background: #f8f9ff; border: 1px solid #e6e8ff; border-radius: 12px; font-size: .95rem; color: #4b4b57; }
.blog-resources a { font-weight: 600; }

/* Rendered Markdown body - readable measure + typographic rhythm */
.blog-post-content { font-size: 1.075rem; line-height: 1.75; color: #27272a; }
.blog-post-content > * { max-width: 100%; }
.blog-post-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.25rem 0 0.9rem; letter-spacing: -0.01em; }
.blog-post-content h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 0.75rem; }
.blog-post-content p { margin: 0 0 1.25rem; }
.blog-post-content a { color: var(--sp-accent); }
.blog-post-content ul, .blog-post-content ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.blog-post-content li { margin-bottom: 0.4rem; }
.blog-post-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.5rem 0; }
.blog-post-content blockquote {
    margin: 1.5rem 0;
    padding: 0.5rem 1.25rem;
    border-left: 4px solid var(--sp-accent);
    color: #52525b;
    background: #fafafa;
    border-radius: 0 8px 8px 0;
}
.blog-post-content pre {
    background: #18181b;
    color: #e4e4e7;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}
.blog-post-content code { font-size: 0.9em; }
.blog-post-content :not(pre) > code { background: #f4f4f5; padding: 0.15em 0.4em; border-radius: 5px; color: #be185d; }
.blog-post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.blog-post-content th, .blog-post-content td { border: 1px solid #e4e4e7; padding: 0.6rem 0.85rem; text-align: left; }
.blog-post-content th { background: #fafafa; font-weight: 600; }

.blog-post-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin: 2.5rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid #ececf0;
}
.blog-back { font-weight: 600; color: var(--sp-text-muted); text-decoration: none; }
.blog-back:hover { color: var(--sp-accent); }
.blog-related { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #ececf0; }
.blog-related a { color: var(--sp-accent); text-decoration: none; font-weight: 500; }
.blog-related a:hover { text-decoration: underline; }

/* ── Search form + typeahead ───────────────────────── */
.blog-search-form {
    position: relative;
    max-width: 460px;
    margin: 1.5rem auto 0;
    display: flex;
    align-items: center;
}
.blog-search-form .bi-search { position: absolute; left: 1rem; color: #a1a1aa; pointer-events: none; }
.blog-search-form input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.5rem;
    border: 1px solid #e4e4e7;
    border-radius: 100px;
    font-size: 0.95rem;
    background: #fff;
}
.blog-search-form input:focus { outline: none; border-color: var(--sp-accent); box-shadow: 0 0 0 3px rgba(90,92,232,0.15); }
.blog-typeahead {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(24,24,27,0.12);
    overflow: hidden;
    z-index: 20;
    text-align: left;
}
.blog-typeahead a { display: block; padding: 0.6rem 1rem; color: #27272a; text-decoration: none; font-size: 0.9rem; }
.blog-typeahead a:hover { background: #f4f4f5; color: var(--sp-accent); }

.blog-search-results li { margin-bottom: 0.75rem; }
.blog-search-result { display: block; padding: 0.9rem 1.1rem; border: 1px solid #ececf0; border-radius: 12px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.blog-search-result:hover { border-color: var(--sp-accent); box-shadow: 0 6px 18px rgba(24,24,27,0.06); }
.blog-search-result-title { display: block; font-weight: 600; color: #18181b; }
.blog-search-result-excerpt { display: block; font-size: 0.875rem; color: var(--sp-text-muted); margin-top: 0.2rem; }

/* ── Tags ──────────────────────────────────────────── */
.blog-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0 0; }
.blog-tag {
    font-size: 0.8rem; font-weight: 600; color: #52525b;
    background: #f4f4f5; padding: 0.3rem 0.7rem; border-radius: 100px; text-decoration: none;
}
.blog-tag:hover { background: var(--sp-accent); color: #fff; }

/* ── Share row ─────────────────────────────────────── */
.blog-share { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.75rem; }
.blog-share-label { font-size: 0.85rem; font-weight: 600; color: var(--sp-text-muted); }
.blog-share-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid #e4e4e7; background: #fff; color: #52525b; cursor: pointer;
    text-decoration: none; transition: all .15s;
}
.blog-share-btn:hover { border-color: var(--sp-accent); color: var(--sp-accent); }
.blog-share-btn.copied { border-color: #16a34a; color: #16a34a; }

/* ── Author box ────────────────────────────────────── */
.blog-author-box { display: flex; gap: 1rem; align-items: flex-start; margin-top: 2.5rem; padding: 1.5rem; background: #fafafa; border-radius: 16px; }
.blog-author-box-lg { background: transparent; padding: 0; justify-content: center; text-align: left; margin-top: 1rem; }
.blog-author-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.blog-author-box-lg .blog-author-avatar { width: 88px; height: 88px; }
.blog-author-avatar-fallback { display: flex; align-items: center; justify-content: center; background: var(--sp-accent); color: #fff; font-size: 1.6rem; font-weight: 700; }
.blog-author-name { font-weight: 700; font-size: 1.05rem; }
.blog-author-name a { color: #18181b; text-decoration: none; }
.blog-author-name a:hover { color: var(--sp-accent); }
.blog-author-role { font-size: 0.85rem; color: var(--sp-accent); font-weight: 600; }
.blog-author-bio { font-size: 0.9rem; color: var(--sp-text-muted); margin: 0.4rem 0 0.5rem; }
.blog-author-links { display: flex; gap: 0.75rem; font-size: 1.1rem; }
.blog-author-links a { color: var(--sp-text-muted); }
.blog-author-links a:hover { color: var(--sp-accent); }

/* ── Table of contents (sticky, right rail) ────────── */
.blog-toc { position: sticky; top: 90px; font-size: 0.875rem; border-left: 2px solid #ececf0; padding-left: 1rem; }
.blog-toc-title { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; color: #a1a1aa; margin-bottom: 0.6rem; }
.blog-toc ul { list-style: none; margin: 0; padding: 0; }
.blog-toc li { margin: 0.1rem 0; }
.blog-toc-l3 { padding-left: 0.85rem; }
.blog-toc a { color: var(--sp-text-muted); text-decoration: none; display: block; padding: 0.2rem 0; line-height: 1.35; border-left: 2px solid transparent; margin-left: -1rem; padding-left: 1rem; }
.blog-toc a:hover { color: var(--sp-accent); }
.blog-toc a.active { color: var(--sp-accent); font-weight: 600; border-left-color: var(--sp-accent); }

/* ── Code-copy + heading anchors ───────────────────── */
.blog-post-content pre { position: relative; }
.blog-code-copy {
    position: absolute; top: 0.5rem; right: 0.5rem;
    border: none; background: rgba(255,255,255,0.1); color: #e4e4e7;
    border-radius: 6px; padding: 0.25rem 0.45rem; cursor: pointer; font-size: 0.85rem; line-height: 1;
    opacity: 0; transition: opacity .15s;
}
.blog-post-content pre:hover .blog-code-copy { opacity: 1; }
.blog-code-copy:hover { background: rgba(255,255,255,0.2); }
.blog-post-content h2, .blog-post-content h3 { position: relative; }
.blog-heading-anchor { opacity: 0; margin-left: 0.4rem; color: var(--sp-accent); text-decoration: none; font-size: 0.85em; }
.blog-post-content h2:hover .blog-heading-anchor, .blog-post-content h3:hover .blog-heading-anchor { opacity: 0.7; }

/* ── Draft preview banner ──────────────────────────── */
.blog-draft-banner { background: #f59e0b; color: #1c1917; text-align: center; padding: 0.6rem 1rem; font-size: 0.9rem; font-weight: 500; }

/* ── Callouts (DocsService emits .docs-callout-*) ──── */
.docs-callout { display: flex; gap: 0.75rem; padding: 1rem 1.25rem; border-radius: 10px; margin: 1.5rem 0; border: 1px solid transparent; }
.docs-callout-icon { font-size: 1.15rem; line-height: 1.6; flex-shrink: 0; }
.docs-callout-body > :last-child { margin-bottom: 0; }
.docs-callout-note, .docs-callout-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.docs-callout-tip { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.docs-callout-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.docs-callout-important { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.docs-callout-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.docs-callout a { color: inherit; text-decoration: underline; }

/* ── Reading progress bar ──────────────────────────── */
.blog-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: transparent; z-index: 1080; }
.blog-progress span { display: block; height: 100%; width: 0; background: var(--sp-accent); transition: width .1s linear; }

/* ── Prev / next post nav ──────────────────────────── */
.blog-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2.5rem; }
.blog-prevnext-link {
    display: flex; flex-direction: column; gap: 0.25rem;
    padding: 1rem 1.15rem; border: 1px solid #ececf0; border-radius: 12px;
    text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.blog-prevnext-link:hover { border-color: var(--sp-accent); box-shadow: 0 6px 18px rgba(24,24,27,0.06); }
.blog-prevnext-next { text-align: right; }
.blog-prevnext-label { font-size: 0.78rem; font-weight: 600; color: var(--sp-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.blog-prevnext-title { font-weight: 600; color: #18181b; line-height: 1.3; }

/* ── "Most read" widget ────────────────────────────── */
.blog-popular { background: #fafafa; border-radius: 16px; padding: 1.5rem 1.75rem; margin-bottom: 2.5rem; }
.blog-popular-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.75rem; }
.blog-popular-title .bi-fire { color: #f97316; }
.blog-popular-list { margin: 0; padding-left: 1.25rem; columns: 2; }
.blog-popular-list li { margin-bottom: 0.4rem; }
.blog-popular-list a { color: #27272a; text-decoration: none; }
.blog-popular-list a:hover { color: var(--sp-accent); }
@media (max-width: 600px) { .blog-popular-list { columns: 1; } .blog-prevnext { grid-template-columns: 1fr; } }
