/* card - shared primitive, themed by the active language's tokens.

   Radius rule for this system, stated so it stays consistent: containers use
   --nx-radius-card, interactive elements use --nx-radius-pill. Nothing mixes. */

.nx-card {
  display: flex;
  flex-direction: column;
  background: var(--nx-bg);
  border: var(--nx-hairline) solid var(--nx-grid);
  border-radius: var(--nx-radius-card);
  padding: 22px 22px 18px;
  font-family: var(--nx-font-sans);
  color: var(--nx-ink);
}

/* Inverted. Present because the source collection inverts roughly a fifth of
   its cards, and that contrast is part of the language rather than a theme. */
.nx-card--invert {
  background: var(--nx-ink);
  border-color: var(--nx-ink);
  color: var(--nx-bg);
}

.nx-card--invert .nx-card__sub {
  color: var(--nx-muted);
}

.nx-card--invert .nx-card__caption {
  color: var(--nx-onDarkFaint, var(--nx-muted));
}

/* Borderless, for grids that separate by space rather than by line. */
.nx-card--plain {
  border-color: transparent;
}

/* Card anatomy, in the order DESIGN.md fixes: title, sub, body, caption. */
.nx-card__title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nx-card__sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--nx-muted);
}

.nx-card__body {
  margin-top: 14px;
}

.nx-card__caption {
  margin-top: 12px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nx-faint);
}

/* Interactive cards get a hairline that firms up. No shadow, no lift: this
   language has no elevation model. */
.nx-card--link {
  text-decoration: none;
  transition: border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.nx-card--link:hover {
  border-color: var(--nx-muted);
}

.nx-card--link:focus-visible {
  outline: var(--nx-hairline) solid var(--nx-ink);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .nx-card--link {
    transition: none;
  }
}
