/* lp-blog-detail.css — Camika blog article detail (/blog/:slug)
 *
 * Reuses the same .blog-detail-* / .blog-toc-* / .blog-share-* /
 * .blog-related-* / .blog-code-* class names as desktop.css line 4195-4480
 * so the article reading experience is visually identical inside the
 * marketing site and inside the /desktop SPA.
 *
 * Self-contained — only depends on lp-home.css for the lphome-header /
 * footer chrome (loaded alongside). Typography tokens (--text-* / --font-display
 * / --weight-*) are declared here because lp-home.css's P5 token set
 * doesn't include them.
 */

/* Typography + missing P5 tokens needed by .blog-detail-* CSS below.
   Mirrors desktop.css :root values (kept in sync if those change). */
:root[data-page="lp"] {
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-md: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --font-display: 'Oswald', 'Inter', system-ui, -apple-system, sans-serif;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --p5-dark: #16161d;
  --p5-red-light: #ff6b6b;
}

/* Section padding — matches desktop #blog-detail-view padding. The lp
   header is sticky so we keep a top margin too. */
.lpbg-detail-section {
  padding: 32px 32px 64px;
  background: var(--p5-bg);
}

/* ---- Blog Detail View (copied 1:1 from desktop.css 4198-4478) ---- */
.blog-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--p5-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  margin-bottom: 20px;
  transition: color .2s;
  text-decoration: none;
}
.blog-detail-back:hover { color: var(--p5-text); }

.blog-detail-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  /* Center content + TOC together on wide screens so the article doesn't get
     stuck on the left with a huge empty band on the right. 1080 = 800 (content
     max-width) + 40 (gap) + 200 (toc) + a little breathing room. */
  max-width: 1080px;
  margin: 0 auto;
}

/* Article content */
.blog-detail-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

.blog-detail-hero-title {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--p5-text);
  margin: 0 0 16px;
  line-height: 1.35;
}

.blog-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  font-size: var(--text-sm);
  color: var(--p5-muted);
  flex-wrap: wrap;
}

.blog-detail-author {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-detail-avatar {
  width: 28px;
  height: 28px;
  background: var(--p5-red-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Camika brand-mark avatar — let the SVG occupy the full square; no inset
   so the logo is not visibly shrunk inside the red gradient. */
.blog-detail-avatar-logo { padding: 0; overflow: hidden; }
.blog-detail-avatar-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.blog-detail-tag {
  padding: 3px 12px;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--p5-border);
  color: var(--p5-text-secondary);
}

.blog-detail-body h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--p5-text);
  margin: 32px 0 12px;
  padding-top: 8px;
  line-height: 1.4;
}

.blog-detail-body h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--p5-text);
  margin: 24px 0 10px;
  line-height: 1.4;
}

.blog-detail-body p {
  font-size: var(--text-base);
  color: var(--p5-text-secondary);
  line-height: 1.8;
  margin: 0 0 16px;
}

.blog-detail-body img {
  max-width: 100%;
  margin: 16px 0;
  border: 1px solid var(--p5-border);
}

/* Code block */
.blog-code-block {
  position: relative;
  background: var(--p5-dark);
  border: 1px solid var(--p5-border);
  margin: 20px 0;
  overflow: hidden;
}

.blog-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--p5-border);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p5-text-secondary);
}

.blog-code-copy {
  padding: 4px 12px;
  background: var(--p5-red);
  border: none;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s;
}
.blog-code-copy:hover { background: var(--p5-red-light); }

.blog-code-block pre {
  margin: 0;
  padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: var(--text-sm);
  color: var(--p5-text);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* Right TOC sidebar */
.blog-detail-toc {
  width: 200px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 16px;
  border: 1px solid var(--p5-border);
  background: var(--p5-card);
}
.blog-detail-toc::-webkit-scrollbar { display: none; }

.blog-toc-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p5-text);
  margin: 0 0 12px;
}

.blog-toc-item {
  display: block;
  padding: 4px 0 4px 12px;
  font-size: var(--text-xs);
  color: var(--p5-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  line-height: 1.5;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blog-toc-item:hover { color: var(--p5-text); }
.blog-toc-item.active {
  color: var(--p5-red);
  border-left-color: var(--p5-red);
  font-weight: var(--weight-medium);
}

/* Share bar */
.blog-share {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--p5-border);
  margin-top: 32px;
}
.blog-share-label {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p5-muted);
}
.blog-share-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--p5-card);
  border: 1px solid var(--p5-border);
  color: var(--p5-text-secondary);
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.blog-share-btn:hover { border-color: var(--p5-red); color: var(--p5-red); }

/* Related articles */
.blog-related { margin-top: 24px; }
.blog-related-title {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  color: var(--p5-text);
  margin: 0 0 16px;
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.blog-related-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--p5-card);
  border: 1px solid var(--p5-border);
  cursor: pointer;
  transition: border-color .2s;
  text-decoration: none;
}
.blog-related-card:hover { border-color: var(--p5-red); }
.blog-related-thumb {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  background: var(--p5-bg-alt);
  object-fit: cover;
}
.blog-related-info { min-width: 0; }
.blog-related-info h4 {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--p5-text);
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.blog-related-info span {
  font-size: var(--text-xs);
  color: var(--p5-muted);
}

/* Responsive — hide TOC on narrow viewports (mirrors desktop behaviour). */
@media (max-width: 900px) {
  .blog-detail-layout { flex-direction: column; }
  .blog-detail-toc { display: none; }
  .blog-related-grid { grid-template-columns: 1fr; }
}
