/* ==========================================================================
   Texvian IT — CASE STUDY CARD + FILTER CHIPS (shared component)
   Used by Home 02 and the Case Studies pages. Driven by
   modules/case-studies-filter.js (data-nx-case-* attributes).
   ========================================================================== */

.nx-tc-case-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--nx-space-2);
  margin-bottom: var(--nx-space-8);
}

.nx-tc-case-filters .nx-tag {
  padding: var(--nx-space-2) var(--nx-space-4);
  font-size: var(--nx-fs-sm);
  border: 1px solid var(--nx-border-color);
  cursor: pointer;
}

/* Scoped to :not(.is-active) so this never fights the base .nx-tag.is-active
   rule in components/badges.css (same specificity fix already applied on
   Home 01 — see home.css for the full explanation). */
.nx-tc-case-filters .nx-tag:not(.is-active) {
  background: var(--nx-surface);
}

.nx-tc-case-card {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border-color);
  border-radius: var(--nx-radius-lg);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: var(--nx-transition-base), transform var(--nx-duration-base) var(--nx-ease-emphasized);
}

.nx-tc-case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--nx-shadow-md);
  border-color: var(--nx-border-color-strong);
}

.nx-tc-case-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.nx-tc-case-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nx-duration-slower) var(--nx-ease-emphasized);
}

.nx-tc-case-card:hover .nx-tc-case-card__media img {
  transform: scale(1.06);
}

.nx-tc-case-card__category {
  position: absolute;
  top: var(--nx-space-3);
  left: var(--nx-space-3);
}

.nx-tc-case-card__body {
  padding: var(--nx-space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.nx-tc-case-card__title {
  font-size: var(--nx-fs-lg);
  margin-bottom: var(--nx-space-2);
}

.nx-tc-case-card__text {
  font-size: var(--nx-fs-sm);
  color: var(--nx-text-secondary);
  margin-bottom: var(--nx-space-4);
}

.nx-tc-case-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--nx-space-2);
  margin-bottom: var(--nx-space-4);
}

.nx-tc-case-card__tags .nx-tag {
  font-size: 0.7rem;
  padding: 4px var(--nx-space-3);
}

.nx-tc-case-card__link {
  margin-top: auto;
}

/* The filter module (case-studies-filter.js) toggles `.is-hidden` on the
   grid-column wrapper (`[data-nx-case-item]`) — this selector must match
   that wrapper or nothing is actually hidden. */
[data-nx-case-item].is-hidden {
  display: none;
}

.nx-tc-case-empty {
  display: none;
  text-align: center;
  padding-block: var(--nx-space-9);
  color: var(--nx-text-secondary);
}

.nx-tc-case-empty.is-visible {
  display: block;
}