/* ==========================================================================
   Devgun Family Law -- Block: Blog card grid
   Figma: 03-ajay-profile.png "Featured Blog" (7146:1076) -- the only
   designed blog-card reference. Card anatomy read off the frame:
   image on top (3:2 at 442px card width), flat tinted panel below
   (pixel-sampled #EEF4F5 = --color-blue-lightest), date (Body-2), H5
   title, Body-2 excerpt; all card text pixel-samples #2E4C51
   (--color-blue-dark, 8.3:1 on the panel -- passes AA normal text).
   Grid per build spec Section 6: "Blog 3-up at lg+" with 30px desktop
   gaps (--space-gap), 2-up at md, 1-up stacked below (generic card rule).
   Flat card, --radius-card, no shadow (build spec 5.2); whole card is one
   link -- hover/focus = subtle lift + tint shift like team-cards.
   Raw ramp tokens (--color-blue-lightest, --color-blue-dark,
   --color-green-lighter) are used where no semantic alias exists, same
   precedent as blocks/team-cards.css -- no raw hex.
   Loaded by templates/App/Includes/BlogCards.ss (self-contained include;
   PersonPage "Featured Blog" reuses it in a later wave). Because this file
   is also loaded standalone on PersonPage (where page/blog.css's .blog-pill
   may not be present), the .blog-card__category chip below is fully
   self-contained rather than depending on page/blog.css.
   ========================================================================== */

.blog-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-gap); /* 30px at desktop per build spec Section 6 */
  max-width: 28rem; /* keep 1-up cards near the designed 442px width */
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 768px) {
  .blog-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: none;
  }
}

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

/* ------------------------------------------------------------------ *
 * Card -- the whole card is ONE link to the post. Resets the
 * foundation link typography (bold/tracked Links style) back to card
 * text; hover/focus-visible = lift + panel tint shift (build spec 5.2
 * card states); focus ring comes from the foundation :focus-visible
 * standard, with the card radius re-asserted so the ring hugs the
 * rounded corners.
 * ------------------------------------------------------------------ */

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-card);
  background-color: var(--color-blue-lightest); /* panel fill sampled off 03-ajay-profile.png */
  color: var(--color-blue-dark);                /* card text sampled off 03-ajay-profile.png */
  font-weight: var(--fw-regular);
  font-size: var(--fs-body2);
  line-height: var(--lh-body2);
  letter-spacing: 0;
  transition: background-color 150ms ease, transform 150ms ease;
}

.blog-card:hover,
.blog-card:focus-visible {
  text-decoration: none;
  background-color: var(--color-bg-card-tint);
  transform: translateY(-4px);
}

.blog-card:focus-visible {
  border-radius: var(--radius-card);
}

.blog-card__media {
  width: 100%;
  aspect-ratio: 3 / 2;
}

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

/* Empty state: brand icon on a tinted panel (CMS-safe placeholder,
   same pattern as team-cards). */
.blog-card__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-green-lighter);
}

.blog-card__placeholder-icon {
  width: 40%;
  height: auto;
}

.blog-card__panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

/* Category chip -- non-link (the whole card is already an anchor, so this
   is a <span>, never a nested <a>). Shares the .blog-pill class from
   page/blog.css for markup consistency, but blog-cards.css is ALSO loaded
   on PersonPage, where page/blog.css (the .blog-pill source) may not be
   present -- so every property the chip needs is restated here,
   self-contained, sourced from the same tokens as .blog-pill
   (page/blog.css) rather than duplicated raw values. */
.blog-card__category {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg-card-tint);
  color: var(--color-blue-dark);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body2);
  line-height: var(--lh-body2);
  letter-spacing: 0;
}

.blog-card__date {
  font-size: var(--fs-body2);
  line-height: var(--lh-body2);
  letter-spacing: 0;
}

.blog-card__title {
  margin: 0;
  color: var(--color-blue-dark); /* design reads Dark Blue, not the default heading green */
}

.blog-card__excerpt {
  font-size: var(--fs-body2);
  line-height: 1.4;
  letter-spacing: 0;
}

/* $Summary is CMS HTMLText -- normalise any pasted <p> to card type. */
.blog-card__excerpt p {
  margin: 0 0 0.5rem;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.blog-card__excerpt p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .blog-card {
    transition: none;
  }
}
