/*! blog.css — linked from layouts/blog/single.html for public editorial articles.
   Reuses the shared tokens from styles.css (--gold, --brg, --bg, --border, --text-*,
   --nav-height). Prefix: .blog-. Global reset (*{margin:0;padding:0;box-sizing:border-box})
   already applies from styles.css, loaded before this file. */

/* --- Reading progress (single post only) --- */
.blog-progress {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 90;
  pointer-events: none;
}
.blog-progress-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 80ms linear;
}
@media (prefers-reduced-motion: reduce) { .blog-progress-fill { transition: none; } }

/* --- Editorial hero --- */
.blog-post { max-width: none; margin: 0; padding: 0; }

/* Cap the hero itself, never the media layer: the scrim and the bottom-aligned
   title fill the full hero, so a capped photo left a black strip behind the
   title on tall viewports. The hero still grows past the cap if the title
   needs the room, and the photo follows because it is inset: 0. */
.blog-hero { position: relative; min-height: min(60vh, 520px); display: flex; align-items: flex-end; overflow: hidden; background: #0A0A0A; }
.blog-hero-media { position: absolute; inset: 0; }
.blog-hero-media img, .blog-hero-media picture { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.blog-hero-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.82) 100%); }
.blog-hero-content { position: relative; z-index: 2; width: 100%; padding: calc(var(--nav-height) + 32px) 20px 48px; }
.blog-hero-inner { max-width: 800px; margin: 0 auto; }
.blog-hero .blog-back { color: rgba(255,255,255,0.85); }
.blog-hero .blog-back:hover { color: var(--gold-light); }
.blog-hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 20px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.7); }
.blog-hero-dot { opacity: 0.6; }
.blog-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 56px); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; color: #FFFFFF; margin-top: 12px; }
.blog-hero .blog-post-subtitle { font-size: 17px; line-height: 1.6; color: rgba(255,255,255,0.85); margin-top: 14px; max-width: 62ch; }
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-top: 20px; }
.blog-topic-chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #FFFFFF; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; padding: 6px 14px; }

.blog-hero--plain { min-height: 0; background: var(--bg); align-items: stretch; padding-top: var(--nav-height); }
.blog-hero--plain .blog-hero-content { padding: 48px 20px 32px; }
.blog-hero--plain .blog-back { color: var(--gold); }
.blog-hero--plain .blog-hero-meta { color: var(--text-muted); }
.blog-hero--plain h1 { color: var(--text-primary); }
.blog-hero--plain .blog-post-subtitle { color: var(--text-secondary); }
.blog-hero--plain .blog-topic-chip { color: var(--text-primary); background: var(--bg-alt); border-color: var(--border); }

/* --- Shell (everything below the full-bleed hero) --- */
.blog-post-shell { max-width: 1024px; margin: 0 auto; padding: 0 20px 60px; }

/* --- Promo stats + pull-quote --- */
.blog-promo { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; padding: 24px 0; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.blog-promo-stats { display: flex; flex-wrap: wrap; gap: 16px; }
.blog-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--av2-radius, 12px); background: var(--bg-alt); }
.blog-stat-value { font-size: 28px; font-weight: 800; color: var(--brg); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.blog-stat-label { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.blog-promo-quote { flex: 1 1 280px; margin: 0; border-left: 3px solid var(--gold); padding: 4px 0 4px 20px; font-size: 17px; line-height: 1.6; font-weight: 600; color: var(--text-primary); font-style: normal; }
.blog-promo-quote p { margin: 0; }

/* --- Content + TOC layout ---
   Below 1200px this is plain block flow (content centred by its own
   max-width + auto margins); CSS grid only kicks in once the TOC rail
   appears, to avoid a fixed-max-width track overflowing a narrow viewport. */
.blog-layout { display: block; }

.blog-post-content { max-width: 720px; margin: 0 auto; font-size: 16px; line-height: 1.7; color: var(--text-secondary); }
.blog-post-content .av2-heading { margin: 48px 0 16px; }
.blog-post-content h2, .blog-post-content .av2-heading h2 { max-width: none; margin: 0; font-size: clamp(26px, 3.5vw, 38px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--text-primary); scroll-margin-top: calc(var(--nav-height) + 20px); }
.blog-post-content h3, .blog-post-content .av2-heading h3 { max-width: none; margin: 0; font-size: clamp(20px, 2.5vw, 24px); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--text-primary); scroll-margin-top: calc(var(--nav-height) + 20px); }

.blog-figure { margin: 28px 0; }
.blog-figure img, .blog-figure picture { margin: 0; }
.blog-figure figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-muted); text-align: center; }

.blog-post-content table { width: 100%; border-collapse: collapse; }
.blog-table-scroll th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.blog-table-scroll tbody tr:nth-child(even) { background: var(--bg-alt); }
.blog-table-scroll tbody td:first-child { font-weight: 700; color: var(--text-primary); }

/* --- Sticky table of contents (>=1200px) --- */
.blog-toc { display: none; }
@media (min-width: 1200px) {
  /* align-items stays default (stretch): the TOC's grid area must span the
     full row height (matched to the taller content column) or the sticky
     rule below has no room to keep it pinned while the page scrolls. */
  .blog-layout { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: 64px; justify-content: start; }
  .blog-post-content { margin: 0; align-self: start; }
  .blog-toc { display: block; }
  .blog-toc-inner { position: sticky; top: calc(var(--nav-height) + 32px); }
  .blog-toc-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 14px; }
  .blog-toc ul { list-style: none; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--border); }
  .blog-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: 13px; line-height: 1.4; color: var(--text-muted); text-decoration: none; transition: color 0.2s, border-color 0.2s; }
  .blog-toc a:hover { color: var(--text-primary); }
  .blog-toc a.is-active { color: var(--gold); border-left-color: var(--gold); font-weight: 600; }
}

/* --- Related product bridge (existing partial) sits between content and related posts --- */
.related-product { margin-top: 48px; }

/* --- Related posts --- */
.blog-related { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--border); }
.blog-related-heading { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); margin-bottom: 20px; }
.blog-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.blog-related-card { display: block; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; }
.blog-related-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); }
.blog-related-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.blog-related-card-body { padding: 16px; }
.blog-related-card-body time { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.blog-related-card-body h3 { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-top: 6px; line-height: 1.35; }

.blog-post-footer { margin-top: 56px; }


@media (max-width: 767px) {
  .blog-hero { min-height: min(46vh, 360px); }
  .blog-promo { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px 0; margin-bottom: 24px; }
  .blog-promo-quote { flex: 0 0 auto; width: 100%; }
  .blog-related-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-related-card { transition: none; }
}
