/* =============================================================================
   Blog card — docs/components/card.md § Blog Post Card, badge.md, motion.md
   A card with a 16:9 cover image, category pills, title, excerpt and a meta row.
   The whole card is one anchor (.blog-card-link), so the lift and the focus ring
   are driven from the link, not from the article.
   ============================================================================= */

.blog-card-link {
  display: block;
  height: 100%;
  color: inherit;
  border-radius: var(--border-radius-lg);
}

/* The global :focus-visible ring (globals.css) supplies colour and offset; the
   radius here keeps it wrapped around the rounded card. */
.blog-card-link:focus-visible {
  border-radius: var(--border-radius-lg);
}

.blog-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--duration-moderate) var(--ease-standard),
    box-shadow var(--duration-moderate) var(--ease-standard);
  will-change: transform;
}

/* Only the link lifts the card — a .blog-card outside .blog-card-link is not
   clickable and stays still (motion.md § Hover only on clickable surfaces). */
.blog-card-link:hover .blog-card,
.blog-card-link:focus-visible .blog-card {
  transform: var(--lift-lg);
  box-shadow: var(--shadow-card-hover);
}

/* ---------------------------------------------------------------------------
   Cover
   --------------------------------------------------------------------------- */
.blog-card__image {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    135deg,
    var(--color-primary-light) 0%,
    var(--color-division-card-bg) 100%
  );
}

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

/* ---------------------------------------------------------------------------
   Body
   --------------------------------------------------------------------------- */
.blog-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: var(--card-padding);
}

/* Badge-shaped, per badge.md (8×16, pill radius, 14px/700/uppercase). It is a
   sibling of the .badge component, not an instance of it — package 3.1 owns
   .badge itself. EdTech contrast rule: dark text on the light teal accent.
   Also used by the article headers inside .blog-post__tags. */
.blog-card__category {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--border-radius-pill);
  background-color: var(--color-accent);
  color: var(--color-primary-darkest);
  font-size: 0.875rem;
  line-height: 1rem;
  font-weight: 700;
  text-transform: uppercase;
}

.blog-card__title {
  font-size: 1.5rem;
  line-height: 130%;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

.blog-card__excerpt {
  font-size: 0.9375rem;
  line-height: 160%;
  font-weight: 500;
  color: var(--color-text-gray);
  margin-bottom: 0;
}

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: auto;
  padding-top: var(--space-4);
  font-size: 0.875rem;
  line-height: 160%;
  font-weight: 500;
  color: var(--color-mid-gray);
}

/* ---------------------------------------------------------------------------
   Responsive typography — .h4 / .body-medium / .body-small per breakpoint.
   Padding needs no query: --card-padding is responsive in css/variables.css.
   --------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .blog-card__title {
    font-size: 1.375rem;
  }

  .blog-card__excerpt {
    font-size: 0.875rem;
  }

  .blog-card__meta,
  .blog-card__category {
    font-size: 0.8125rem;
  }
}

@media (max-width: 600px) {
  .blog-card__title {
    font-size: 1.125rem;
  }

  .blog-card__excerpt {
    font-size: 0.8125rem;
  }

  .blog-card__meta,
  .blog-card__category {
    font-size: 0.875rem;
  }

  .blog-card__category {
    padding: var(--space-1) var(--space-3);
  }
}
