/* Blog Public Styles v20260219b */
/* Clean, readable blog styling for blog.goviva.ai */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1F2937;
    background: #FAFAFA;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ─── Header ──────────────────────────────────── */

.blog-pub-header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.blog-pub-header-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-pub-brand {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.blog-pub-brand:hover {
    color: #FF6B35;
}

/* ─── Main Content ────────────────────────────── */

.blog-pub-main {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ─── Single Post Article ─────────────────────── */

.blog-pub-article {
    max-width: 720px;
    margin: 0 auto;
}

/* ─── Breadcrumb ──────────────────────────────────
   Lives inside the article rather than the page header: offsite-shell.js hides
   .blog-pub-header on businesses that mirror their own site, and that header
   held the only link back to the post index. See functions/_middleware.js. */

.blog-pub-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    color: #6B7280;
    min-width: 0;               /* let the flex child actually shrink */
}

.blog-pub-crumbs a {
    color: #FF6B35;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
}

.blog-pub-crumbs a:hover {
    text-decoration: underline;
}

.blog-pub-crumb-sep {
    color: #D1D5DB;
    flex: 0 0 auto;
}

/* Truncate with CSS, not JS — the full title stays in the DOM for screen
   readers and crawlers while the visible crumb stays one tidy line. */
.blog-pub-crumb-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Give the crumb breathing room when the mirrored-site shell is on top. */
body.offsite-shell-active .blog-pub-crumbs {
    margin-top: 4px;
}

.blog-pub-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6B7280;
}

.blog-pub-category {
    background: #FFF7ED;
    color: #FF6B35;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.blog-pub-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    color: #111827;
    margin-bottom: 24px;
}

/* Header image.
   A fixed 3:2 window (720 × 480 at full article width — the exact maximum the
   hero used to reach). It was previously `height:auto; max-height:480px`, which
   meant tall photos were silently centre-cropped at a size that depended on the
   image, so the editor could not show a truthful preview. A fixed ratio makes
   the crop identical everywhere, and `object-position` lets the author choose
   what stays in frame (defaults to centre — see the focal point picker). */
.blog-pub-hero {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: 50% 50%;   /* overridden per-post inline when a focal point is set */
    border-radius: 12px;
    margin-bottom: 32px;
    background: #F3F4F6;
}

/* ─── Post Body Typography ────────────────────── */

.blog-pub-body {
    font-size: 17px;
    line-height: 1.8;
    color: #374151;
}

.blog-pub-body h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 36px 0 16px 0;
    color: #111827;
}

.blog-pub-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 28px 0 12px 0;
    color: #1F2937;
}

.blog-pub-body p {
    margin: 0 0 20px 0;
}

.blog-pub-body ul, .blog-pub-body ol {
    margin: 0 0 20px 0;
    padding-left: 28px;
}

.blog-pub-body li {
    margin-bottom: 6px;
}

.blog-pub-body blockquote {
    border-left: 4px solid #FF6B35;
    margin: 24px 0;
    padding: 16px 20px;
    background: #FFF7ED;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #374151;
}

.blog-pub-body strong {
    font-weight: 600;
    color: #111827;
}

.blog-pub-body code {
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.blog-pub-body pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.5;
}

.blog-pub-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-pub-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* ─── AI-Generated Visual Components ─────────── */

/* Introduction paragraph */
.blog-pub-body .blog-intro {
    font-size: 1.2rem;
    line-height: 1.7;
    color: #111827;
    font-weight: 500;
    margin-bottom: 28px;
}

/* Key Points Grid */
.blog-pub-body .blog-key-points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 28px 0;
}

