/* ==========================================================================
   Blog — public listing and post pages
   Mobile-first; tokens come from styles.css.
   ========================================================================== */

.blog-wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.blog-wrap--narrow { width: min(760px, calc(100% - 40px)); }

/* ------------------------------------------------------------------ hero */
.blog-hero { padding: 56px 0 28px; }
.blog-hero__title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  margin: 10px 0 12px;
  color: var(--color-ink, #171a17);
}
.blog-hero__sub {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-muted, #77766f);
  max-width: 46ch;
  margin: 0;
}

/* --------------------------------------------------------------- listing */
.blog-list-section { padding: 12px 0 72px; }

.blog-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
}

.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-line, #efece3);
  border-radius: 14px;
  background: var(--color-card, #fffdf8);
  overflow: hidden;
}

.blog-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #efece3; }
.blog-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-thumb--placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #efece3, #e3ded1);
}

.blog-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }

.blog-card__title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0;
}
.blog-card__title a { color: var(--color-ink, #171a17); text-decoration: none; }
.blog-card__title a:hover { text-decoration: underline; }

.blog-card__excerpt { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--color-muted, #77766f); }
.blog-card__meta { font-size: 0.8rem; color: #9b9a92; }
.blog-card__more { margin-top: auto; font-size: 0.88rem; font-weight: 650; color: var(--color-sage-ink, #47766e); text-decoration: none; }
.blog-card__more:hover { text-decoration: underline; }

.blog-empty { color: var(--color-muted, #77766f); padding: 40px 0; }

.blog-pagination { margin-top: 42px; }

/* ------------------------------------------------------------------ post */
.blog-post { padding: 34px 0 64px; }

.blog-crumbs { margin-bottom: 22px; }
.blog-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; font-size: 0.82rem; }
.blog-crumbs li + li::before { content: '›'; margin-right: 8px; color: #b6b3a8; }
.blog-crumbs a { color: var(--color-muted, #77766f); text-decoration: none; }
.blog-crumbs a:hover { text-decoration: underline; }
.blog-crumbs [aria-current] { color: #9b9a92; }

.blog-post__title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.14;
  margin: 0 0 14px;
  color: var(--color-ink, #171a17);
}

.blog-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.83rem;
  color: #9b9a92;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-line, #efece3);
}
.blog-post__reading { color: var(--color-sage-ink, #47766e); font-weight: 600; }

.blog-post__lede {
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--color-muted, #77766f);
  margin: 20px 0 0;
}

.blog-post__figure { margin: 28px 0 0; }
.blog-post__figure img { width: 100%; height: auto; border-radius: 14px; display: block; }
.blog-post__figure figcaption { margin-top: 10px; font-size: 0.8rem; color: #9b9a92; }

/* ---------------------------------------------------- table of contents */
.blog-toc {
  margin: 32px 0 0;
  padding: 20px 22px;
  border: 1px solid var(--color-line, #efece3);
  border-radius: 12px;
  background: var(--color-paper-soft, #f6f4ed);
}
.blog-toc__title { font-size: 0.72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--color-sage-ink, #47766e); margin: 0 0 12px; }
.blog-toc__list { margin: 0; padding-left: 1.15rem; display: flex; flex-direction: column; gap: 7px; }
.blog-toc__item--h3 { margin-left: 1rem; list-style-type: circle; }
.blog-toc__list a { color: var(--color-ink, #171a17); text-decoration: none; font-size: 0.92rem; }
.blog-toc__list a:hover { text-decoration: underline; }

/* ------------------------------------------------------- post body copy */
.blog-content {
  margin-top: 34px;
  font-size: 1.03rem;
  line-height: 1.78;
  color: #2c2f2c;
}

.blog-content > * + * { margin-top: 1.15em; }

.blog-content h2,
.blog-content h3,
.blog-content h4 {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  color: var(--color-ink, #171a17);
  line-height: 1.25;
  /* Offset so an anchored heading is not hidden under the sticky navbar. */
  scroll-margin-top: 90px;
}
.blog-content h2 { font-size: 1.7rem; margin-top: 2em; }
.blog-content h3 { font-size: 1.32rem; margin-top: 1.7em; }
.blog-content h4 { font-size: 1.1rem; margin-top: 1.5em; }

.blog-content a { color: var(--color-sage-ink, #47766e); }

.blog-content ul,
.blog-content ol { padding-left: 1.4rem; }
.blog-content li + li { margin-top: 0.45em; }

.blog-content blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--color-sage-ink, #47766e);
  color: var(--color-muted, #77766f);
  font-style: italic;
}

.blog-content img { max-width: 100%; height: auto; border-radius: 10px; display: block; }

.blog-content hr { border: 0; border-top: 1px solid var(--color-line, #efece3); margin: 2.2em 0; }

.blog-content pre {
  background: #171a17;
  color: #f6f4ed;
  padding: 16px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.86rem;
}
.blog-content code { font-size: 0.9em; }

/* Wide tables scroll inside their own box rather than the page. */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.93rem;
}
.blog-content th,
.blog-content td { border: 1px solid var(--color-line, #efece3); padding: 9px 12px; text-align: left; }
.blog-content th { background: var(--color-paper-soft, #f6f4ed); font-weight: 700; }

/* Embeds keep their aspect ratio on every width. */
.blog-content iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 10px;
}

/* ----------------------------------------------------------------- share */
.blog-share {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid var(--color-line, #efece3);
  font-size: 0.88rem;
}
.blog-share__label { font-weight: 700; color: var(--color-ink, #171a17); }
.blog-share a { color: var(--color-sage-ink, #47766e); text-decoration: none; }
.blog-share a:hover { text-decoration: underline; }

/* ----------------------------------------------------------- more posts */
.blog-more { padding: 20px 0 80px; background: var(--color-paper-soft, #f6f4ed); }
.blog-more__title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 1.6rem;
  margin: 44px 0 24px;
  color: var(--color-ink, #171a17);
}

/* --------------------------------------------------------- preview bar */
.blog-preview-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: #fdf0e6;
  border-bottom: 1px solid #f0d9c4;
  color: #a45f22;
  font-size: 0.86rem;
}
.blog-preview-bar a { color: #a45f22; font-weight: 700; margin-left: auto; }

@media (min-width: 700px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
}
