/* ============================================================
   blog.css - Roundmark blog + article styles
   Loaded AFTER site.css on blog pages only.
   Relies on brand vars from site.css:
   --ink:#171717  --accent:#4343d5  --paper:#fcf8f9
   --tint:#f3eff4  --muted:#6b7280  --line:#e7e3ea
   Fallbacks included so the file is robust in isolation.
   ============================================================ */

:root {
  --ink: #171717;
  --accent: #4343d5;
  --accent-dark: #3838bd;
  --accent-2: #fb923c;
  --paper: #fcf8f9;
  --tint: #f3eff4;
  --muted: #6b7280;
  --line: #e7e3ea;
  --cta-from: #5b54e0;
  --cta-to: #4343d5;
}

/* ---------- Blog index hero ---------- */
.blog-hero {
  padding: 5rem 0 2.5rem;
  text-align: center;
}
.blog-hero h1 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0.4rem 0 0.9rem;
}
.blog-hero p {
  max-width: 34rem;
  margin: 0 auto;
  font-size: 1.075rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- Card grid ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
  padding: 1rem 0 4.5rem;
}
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px -18px rgba(23, 23, 23, 0.16);
  border-color: #d6d2db;
}
.post-card-media {
  aspect-ratio: 1200 / 630;
  width: 100%;
  height: auto; /* attr height=630 would otherwise fix the box height */
  background: var(--tint);
  display: block;
  object-fit: cover;
}
.post-card-body {
  padding: 1.15rem 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}
.post-card-cat {
  color: var(--accent-2);
  font-weight: 600;
}
.post-card-dot { color: var(--line); }
.post-card h2,
.post-card h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.24rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.post-card p {
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 1rem;
}
.post-card-more {
  margin-top: auto;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Article layout ---------- */
.article-wrap { max-width: 720px; }
.article {
  padding: 2.5rem 0 3rem;
}
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 1.5rem 0 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span[aria-current] { color: var(--ink); }
.breadcrumb .sep { color: var(--line); }

.article-head { margin-bottom: 2rem; }
.article-cat {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent-2);
  margin-bottom: 0.75rem;
}
.article-head h1 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 0.9rem;
}
.article-byline {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.article-byline .sep { color: var(--line); }

.article-cover {
  width: 100%;
  height: auto; /* attr height=630 would otherwise fix the box height */
  aspect-ratio: 1200 / 630;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin: 0 0 2.2rem;
  display: block;
  object-fit: cover;
}

/* ---------- Article typography ---------- */
.article-body {
  font-size: 17px;
  line-height: 1.75;
  color: #3f3f46;
}
.article-body > p:first-of-type {
  font-size: 1.16rem;
  line-height: 1.6;
  color: var(--ink);
}
.article-body p { margin: 0 0 1.35rem; }
.article-body h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 2.6rem 0 0.9rem;
}
.article-body h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 1.9rem 0 0.6rem;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.article-body a:hover { text-decoration-thickness: 2px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body ul,
.article-body ol {
  margin: 0 0 1.5rem;
  padding-left: 1.3rem;
}
.article-body li { margin: 0 0 0.55rem; padding-left: 0.25rem; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote {
  margin: 1.8rem 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--ink);
}
.article-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.6rem 0;
}

/* ---------- Comparison / data tables ---------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 34rem;
}
.article-body th,
.article-body td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.article-body thead th {
  background: var(--tint);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.article-body tbody tr:last-child td { border-bottom: 0; }
.article-body tbody tr:nth-child(even) { background: rgba(243, 239, 244, 0.6); }
.article-body td strong { color: var(--ink); }

/* ---------- Callout / key box ---------- */
.callout {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  margin: 0 0 1.8rem;
  font-size: 0.98rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

/* ---------- FAQ block ---------- */
.faq {
  margin: 2.8rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.8rem;
}
.faq h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
  margin: 0 0 1.2rem;
}
/* Explicit border/padding so the blog FAQ does not inherit site.css's
   accordion (<details>/<summary>) FAQ styling - deterministic either way. */
.faq-item {
  margin: 0;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}
.faq-item:first-child { padding-top: 0; }
.faq-item:last-child { padding-bottom: 0; border-bottom: 0; }
.faq-item h3 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.4rem;
}
.faq-item p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #3f3f46;
  margin: 0;
}

/* ---------- End-of-post CTA card ---------- */
.post-cta {
  margin: 3rem 0 1rem;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  border-radius: 20px;
  padding: 2.6rem 2rem;
  text-align: center;
  color: #fff;
}
.post-cta h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 0.6rem;
}
.post-cta p {
  color: rgba(255, 255, 255, 0.82);
  max-width: 28rem;
  margin: 0 auto 1.4rem;
  font-size: 1rem;
  line-height: 1.55;
}
/* White button on the indigo band - indigo-on-indigo fails contrast */
.post-cta .btn-primary {
  font-size: 0.98rem;
  background: #fff;
  color: var(--accent);
  border-color: #fff;
}
.post-cta .btn-primary:hover { background: #f1f0fb; color: var(--accent-dark); border-color: #f1f0fb; }

/* ---------- Related posts strip ---------- */
.related {
  margin: 3.5rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
}
.related h2 {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0 0 1.2rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
}
.related-card {
  display: block;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.related-card strong {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
}
