/* ─── Post card + card grid ───────────────────────────────────────────────────
   template-parts/card-news.php — the one post card of the site (homepage blog
   section, blog listings, related posts), so posts look identical
   everywhere. Loaded on the front page (blog section) and on blog views.
   Built from the design's plan/pillar cards: white surface, line border,
   22px radius, ink arrow disc that turns signal on hover.
   ────────────────────────────────────────────────────────────────────────── */

/* ─── Grid ─── */
.posts-grid {
  display: grid;
  gap: 22px;

  @media (min-width: 640px) {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* ─── Post card ─── */
.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;

  &:hover {
    transform: translateY(-6px);
    box-shadow: 0 30px 50px -30px color-mix(in srgb, var(--text-color) 35%, transparent);
  }

  &:hover .news-card__arrow {
    background: var(--signal);
    color: var(--ink);
    transform: rotate(-45deg);
  }
}

.news-card__media {
  aspect-ratio: 16 / 10;

  > a:not(.news-card__tag) {
    display: block;
    height: 100%;
  }
}

.news-card__tag {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  background: color-mix(in srgb, var(--text-color) 82%, transparent);
  backdrop-filter: blur(6px);
  color: var(--on-dark);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;

  &:hover {
    background: var(--signal);
    color: var(--ink);
  }
}

.news-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 22px 20px;
}

.news-card__eyebrow {
  margin-bottom: 12px;
}

.news-card__title {
  font-size: 1.3rem;
  line-height: 1.12;

  a {
    text-decoration: none;

    &::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: 1;
    }
  }
}

.news-card__tag,
.news-card__eyebrow {
  position: relative;
  z-index: 2;
}

.news-card__tag {
  position: absolute;
}

.news-card__excerpt {
  margin-top: 10px;
  font-size: 0.93rem;
  color: var(--muted);
}

.news-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.news-card__arrow {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--on-dark);
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}

/* ─── Featured (lead card of a listing's first page) ─── */
.news-card--featured {
  margin-bottom: 22px;

  .news-card__title {
    font-size: clamp(1.6rem, 3.4vw, 2.5rem);
    font-stretch: 112%;
    line-height: 1.05;
    letter-spacing: -0.02em;
  }

  .news-card__excerpt {
    font-size: 1rem;
    margin-top: 14px;
  }

  .news-card__body {
    padding: 26px 22px 22px;
  }

  @media (min-width: 768px) {
    flex-direction: row;

    .news-card__media {
      flex: 0 0 56%;
      aspect-ratio: auto;
      min-height: 360px;
    }

    .news-card__body {
      justify-content: center;
      padding: 40px 36px 32px;
    }

    .news-card__meta {
      margin-top: 28px;
    }
  }

  @media (min-width: 1200px) {
    .news-card__body {
      padding: 50px 48px 40px;
    }
  }

  /* No photo: a wide text card with a signal accent edge. */
  &:not(:has(.news-card__media)) {
    border-left: 4px solid var(--signal);

    @media (min-width: 768px) {
      .news-card__body {
        max-width: 820px;
      }
    }
  }
}
