/* Blog design system (2026-11): blog list + post template on the new
   home design (layouts/blog/list.html, layouts/blog/single.html). Loads
   after home.css + chrome.css and assumes no Bootstrap (both templates'
   non-empty "scripts" blocks suppress the bundle). home.css provides the
   reset and shared primitives (.hero, .card, .faq, .final-cta, .edge,
   .btn, .hero-badge); this file adds:
     - the list page: dark hero band, card grid, featured card, in-grid
       App Store card
     - the post template: 720px article column, prose type scale, answer
       /insight cards, in-column tables, code blocks, in-article app card
   Class names reuse the landing.css vocabulary (.quick-answer,
   .app-cta-card, .table-scroll) where the look is identical - landing.css
   is never loaded on blog pages, so there is no conflict.
   The trailing block re-creates the handful of Bootstrap helper classes
   that already exist inside published post bodies (wording is frozen;
   their raw HTML must still look right without the bundle). */

/* ---------- List page ---------- */

/* Compact dark hero: .hero skin from home.css, trimmed padding (the list's
   job is routing readers, not selling). */
.blog-hero { padding-block: 52px 60px; }
@media (max-width: 959px) { .blog-hero { padding-block: 34px 40px; } }

.blog-list { background: var(--hc-surface); padding-block: 40px 72px; }
@media (min-width: 768px) { .blog-list { padding-block: 52px 96px; } }

/* Grid: 1 col phone, 2 col tablet, 3 col desktop. */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px)  { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-grid--main { margin-top: 20px; }

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-radius: var(--radius-2xl);
  padding: 24px 24px 22px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
a.blog-card:hover { border-color: var(--hc-teal-light); box-shadow: var(--hc-shadow-lg); }

.blog-card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  font-size: 13px; color: var(--hc-text-muted); margin-bottom: 10px;
}
.blog-card-meta .sep { color: var(--hc-border); }

.blog-card-title {
  font-size: 18px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em;
  color: var(--hc-text-strong); margin-bottom: 8px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
a.blog-card:hover .blog-card-title { color: var(--hc-teal-hover); }

.blog-card-summary {
  font-size: 14.5px; line-height: 1.55; color: var(--hc-text-body);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

.blog-card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.blog-card-tags span {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--hc-teal); background: var(--hc-teal-tint);
  border-radius: 999px; padding: 4px 10px;
}

/* Featured (newest) card: wide, spans the whole grid. */
.blog-card--featured {
  grid-column: 1 / -1;
  flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 44px;
  padding: 30px 32px 32px;
}
.blog-card--featured .blog-card-main { flex: 1 1 380px; min-width: 0; }
.blog-card--featured .blog-card-title { font-size: clamp(22px, 3vw, 28px); -webkit-line-clamp: 2; margin-bottom: 10px; }
.blog-card--featured .blog-card-summary { font-size: 15.5px; -webkit-line-clamp: 2; max-width: 720px; }
.blog-card--featured .blog-card-open {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 650; color: var(--hc-teal);
}
.blog-card--featured:hover .blog-card-open { color: var(--hc-teal-hover); }
.blog-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--hc-teal); margin-bottom: 10px;
}
@media (max-width: 639px) { .blog-card--featured { padding: 22px 20px 24px; } }

/* App Store card that rides along in the grid (first cell after row 1). */
.blog-cta-card {
  background: var(--hc-teal-tint);
  border-color: #cfe6ef;
  justify-content: space-between;
}
.blog-cta-card:hover { border-color: var(--hc-teal); box-shadow: var(--hc-shadow-lg); }
.blog-cta-card .blog-cta-copy {
  font-size: 15.5px; font-weight: 650; line-height: 1.5;
  color: var(--hc-text-strong); margin-bottom: 16px;
}
/* home.css hides .hero-badge below 960px; this card's badge is its only
   link, so it must stay visible and tappable. */
.blog-cta-card .hero-badge { display: inline-flex; align-self: flex-start; }
.blog-cta-card .hero-badge img { height: 44px; }

/* ---------- Post template: header ---------- */

.post-wrap { background: var(--hc-surface); }
.post-head { max-width: 760px; margin-inline: auto; padding: 36px 0 8px; }
@media (min-width: 768px) { .post-head { padding-top: 56px; } }

