/*
 * Blog presentation (round 74) - used only by templates/blog.html and
 * templates/blog_post.html. Built on the site's own tokens from
 * style.css (--card, --text, --border, --accent ...), so both themes work
 * with no extra rules. Uses logical properties (inline-start/end) so the
 * same stylesheet serves right-to-left languages (Arabic, Urdu) without a
 * second copy. style.css is deliberately untouched.
 */
.bp-wrap { max-width: 1080px; margin: 0 auto; padding: 0 4px; }

/* ---- index ------------------------------------------------------------ */
.bp-hero { text-align: center; padding: 26px 0 8px; }
.bp-hero h1 { margin: 6px 0 8px; font-size: clamp(28px, 4.6vw, 40px); line-height: 1.2; }
.bp-hero p { margin: 0 auto; max-width: 620px; color: var(--text-muted); }
.bp-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 8px; padding: 0; list-style: none; }
.bp-chips a { display: inline-block; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; }
.bp-chips a:hover, .bp-chips a[aria-current="page"] { background: var(--tint); border-color: var(--tint-border); }
.bp-chips .bp-n { color: var(--text-muted); font-size: 12px; margin-inline-start: 4px; }

.bp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; margin: 22px 0; padding: 0; list-style: none; }
.bp-card { display: flex; flex-direction: column; height: 100%; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease; }
.bp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.bp-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface-soft); }
.bp-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bp-card h2, .bp-card h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.bp-card p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.bp-meta { margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.bp-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 26px 0 8px; flex-wrap: wrap; }
.bp-pager a, .bp-pager span { padding: 8px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); text-decoration: none; font-size: 14px; }
.bp-pager span.bp-off { opacity: .45; }
.bp-pager .bp-cur { border-color: transparent; background: transparent; color: var(--text-muted); }
.bp-foot { text-align: center; margin: 14px 0 28px; font-size: 13.5px; }
.bp-foot a { color: var(--text-muted); }

/* ---- article ---------------------------------------------------------- */
.bp-article { max-width: 780px; margin: 0 auto; }
.bp-crumbs { font-size: 13.5px; color: var(--text-muted); margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bp-crumbs a { color: var(--text-muted); text-decoration: none; }
.bp-crumbs a:hover { text-decoration: underline; }
.bp-crumbs .bp-sep { opacity: .5; }
.bp-article h1 { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.25; margin: 0 0 10px; }
.bp-byline { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.bp-cover { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 14px; margin: 0 0 22px; background: var(--surface-soft); }
.bp-toc { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin: 0 0 26px; }
.bp-toc strong { display: block; margin-bottom: 6px; font-size: 15px; }
.bp-toc ol { margin: 0; padding-inline-start: 22px; }
.bp-toc li { margin: 3px 0; font-size: 14.5px; }
.bp-toc a { color: var(--text); text-decoration: none; }
.bp-toc a:hover { text-decoration: underline; }

.bp-article .blog-post-body { max-width: none; font-size: 16.5px; line-height: 1.8; }
.bp-article .blog-post-body h2 { scroll-margin-top: 80px; margin-top: 38px; }
.bp-article .blog-post-body figure { margin: 22px 0; }
.bp-article .blog-post-body figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); margin: 0; }
.bp-article .blog-post-body figcaption { margin-top: 8px; font-size: 13.5px; color: var(--text-muted); text-align: center; }
.bp-article .blog-post-body .bp-note { background: var(--tint); border: 1px solid var(--tint-border); border-radius: 10px; padding: 12px 16px; margin: 18px 0; }
.bp-article .blog-post-body table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.bp-article .blog-post-body th, .bp-article .blog-post-body td { border: 1px solid var(--border); padding: 8px 10px; text-align: start; vertical-align: top; }
.bp-article .blog-post-body th { background: var(--surface-soft); }
.bp-article .blog-faq h3 { font-size: 17px; margin: 22px 0 6px; }
.bp-article .blog-faq p { margin: 0 0 12px; }

.bp-cta { margin: 34px 0 10px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.bp-cta p { margin: 0 0 10px; font-weight: 600; }
.bp-related { margin-top: 38px; }
.bp-related h2 { font-size: 20px; margin: 0 0 14px; }
.bp-related .bp-grid { margin-top: 0; }

@media (max-width: 600px) {
  .bp-grid { grid-template-columns: 1fr; }
  .bp-article .blog-post-body { font-size: 16px; }
}
