/* Blog-specific styles — extends styles.css */

.blog-hero {
  padding: 80px 0 40px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,181,71,0.08), transparent 60%),
    var(--bg);
}
.blog-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 16px; }
.blog-hero .lede { max-width: 700px; }

.post-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 18px;
}
.post-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s ease, transform .2s ease;
}
.post-card:hover { border-color: rgba(255,181,71,0.3); transform: translateY(-2px); }
.post-link {
  display: block;
  padding: 28px;
  color: inherit;
}
.post-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 0.86rem; color: var(--text-muted);
}
.post-meta time { font-family: var(--mono); }
.post-tag {
  background: rgba(110, 231, 255, 0.1);
  color: var(--accent);
  padding: 3px 10px; border-radius: 999px;
  font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.post-read-time { color: var(--text-muted); }
.post-card h2 {
  font-size: 1.4rem; color: var(--text); margin-bottom: 8px;
}
.post-card p { color: var(--text-dim); margin-bottom: 12px; }
.post-read {
  font-family: var(--mono); font-size: 0.86rem; color: var(--brand); font-weight: 600;
}

.blog-cta {
  margin-top: 48px; text-align: center;
  padding: 36px;
  background: linear-gradient(135deg, rgba(255,181,71,0.06), rgba(110,231,255,0.04));
  border: 1px dashed rgba(255,181,71,0.3);
  border-radius: var(--radius);
}
.blog-cta h3 { color: var(--text); }
.blog-cta p { color: var(--text-dim); margin-bottom: 18px; }

/* ---------- Article page ---------- */

.post { padding: 60px 0 80px; }
.post-narrow { max-width: 760px; }
.post .post-meta { margin-bottom: 18px; }
.post h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  font-weight: 800; line-height: 1.15;
  margin-bottom: 20px;
}
.post-lede {
  font-size: 1.18rem; color: var(--text-dim); line-height: 1.65;
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.post h2 {
  font-size: 1.6rem; color: var(--text);
  margin-top: 44px; margin-bottom: 14px;
}
.post h3 { font-size: 1.2rem; margin-top: 32px; margin-bottom: 10px; }
.post p {
  font-size: 1.04rem; line-height: 1.75;
  color: var(--text); margin-bottom: 18px;
}
.post p em { color: var(--text-dim); }
.post code {
  font-family: var(--mono); font-size: 0.92em;
  background: rgba(110, 231, 255, 0.1); color: var(--accent);
  padding: 2px 6px; border-radius: 5px;
}
.post strong { color: var(--text); }
.post ul, .post ol {
  padding-left: 1.4em; margin-bottom: 22px;
}
.post li { color: var(--text); margin-bottom: 8px; line-height: 1.7; }
.post blockquote {
  margin: 22px 0; padding: 14px 22px;
  border-left: 3px solid var(--brand);
  background: rgba(255, 181, 71, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text); font-style: italic;
}
.post a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post a.btn { color: inherit; text-decoration: none; }
.post-divider {
  margin: 48px 0; border: 0; height: 1px;
  background: var(--line);
}

.post-cta {
  margin: 32px 0;
  padding: 28px;
  background: linear-gradient(135deg, rgba(255,181,71,0.08), rgba(110,231,255,0.04));
  border: 1px solid rgba(255,181,71,0.25);
  border-radius: var(--radius);
  text-align: center;
}
.post-cta h2 { margin-top: 0; }
.post-cta h3 { margin-top: 0; }
.post-cta p { color: var(--text-dim); }
.post-cta-paid {
  background: linear-gradient(135deg, rgba(255,181,71,0.18), rgba(255,138,61,0.08));
  border-color: rgba(255,181,71,0.45);
}
.post-cta-sample {
  text-align: left;
}
.post-cta-sample .post-sample-mdc {
  margin: 16px 0 20px;
  padding: 16px 18px;
  background: var(--bg-3, #0f1117);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-x: auto;
  text-align: left;
}
.post-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
.post-cta-footnote {
  margin: 16px 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.post-related {
  margin: 40px 0 8px;
  padding: 24px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.post-related h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}
.post-related ul {
  margin: 0 0 16px;
  padding-left: 1.25rem;
}
.post-related li { margin-bottom: 8px; }
.post-related-hub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.post-related-hub a { font-weight: 600; }

/* ---------- Comparison tables (posts 05–08) ---------- */

.post .post-table-wrap {
  margin: 24px 0 28px;
  max-width: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.post-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.94rem;
}

.post-table thead {
  background: var(--bg-3);
  border-bottom: 2px solid var(--line-strong);
}

.post-table th {
  padding: 12px 16px;
  text-align: left;
  vertical-align: bottom;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  line-height: 1.35;
}

.post-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  line-height: 1.55;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.post-table tbody tr:last-child td {
  border-bottom: none;
}

.post-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}

.post-table td strong {
  color: var(--text);
  font-weight: 700;
}

/* 3-column matrices (pricing, task picks) */
.post-table:has(thead tr > th:nth-child(3):last-child) th:nth-child(1),
.post-table:has(thead tr > th:nth-child(3):last-child) td:nth-child(1) {
  width: 24%;
}

.post-table:has(thead tr > th:nth-child(3):last-child) th:nth-child(2),
.post-table:has(thead tr > th:nth-child(3):last-child) td:nth-child(2) {
  width: 22%;
}

.post-table:has(thead tr > th:nth-child(3):last-child) th:nth-child(3),
.post-table:has(thead tr > th:nth-child(3):last-child) td:nth-child(3) {
  width: 54%;
}

/* 4-column spec tables */
.post-table:has(thead tr > th:nth-child(4)) th:nth-child(1),
.post-table:has(thead tr > th:nth-child(4)) td:nth-child(1) {
  width: 14%;
}

.post-table:has(thead tr > th:nth-child(4)) th:nth-child(2),
.post-table:has(thead tr > th:nth-child(4)) td:nth-child(2) {
  width: 14%;
}

.post-table:has(thead tr > th:nth-child(4)) th:nth-child(3),
.post-table:has(thead tr > th:nth-child(4)) td:nth-child(3) {
  width: 18%;
}

.post-table:has(thead tr > th:nth-child(4)) th:nth-child(4),
.post-table:has(thead tr > th:nth-child(4)) td:nth-child(4) {
  width: 54%;
}

/* ---------- Mobile (Astra-style) ---------- */
@media (max-width: 768px) {
  .blog-hero {
    padding: 48px 0 28px;
    text-align: left;
  }
  .blog-hero .container {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .blog-hero .lede {
    margin: 0;
    font-size: 1rem;
    line-height: 1.65;
    max-width: none;
  }
  .post .container,
  .section > .container {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }

  .post-link { padding: 20px 18px; }
  .post-card h2 { font-size: 1.15rem; }
  .post-card p { font-size: 0.92rem; }

  .post { padding: 40px 0 56px; }
  .post h1 { font-size: clamp(1.65rem, 6vw, 2.1rem); }
  .post-lede { font-size: 1.02rem; margin-bottom: 28px; }
  .post h2 { font-size: 1.3rem; margin-top: 32px; }
  .post h3 { font-size: 1.08rem; }
  .post p, .post li { font-size: 0.98rem; line-height: 1.7; }

  .post-cta, .post-related, .blog-cta {
    padding: 20px 18px;
    margin-left: 0;
    margin-right: 0;
  }

  .post pre, .post code, .example-pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    word-break: break-word;
  }

  .post-table-wrap {
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius-sm);
  }

  .post-table {
    min-width: 480px;
    font-size: 0.88rem;
  }

  .post-table th,
  .post-table td {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .post-meta { font-size: 0.8rem; gap: 8px; }
  .blog-cta { padding: 24px 16px; }
}
