/* Shared feedback for linked content cards. Never apply to prose, tables or forms. */
main :is(article.card, .nj-focus-card, .nj-featured-card, .nj-about-card, .nj-certificate-card):has(a[href]),
main a:is(.nj-home-news-card, .nj-language-card)[href] {
  --nj-card-border: #dce5ee;
  border-color: var(--nj-card-border);
  box-shadow: none;
  transform: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

/* Touch devices keep a stable card; feedback never hides content. */
@media (hover: hover) and (pointer: fine) {
  main :is(article.card, .nj-focus-card, .nj-featured-card, .nj-about-card, .nj-certificate-card):has(a[href]):hover,
  main a:is(.nj-home-news-card, .nj-language-card)[href]:hover {
    border-color: #95152f;
    box-shadow: 0 6px 20px rgb(19 46 80 / 8%);
  }
}

/* Keyboard users receive the same card feedback plus a clear link outline. */
main :is(article.card, .nj-focus-card, .nj-featured-card, .nj-about-card, .nj-certificate-card):has(a[href]:focus-visible),
main a:is(.nj-home-news-card, .nj-language-card)[href]:focus-visible {
  border-color: #95152f;
  box-shadow: 0 6px 20px rgb(19 46 80 / 8%);
}
main :is(article.card, .nj-focus-card, .nj-featured-card, .nj-about-card, .nj-certificate-card) a[href]:focus-visible,
main a:is(.nj-home-news-card, .nj-language-card)[href]:focus-visible {
  outline: 3px solid #95152f;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  main :is(article.card, .nj-focus-card, .nj-featured-card, .nj-about-card, .nj-certificate-card):has(a[href]),
  main a:is(.nj-home-news-card, .nj-language-card)[href] {
    transition: none;
  }
}
