/* Shared news card primitives (namespace: nx-).
   Used by the news index grid (templates/news/list.html) and by the
   related-news block on service pages (templates/_snippets/related_news.html).
   Page-specific nx- rules (head, filter, hero, feature, side list) stay inline
   in templates/news/index.html. */
:root {
  --nx-radius: 16px;
  --nx-radius-sm: 12px;
  --nx-gap: 20px;
  --nx-shadow: 0 1px 2px rgba(43, 52, 63, 0.04), 0 8px 24px rgba(43, 52, 63, 0.06);
  --nx-shadow-hover: 0 12px 28px rgba(43, 52, 63, 0.14);
}

/* Shared chip & "read more" */
.nx-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 130%;
  letter-spacing: 0.01em;
  color: var(--primaryColor);
  background-color: rgba(255, 95, 47, 0.1);
  border-radius: 999px;
  white-space: nowrap;
}
.nx-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 14px;
  font-weight: 500;
  color: var(--primaryColor);
  transition: gap 0.2s ease;
}
.nx-more svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.nx-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nx-date {
  font-size: 12px;
  color: var(--greyColor-2L);
}

/* Cards grid (list.html) */
.nx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--nx-gap);
}
@media screen and (min-width: 560px) {
  .nx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media screen and (min-width: 1024px) {
  .nx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Each "show more" page appends a new grid — keep spacing between them */
.nx-grid + .nx-grid { margin-top: var(--nx-gap); }
.nx-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--accentColor);
  border: 1px solid var(--accentColor-2D);
  border-radius: var(--nx-radius);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.nx-card:hover {
  border-color: transparent;
  box-shadow: var(--nx-shadow-hover);
  transform: translateY(-4px);
}
.nx-card:hover .nx-card__img { transform: scale(1.05); }
.nx-card:hover .nx-card__title { color: var(--primaryColor); }
.nx-card:hover .nx-more svg { transform: translateX(4px); }
.nx-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--accentColor-1D);
}
.nx-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.nx-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  padding: 20px;
}
.nx-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 17px;
  line-height: 132%;
  transition: color 0.2s ease;
}
.nx-card__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--greyColor-1L);
  font-size: 14px;
  line-height: 150%;
}

/* Dark theme (BVI) */
.bvi-body[data-bvi-theme='black'] .nx-card {
  background-color: var(--secondaryColor);
  border-color: var(--secondaryColor);
}
.bvi-body[data-bvi-theme='black'] .nx-card__excerpt,
.bvi-body[data-bvi-theme='black'] .nx-date {
  color: var(--greyColor-3L);
}
.bvi-body[data-bvi-theme='black'] .nx-card__media {
  background-color: var(--accentColor-1DD);
}
