/* Blog post page — same shell as the feed (blog-feed.css), article specifics here. Template 8. */

/* Reading progress */
.bp-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.bp-progress span { display: block; height: 100%; background: #00ab57; transform: scaleX(var(--bp-p, 0)); transform-origin: left; }

.bp-back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 40px; padding: 8px 16px 8px 10px; margin-bottom: 14px; border-radius: 999px;
  background: var(--bf-card); font-size: 14px; font-weight: 600;
  transition: background-color .2s ease;
}
.bp-back:hover { background: var(--bf-tone-2); }
.bp-back svg { width: 18px; height: 18px; }

/* ---------- Article card ---------- */
.bp-article { background: var(--bf-card); border-radius: var(--bf-r); padding: 26px 32px 28px; }
.bp-title { margin-top: 18px; font-size: 34px; line-height: 1.14; font-weight: 700; letter-spacing: -.028em; text-wrap: balance; }
.bp-lead { margin-top: 14px; font-size: 19px; line-height: 1.55; color: var(--bf-text); }
.bp-meta { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 14px; color: var(--bf-faint); }
.bp-meta .bf-views { margin-left: 0; }
.bp-cover { margin: 22px 0 0; }

/* ---------- Prose ---------- */
.bp-prose { margin-top: 28px; font-size: 18px; line-height: 1.7; color: #1c2521; overflow-wrap: break-word; }
.bp-prose > * + * { margin-top: 1em; }
.bp-prose p:empty { display: none; }
.bp-prose h2 { margin-top: 1.9em; font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; scroll-margin-top: 80px; }
.bp-prose h3 { margin-top: 1.6em; font-size: 21px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; scroll-margin-top: 80px; }
.bp-prose h4 { margin-top: 1.4em; font-size: 18px; font-weight: 700; }
.bp-prose h2 + *, .bp-prose h3 + *, .bp-prose h4 + * { margin-top: .55em; }
.bp-prose strong, .bp-prose b { font-weight: 600; color: var(--bf-ink); }
.bp-prose a { color: var(--bf-green-ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .18em; text-decoration-color: rgba(0, 128, 63, .35); transition: text-decoration-color .2s ease, color .2s ease; }
.bp-prose a:hover { color: #00602f; text-decoration-color: currentColor; }
.bp-prose ul, .bp-prose ol { padding-left: 1.35em; }
.bp-prose ul { list-style: disc; }
.bp-prose ol { list-style: decimal; }
.bp-prose li + li { margin-top: .45em; }
.bp-prose li::marker { color: var(--bf-green); font-weight: 600; }
.bp-prose blockquote { margin-left: 0; margin-right: 0; padding: 18px 22px; border-radius: 14px; background: var(--bf-green-tint); color: #17331f; }
.bp-prose img { max-width: 100%; height: auto; border-radius: 14px; }
.bp-prose figure { margin: 1.6em 0 0; }
.bp-prose figure img { display: block; width: 100%; background: var(--bf-tone); }
.bp-prose figure + * { margin-top: 1.6em; }
.bp-prose hr { border: 0; height: 8px; margin: 2em 0; background: var(--bf-tone); border-radius: 4px; }

.bp-table { margin-top: 1.4em; overflow-x: auto; border-radius: 14px; background: var(--bf-tone); -webkit-overflow-scrolling: touch; }
.bp-prose .bp-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.45; margin: 0; }
.bp-prose .bp-table td, .bp-prose .bp-table th { padding: 12px 14px; vertical-align: top; text-align: left; }
.bp-prose .bp-table tr + tr { border-top: 1px solid #dfe6e1; }
.bp-prose .bp-table tr:first-child { background: #e3ebe5; font-weight: 600; color: var(--bf-ink); }
/* Tables come from an old editor: headings and padded paragraphs inside cells, border attributes, centring. */
.bp-prose .bp-table table, .bp-prose .bp-table td, .bp-prose .bp-table th { border: 0 !important; }
.bp-prose .bp-table td, .bp-prose .bp-table th { width: auto; }
.bp-prose .bp-table td * { margin: 0 !important; padding: 0 !important; font-size: inherit !important; line-height: inherit !important; text-align: left !important; letter-spacing: 0 !important; }
.bp-prose .bp-table td :is(h1, h2, h3, h4, strong, b) { font-weight: inherit; color: inherit; }
.bp-prose .bp-table td:first-child { font-weight: 600; color: var(--bf-ink); }

.bp-foot { margin-top: 32px; padding-top: 20px; box-shadow: inset 0 1px 0 #e6ebe8; }
.bp-foot .bf-post__foot { margin-top: 0; }
.bp-foot__hint { margin-top: 12px; font-size: 14px; color: var(--bf-soft); }

.bp-inline-cta { display: none; margin-top: 14px; }

/* ---------- Pager ---------- */
.bp-pager { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bp-pager__item { display: flex; flex-direction: column; gap: 8px; padding: 18px 22px 20px; border-radius: var(--bf-r); background: var(--bf-card); transition: background-color .2s ease; }
.bp-pager__item:hover { background: #f7faf8; }
.bp-pager__item:hover .bp-pager__title { color: var(--bf-green-ink); }
.bp-pager__item--next { text-align: right; align-items: flex-end; }
.bp-pager__item--next:only-child { grid-column: 1 / -1; }
.bp-pager__dir { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--bf-faint); }
.bp-pager__dir svg { width: 16px; height: 16px; }
.bp-pager__title { font-size: 17px; line-height: 1.35; font-weight: 700; letter-spacing: -.01em; transition: color .2s ease; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- More in this rubric ---------- */
.bp-more { margin-top: 40px; }
.bp-more__title { font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0 4px 14px; }
.bp-mini { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 20px; align-items: center; padding: 14px; }
.bp-mini .bf-media { margin: 0; aspect-ratio: 4 / 3; border-radius: 12px; }
.bp-mini__body { min-width: 0; padding-right: 8px; }
.bp-mini .bf-post__title { margin: 0; font-size: 19px; }
.bp-mini__meta { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--bf-faint); }
.bp-mini__meta .bf-views { margin: 0; font-size: 13px; }
.bp-mini__meta svg { width: 16px; height: 16px; }
.bp-mini__likes { display: inline-flex; align-items: center; gap: 5px; }
.bp-more__all { margin-top: 18px; width: 100%; background: var(--bf-card); }
.bp-more__all:hover { background: var(--bf-tone-2); }

/* ---------- Contents ---------- */
.bp-toc[hidden] { display: none; }
.bp-toc__list { margin-top: 10px; display: flex; flex-direction: column; }
.bp-toc__list a { display: block; padding: 8px 12px; margin: 0 -12px; border-radius: 12px; font-size: 14px; line-height: 1.35; font-weight: 500; color: var(--bf-soft); transition: background-color .2s ease, color .2s ease; }
.bp-toc__list a:hover { background: var(--bf-tone); color: var(--bf-ink); }
.bp-toc__list a.is-active { background: var(--bf-green-tint); color: var(--bf-green-ink); font-weight: 600; }

/* ---------- Narrower layouts ---------- */
@media (max-width: 1023px) {
  .bp-inline-cta { display: block; }
}
@media (max-width: 767px) {
  .bp-back { margin-bottom: 10px; }
  .bp-article { padding: 18px 16px 20px; }
  .bp-title { margin-top: 14px; font-size: 26px; }
  .bp-lead { font-size: 17px; }
  .bp-cover { margin-top: 18px; }
  .bp-prose { margin-top: 22px; font-size: 17px; line-height: 1.65; }
  .bp-prose h2 { font-size: 22px; }
  .bp-prose h3 { font-size: 19px; }
  .bp-pager { grid-template-columns: 1fr; gap: 10px; }
  .bp-pager__item--next { text-align: left; align-items: flex-start; }
  .bp-mini { grid-template-columns: 1fr; gap: 12px; padding: 12px 12px 16px; }
  .bp-mini__body { padding: 0 4px; }
  .bp-mini .bf-media { aspect-ratio: 16 / 9; }
  .bp-more__title { font-size: 20px; }
}