.post-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--hc-text-muted);
  margin-bottom: 22px;
}
.post-back:hover { color: var(--hc-teal); }

.post-head h1 {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.12;
  color: var(--hc-text-strong); margin-bottom: 16px;
}

.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 14px; color: var(--hc-text-muted); margin-bottom: 22px;
}
.post-meta .sep { color: var(--hc-border); }
.post-meta strong { font-weight: 600; color: var(--hc-text-body); }

/* Language switcher: quiet pills (replaces the Bootstrap btn-group); the
   hreflang attr stays so analytics.js keeps tracking language_switch. */
.post-lang { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 24px; font-size: 13.5px; color: var(--hc-text-muted); }
.post-lang a {
  display: inline-flex; align-items: center;
  border: 1px solid var(--hc-border); border-radius: 999px;
  padding: 6px 14px; font-weight: 600; color: var(--hc-text-strong);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.post-lang a:hover { border-color: var(--hc-teal); color: var(--hc-teal); }

.post-hero-img { margin: 8px 0 8px; }
.post-hero-img img { border: 1px solid var(--hc-border); border-radius: var(--radius-xl); }

/* ---------- Post template: article column (~720px, 18px body) ---------- */

.post-article { padding-block: 20px 64px; }
@media (min-width: 768px) { .post-article { padding-block: 28px 88px; } }

.post-prose { max-width: 720px; margin-inline: auto; }

.post-prose p { font-size: 18px; line-height: 1.75; color: var(--hc-text-body); margin-bottom: 20px; }
.post-prose strong { color: var(--hc-text-strong); }
.post-prose a { color: var(--hc-teal); text-decoration: underline; }
.post-prose hr { border-top: 1px solid var(--hc-border-soft); margin: 44px 0; }
.post-prose img { border-radius: var(--radius-lg); margin: 8px 0 20px; }

/* In-body figures (dated vendor screenshots): native blog component - the
   blog posts that carry them no longer need the Bootstrap helper classes. */
.post-prose figure { margin: 8px 0 28px; }
.post-prose figure img { display: block; margin: 0; border: 1px solid var(--hc-border); }
.post-prose figure figcaption { font-size: 13px; line-height: 1.5; color: var(--hc-text-muted); margin-top: 10px; }

/* Markdown lists would vanish under the home.css reset - restore them. */
.post-prose ul:not(.faq-list):not(.chip-row):not(.check-list),
.post-prose ol { margin: 0 0 20px; padding-left: 26px; }
.post-prose ul:not(.faq-list):not(.chip-row):not(.check-list) { list-style: disc; }
.post-prose ol { list-style: decimal; }
.post-prose li { margin-bottom: 10px; font-size: 17px; line-height: 1.7; color: var(--hc-text-body); }
.post-prose li::marker { color: var(--hc-teal); }

.post-prose h2 {
  font-size: clamp(24px, 3.6vw, 30px);
  font-weight: 700; letter-spacing: -0.015em; line-height: 1.25;
  color: var(--hc-text-strong); margin: 52px 0 16px;
}
.post-prose h3 { font-size: 20px; font-weight: 650; color: var(--hc-text-strong); margin: 34px 0 12px; }
.post-prose h2:first-child, .post-prose h3:first-child { margin-top: 0; }

/* ---------- Section cards the layout wraps around markdown sections ----------
   .quick-answer: the landing-page answer card (landing.css look).
   .post-insight: same family, neutral surface + teal edge (Key Insight). */

.quick-answer {
  background: var(--hc-teal-tint);
  border: 1px solid #cfe6ef;
  border-radius: var(--radius-2xl);
  padding: 26px 28px 24px;
  margin: 8px 0 12px;
}
.quick-answer h2 { margin: 0 0 12px; }
.quick-answer p, .quick-answer li { color: var(--hc-text-strong); }
.quick-answer p:last-child, .quick-answer ul:last-child, .quick-answer ol:last-child { margin-bottom: 0; }
.quick-answer a { color: var(--hc-teal-hover); }

.post-insight {
  background: var(--hc-surface-alt);
  border: 1px solid var(--hc-border);
  border-left: 4px solid var(--hc-teal);
  border-radius: var(--radius-2xl);
  padding: 26px 28px 24px;
  margin: 8px 0 12px;
}
.post-insight h2 { margin: 0 0 12px; }
.post-insight p:last-child, .post-insight ul:last-child, .post-insight ol:last-child { margin-bottom: 0; }
@media (max-width: 599px) {
  .quick-answer, .post-insight { padding: 22px 20px 20px; }
}

/* ---------- Inline code / code blocks / blockquotes ---------- */

.post-prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--hc-teal-tint);
  color: var(--hc-teal-hover);
  border-radius: 6px;
  padding: 2px 7px;
  overflow-wrap: anywhere; /* long paths (server/api/tests/...) must not widen the page on phones */
}
.post-prose pre {
  background: var(--hc-ink);
  border-radius: var(--radius-xl);
  padding: 20px 22px;
  margin: 8px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.post-prose pre code { background: none; color: #dce8ee; padding: 0; font-size: 14px; line-height: 1.6; }

.post-prose blockquote {
  border-left: 3px solid var(--hc-teal);
  background: var(--hc-teal-tint);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  padding: 16px 22px;
  margin: 24px 0;
}
.post-prose blockquote p { font-size: 17px; color: var(--hc-text-strong); margin: 0; }
.post-prose blockquote p + p { margin-top: 8px; }

/* ---------- Tables: markdown tables get wrapped by the layout in
   .table-scroll (they scroll inside the column on phones); tables from
   shared partials keep their Bootstrap-era .table-responsive wrapper,
   which is inert without the bundle - recreate the card look for both. ---------- */

.post-prose .table-scroll, .post-prose .table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hc-border);
  border-radius: var(--radius-xl);
  background: var(--hc-surface);
  box-shadow: var(--hc-shadow-lg);
  margin: 8px 0 24px;
}
.post-prose .table-scroll table { width: 100%; border-collapse: collapse; min-width: 640px; margin: 0; }
.post-prose .table-responsive table { width: 100%; border-collapse: collapse; min-width: 760px; margin: 0; }
.post-prose .table-scroll caption, .post-prose .table-responsive caption {
  caption-side: top; text-align: left; padding: 16px 18px 4px;
  font-size: 15px; font-weight: 650; color: var(--hc-text-strong);
}
.post-prose .table-scroll th, .post-prose .table-scroll td,
.post-prose .table-responsive th, .post-prose .table-responsive td {
  padding: 13px 16px; text-align: left;
  border-top: 1px solid var(--hc-border-soft);
  color: var(--hc-text-body); line-height: 1.5; font-size: 14px; margin: 0;
}
.post-prose .table-scroll thead th, .post-prose .table-responsive thead th {
  border-top: 0; background: var(--hc-surface-alt);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--hc-text-muted);
}
.post-prose .table-scroll td:first-child, .post-prose .table-scroll th:first-child,
.post-prose .table-responsive td:first-child, .post-prose .table-responsive th:first-child { font-weight: 650; color: var(--hc-text-strong); }
/* First body row is the HandyCode line on these comparison tables (it is
   first in every language) - same tint as the landing tables. */
