/* Blog list (home.php / archive.php) and single post (single.php).
   Shared nav/footer/section chrome lives in shared/components.css. */

/* Single content width for every section of the single post. */
:root { --blog-detail-width: 960px; }

/* ---- Post grid ---- */
.blog-grid-section {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(64px,8vw,96px) var(--gutter-x) clamp(96px,12vw,140px);
}
.blog-grid-head {
  max-width: 1440px;
  margin: 0 auto clamp(36px,4.5vw,52px);
}
.blog-grid-title {
  margin: 0;
  font-family: 'Geist', sans-serif;
  font-weight: 250;
  font-size: clamp(28px,3vw,38px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text-charcoal);
}
.blog-grid-lead {
  max-width: 640px;
  margin: 14px 0 0;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.blog-grid {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(32px,4vw,48px) clamp(24px,3vw,40px);
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--surface-card-border);
  border-radius: 20px;
  overflow: hidden;
  color: inherit;
  transition: box-shadow 200ms ease, transform 200ms ease;
}
.blog-card:hover {
  color: inherit;
  box-shadow: var(--shadow-md);
}
.blog-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--surface-bg-alt);
}
.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms ease;
}
.blog-card:hover .blog-card-image img {
  transform: scale(1.04);
}
.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: clamp(20px,2.4vw,28px);
}
.blog-card-title {
  margin: 0 0 10px;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-charcoal);
}
.blog-card-excerpt {
  margin: 0 0 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.blog-card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-primary);
}
.blog-empty { text-align: center; color: var(--text-secondary); }

/* ---- Pagination ---- */
.blog-pagination { max-width: 1440px; margin: clamp(40px,5vw,64px) auto 0; }
.blog-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.blog-pagination .page-numbers {
  padding: 8px 14px;
  border: 1px solid var(--surface-card-border);
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-charcoal);
}
.blog-pagination .page-numbers.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---- Shared meta row (category · date · read time) ---- */
.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: var(--text-secondary);
}
.blog-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green-leaf);
  flex-shrink: 0;
}
.blog-meta-tag {
  font-weight: 600;
  color: var(--color-primary);
}

/* ---- Detail: header ---- */
.blog-article-hero {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(56px,8vw,96px) var(--gutter-x) clamp(36px,4.5vw,52px);
}
.blog-article-head {
  max-width: var(--blog-detail-width);
  margin: 0 auto;
}
.blog-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
}
.blog-article-title {
  margin: 0 0 20px;
  font-family: 'Geist', sans-serif;
  font-weight: 250;
  font-size: clamp(34px,4.8vw,54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text-charcoal);
}
.blog-article-lede {
  margin: 0 0 24px;
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ---- Detail: cover image ---- */
.blog-article-cover {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0 var(--gutter-x);
}
.blog-article-cover img {
  display: block;
  width: 100%;
  max-width: var(--blog-detail-width);
  margin: 0 auto;
  aspect-ratio: 21/9;
  object-fit: cover;
  border-radius: 20px;
}

/* ---- Detail: body ---- */
.blog-article {
  box-sizing: border-box;
  max-width: calc(var(--blog-detail-width) + 2 * var(--gutter-x));
  margin: 0 auto;
  padding: clamp(48px,6vw,72px) var(--gutter-x) clamp(72px,9vw,112px);
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-charcoal);
}
.blog-article p { margin: 0 0 22px; }
.blog-article h2 {
  margin: 44px 0 16px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: clamp(22px,2.4vw,28px);
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.blog-article h3 {
  margin: 32px 0 12px;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: clamp(19px,2vw,23px);
  line-height: 1.3;
}
.blog-article h4 { margin: 24px 0 10px; font-family: 'Geist', sans-serif; font-weight: 500; font-size: 18px; }
.blog-article ul,
.blog-article ol {
  margin: 0 0 22px;
  padding-left: 22px;
}
.blog-article li { margin-bottom: 8px; }
.blog-article li::marker { color: var(--green-leaf); }
.blog-article a { text-decoration: underline; text-underline-offset: 2px; }
.blog-article img,
.blog-article video,
.blog-article iframe { max-width: 100%; height: auto; border-radius: 12px; }
.blog-article blockquote {
  margin: 36px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--green-leaf);
  font-family: 'Geist', sans-serif;
  font-weight: 300;
  font-size: clamp(20px,2.2vw,24px);
  line-height: 1.45;
  color: var(--color-primary);
}
.blog-article blockquote h1,
.blog-article blockquote h2,
.blog-article blockquote h3 { margin: 0; font: inherit; }
.blog-article table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
  margin: 0 0 22px;
}
.blog-article th,
.blog-article td { border: 1px solid var(--surface-card-border); padding: 10px 12px; text-align: left; }
.blog-article th { background: var(--surface-bg-alt); }
.blog-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--surface-card-border);
}
.blog-article-tags a {
  font-size: 13px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--surface-bg-alt);
  padding: 4px 10px;
  border-radius: 999px;
}

/* ---- Detail: related posts ---- */
.blog-related { background: var(--surface-section-alt); }
.blog-related .blog-grid-head,
.blog-related .blog-grid {
  max-width: var(--blog-detail-width);
}
.blog-related .blog-grid-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-article { font-size: 16px; }
  .blog-article-cover img { aspect-ratio: 16/10; }
}
