/* Single blog article page — layout, image variants, breadcrumb, tool CTA.
   Uses the same CSS variables from theme.css as the rest of the site
   (--text, --muted, --border, --primary, --surface, --radius-*, --shadow-*)
   so it matches light/dark mode automatically, same as blog.html. */

.blog-article-page {
  max-width: 760px;
}

/* Breadcrumb */
.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 20px;
}

.blog-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.blog-breadcrumb a:hover {
  color: var(--primary);
}

.blog-breadcrumb .crumb-sep {
  opacity: 0.5;
}

.blog-breadcrumb .crumb-current {
  color: var(--text);
  font-weight: 600;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Cover image */
.blog-article-cover {
  margin: 0 0 28px;
}

.blog-article-cover img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

/* Head */
.blog-article-head {
  margin-bottom: 28px;
}

.blog-article-title {
  font-family: var(--font-head);
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  color: var(--text);
}

.blog-article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.blog-article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-article-meta .tag-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(109, 93, 252, 0.1);
  color: var(--primary);
}

/* Body / blocks */
.blog-article-body {
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
}

.blog-block {
  margin-bottom: 24px;
}

.blog-heading {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.3;
  margin-top: 12px;
}

.blog-paragraph p,
.blog-paragraph {
  margin: 0 0 9px;
}

.blog-quote {
  border-left: 4px solid var(--primary);
  padding: 4px 20px;
  font-style: italic;
  color: var(--muted);
  background: rgba(109, 93, 252, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Image blocks + layout variants */
.blog-image {
  margin: 0 auto 24px;
}

.blog-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

.blog-image.layout-full {
  width: 100%;
}

.blog-image.layout-wide {
  width: 100%;
  margin-left: calc(50% - 50vw + 8px);
  margin-right: calc(50% - 50vw + 8px);
  max-width: 1100px;
  left: 50%;
}

.blog-image.layout-medium {
  width: 70%;
}

.blog-image.layout-thumbnail {
  width: 240px;
}

.blog-image.layout-float-left {
  float: left;
  width: 45%;
  margin: 0 20px 16px 0;
}

.blog-image.layout-float-right {
  float: right;
  width: 45%;
  margin: 0 0 16px 20px;
}

.blog-caption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  text-align: center;
}

/* Related tool CTA */
.blog-tool-cta-slot {
  clear: both;
}

.blog-tool-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-tool-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.blog-tool-cta-label {
  font-size: 13px;
  color: var(--muted);
}

.blog-tool-cta-name {
  font-weight: 700;
  color: var(--primary);
}

.blog-tool-cta-arrow {
  margin-left: auto;
  color: var(--primary);
}

/* In-content CTA button blocks (admin-added, multiple per post) */
.blog-cta-button-wrap {
  clear: both;
  text-align: center;
  margin: 28px 0;
}

.blog-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.blog-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}

.blog-cta-button-arrow {
  transition: transform 0.2s ease;
}

.blog-cta-button:hover .blog-cta-button-arrow {
  transform: translateX(3px);
}

/* FAQ accordion */
.blog-faq-section {
  margin-top: 32px;
  clear: both;
}

.blog-faq-heading {
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text);
}

.blog-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  background: var(--surface);
  overflow: hidden;
}

.blog-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  transition: color 0.2s ease;
}

.blog-faq-question:hover {
  color: var(--primary);
}

.blog-faq-chevron {
  display: flex;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.blog-faq-item.is-open .blog-faq-chevron {
  transform: rotate(180deg);
}

.blog-faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.blog-faq-item.is-open .blog-faq-answer-wrap {
  grid-template-rows: 1fr;
}

.blog-faq-answer-inner {
  overflow: hidden;
  padding: 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.blog-faq-item.is-open .blog-faq-answer-inner {
  padding: 0 18px 16px;
}

/* Loading skeleton */
.blog-article-loading {
  padding-top: 4px;
}

.skel-line,
.skel-block {
  background: rgba(127, 127, 127, 0.12);
  border-radius: var(--radius-xs);
  animation: blogSkelPulse 1.4s ease-in-out infinite;
}

.skel-tag {
  width: 120px;
  height: 20px;
  margin-bottom: 18px;
}

.skel-title {
  width: 100%;
  height: 32px;
  margin-bottom: 12px;
}

.skel-cover {
  width: 100%;
  aspect-ratio: 1200 / 630;
  margin-top: 20px;
}

@keyframes blogSkelPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Error state (used only if /404.html itself can't be fetched) */
.blog-article-error {
  text-align: center;
  padding: 80px 20px;
}

.blog-article-error a {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .blog-image.layout-float-left,
  .blog-image.layout-float-right {
    float: none;
    width: 100%;
    margin: 0 0 16px;
  }

  .blog-image.layout-medium {
    width: 100%;
  }
}