/* ==========================================================================
   BLOG ARTICLE PAGE STYLES
   ==========================================================================
   Self-contained, page-prefixed classes (.article-*), loaded only by
   individual article pages built from blog/article-template.html.
   Nothing here depends on another page's stylesheet — the same
   scoping discipline established after the .about-section bug was
   found and fixed across multiple pages earlier in this project.
   ========================================================================== */


/* ==========================================================================
   ARTICLE HERO — featured image, category, title, meta row
   ========================================================================== */

.article-hero {
  padding-block: var(--space-4xl) var(--space-3xl);
}

.article-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
}

.article-hero-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.article-hero h1 {
  font-size: var(--text-display-md);
  line-height: var(--leading-tight);
  max-width: 760px;
  margin-top: var(--space-lg);
}

.article-hero-excerpt {
  font-size: var(--text-body-lg);
  color: var(--color-text-secondary);
  max-width: 640px;
  margin-top: var(--space-lg);
}

/* Featured image — placeholder-labeled the same way every other
   unfinished visual on this site is (Features page screenshots, blog
   index cards), not a generic gray box with no explanation. */
.article-featured-image {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  background: var(--color-sky-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-3xl);
  overflow: hidden;
}

.article-featured-image-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  color: var(--color-brand-blue);
  background: rgba(255, 255, 255, 0.8);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  border: 1px dashed var(--color-brand-blue);
}

.article-featured-image-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Ready for a real image later — matches the same img-swap pattern
   already used on the homepage's feature-preview cards. */
.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ==========================================================================
   TWO-COLUMN LAYOUT — TOC sidebar + article content, same responsive
   pattern as legal.css's sidebar (sticky on desktop, hidden on mobile),
   but this sidebar's contents are generated by JavaScript from the
   article's real headings rather than hand-written.
   ========================================================================== */

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3xl);
  padding-block: var(--space-2xl) var(--space-5xl);
}

.article-toc {
  display: none;
}

.article-main {
  min-width: 0;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 240px 1fr;
    align-items: start;
  }

  .article-toc {
    display: block;
    position: sticky;
    top: calc(var(--space-3xl) + 64px);
  }
}

.article-toc-title {
  font-size: var(--text-body-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

.article-toc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  border-left: 2px solid var(--color-border);
}

.article-toc-list a {
  display: block;
  padding: var(--space-xs) var(--space-lg);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color var(--duration-fast) var(--ease-smooth),
              border-color var(--duration-fast) var(--ease-smooth);
}

.article-toc-list a:hover {
  color: var(--color-brand-blue);
  border-left-color: var(--color-brand-blue);
}

.article-toc-list a.article-toc-sub {
  padding-left: var(--space-2xl); /* indents h3 entries under their h2 parent */
  font-size: var(--text-body-sm);
  opacity: 0.85;
}


/* ==========================================================================
   ARTICLE PROSE — typography tuned specifically for long-form reading,
   distinct from the site's standard body-copy sizing used elsewhere.
   ========================================================================== */

.article-prose {
  max-width: 680px; /* same line-length reasoning used everywhere else
                        long-form text appears on this site */
}

.article-prose > * + * {
  margin-top: var(--space-lg);
}

.article-prose p {
  font-size: 1.0625rem; /* slightly larger than the site's standard
                            --text-body-md (15px) — long-form reading
                            benefits from a bit more size than UI copy */
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.article-prose h2 {
  font-size: var(--text-heading-md);
  margin-top: var(--space-3xl);
  scroll-margin-top: calc(var(--space-2xl) + 72px); /* so a TOC jump
                                                          doesn't land
                                                          the heading
                                                          under the
                                                          sticky header */
}

.article-prose h3 {
  font-size: var(--text-heading-sm);
  margin-top: var(--space-2xl);
  scroll-margin-top: calc(var(--space-2xl) + 72px);
}

.article-prose ul,
.article-prose ol {
  padding-left: var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.article-prose li {
  font-size: 1.0625rem;
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
}

.article-prose li::marker {
  color: var(--color-text-muted);
}

.article-prose blockquote {
  font-family: var(--font-display);
  font-size: var(--text-heading-sm);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
  padding-left: var(--space-2xl);
  border-left: 3px solid var(--color-brand-blue);
}

.article-prose strong {
  color: var(--color-text-primary);
  font-weight: 600;
}


/* ==========================================================================
   TAGS
   ========================================================================== */

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
}

.article-tag {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  background: var(--color-sand);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-pill);
}


/* ==========================================================================
   AUTHOR BOX
   ========================================================================== */

.article-author-box {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-top: var(--space-3xl);
  padding: var(--space-xl);
  background: var(--color-sand);
  border-radius: var(--radius-lg);
}

.article-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-brand-gradient-soft);
  flex-shrink: 0;
}

.article-author-name {
  font-weight: 600;
  color: var(--color-text-primary);
  font-size: var(--text-body-md);
}

.article-author-bio {
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
}


/* ==========================================================================
   SHARE SECTION
   ========================================================================== */

.article-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-3xl);
}

.article-share-label {
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: var(--space-sm);
}

.article-share-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  font-size: var(--text-body-sm);
  color: var(--color-text-secondary);
  transition: border-color var(--duration-fast) var(--ease-smooth),
              color var(--duration-fast) var(--ease-smooth);
}

.article-share-button:hover {
  border-color: var(--color-brand-blue);
  color: var(--color-brand-blue);
}

.article-share-button svg {
  width: 15px;
  height: 15px;
}


/* ==========================================================================
   PREV/NEXT NAVIGATION — populated by js/blog-article.js
   ========================================================================== */

.article-prev-next {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-top: var(--space-4xl);
  padding-top: var(--space-3xl);
  border-top: 1px solid var(--color-border);
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: border-color var(--duration-fast) var(--ease-smooth),
              transform var(--duration-fast) var(--ease-smooth);
}

.article-nav-link:hover {
  border-color: var(--color-brand-blue);
  transform: translateY(-2px);
}

.article-nav-label {
  font-size: var(--text-body-sm);
  color: var(--color-text-muted);
}

.article-nav-title {
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--color-text-primary);
}

.article-nav-next {
  text-align: right;
}

@media (min-width: 640px) {
  .article-prev-next {
    flex-direction: row;
  }
  .article-nav-link {
    flex: 1;
  }
}


/* ==========================================================================
   RELATED ARTICLES — grid populated by js/blog-article.js
   ========================================================================== */

.related-articles {
  padding-block: var(--space-5xl);
  background: var(--color-sand);
}

.related-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.related-article-card h3 {
  font-size: var(--text-heading-sm);
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  line-height: var(--leading-snug);
}

.related-article-card p {
  font-size: var(--text-body-sm);
}

@media (min-width: 768px) {
  .related-articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ==========================================================================
   NEWSLETTER CTA — visually distinct from the site-wide .final-cta
   (which sells the app), since this one is specifically about the
   blog. Honestly non-functional today, matching the same disabled-
   state pattern used for the site's "Coming soon" download button —
   no fake email capture that goes nowhere.
   ========================================================================== */

.newsletter-cta {
  padding-block: var(--space-5xl);
  text-align: center;
}

.newsletter-cta-inner {
  max-width: 480px;
  margin-inline: auto;
}

.newsletter-cta h2 {
  font-size: var(--text-heading-lg);
  margin-bottom: var(--space-md);
}

.newsletter-cta p {
  font-size: var(--text-body-md);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 360px;
  margin-inline: auto;
}

@media (min-width: 480px) {
  .newsletter-form {
    flex-direction: row;
  }
  .newsletter-form input {
    flex: 1;
  }
}
