/* Public blog styling — shared by the index, the topic archives, and the article.
   A two-column layout (post list + sidebar) echoing a typical blog, plus a clean
   single-column article. Self-contained; loaded via <HeadContent> on the blog
   public pages. See docs/BLOG.md. */

.bpx {
    --bpx-ink: #1f2733;
    --bpx-muted: #6b7280;
    --bpx-rule: #e5e7eb;
    /* Follows the practice brand accent (set by BlogChrome's BrandedSurface);
       falls back to a neutral slate when there's no brand context. */
    --bpx-accent: var(--cc-accent, #3b5266);
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    color: var(--bpx-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.bpx-masthead { margin-bottom: 2rem; }
.bpx-home { color: var(--bpx-muted); text-decoration: none; font-size: 0.9rem; }
.bpx-home:hover { text-decoration: underline; }
.bpx-masthead h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.6rem; line-height: 1.1; letter-spacing: -0.01em; margin: 0.3rem 0 0;
}
.bpx-masthead .bpx-sub { color: var(--bpx-muted); margin: 0.4rem 0 0; }

/* Two-column layout */
.bpx-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 3rem; align-items: start; }
@media (max-width: 820px) { .bpx-cols { grid-template-columns: 1fr; gap: 2rem; } }

/* Post list (index + archive) */
.bpx-posts { display: flex; flex-direction: column; gap: 2.5rem; }
.bpx-empty { color: var(--bpx-muted); }
.bpx-post { border-bottom: 1px solid var(--bpx-rule); padding-bottom: 2.5rem; }
.bpx-post:last-child { border-bottom: none; }
.bpx-post-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 1.1rem; }
.bpx-post-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.8rem; line-height: 1.2; margin: 0 0 0.4rem; }
.bpx-post-title a { color: var(--bpx-ink); text-decoration: none; }
.bpx-post-title a:hover { color: var(--bpx-accent); }
.bpx-post-meta { color: var(--bpx-muted); font-size: 0.85rem; font-style: italic; margin-bottom: 0.8rem; }
.bpx-post-meta a { color: var(--bpx-muted); text-decoration: none; }
.bpx-post-meta a:hover { text-decoration: underline; }
.bpx-post-excerpt { color: #374151; line-height: 1.6; margin: 0 0 1rem; }
.bpx-readmore {
    display: inline-block; background: var(--bpx-accent); color: #fff; text-decoration: none;
    padding: 0.45rem 1.1rem; border-radius: 6px; font-size: 0.85rem; font-weight: 600;
}
.bpx-readmore:hover { background: #2c3f50; color: #fff; }

/* Sidebar */
.bpx-side { display: flex; flex-direction: column; gap: 2rem; }
.bpx-side-block h3 {
    font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem;
    margin: 0 0 0.75rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--bpx-rule);
}
.bpx-side-block ul { list-style: none; padding: 0; margin: 0; }
.bpx-side-block li { padding: 0.35rem 0; border-bottom: 1px solid var(--bpx-rule); }
.bpx-side-block li:last-child { border-bottom: none; }
.bpx-side-block a { color: var(--bpx-accent); text-decoration: none; }
.bpx-side-block a:hover { text-decoration: underline; }
.bpx-side-count { color: var(--bpx-muted); font-size: 0.8rem; }

/* Article */
.bpx-article { max-width: 720px; margin: 0 auto; line-height: 1.75; }
.bpx-article .bpx-post-title { font-size: 2.4rem; margin-top: 0.6rem; }
.bpx-article-hero { width: 100%; border-radius: 12px; margin: 1.25rem 0 1.75rem; object-fit: cover; }
.bpx-article-body { font-size: 1.1rem; color: #1f2733; }
.bpx-article-body :first-child { margin-top: 0; }
.bpx-article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.bpx-article-body h2 { font-family: Georgia, serif; font-size: 1.55rem; margin: 2rem 0 0.6rem; }
.bpx-article-body h3 { font-family: Georgia, serif; font-size: 1.25rem; margin: 1.6rem 0 0.5rem; }
.bpx-article-body p { margin: 0 0 1.1rem; }
.bpx-article-body a { color: var(--bpx-accent); }
.bpx-article-body blockquote { border-left: 3px solid var(--bpx-rule); margin: 1.2rem 0; padding: 0.2rem 0 0.2rem 1rem; color: #4b5563; }
.bpx-article-foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--bpx-rule); }

/* ── Blog chrome (profile-mode): branded header + footer around the blog ──────
   Rendered by BlogChrome.razor inside a BrandedSurface, so --cc-accent is the
   practice brand. Uses the app's neutral surface/border/text tokens for the frame. */
.bchrome { min-height: 100vh; background: var(--cc-bg, #F7F6F3); }
.bchrome-card { display: flex; flex-direction: column; min-height: 100vh; }
/* Wide-display framing: the blog becomes an elevated card on a tinted canvas,
   mirroring the profile + website (full-bleed on phones/tablets). Blog uses the
   clean SiteLayout, so no content-padding breakout is needed (unlike the profile). */
@media (min-width: 1024px) {
    .bchrome { background: var(--cc-surface-2); padding: 32px 24px; }
    .bchrome-card {
        /* 1120px matches the website (.cc-shell) + public profile (.cp-shell) card
           frame so all three presences read at one width. */
        max-width: 1120px; margin: 0 auto; min-height: calc(100vh - 64px);
        background: var(--cc-bg); border: 1px solid var(--cc-border); border-radius: 18px;
        overflow: hidden; box-shadow: 0 14px 46px rgba(20, 16, 10, 0.10);
    }
}
/* Profile-mode blog (no published site): wear the profile's warm surface + Inter
   type instead of the blog's own cool / serif editorial look, so a profile + blog
   read as one presence. The brand accent (--cc-accent → --bpx-accent) is kept. */
.bchrome .bpx { --bpx-ink: var(--cc-text); --bpx-muted: var(--cc-text-muted); --bpx-rule: var(--cc-border); }
.bchrome .bpx-masthead h1, .bchrome .bpx-post-title, .bchrome .bpx-side-block h3,
.bchrome .bpx-article-body h2, .bchrome .bpx-article-body h3 {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.bchrome-in { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bchrome-header { border-bottom: 1px solid var(--cc-border, #e5e7eb); }
.bchrome-header .bchrome-in { padding-top: 1rem; padding-bottom: 1rem; }
.bchrome-brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--cc-text, #1f2733); }
.bchrome-logo { height: 40px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.bchrome-name { font-weight: 700; font-size: 1.15rem; }
.bchrome-body { flex: 1; }
.bchrome-footer { border-top: 1px solid var(--cc-border, #e5e7eb); margin-top: 2rem; }
.bchrome-footer .bchrome-in { padding-top: 1.25rem; padding-bottom: 1.5rem; font-size: 0.85rem; color: var(--cc-text-muted, #6b7280); }
.bchrome-back { color: var(--cc-accent, #3b5266); text-decoration: none; font-weight: 600; }
.bchrome-back:hover { text-decoration: underline; }
@media (max-width: 560px) { .bchrome-footer .bchrome-in { flex-direction: column; align-items: flex-start; gap: 0.4rem; } }

/* ── Blog nested in the coach's published website (BlogChrome site mode) ──
   The article keeps its editorial reading style; the content region only adapts
   its accent + body font to the site theme so the blog reads as part of the
   website (header/footer/theme come from the real SiteHeaderNav/SiteFooter). */
.cc-site .cc-blogmain { min-height: 55vh; }
.cc-site .cc-blogmain .bpx {
    /* site.css themes on --accent; the profile chrome used --cc-accent. */
    --bpx-accent: var(--accent, #3b5266);
    font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
    /* Match the site's .cc-wrap (1080px) so the blog column lines up with the
       header nav + footer instead of running ~20px wider on each side. */
    max-width: 1080px;
}
/* Read-more button: match the site's own primary buttons (accent background +
   the theme's on-accent text). Without this, site.css's `.cc-site a { color:
   inherit }` wins on specificity and darkens the label to the body text color —
   low-contrast dark-on-accent. Hover darkens the accent instead of the profile
   chrome's fixed navy, which clashed with the theme. */
.cc-site .cc-blogmain .bpx-readmore,
.cc-site .cc-blogmain .bpx-readmore:hover {
    color: var(--accent-contrast, #fff);
}
.cc-site .cc-blogmain .bpx-readmore:hover {
    background: var(--accent, #3b5266);
    filter: brightness(0.92);
}

/* Share row under an article. */
.bpx-share {
    margin: 2rem 0 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--bpx-rule);
}
