/* ==========================================================================
   Pray Assist webpromo — community blog (index + post detail).
   --------------------------------------------------------------------------
   Content comes from members who wrote a post inside the app and turned on
   "show on the web" (PA-client-api: /api/public/blog). Rendered server-side by
   render_server.py, so this stylesheet only has to describe the finished DOM —
   there is no client-side blog script.

   Every colour, radius and shadow is a token from css/style.css. No hardcoded
   value here; dark mode follows automatically because the tokens flip.
   ========================================================================== */

.blog-main { padding-top: 96px; }

/* --- index ---------------------------------------------------------------- */
.blog-head { margin-bottom: 28px; }
.blog-head .eyebrow { color: var(--brand-600); }
.blog-head h1 { margin: 6px 0 10px; }

/* Language chips: the visitor's language first, then every other language that
   actually has posts. Rendered as links so they work without JavaScript. */
.blog-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}
.blog-langs a {
  display: inline-block;
  padding: 6px 14px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
}
.blog-langs a:hover { border-color: var(--brand-500); color: var(--text); }
.blog-langs a[aria-current="true"] {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: var(--on-primary);
}

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

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.blog-card:hover { border-color: var(--brand-500); box-shadow: var(--card-shadow-lg); }

.blog-card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--inset);
}
.blog-card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 20px; }
.blog-card-cat {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-600);
}
.blog-card-title { font-size: 18px; line-height: 1.35; margin: 0; }
.blog-card-title a { color: var(--text); text-decoration: none; }
.blog-card-title a:hover { color: var(--brand-600); }
.blog-card-excerpt {
  margin: 0;
  color: var(--text-3);
  font-size: 14.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- byline (shared by the card and the article) -------------------------- */
.blog-byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-3);
  font-size: 13px;
}
.blog-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--inset);
}
.blog-author { color: var(--text-2); font-weight: 600; }
.blog-byline .sep { opacity: .5; }

/* --- pagination ----------------------------------------------------------- */
.blog-pager {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}
.blog-pager a {
  min-height: 44px;              /* touch target */
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.blog-pager a:hover { border-color: var(--brand-500); color: var(--brand-600); }

.blog-empty {
  margin: 40px 0;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-3);
  text-align: center;
}
.blog-empty:empty { display: none; }

/* --- post detail ---------------------------------------------------------- */
.blog-article { max-width: 820px; margin: 0 auto; }
.blog-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 18px;
}
.blog-breadcrumb a { color: var(--text-3); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--brand-600); text-decoration: underline; }
.blog-breadcrumb .sep { opacity: .5; }

.blog-post-title {
  font-family: var(--font-brand, inherit);
  font-size: 34px;
  line-height: 1.2;
  margin: 8px 0 14px;
  color: var(--text);
}
.blog-post-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  margin: 22px 0 8px;
  background: var(--inset);
}
.blog-post-lead {
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.6;
  margin: 18px 0 0;
}
.blog-post-body {
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.75;
  margin-top: 24px;
  overflow-wrap: anywhere;       /* a member may paste a very long token */
}
.blog-post-body p { margin: 0 0 16px; white-space: pre-wrap; }

/* Member-written text is inserted as plain paragraphs; the CTA below closes
   the page the same way the answer pages do. */
.blog-cta {
  margin-top: 44px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--inset);
  text-align: center;
}
.blog-cta h2 { font-family: var(--font-brand, inherit); font-size: 22px; margin: 0 0 8px; color: var(--text); }
.blog-cta p { color: var(--text-2); margin: 0 0 18px; }

@media (max-width: 640px) {
  .blog-main { padding-top: 84px; }
  .blog-post-title { font-size: 26px; }
  .blog-grid { grid-template-columns: 1fr; }
}