.blog-pub-body .blog-key-point-card {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-pub-body .blog-key-point-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.blog-pub-body .blog-key-point-number {
    width: 32px;
    height: 32px;
    background: #FF6B35;
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.blog-pub-body .blog-key-point-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    margin-top: 0;
}

.blog-pub-body .blog-key-point-card p {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Callout Box */
.blog-pub-body .blog-callout {
    background: #FFF7ED;
    border-left: 4px solid #FF6B35;
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    margin: 28px 0;
}

.blog-pub-body .blog-callout-title {
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 6px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.blog-pub-body .blog-callout p {
    margin-bottom: 0;
    color: #92400E;
    font-size: 15px;
    line-height: 1.6;
}

/* Stats Row */
.blog-pub-body .blog-stats-row {
    display: flex;
    gap: 16px;
    margin: 28px 0;
    flex-wrap: wrap;
}

.blog-pub-body .blog-stat-item {
    flex: 1;
    min-width: 120px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.blog-pub-body .blog-stat-item .blog-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #FF6B35;
    line-height: 1.2;
    margin-bottom: 4px;
}

.blog-pub-body .blog-stat-item .blog-stat-label {
    font-size: 13px;
    color: #6B7280;
    line-height: 1.4;
}

/* CTA Box (within body) */
.blog-pub-body .blog-cta-box {
    background: linear-gradient(135deg, #FF6B35 0%, #F59E0B 100%);
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    color: white;
    margin: 32px 0;
}

.blog-pub-body .blog-cta-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    margin-top: 0;
    color: white;
}

.blog-pub-body .blog-cta-box p {
    font-size: 15px;
    margin-bottom: 16px;
    opacity: 0.95;
    color: white;
}

/* Big, high-contrast button — Laura: "people have the attention of a gnat" */
.blog-pub-body .blog-cta-btn {
    display: inline-block;
    background: #ffffff;
    color: #C2410C;
    padding: 14px 32px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-top: 4px;
}
.blog-pub-body .blog-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}
.blog-pub-body .blog-cta-btn:active {
    transform: translateY(0);
}

/* ─── Post Footer (likes, share) ──────────────── */

.blog-pub-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #E5E7EB;
}

.blog-pub-stats {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 16px;
}

.blog-pub-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.blog-pub-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.blog-pub-like-btn:hover,
.blog-pub-like-btn.liked {
    background: #FEF2F2;
    border-color: #FCA5A5;
    color: #DC2626;
}

.blog-pub-like-btn.liked svg {
    fill: #DC2626;
}

.blog-pub-share {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-pub-share a,
.blog-pub-copy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #6B7280;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.blog-pub-share a:hover,
.blog-pub-copy-link:hover {
    background: #E5E7EB;
    color: #374151;
}

/* ─── Comments Section ────────────────────────── */

.blog-pub-comments {
    max-width: 720px;
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 1px solid #E5E7EB;
}

.blog-pub-comments h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
}

.blog-pub-no-comments {
    color: #9CA3AF;
    font-size: 15px;
    padding: 20px 0;
}

.blog-pub-comment {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
}

.blog-pub-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.blog-pub-comment-header strong {
    font-size: 14px;
    color: #111827;
}

.blog-pub-comment-header time {
    font-size: 12px;
    color: #9CA3AF;
}

.blog-pub-comment p {
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

/* Comment Form */
.blog-pub-comment-form {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-top: 24px;
}

.blog-pub-comment-form h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.blog-pub-comment-form input,
.blog-pub-comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.15s;
}

.blog-pub-comment-form input:focus,
.blog-pub-comment-form textarea:focus {
    outline: none;
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.blog-pub-comment-form button {
    padding: 10px 24px;
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.blog-pub-comment-form button:hover {
    background: #e55a28;
}

.blog-pub-comment-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── Blog Index Page ─────────────────────────── */

.blog-pub-index-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 32px;
    color: #111827;
}

.blog-pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.blog-pub-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    overflow: hidden;
    transition: box-shadow 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
}

.blog-pub-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.blog-pub-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: 50% 50%;   /* honours the post's focal point, same as the hero */
}

.blog-pub-card-placeholder {
    background: linear-gradient(135deg, #FFF7ED 0%, #FEE2E2 50%, #F3F4F6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-pub-card-placeholder-letter {
    font-size: 48px;
    font-weight: 800;
    color: rgba(255, 107, 53, 0.25);
    user-select: none;
}

.blog-pub-card-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-pub-card-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: #FF6B35;
    margin-bottom: 6px;
}

.blog-pub-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.3;
}

.blog-pub-card-excerpt {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-pub-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #9CA3AF;
}

/* ─── Card Share Bar ─────────────────────────── */

.blog-pub-card-share {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F3F4F6;
}

.blog-pub-card-share a,
.blog-pub-card-share .blog-pub-copy-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #F9FAFB;
    color: #9CA3AF;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.blog-pub-card-share a:hover,
.blog-pub-card-share .blog-pub-copy-link:hover {
    background: #F3F4F6;
    color: #374151;
}

.blog-pub-card-share .blog-pub-copy-link.copied {
    background: #ECFDF5;
    color: #059669;
}

/* ─── Footer ──────────────────────────────────── */

.blog-pub-site-footer {
    max-width: 960px;
    margin: 48px auto 0;
    padding: 24px;
    text-align: center;
    border-top: 1px solid #E5E7EB;
    font-size: 13px;
    color: #9CA3AF;
}

.blog-pub-site-footer a {
    color: #FF6B35;
    font-weight: 500;
}

/* ─── Discovery Page ──────────────────────────── */

.blog-pub-discovery {
    text-align: center;
    padding: 60px 24px;
}

.blog-pub-discovery h1 {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 12px;
}

.blog-pub-discovery p {
    font-size: 16px;
    color: #6B7280;
    max-width: 480px;
    margin: 0 auto 32px;
}

/* ─── Responsive ──────────────────────────────── */

@media (max-width: 640px) {
    /* On a phone the post title is already the h1 directly below, so repeating
       it in the crumb is noise. Keep the "Blog" link (the thing you tap) and
       drop the current-page label rather than shrinking it to two words. */
    .blog-pub-crumb-current,
    .blog-pub-crumb-sep {
        display: none;
    }

    .blog-pub-crumbs {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .blog-pub-title {
        font-size: 26px;
    }

    .blog-pub-body {
        font-size: 16px;
    }

    .blog-pub-grid {
        grid-template-columns: 1fr;
    }

    .blog-pub-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-pub-body .blog-key-points-grid {
        grid-template-columns: 1fr;
    }

    .blog-pub-body .blog-stats-row {
        flex-direction: column;
    }

    .blog-pub-body .blog-cta-box {
        padding: 24px 16px;
    }
}

/* Editor normalization guards (v20260820a)
 *
 * ProseMirror requires block content inside a blockquote and inside our
 * component containers, so a bare inline child comes back wrapped in a <p>.
 * VivaEditor's serializer unwraps the trivial cases it can (see
 * js/editor/entry.js), but a CTA button sitting directly inside .blog-cta-box
 * legitimately becomes <p><a class="blog-cta-btn">. Without these two rules that
 * inherited paragraph margin opens a gap under the button and under a quote.
 *
 * They are also a small improvement to posts written before the editor existed:
 * some already stored <blockquote><p>, and those had the same extra gap. */
.blog-pub-body blockquote > p:only-child { margin-bottom: 0; }
.blog-pub-body .blog-cta-box > p:last-child { margin-bottom: 0; }
