/* ============================================
   Blog: index, post pages, and the "From the Blog" block on the home page.
   Uses the color/spacing tokens from styles.css.
   ============================================ */

.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Blog index ---------- */
.blog-hero { padding: 72px 0 8px; }
.blog-hero p { max-width: 620px; font-size: 1.12rem; }

.blog-list { padding: 48px 0 0; }

.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.cat-filter button {
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cat-filter button:hover { border-color: var(--text-soft); color: var(--text); }

.cat-filter button[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: var(--white);
}

/* ---------- Post cards (index, related, home) ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.post-card[hidden] { display: none; }

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-alt);
  border-radius: 24px;
  padding: 32px 30px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.post-card-link:hover {
  transform: translateY(-4px);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.post-cat {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 12px;
}

.post-card h2,
.post-card h3 {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.22;
  margin-bottom: 12px;
  color: var(--text);
}

.post-card p {
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 22px;
}

.post-meta {
  margin-top: auto;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ---------- Single post ---------- */
.post { padding: 56px 0 24px; }

.post-header { margin-bottom: 36px; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-bottom: 28px;
}

.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

.post-header h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.post-byline img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post-byline a { color: var(--text); font-weight: 600; }
.post-byline a:hover { text-decoration: underline; }

/* "The short answer" box: the summary AI search engines and featured snippets can lift directly */
.quick-answer {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 32px;
}

.quick-answer h2 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}

.quick-answer p {
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.6;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 28px;
  margin-bottom: 40px;
}

.toc h2 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.toc ol {
  list-style: decimal;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}

.toc li { color: var(--text-soft); font-size: 0.95rem; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--text); text-decoration: underline; }

/* Article body */
.prose {
  font-size: 1.1rem;
  line-height: 1.72;
}

.prose > * + * { margin-top: 1.1em; }

.prose p,
.prose li { color: #3a3a3c; }

.prose h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-top: 2em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h3 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-top: 1.7em;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.prose h2 + *,
.prose h3 + * { margin-top: 0.6em; }

.prose ul { list-style: disc; padding-left: 1.3em; }
.prose ol { list-style: decimal; padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent-dark); }

.prose a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--accent-dark); }

.prose strong { color: var(--text); font-weight: 650; }

.prose code {
  font-size: 0.9em;
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 5px;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--bg-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 18px 22px;
}

.callout p { color: var(--text); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.5;
}

.prose th,
.prose td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.prose th {
  background: var(--bg-alt);
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
}

.prose td { color: #3a3a3c; }
.prose tr:last-child td { border-bottom: none; }

.faq-list .faq-q { margin-top: 1.5em; }

.author-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-top: 56px;
  padding: 28px;
  background: var(--bg-alt);
  border-radius: var(--radius-tile);
}

.author-card img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-card h2 {
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.author-card p { font-size: 0.97rem; }

.author-links {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

.author-links a { color: var(--text); font-weight: 600; }
.author-links a:hover { text-decoration: underline; }

.disclaimer {
  margin-top: 24px;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.related { padding: 88px 0 0; }
.related h2 { margin-bottom: 36px; font-size: clamp(1.8rem, 3.4vw, 2.4rem); }

/* ---------- Home page "From the Blog" ---------- */
.home-blog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 48px;
}

.home-blog-head .section-head { margin-bottom: 0; }
.home-blog-head .link-arrow { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-card-link { padding: 28px 24px 24px; }
  .blog-hero { padding-top: 48px; }
  .post { padding-top: 32px; }
  .related { padding-top: 64px; }
  .home-blog-head { flex-direction: column; align-items: flex-start; margin-bottom: 36px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .prose { font-size: 1.04rem; }
  .quick-answer { padding: 20px 20px; }
  .toc { padding: 18px 20px; }
  .author-card { flex-direction: column; padding: 24px; }
  .post-byline { align-items: flex-start; }
}

/* ---------- Post cards with a photo (posts that set an image) ---------- */
.post-card-link:has(.post-card-img) { padding: 0 0 28px; overflow: hidden; }
.post-card-img { display: block; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 24px 24px 0 0; background: var(--bg-alt); }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-link:has(.post-card-img) .post-cat,
.post-card-link:has(.post-card-img) h2,
.post-card-link:has(.post-card-img) h3,
.post-card-link:has(.post-card-img) p,
.post-card-link:has(.post-card-img) .post-meta { padding-left: 30px; padding-right: 30px; }
.post-card-link:has(.post-card-img) .post-cat { margin-top: 22px; }
