/* Additive only — does not modify assets/css/main.css or home.min.css.
   The homepage loads only the trimmed home.min.css bundle, which predates
   the blog feature and has no .blog-grid/.blog-card rules at all (the
   global 8px grid-gap override in home.min.css already targets .blog-grid
   by selector, it just had no base rule to apply to). Other pages load the
   full main.min.css, which already defines these — the declarations below
   are then simply redundant (identical values, last one wins, no visual
   change). Either way this file is safe to include everywhere.

   Base rules copied verbatim from assets/css/main.css (lines 2197-2213). */
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.blog-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--ease), box-shadow var(--ease);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
/* .blog-card__img is an <a> tag — anchors are inline by default, and
   aspect-ratio has no effect on inline boxes, so it must be block-level
   for the 16:10 crop to actually apply. Without this the image renders at
   its unconstrained intrinsic height and pushes the card body out of the
   card's own (overflow:hidden) box, hiding the category/title/excerpt/date. */
.blog-card__img { display: block; aspect-ratio: 16/10; overflow: hidden; }
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--ease-slow); }
.blog-card:hover .blog-card__img img { transform: scale(1.05); }
.blog-card__body { padding: var(--sp-md); display: flex; flex-direction: column; flex: 1; }
.blog-card__meta { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: 0.75rem; }
.blog-card__meta .label { margin: 0; }
.blog-card h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--text-heading); line-height: 1.4; }
.blog-card p  { font-size: 0.875rem; color: var(--text-body); margin-bottom: 0.875rem; flex: 1; }
.blog-card__readmore {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-mid);
  margin-top: auto;
}
.blog-card__readmore svg { width: 14px; height: 14px; transition: transform var(--ease); }
.blog-card:hover .blog-card__readmore svg { transform: translateX(3px); }

/* New: explicit tablet 2-column step (the original only had a single
   768px breakpoint collapsing 3 columns straight to 1). Required for
   the Latest Insights / blog listing sections introduced in this Astro
   migration. */
@media (max-width: 1024px) and (min-width: 769px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── BLOG LIST (the /blog/ index and its pagination pages) ──────────
   A single card container holding one row per article: date block,
   thumbnail, and title/excerpt/link — used only on the blog listing
   pages. The homepage "Latest Insights" grid above is untouched and
   keeps using .blog-grid / .blog-card. */
.blog-list {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.blog-list-item {
  display: grid;
  grid-template-columns: 72px 200px 1fr;
  gap: var(--sp-md);
  align-items: center;
  padding: var(--sp-md) var(--sp-lg);
  text-decoration: none;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--ease);
}
.blog-list-item:last-child { border-bottom: none; }
.blog-list-item:hover { background: var(--bg-light); }

.blog-list-item__date {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.blog-list-item__month {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--purple-mid);
  margin-bottom: 0.35rem;
}
.blog-list-item__day {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-heading, var(--navy));
}

.blog-list-item__img {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.blog-list-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Placeholder thumbnail — used until a dedicated featured image exists
   for a post. Draws a soft brand-gradient tile with a simple image glyph
   instead of linking a generic stock/AI image. */
.blog-list-item__img--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(91,82,203,0.14), rgba(174,165,254,0.22));
}
.blog-list-item__img--placeholder svg {
  width: 34%;
  height: 34%;
  color: var(--purple-mid);
  opacity: 0.55;
}

.blog-list-item__body h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
  color: var(--text-heading, var(--navy));
  line-height: 1.4;
}
.blog-list-item__meta {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.blog-list-item__meta .label { margin: 0; }
.blog-list-item__body p {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 0.6rem;
  line-height: 1.6;
}
.blog-list-item__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-mid);
}
.blog-list-item__link svg { width: 14px; height: 14px; transition: transform var(--ease); }
.blog-list-item:hover .blog-list-item__link svg { transform: translateX(3px); }

.blog-list-footer {
  display: flex;
  justify-content: center;
  padding: var(--sp-md) var(--sp-lg);
}

@media (max-width: 768px) {
  .blog-list-item {
    grid-template-columns: 1fr;
    grid-template-areas:
      "date"
      "img"
      "body";
    row-gap: 0.75rem;
  }
  .blog-list-item__date { grid-area: date; flex-direction: row; align-items: baseline; gap: 0.4rem; }
  .blog-list-item__img { grid-area: img; aspect-ratio: 16/9; }
  .blog-list-item__body { grid-area: body; }
  .blog-list-item__meta {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0.3rem;
  }
  .blog-list-item__meta .label {
    white-space: nowrap;
  }
  .blog-list-item__meta > span:not(.label) {
    display: none;
  }
}

/* ── SINGLE BLOG POST: hero-media/TOC split, content/sidebar split ── */
.blog-post-top-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-lg);
  align-items: stretch;
}
.blog-post-top-grid__media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}
.blog-post-toc {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  height: 100%;
  box-sizing: border-box;
}
.blog-post-toc strong {
  display: block;
  margin-bottom: 0.85rem;
  font-family: var(--font-head);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--text-heading, var(--navy));
}
.blog-post-toc ul { margin: 0; padding-left: 1.1rem; }
.blog-post-toc li { margin-bottom: 0.55rem; font-size: 0.88rem; line-height: 1.4; }
.blog-post-toc li:last-child { margin-bottom: 0; }
.blog-post-toc a { color: var(--text-body); font-weight: 500; }
.blog-post-toc a:hover { color: var(--purple-mid); }

.blog-post-content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--sp-lg);
  align-items: start;
}

.blog-post-sidebar {
  position: sticky;
  top: 130px;
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: var(--sp-lg) var(--sp-md);
  color: rgba(255, 255, 255, 0.85);
}
.blog-post-sidebar h3 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: var(--sp-md);
}
.blog-post-sidebar-post {
  display: flex;
  gap: 0.75rem;
  padding-bottom: var(--sp-sm);
  margin-bottom: var(--sp-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
}
.blog-post-sidebar-post:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.blog-post-sidebar-post__img {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}
.blog-post-sidebar-post__img img { width: 100%; height: 100%; object-fit: cover; }
.blog-post-sidebar-post__body .label {
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 0;
  margin: 0 0 0.3rem;
}
.blog-post-sidebar-post h4 {
  font-size: 0.85rem;
  color: var(--white);
  line-height: 1.35;
  margin: 0;
  font-weight: 400;
}
.blog-post-sidebar-post:hover h4 { color: var(--purple); }
.blog-post-sidebar__cta {
  margin-top: var(--sp-md);
  padding-top: var(--sp-md);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.blog-post-sidebar__cta p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .blog-post-top-grid,
  .blog-post-content-grid {
    grid-template-columns: 1fr;
  }
  .blog-post-sidebar { position: static; }
}

@media (max-width: 600px) {
  .blog-post-sidebar-post {
    flex-direction: column;
  }
  .blog-post-sidebar-post__img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}
