/* ==========================================================================
   blog.css — Blog listing, article, and comparison/money-page styles.
   Reuses the global design tokens from styles.css (--bg-*, --text-*, etc.).
   Everything is scoped under .blog-* / .article-* / .cmp-* so it never
   leaks into the marketing pages.
   ========================================================================== */

/* ---- Shared narrow reading column (articles) ---- */
.blog-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
/* Wider column for the listing grid so wide screens fit 3-4 cards */
.blog-wrap-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- Listing header ---- */
.blog-head {
  text-align: center;
  padding: 4rem 0 2.5rem;
}
.blog-head h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}
.blog-head p {
  color: var(--text-secondary);
  font-size: 1.075rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---- Listing grid ---- */
.blog-list {
  display: grid;
  /* Responsive: as many columns as fit — wide screens get 3-4, narrow get 1-2. */
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding-bottom: 5rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: var(--border);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.blog-card:hover {
  transform: translateY(-4px);
  border: var(--border-hover);
  box-shadow: var(--card-shadow);
}
.blog-card-cover {
  width: 100%;
  height: 190px;
  object-fit: cover;
  object-position: left center; /* covers have their title on the left — show that */
  display: block;
  background: #0a1020;
}
.blog-card-body { padding: 1.25rem 1.35rem 1.4rem; }

/* ---- Color-coded category badges ---- */
.cat-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.28em 0.7em;
  border-radius: 999px;
  margin-bottom: 0.85rem;
  border: 1px solid transparent;
}
.cat-ios      { color: #60a5fa; background: rgba(59,130,246,0.14);  border-color: rgba(59,130,246,0.35); }
.cat-android  { color: #4ade80; background: rgba(34,197,94,0.14);   border-color: rgba(34,197,94,0.35); }
.cat-flutter  { color: #38bdf8; background: rgba(56,189,248,0.14);  border-color: rgba(56,189,248,0.35); }
.cat-rn       { color: #c084fc; background: rgba(168,85,247,0.14);  border-color: rgba(168,85,247,0.35); }
.cat-qa       { color: #fb923c; background: rgba(249,115,22,0.14);  border-color: rgba(249,115,22,0.35); }
.cat-compare  { color: #94a3b8; background: rgba(148,163,184,0.14); border-color: rgba(148,163,184,0.35); }

.blog-card-body h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 0 0 0.55rem;
}
.blog-card-body p {
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}
.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.blog-readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-light);
}
.blog-readmore svg { width: 16px; height: 16px; }

/* ==========================================================================
   Article (blog/[slug])
   ========================================================================== */
.article {
  padding: 3rem 0 4rem;
}
.article-head { margin-bottom: 2rem; }
.article-eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-light);
  margin-bottom: 0.85rem;
}
.article-head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.article-byline .dot { opacity: 0.5; }
.article-cover {
  display: block;
  width: 100%;
  height: auto;          /* keep full image, never crop */
  max-width: 560px;      /* but cap the size so it isn't oversized */
  margin: 2rem auto 2.5rem;
  border-radius: 16px;
  border: var(--border);
}

/* ---- Article body typography (readability first) ---- */
.article-body {
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--text-secondary);
}
.article-body > * + * { margin-top: 1.35rem; }
.article-body h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 0.25rem;
  scroll-margin-top: 90px;
}
.article-body h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-top: 2rem;
}
.article-body p { margin: 0; }
.article-body a {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body strong { color: var(--text-primary); font-weight: 700; }
.article-body ul,
.article-body ol {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.article-body li { line-height: 1.65; }
.article-body img {
  width: 100%;
  border-radius: 12px;
  border: var(--border);
  margin: 1rem 0;
}
.article-body figure { margin: 2rem 0; text-align: center; }
/* Tall phone screenshots: cap HEIGHT so the portrait image stays compact and
   doesn't stretch down the page. Width auto-derives from the aspect ratio. */
.article-body figure img {
  width: auto;
  max-width: 100%;
  max-height: 520px;
  margin: 0 auto;
  object-fit: contain;
}
.article-body figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.6rem;
}
.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 0.4rem 0 0.4rem 1.25rem;
  color: var(--text-primary);
  font-style: italic;
}
.article-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  padding: 0.15em 0.4em;
  border-radius: 5px;
}
.article-body pre {
  background: var(--bg-elevated);
  border: var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
}
.article-body pre code { background: none; padding: 0; }

/* Hide screenshot placeholders until real images are supplied.
   Hides the whole <figure> (placeholder + its caption) so no empty boxes show.
   To re-enable a slot, replace its .shot-placeholder div with a real <img>. */
.article-body figure:has(.shot-placeholder) { display: none; }

/* ---- Image placeholder box (swap for real screenshots later) ---- */
.shot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 240px;
  border: 1px dashed rgba(120, 140, 170, 0.4);
  border-radius: 12px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1.5rem;
  margin: 1.25rem 0;
}

/* ==========================================================================
   Comparison / money-page table
   ========================================================================== */
.cmp-table-wrap {
  overflow-x: auto;
  margin: 2rem 0;
  border: var(--border);
  border-radius: 14px;
}
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 480px;
}
.cmp-table th,
.cmp-table td {
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: var(--border);
}
.cmp-table thead th {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.9rem;
}
.cmp-table tbody tr:last-child td { border-bottom: none; }
.cmp-table td:first-child,
.cmp-table th:first-child { color: var(--text-primary); font-weight: 600; }
.cmp-yes { color: #22c55e; font-weight: 700; }
.cmp-no { color: var(--text-muted); }
.cmp-table .col-moni {
  background: rgba(37, 99, 235, 0.06);
  color: var(--text-primary);
}

/* ==========================================================================
   Related articles + CTA
   ========================================================================== */
.related {
  padding: 3rem 0 1rem;
  border-top: var(--border);
  margin-top: 3.5rem;
}
.related h2 { font-size: 1.4rem; margin-bottom: 1.5rem; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.related-card {
  display: block;
  padding: 1.25rem 1.4rem;
  background: var(--bg-secondary);
  border: var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.related-card:hover { border: var(--border-hover); transform: translateY(-2px); }
.related-card span { font-size: 0.78rem; color: var(--primary-light); font-weight: 600; }
.related-card h3 { font-size: 1.05rem; margin-top: 0.35rem; line-height: 1.3; }

.blog-cta {
  margin: 3.5rem 0 1rem;
  padding: 2.5rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(14,165,233,0.12));
  border: var(--border-glow);
  border-radius: 20px;
}
.blog-cta h2 { font-size: 1.6rem; margin-bottom: 0.6rem; }
.blog-cta p { color: var(--text-secondary); max-width: 480px; margin: 0 auto 1.5rem; }
.blog-cta-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
  .blog-head { padding: 2.5rem 0 1.5rem; }
}