.post-prose .table-scroll tbody tr:first-child, .post-prose .table-responsive tbody tr:first-child { background: var(--hc-teal-tint); }
.post-prose .table-scroll tbody tr:first-child td, .post-prose .table-responsive tbody tr:first-child td { border-top-color: #cfe6ef; }
.post-prose .table-scroll tbody tr:first-child td:first-child, .post-prose .table-responsive tbody tr:first-child td:first-child,
.post-prose .table-responsive tbody tr:first-child td:first-child strong { color: var(--hc-teal-hover); }
.post-prose .table-scroll a, .post-prose .table-responsive a { color: var(--hc-teal); text-decoration: underline; }
.post-prose .table-responsive .small { font-size: 12.5px; }
.post-prose .table-responsive .text-muted { color: var(--hc-text-muted); padding: 0 16px 14px; line-height: 1.55; }

/* ---------- In-column FAQ (markdown FAQ sections rendered as <details>) ---------- */

.post-faq { margin: 8px 0 12px; }
.post-faq h2 { margin-bottom: 18px; }
.post-faq .faq-list { max-width: none; }
.post-faq summary { font-size: 17px; }
.post-faq .faq-body { font-size: 16px; line-height: 1.7; }
.post-faq .faq-body p { font-size: 16px; margin: 0; }
.post-faq .faq-body p + p { margin-top: 10px; }

/* ---------- In-article App Store card (mid-article CTA) ---------- */

.app-cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin: 36px 0;
  background: var(--hc-surface);
  border: 1px solid var(--hc-border);
  border-left: 4px solid var(--hc-teal);
  border-radius: var(--radius-2xl);
  padding: 24px 26px;
  box-shadow: var(--hc-shadow-lg);
}
.app-cta-copy { font-size: 16.5px; font-weight: 650; line-height: 1.5; color: var(--hc-text-strong); margin: 0; }
/* Keep the badge tappable below 960px (home.css hides .hero-badge there). */
.app-cta-card .hero-badge { flex-shrink: 0; display: inline-flex; }
@media (max-width: 599px) {
  .app-cta-card { flex-direction: column; align-items: flex-start; padding: 22px 20px; }
  .app-cta-card .hero-badge img { height: 44px; }
}

