/* ============================================================
   blog-prose.css — Unified typography for blog post bodies.
   Shared by: SSR pages (/blog/<slug>/), front-end SPA detail,
   and the admin rich-text editor / preview so what you edit is
   what visitors see. Scoped under .blog-prose to avoid leaking
   into other sections.
   ============================================================ */
.blog-prose {
  max-width: 760px;
  margin: 0 auto;
  color: #2d3436;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1.02rem;
  line-height: 1.85;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.blog-prose > *:first-child { margin-top: 0; }
.blog-prose > *:last-child { margin-bottom: 0; }

.blog-prose p { margin: 0 0 1.15em; }
.blog-prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem; font-weight: 800; color: #2d3436;
  margin: 1.9em 0 0.65em; line-height: 1.3;
}
.blog-prose h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.28rem; font-weight: 700; color: #2d3436;
  margin: 1.5em 0 0.55em; line-height: 1.35;
}
.blog-prose strong, .blog-prose b { font-weight: 700; color: #2d3436; }
.blog-prose em, .blog-prose i { font-style: italic; }
.blog-prose u { text-decoration: underline; }
.blog-prose s { text-decoration: line-through; color: #636e72; }

.blog-prose a { color: #6c5ce7; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(108,92,231,.35); }
.blog-prose a:hover { border-bottom-color: #6c5ce7; }

.blog-prose ul, .blog-prose ol { margin: 0 0 1.2em; padding-left: 1.6em; }
.blog-prose ul { list-style: disc; }
.blog-prose ol { list-style: decimal; }
.blog-prose li { margin: 0.4em 0; }
.blog-prose li::marker { color: #00b894; font-weight: 700; }
.blog-prose li > ul, .blog-prose li > ol { margin: 0.4em 0; }

.blog-prose blockquote {
  margin: 1.4em 0;
  padding: 0.9em 1.25em;
  border-left: 4px solid #00cec9;
  background: #f5f6fa;
  border-radius: 0 10px 10px 0;
  color: #4a5153;
  font-style: italic;
}
.blog-prose blockquote p:last-child { margin-bottom: 0; }

.blog-prose figure { margin: 1.6em 0; text-align: center; }
.blog-prose img {
  max-width: 100%; height: auto;
  border-radius: 12px;
  display: block; margin: 0 auto;
  box-shadow: 0 6px 24px rgba(45,52,54,.10);
}
.blog-prose figure img { margin: 0 auto; }
.blog-prose figcaption {
  margin-top: 0.6em;
  font-size: .85rem; color: #636e72; line-height: 1.5;
}

/* Wide tables scroll inside their own box (never break the page) */
.blog-prose .blog-table-wrap {
  margin: 1.5em 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid #dfe6e9; border-radius: 12px;
}
.blog-prose table {
  width: 100%; border-collapse: collapse; min-width: 480px;
  font-size: .95rem; line-height: 1.6;
}
.blog-prose th, .blog-prose td {
  padding: 10px 14px; text-align: left;
  border-bottom: 1px solid #dfe6e9; vertical-align: top;
}
.blog-prose thead th {
  background: #6c5ce7; color: #fff; font-weight: 600; white-space: nowrap;
}
.blog-prose tbody tr:nth-child(even) { background: #f5f6fa; }
.blog-prose tbody tr:last-child td { border-bottom: none; }

.blog-prose hr { border: none; border-top: 1px solid #dfe6e9; margin: 2em 0; }

/* ---- Admin rich-text editor (contenteditable) theming ---- */
.blog-editor-wrap .rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 8px 10px; border: 1px solid #dfe6e9; border-radius: 8px 8px 0 0;
  background: #fff; position: sticky; top: 0; z-index: 5;
  border-bottom: none;
}
.blog-editor-wrap .rte-btn {
  min-width: 34px; min-height: 34px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: 6px; background: transparent;
  color: #2d3436; font-size: .9rem; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.blog-editor-wrap .rte-btn:hover { background: #f5f6fa; border-color: #dfe6e9; }
.blog-editor-wrap .rte-btn:active { background: #dfe6e9; }
.blog-editor-wrap .rte-select {
  height: 34px; border: 1px solid #dfe6e9; border-radius: 6px;
  padding: 0 6px; font-family: 'Poppins', sans-serif; color: #2d3436; background: #fff;
}
.blog-editor-wrap .rte-sep { width: 1px; height: 22px; background: #dfe6e9; margin: 0 4px; }
.blog-editor-wrap .rte-surface {
  border: 1px solid #dfe6e9; border-radius: 0 0 8px 8px;
  min-height: 320px; max-height: 60vh; overflow-y: auto;
  padding: 18px 20px; background: #fff; outline: none; font-size: 1rem;
  position: relative;
}
.blog-editor-wrap .rte-surface:empty::before {
  content: attr(data-placeholder); color: #b2bec3; pointer-events: none;
}
.blog-editor-wrap .rte-surface h2 { font-family: 'Playfair Display', serif; }
.blog-editor-wrap .rte-surface h3 { font-family: 'Playfair Display', serif; }
.blog-editor-wrap .rte-surface blockquote {
  border-left: 4px solid #00cec9; background: #f5f6fa;
  margin: 1em 0; padding: .7em 1em; border-radius: 0 10px 10px 0;
}
.blog-editor-wrap .rte-surface a { color: #6c5ce7; }
.blog-editor-wrap .rte-surface table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.blog-editor-wrap .rte-surface th, .blog-editor-wrap .rte-surface td {
  border: 1px solid #dfe6e9; padding: 6px 10px; min-width: 40px;
}
.blog-editor-wrap .rte-surface th { background: #6c5ce7; color: #fff; }
.blog-editor-wrap .rte-surface td:focus, .blog-editor-wrap .rte-surface th:focus { outline: 2px solid #00cec9; }
/* inline image upload status overlay */
.img-uploading { outline: 2px dashed #6c5ce7; outline-offset: 2px; opacity: .55; }

@media (max-width: 600px) {
  .blog-prose { font-size: .97rem; line-height: 1.8; }
  .blog-prose h2 { font-size: 1.4rem; }
  .blog-prose h3 { font-size: 1.15rem; }
}
