/* ============================================================
   Blog: post pages and the /blog index. Loaded after quoting-theme.css
   on blog pages only. Bump the blog stylesheet version (BLOG_CSS_V)
   whenever this file changes, then rebuild.
   ============================================================ */

/* ---------- Post hero ---------- */
.post-hero .hero-content { max-width: 760px; }
.post-hero h1 { font-size: var(--display-xl); line-height: var(--leading-tight); }
.post-kicker {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--orange);
}
.post-kicker a { color: inherit; }
.post-meta {
  margin-top: 1.25rem;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ---------- Post body ---------- */
.post-body { max-width: 760px; margin: 0 auto; color: var(--text-body); }
.post-body > p:first-of-type { font-size: var(--text-lg); color: var(--text-primary); }
.post-body h2 { scroll-margin-top: 6rem; }
.post-body a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.post-body a.btn { color: var(--text-on-orange); text-decoration: none; }
.post-body strong { color: var(--text-primary); }
.post-body ol { margin: 0 0 1rem; padding-left: 1.5rem; list-style: decimal; }
.post-body ol li { margin-bottom: 0.5rem; line-height: var(--leading-relaxed); }
.post-body code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 0.9em;
}

/* Figures: photos, app screenshots and diagrams */
.post-figure { margin: 2rem 0; }
.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-hover);
}
.post-figure--wide { margin-left: -4rem; margin-right: -4rem; }
.post-figure figcaption {
  margin-top: 0.6rem;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

/* Big number row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.stat {
  padding: 1.25rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.stat__value {
  display: block;
  font-size: var(--display-md);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--orange);
}
.stat__label { display: block; margin-top: 0.4rem; font-size: var(--text-sm); color: var(--text-secondary); }

/* Callouts */
.callout {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--orange);
  border-radius: var(--radius-md);
  background: var(--orange-subtle);
}
.callout--warning { border-left-color: #eab308; background: rgba(234, 179, 8, 0.08); }
.callout__title { margin: 0 0 0.4rem; font-weight: var(--weight-bold); color: var(--text-primary); }
.callout > :last-child { margin-bottom: 0; }

/* Pull quote */
.pull-quote {
  margin: 2.5rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--orange-border);
  font-size: var(--display-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--text-primary);
}
.pull-quote p { margin: 0; line-height: inherit; }

/* Numbered steps */
.post-body ol.steps { list-style: none; padding: 0; counter-reset: step; }
.post-body ol.steps > li {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem 1rem 3.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  counter-increment: step;
}
.post-body ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--radius-full);
  background: var(--orange);
  color: var(--text-on-orange);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  line-height: 1.8rem;
  text-align: center;
}

/* Side by side comparison */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2rem 0; }
.compare__col {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.compare__col--good { border-color: var(--orange-border); }
.compare__col > :last-child { margin-bottom: 0; }
.compare__col h3 { margin-top: 0; }

/* Tables (cards on phones via .stack-table from the theme) */
.post-table { margin: 1.5rem 0; overflow-x: auto; }
.post-table table { width: 100%; border-collapse: collapse; }
.post-table th {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border-hover);
  text-align: left;
  color: var(--text-primary);
}
.post-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-default); color: var(--text-secondary); }

/* Mid article call to action */
.inline-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--orange-border);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--orange-subtle), transparent 70%), var(--bg-card);
}
.inline-cta__text { flex: 1 1 320px; }
.inline-cta__title { margin: 0 0 0.3rem; font-size: var(--text-lg); font-weight: var(--weight-bold); color: var(--text-primary); }
.inline-cta__text p { margin: 0; }

/* Calculator */
.calc {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
}
.calc__title { margin: 0 0 0.25rem; font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--text-primary); }
.calc__intro { margin: 0 0 1.25rem; font-size: var(--text-sm); color: var(--text-secondary); }
.calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem 1rem; }
/* Inputs sit on the bottom of each cell, so a row lines up when labels wrap differently */
.calc__field { display: flex; flex-direction: column; justify-content: flex-end; }
.calc__field label { display: block; margin-bottom: 0.3rem; font-size: var(--text-sm); color: var(--text-secondary); }
.calc__field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}
.calc__field select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}
.calc__field input:focus-visible, .calc__field select:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.calc__group {
  margin: 1.5rem 0 0.75rem;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--orange);
}
.calc__intro + .calc__group { margin-top: 0.5rem; }
.calc__field--wide { grid-column: 1 / -1; }
.calc__field--wide select { max-width: 360px; }
.calc__out {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-default);
}
.calc__out div { font-size: var(--text-sm); color: var(--text-secondary); }
.calc__out strong { display: block; font-size: var(--text-xl); color: var(--text-primary); }
.calc__out .calc__price strong { color: var(--orange); font-size: var(--display-sm); }
.calc__note { margin: 1rem 0 0; font-size: var(--text-xs); color: var(--text-muted); }

/* FAQ */
.post-faq { margin-top: 3rem; }
.post-faq details {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.post-faq summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}
.post-faq details > div { padding: 0 1.25rem 1rem; }

/* Related posts and the blog index */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover, .post-card:focus-visible { border-color: var(--orange-border); transform: translateY(-2px); }
.post-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card__body { padding: 1.25rem 1.5rem 1.5rem; }
.post-card__cat {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--orange);
}
.post-card h2, .post-card h3 { margin: 0.5rem 0; font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--text-primary); }
.post-card p { margin: 0 0 0.75rem; font-size: var(--text-sm); color: var(--text-secondary); }
.post-card__meta { font-size: var(--text-xs); color: var(--text-muted); }

@media (max-width: 1024px) {
  .post-figure--wide { margin-left: 0; margin-right: 0; }
}
@media (max-width: 576px) {
  .compare { grid-template-columns: 1fr; }
  .inline-cta .btn { width: 100%; }
  .calc { padding: 1.25rem; }
  .calc__grid, .calc__out { grid-template-columns: 1fr 1fr; }
  .calc__out .calc__price { grid-column: 1 / -1; }
  .pull-quote { font-size: var(--text-xl); }
}
