/* ==========================================================================
   Blog index page (/blog.html) — small hero banner, two-column layout:
   paginated post feed (left) + blog sidebar (right). Solid canvas, no gradients.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Small hero banner — solid canvas-soft, centered, offset below fixed header
   -------------------------------------------------------------------------- */

.bp-banner {
  padding: calc(var(--space-huge) * 2) var(--space-huge) var(--space-huge);
  background-color: var(--c-canvas-soft);
  border-bottom: 1px solid var(--c-hairline);
}

.bp-banner__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  max-width: 56em;
  margin: 0 auto;
  text-align: center;
}

/* Breadcrumb trail — code-sm */
.bp-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-code);
  font-size: 15px;      /* code-sm */
  font-weight: 400;
  line-height: 1.45;
  color: var(--c-text-muted);
}

/* Separator between crumbs */
.bp-breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-sm);
}

.bp-breadcrumb a {
  color: var(--c-text-secondary);
  text-decoration: none;
}

.bp-breadcrumb a:hover,
.bp-breadcrumb a:focus-visible {
  color: var(--c-text-primary);
}

.bp-breadcrumb [aria-current="page"] {
  color: var(--c-accent-strong);
}

/* Page title — display-xxl */
.bp-banner__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 48px;      /* display-xxl */
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -1.2px;
  color: var(--c-text-primary);
}

/* Subtitle — body-lg */
.bp-banner__subtitle {
  margin: 0;
  max-width: 36em;
  font-family: var(--font-body);
  font-size: 18px;      /* body-lg */
  font-weight: 360;
  line-height: 1.55;
  color: var(--c-text-secondary);
}

/* --------------------------------------------------------------------------
   Two-column layout — feed 2fr, sidebar 1fr
   -------------------------------------------------------------------------- */

.bp-main {
  padding: var(--space-huge);
  background-color: var(--c-canvas);
}

.bp-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  gap: var(--space-huge);
  max-width: 72em;
  margin: 0 auto;
}

/* Feed column: list + pagination */
.bp-feed-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxl);
  scroll-margin-top: calc(var(--space-huge) + var(--space-sm));
}

/* Sidebar sticks below fixed header on desktop */
.bp-layout > .blog-sidebar {
  position: sticky;
  top: calc(var(--space-huge) + var(--space-xxl));
}

/* Active filter status line — soft card surface with clear link */
.blog-filter-status {
  margin: 0;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: 16px;      /* body-md */
  font-weight: 360;
  line-height: 1.5;
  color: var(--c-text-secondary);
  background-color: var(--c-canvas-soft);
  border: 1px solid var(--c-hairline);
  border-left: var(--space-xs) solid var(--c-accent);
  border-radius: var(--rounded-sm);
}

.blog-filter-status a {
  color: var(--c-accent-strong);
  text-underline-offset: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Feed items — thumbnail left, text right, hairline separators
   -------------------------------------------------------------------------- */

.blog-feed {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blog-feed > li + li {
  border-top: 1px solid var(--c-hairline);
}

.blog-feed > li {
  padding: var(--space-xl) 0;
}

.blog-feed > li:first-child {
  padding-top: 0;
}

/* Paginated-out items stay hidden despite display rules */
.blog-feed > li[hidden] {
  display: none;
}

/* Page-change fade — reuses pagination keyframes from projects-preview.css */
.blog-feed.is-paging > li:not([hidden]) {
  animation: project-card-in 0.25s ease-out;
}

.blog-post {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
  gap: var(--space-xl);
}

/* Thumbnail frame — fixed 4:3 crop, static asset */
.blog-post__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: var(--c-canvas-soft);
  border: 1px solid var(--c-hairline);
  border-radius: var(--rounded-lg);
}

.blog-post__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-post__thumb:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: var(--space-xxs);
}

.blog-post__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-md);
}

/* Meta row: date · category */
.blog-post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;      /* body-sm */
  font-weight: 360;
  line-height: 1.45;
  color: var(--c-text-muted);
}

/* Dot separator */
.blog-post__meta span + span::before {
  content: "·";
  margin-right: var(--space-sm);
}

/* Category label — code-sm accent */
.blog-post__category {
  font-family: var(--font-code);
  font-size: 15px;      /* code-sm */
  color: var(--c-accent-strong);
}

/* Category link → blog.html?category= */
.blog-post__category a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: var(--space-xs);
}

.blog-post__category a:hover,
.blog-post__category a:focus-visible {
  text-decoration: underline;
}

/* Post title — display-md (heaviest display weight allowed is 400) */
.blog-post__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;      /* display-md */
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.blog-post__title a {
  color: var(--c-text-primary);
  text-decoration: none;
}

.blog-post__title a:hover,
.blog-post__title a:focus-visible {
  color: var(--c-accent-strong);
}

/* Excerpt — body-md */
.blog-post__excerpt {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;      /* body-md */
  font-weight: 360;
  line-height: 1.5;
  color: var(--c-text-secondary);
}

/* Global CTA spacing inside feed item */
.blog-post__body .cta-button {
  margin-top: var(--space-xs);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

/* Large tablet: sidebar drops below feed, tighter padding */
@media (max-width: 1024px) {
  .bp-banner {
    padding: calc(var(--space-huge) * 2) var(--space-xxl) var(--space-huge);
  }

  .bp-banner__title {
    font-size: 36px;    /* display-xl */
    line-height: 1.15;
    letter-spacing: -0.8px;
  }

  .bp-main {
    padding: var(--space-huge) var(--space-xxl);
  }

  .bp-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-huge);
  }

  .bp-layout > .blog-sidebar {
    position: static;
  }
}

/* Small tablet: header offset, feed items stack thumbnail over text */
@media (max-width: 768px) {
  .bp-banner {
    padding-top: calc(var(--space-huge) * 2 + var(--space-xxl));
  }

  .bp-feed-col {
    scroll-margin-top: calc(var(--space-huge) * 2);
  }

  .blog-post {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .blog-post__thumb {
    aspect-ratio: 16 / 9;
  }
}

/* Mobile: single column, smaller type and spacing */
@media (max-width: 480px) {
  .bp-banner {
    padding: calc(var(--space-huge) * 2 + var(--space-lg)) var(--space-lg) var(--space-xxl);
  }

  .bp-banner__title {
    font-size: 22px;    /* display-md */
    line-height: 1.25;
    letter-spacing: -0.3px;
  }

  .bp-banner__subtitle {
    font-size: 16px;    /* body-md */
    line-height: 1.5;
  }

  /* Extra bottom space keeps sidebar clear of Back to Top icon */
  .bp-main {
    padding: var(--space-xxl) var(--space-lg) calc(var(--space-huge) + var(--space-lg));
  }

  .bp-layout {
    gap: var(--space-xxl);
  }

  .bp-feed-col {
    gap: var(--space-xl);
  }

  .blog-feed > li {
    padding: var(--space-lg) 0;
  }

  .blog-post {
    gap: var(--space-md);
  }

  .blog-post__thumb {
    border-radius: var(--rounded-md);
  }

  /* Title → body-lg, excerpt → body-sm */
  .blog-post__title {
    font-family: var(--font-body);
    font-size: 18px;    /* body-lg */
    font-weight: 360;
    line-height: 1.55;
    letter-spacing: 0;
  }

  .blog-post__excerpt {
    font-size: 14px;    /* body-sm */
    line-height: 1.45;
  }

  .blog-post__body {
    align-items: stretch;
  }
}

/* Reduced motion: no page-change fade */
@media (prefers-reduced-motion: reduce) {
  .blog-feed.is-paging > li:not([hidden]) {
    animation: none;
  }
}
