/*
 * Blog post detail page — top-notch reading layout.
 * Optimised for long-form readability + clean SEO surfaces.
 */
.bp-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  color: #0f0f14;
}

.bp-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6b6b75;
  margin-bottom: 20px;
  /* Keep the trail on a single line — the long post title truncates
     instead of wrapping to a messy multi-line block. */
  flex-wrap: nowrap;
  min-width: 0;
}
.bp-breadcrumbs a {
  color: #6b6b75;
  text-decoration: none;
  transition: color .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.bp-breadcrumbs a:hover { color: var(--brand, #8735ee); }
.bp-breadcrumbs > span[aria-hidden] { flex-shrink: 0; }
.bp-breadcrumbs span[aria-current] {
  color: #0f0f14;
  font-weight: 500;
  /* Truncate the active title so the row stays one clean line. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On phones, drop the "Home ›" hop so the title gets more room —
   "Blog › <title…>" reads cleaner on a narrow viewport. */
@media (max-width: 560px) {
  .bp-breadcrumbs { font-size: 12.5px; gap: 5px; }
  .bp-breadcrumbs > a:first-child,
  .bp-breadcrumbs > span[aria-hidden]:first-of-type {
    display: none;
  }
}

.bp-head { margin-bottom: 24px; }
.bp-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.bp-category-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #f3edff;
  color: var(--brand, #8735ee);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s ease;
}
.bp-category-pill:hover { background: #ede4ff; }

.bp-title {
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 14px;
  color: #0f0f14;
}
.bp-excerpt {
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.55;
  color: #4a4a52;
  margin: 0 0 20px;
}
.bp-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: #6b6b75;
}
.bp-meta-author { font-weight: 600; color: #0f0f14; }
.bp-meta-sep { opacity: .5; }

.bp-cover {
  margin: 0 0 32px;
  border-radius: 16px;
  overflow: hidden;
  background: #f5f5f7;
  aspect-ratio: 16 / 9;
}
.bp-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Body content typography */
.bp-body {
  font-size: 17px;
  line-height: 1.75;
  color: #1f1f25;
}
.bp-body h1, .bp-body h2, .bp-body h3, .bp-body h4 {
  color: #0f0f14;
  letter-spacing: -0.018em;
  margin: 1.6em 0 .5em;
  line-height: 1.3;
}
.bp-body h2 { font-size: 28px; font-weight: 700; }
.bp-body h3 { font-size: 22px; font-weight: 600; }
.bp-body h4 { font-size: 18px; font-weight: 600; }
.bp-body p { margin: 0 0 1.2em; }
.bp-body a { color: var(--brand, #8735ee); text-decoration: underline; text-underline-offset: 3px; }
.bp-body a:hover { text-decoration-thickness: 2px; }
.bp-body ul, .bp-body ol { padding-left: 1.6em; margin: 0 0 1.4em; }
.bp-body li { margin: 0.4em 0; }
.bp-body blockquote {
  border-left: 4px solid var(--brand, #8735ee);
  padding: 4px 18px;
  margin: 1.6em 0;
  color: #3a3a44;
  background: #faf7ff;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  font-size: 18px;
}
.bp-body pre {
  background: #0f0f14;
  color: #e8e8eb;
  padding: 16px 18px;
  border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 1.4em 0;
}
.bp-body code {
  background: #f3f3f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  font-size: 0.92em;
}
.bp-body pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.bp-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.4em 0;
  display: block;
}
.bp-body hr {
  border: 0;
  border-top: 1px solid #ececef;
  margin: 2em 0;
}
.bp-body strong { color: #0f0f14; font-weight: 700; }

.bp-body-loading {
  padding: 60px 0;
  text-align: center;
  color: #9a9aa3;
  font-style: italic;
}
.bp-empty { color: #9a9aa3; font-style: italic; }

/* Footer: tags + share */
.bp-foot {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #ececef;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}
.bp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bp-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  background: #f5f5f7;
  color: #4a4a52;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.bp-tag:hover { background: #ececef; color: var(--brand, #8735ee); }
.bp-share {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #6b6b75;
}
.bp-share a,
.bp-share button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f5f7;
  color: #4a4a52;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.bp-share a:hover,
.bp-share button:hover { background: #ededf2; color: var(--brand, #8735ee); }
.bp-share button.is-copied { background: #d8f1e1; color: #1f7a3a; }

/* Related posts rail */
.bp-related {
  max-width: 980px;
  margin: 60px auto 0;
}
.bp-related > h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0f0f14;
  margin: 0 0 18px;
}
.bp-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.bp-related-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #ececef;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .2s ease, transform .15s ease;
}
.bp-related-card:hover {
  border-color: #d8d8df;
  box-shadow: 0 8px 24px rgba(15, 17, 23, 0.08);
  transform: translateY(-2px);
}
.bp-related-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f5f5f7;
}
.bp-related-img img,
.bp-related-fallback { width: 100%; height: 100%; }
.bp-related-img img { object-fit: cover; display: block; }
.bp-related-fallback { background: linear-gradient(135deg, #f4e9ff, #fce4d4); }
.bp-related-meta { padding: 14px 16px 18px; }
.bp-related-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand, #8735ee);
  margin-bottom: 6px;
}
.bp-related-meta h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f0f14;
  margin: 0 0 6px;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.bp-related-meta p {
  font-size: 13px;
  color: #6b6b75;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .bp-page { padding: 24px 18px 60px; }
  .bp-title { font-size: 26px; }
  .bp-excerpt { font-size: 15px; }
  .bp-body { font-size: 16px; }
  .bp-cover { aspect-ratio: 4/3; margin-bottom: 24px; }
  .bp-foot { flex-direction: column; align-items: flex-start; }
}

/* ── Admin preview mode ─────────────────────────────────────────
   When the page is loaded inside the website-editor live preview
   iframe (?admin-preview=1), hide site chrome so the post itself
   fills the iframe column. */
.is-admin-preview .site-header,
.is-admin-preview .ht-menu-wrapper,
.is-admin-preview .newsletter,
.is-admin-preview .footer {
  display: none !important;
}
.is-admin-preview body.blog-post-body { background: #ffffff; }
.is-admin-preview .bp-page { padding: 24px 28px 40px; max-width: none; }
.is-admin-preview .bp-related { margin-top: 36px; max-width: none; }

/* Inline Unsplash photo credit (admin-inserted via RichEditor) */
.bp-body .uic-unsplash-credit {
  font-size: 12px;
  color: #6b6b75;
  margin: -1em 0 1.4em;
  text-align: center;
}
.bp-body .uic-unsplash-credit a {
  color: #6b6b75;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bp-body .uic-unsplash-credit a:hover { color: var(--brand, #8735ee); }