/* ---------- End-of-article CTA band: .final-cta skin from home.css ---------- */

.post-final .final-cta { padding-block: 72px; }
.final-cta .cta-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; margin-bottom: 0; }
.final-cta .cta-actions .hero-badge { margin-bottom: 0; }
/* home.css hides .hero-badge below 960px; keep one tappable CTA there. */
.cta-btn-mobile { display: none; }
@media (max-width: 959px) { .cta-btn-mobile { display: inline-flex; } }

/* ---------- Related posts ---------- */

.blog-related { background: var(--hc-surface-alt); padding-block: 56px 72px; }
@media (min-width: 768px) { .blog-related { padding-block: 72px 96px; } }
.blog-related .h2 { margin-bottom: 32px; }

/* ---------- Bootstrap helpers still present inside published post bodies ----------
   Frozen wording: three posts carry raw Bootstrap HTML (buttons, card rows,
   figures). Without the bundle those classes are inert; recreate just the
   ones they use, scoped to .post-prose so nothing else is touched. */

.post-prose .btn { margin: 8px 0 4px; }
.post-prose .btn-lg { height: 54px; padding-inline: 30px; font-size: 16.5px; border-radius: var(--radius-lg); }
.post-prose .btn-outline-primary { border: 1px solid var(--hc-teal); color: var(--hc-teal); background: var(--hc-surface); }
.post-prose .btn-outline-primary:hover { background: var(--hc-teal); color: #fff; }
.post-prose .row { display: flex; flex-wrap: wrap; gap: 24px; margin: 12px 0 24px; }
.post-prose .row > [class*="col-"] { flex: 1 1 260px; min-width: 0; }
@media (min-width: 768px) {
  .post-prose .col-md-5 { flex-basis: 34%; }
  .post-prose .col-md-6 { flex-basis: calc(50% - 24px); }
  .post-prose .col-md-7 { flex-basis: calc(66% - 24px); }
}
.post-prose .card { border-radius: var(--radius-xl); }
.post-prose .card .card-body { padding: 0; }
.post-prose .border-0 { border: 0; }
.post-prose .shadow-sm { box-shadow: var(--hc-shadow-lg); }
.post-prose .h-100 { height: 100%; }
.post-prose .img-fluid { max-width: 100%; height: auto; }
.post-prose .rounded { border-radius: var(--radius-lg); }
.post-prose .border { border: 1px solid var(--hc-border); }
.post-prose .text-muted { color: var(--hc-text-muted); }
.post-prose .small { font-size: 13px; }
.post-prose .fw-bold { font-weight: 700; }
.post-prose .fw-semibold { font-weight: 650; }
.post-prose .h5 { font-size: 16.5px; font-weight: 650; color: var(--hc-text-strong); margin: 0 0 8px; }
.post-prose .my-4 { margin: 24px 0; }
.post-prose .my-5 { margin: 32px 0; }
.post-prose .my-2 { margin: 12px 0; }
.post-prose .my-3 { margin: 16px 0; }
.post-prose .mt-3 { margin-top: 16px; }
.post-prose .mb-0 { margin-bottom: 0; }
.post-prose .mb-1 { margin-bottom: 4px; }
.post-prose .mb-3 { margin-bottom: 16px; }
