/* ==========================================================================
   Talent Development Pipeline (.nx-tp)

   Self-contained stage list that replaced the nxd talent-development SVG.
   Tokens only from nx-tokens.css. No absolute labels, no chart libs.

   State is carried by exactly two signals: the status text inside the card
   and the card border (solid = active, dashed = planned). Nothing else in
   here may encode state.
   ========================================================================== */

.nx-tp {
  --nx-tp-card-bg: var(--nx-navy);
  --nx-tp-card-radius: var(--nx-radius-sm);
  --nx-tp-gap: var(--nx-space-3);
  --nx-tp-conn: 1.25rem;
  --nx-tp-card-pad: var(--nx-space-4);
  box-sizing: border-box;
  /* The component is dropped into columns of very different widths (a wide
     homepage plate, a narrow figure on the capacity building page), so the
     stage layout keys off its own width rather than the viewport. */
  container: nx-tp / inline-size;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: var(--nx-space-4);
  color: var(--nx-text);
}

.nx-tp *,
.nx-tp *::before,
.nx-tp *::after {
  box-sizing: border-box;
}

.nx-tp--flush {
  padding: var(--nx-space-3);
}

.nx-viz > .nx-tp--flush,
.nx-ip-figure > .nx-tp--flush,
.nx-figure > .nx-tp--flush {
  padding: var(--nx-space-4);
}

/* Fills a stretched plate; stays content-sized when the parent has no
   definite height (the capacity-building page figure). */
.nx-viz > .nx-tp,
.nx-ip-figure > .nx-tp,
.nx-figure > .nx-tp {
  width: 100%;
  max-width: 100%;
  min-height: 100%;
  overflow: visible;
}

.nx-tp__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nx-tp__stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--nx-tp-gap);
  width: 100%;
  min-width: 0;
  flex: 0 1 auto;
}

.nx-tp__stage {
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
  flex: 1 1 calc(50% - var(--nx-tp-gap));
}

/* Every card runs the same four rows: number / title / description / status.
   The description row takes the slack, so the status line sits on one
   baseline across all five cards no matter how long the description is. */
.nx-tp__card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: var(--nx-space-2);
  flex: 1 1 auto;
  min-width: 0;
  min-height: 100%;
  width: 100%;
  padding: var(--nx-tp-card-pad);
  border-radius: var(--nx-tp-card-radius);
  background: var(--nx-tp-card-bg);
}

.nx-tp__stage--active .nx-tp__card {
  border: 1px solid var(--nx-status-active);
}

.nx-tp__stage--planned .nx-tp__card {
  border: 1px dashed var(--nx-status-hold);
}

.nx-tp__num {
  font-family: var(--nx-font);
  font-size: var(--nx-fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--nx-tracking-eyebrow);
  text-transform: uppercase;
  color: var(--nx-text-muted);
  line-height: 1.3;
  white-space: nowrap;
}

.nx-tp__stage--planned .nx-tp__num {
  color: var(--nx-text-muted);
}

/* Titles are single words and must never break or clip. */
.nx-tp__title {
  margin: 0;
  font-family: var(--nx-font);
  font-size: var(--nx-fs-body);
  font-weight: 500;
  letter-spacing: var(--nx-tracking-heading);
  line-height: 1.25;
  color: var(--nx-text);
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.nx-tp__stage--planned .nx-tp__title {
  color: var(--nx-text-body);
}

.nx-tp__detail {
  margin: 0;
  font-family: var(--nx-font);
  font-size: var(--nx-fs-caption);
  line-height: 1.5;
  color: var(--nx-text-body);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.nx-tp__stage--planned .nx-tp__detail {
  color: var(--nx-text-muted);
}

/* "Active" / "Planned" only. Kept short so the label never wraps. */
.nx-tp__status {
  margin: 0;
  align-self: end;
  font-family: var(--nx-font);
  font-size: var(--nx-fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--nx-tracking-eyebrow);
  text-transform: uppercase;
  line-height: 1.3;
  color: var(--nx-status-active);
  white-space: nowrap;
}

.nx-tp__stage--planned .nx-tp__status {
  color: var(--nx-status-hold);
}

/* Connectors sit in the column gap on a lower stacking level than the
   cards, so they can never cross card content. */
.nx-tp__connector {
  display: none;
  z-index: 0;
  flex: 0 0 var(--nx-tp-conn);
  width: var(--nx-tp-conn);
  align-self: center;
  height: 0;
  border: 0;
  border-top-width: 1px;
  border-top-style: solid;
  border-top-color: var(--nx-status-active);
  margin: 0;
  background: transparent;
  pointer-events: none;
}

.nx-tp__connector--dashed {
  border-top-style: dashed;
  border-top-color: var(--nx-status-hold);
}

.nx-tp__caption {
  margin: var(--nx-space-4) 0 0;
  font-family: var(--nx-font);
  font-size: var(--nx-fs-caption);
  line-height: var(--nx-lh-body);
  color: var(--nx-text-muted);
  max-width: 42rem;
}

/* ------------------------------------------------------------ wide plate
   Five equal-width columns. Card height is content-driven and every card
   stretches to the tallest. 40rem is the narrowest container that still
   leaves the longest title ("Mentorship", 87px) room inside a card. */
@container nx-tp (min-width: 40rem) {
  .nx-tp {
    --nx-tp-card-pad: var(--nx-space-3);
  }

  .nx-tp__stages {
    --nx-tp-conn: clamp(0.75rem, 2cqi, 1.25rem);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--nx-tp-conn);
    align-items: stretch;
  }

  .nx-tp__stage {
    display: block;
    flex: none;
    min-width: 0;
  }

  .nx-tp__card {
    height: 100%;
  }

  /* Runs in the column gap, one level below the cards. */
  .nx-tp__connector {
    display: block;
    position: absolute;
    top: 50%;
    left: 100%;
    width: var(--nx-tp-conn);
    margin: 0;
    transform: translateY(-50%);
  }
}

/* --------------------------------------------------------- narrow plate
   Wrap into a fluid grid; no connectors, no horizontal scroll. */
@container nx-tp (min-width: 36rem) and (max-width: 39.999rem) {
  .nx-tp__stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: var(--nx-space-3);
  }

  .nx-tp__stage {
    display: block;
    flex: none;
  }

  .nx-tp__connector {
    display: none;
  }

  .nx-tp__card {
    height: 100%;
  }
}

/* -------------------------------------------------------- stacked plate
   Vertical list. A left-side rule replaces the connectors, solid alongside
   active stages and dashed alongside planned ones. */
@container nx-tp (max-width: 35.999rem) {
  .nx-tp__stages {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
  }

  .nx-tp__stage {
    display: block;
    flex: none;
    width: 100%;
    padding: 0 0 var(--nx-space-3) var(--nx-space-4);
  }

  .nx-tp__stage:last-child {
    padding-bottom: 0;
  }

  .nx-tp__stage::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px solid var(--nx-status-active);
  }

  .nx-tp__stage:last-child::before {
    bottom: 50%;
  }

  .nx-tp__stage--planned::before {
    border-left-style: dashed;
    border-left-color: var(--nx-status-hold);
  }

  .nx-tp__connector {
    display: none;
  }

  .nx-tp__card {
    grid-template-rows: auto auto auto auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nx-tp,
  .nx-tp * {
    animation: none !important;
    transition: none !important;
  }
}
