/* ==========================================================================
   Component: article-card  →  snippets/article-card.liquid + assets/component-article-card.css
   Figma 1352-3443 (The Journal): a 327px blog post card, 393 tall at that width.
     media  327×224 (the product card's white → #f3f3f3 radial behind the photo), photo
            cover-cropped under an optional tint; tag (Label/S on white, 0.5px #e2e2e2 stroke)
            12px in from the top-left corner
     body   16px below, 12px padding: title (Heading/H4) → 12px → excerpt (Body/M, two lines)
            → 32px → "4 Min. Read" | "READ MORE ↗"
   Hovering the card underlines "READ MORE" (Figma draws the first card hovered) and eases the
   photo in a little.
   Settings — on .article-card__media
     --overlay        tint over the photo (any background value), e.g. rgba(0, 0, 0, 0.2)
     --focal-x / --focal-y / --zoom   cover crop (the hero model)
   ========================================================================== */
.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  color: var(--color-text-primary);
}

.article-card__media {
  position: relative;
  display: block;
  aspect-ratio: 327 / 224;
  overflow: hidden;
  background: radial-gradient(53.31% 53.31% at 50% 46.69%, #ffffff 0%, #f3f3f3 100%);
}

.article-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
  transition: transform 700ms var(--ease-out);
}

.article-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay, none);
  pointer-events: none;
}

/* Label/S on white; Figma's 0.5px stroke drawn as an inset shadow so it stays half a pixel */
.article-card__tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  width: var(--width-whole-px); /* Figma rounds the hug-width tag up to whole pixels */
  padding: 4px;
  border-radius: 2px;
  background: var(--color-white);
  box-shadow: inset 0 0 0 0.5px var(--color-border-tertiary);
  color: var(--color-text-secondary);
  font-size: var(--text-label-s-size);
  font-weight: 500;
  line-height: 1;
  pointer-events: none;
}

.article-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: 12px;
}

.article-card__text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Heading/H4 on Figma's 29px box */
.article-card__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  line-height: 29px;
}

/* The whole card is the title link's hit area */
.article-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

/* Body/M; Figma rounds each 19.6px line to 20 */
.article-card__excerpt {
  color: var(--color-text-secondary);
  font-size: var(--text-body-m-size);
  font-weight: 400;
  line-height: 20px;
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-card__read-time {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-body-s-size);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.article-card__read-time .icon {
  color: var(--color-icon-tertiary);
}

/* Tertiary button look with Figma's 2px gap; its 1px underline slot is given back below. It is a
   label, not a second link: the title's link already covers the card. */
.article-card__link {
  --button-gap: 2px;
  margin-bottom: -1px;
}

@media (hover: hover) {
  .article-card:hover .article-card__link {
    border-bottom-color: currentColor;
  }

  .article-card:hover .article-card__media img {
    transform: scale(calc(var(--zoom, 1) * 1.04));
  }
}

.article-card:focus-within .article-card__link {
  border-bottom-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
  .article-card__media img {
    transition: none;
  }
}
