/* ─── Engagement home (Cut 1) ─────────────────────────────────────────── *
 * Lives at /specs. Reuses the .title-row / .cluster / .gauge / .livery
 * vocabulary from style.css; only adds two new selectors:
 *   .engagement-grid   4-col workstream grid (auto-fit, min 240px)
 *   .engagement-card   280px-wide variant of .atoms-kind-tile
 * Extracted into its own file to avoid merge churn against atoms.css.
 */

.engagement-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0 14px;
  flex-wrap: wrap;
}
.engagement-blurb {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-body);
  max-width: 56ch;
  margin: 0;
}
.engagement-quick {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.engagement-link {
  color: var(--ink-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 100ms linear, color 100ms linear;
}
.engagement-link:hover {
  border-bottom-color: var(--livery-lime);
  color: var(--livery-lime);
}
.engagement-link.muted {
  color: var(--ink-mute);
}
.engagement-link.muted:hover {
  color: var(--ink-body);
  border-bottom-color: var(--ink-mute);
}

/* CLEAN-1081 BPH v7 — Grid layout for uniform card sizing.
 * Previous flex-wrap variant let intrinsic content width override the
 * flex-basis: with `flex: 0 0 calc(25% - 1px)` cards rendered at
 * 367 / 370 / 348 px in the same row because the in-card stats line
 * ("STP 10 GROUPS 2585 STEPS 22571 FINDINGS") exceeded the 25 % basis.
 * CSS Grid gives deterministic equal-width columns; align-items
 * defaults to `stretch` so cards in the same row also match heights
 * without the prior min-height hack. */
.engagement-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin-top: 12px;
}
@media (max-width: 899px) {
  .engagement-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .engagement-grid { grid-template-columns: 1fr; }
}

.engagement-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg-panel);
  padding: 18px 20px;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--ink-body);
  transition: background 100ms linear, border-left-color 100ms linear, color 100ms linear;
}
.engagement-card:hover {
  background: rgba(150, 193, 33, 0.04);
  border-left-color: var(--livery-lime);
  color: var(--ink-primary);
}
.engagement-card-link {
  /* deprecated wrapper class — kept for backward compat with any
   * pre-v7 templates that still nest <a class="engagement-card-link"> */
  display: contents;
  text-decoration: none;
  color: inherit;
}

.engagement-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.engagement-card-code {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--ink-primary);
}
.engagement-card-counts {
  display: inline-flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-body);
}
.engagement-card-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}
.ec-stat-lbl {
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  margin-left: 4px;
  text-transform: uppercase;
}

.engagement-legend {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin: 8px 0 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}

.engagement-card-bd {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-body);
}
.engagement-card-pulse-lbl {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.engagement-card-pulse-lbl.muted {
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: none;
}
.engagement-card-pulse {
  font-family: var(--font-sans);
  color: var(--ink-body);
  font-size: 12px;
  line-height: 1.45;
}

/* CLEAN-1081 BPH — expandable L2 ProcessGroup list under each
   workstream card. Sits below the .engagement-card-link header. */
.engagement-card-groups {
  border-top: 1px solid var(--rule);
  padding: 6px 20px 12px;
}
.engagement-card-groups-summary {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
}
.engagement-card-groups-summary::-webkit-details-marker { display: none; }
.engagement-card-groups-summary::before {
  content: "▸ ";
  color: var(--ink-mute);
  display: inline-block;
  width: 1em;
  transition: transform 100ms linear;
}
.engagement-card-groups[open] .engagement-card-groups-summary::before {
  content: "▾ ";
}
.engagement-card-groups-summary:hover { color: var(--ink-primary); }

.engagement-card-groups-list {
  list-style: none;
  margin: 6px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.engagement-card-group {
  background: rgba(255, 255, 255, 0.02);
}
.engagement-card-group--cross {
  /* Tech-Enhancement groups are cross-cutting — render with a softer tone
     so business-process groups dominate the visual scan. */
  opacity: 0.78;
}
.engagement-card-group-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  text-decoration: none;
  color: var(--ink-body);
  font-size: 12px;
  line-height: 1.35;
  transition: background 80ms linear, color 80ms linear;
}
.engagement-card-group-link:hover {
  background: rgba(150, 193, 33, 0.08);
  color: var(--ink-primary);
}
.engagement-card-group-name {
  flex: 1 1 auto;
  font-family: var(--font-sans);
  font-weight: 500;
}
.engagement-card-group-counts {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--ink-mute);
  white-space: nowrap;
}

.engagement-foot {
  margin-top: 18px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
}
.engagement-foot .muted {
  color: var(--ink-mute);
}

@media (max-width: 768px) {
  .engagement-intro {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
}

/* ─── BPH v5/v6 row-level styles for workstream and group pages ───────
 * Used by:
 *   - workstream_groups.html (intermediate page: ProcessGroups in a workstream)
 *   - process_group.html (deepest: ProcessNodes in a group + Findings Mix)
 * Replaces the prior reuse of `.atoms-process-row` which used a
 * 1fr-auto-auto grid that collapsed the link cell to min-content width
 * when content was multi-token, stacking text vertically. */

.bph-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bph-group-row {
  display: block;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-panel);
  transition: background 100ms linear, box-shadow 100ms linear;
}
.bph-group-row:hover {
  background: rgba(150, 193, 33, 0.04);
  box-shadow: inset 2px 0 0 var(--livery-lime);
}
.bph-group-row:last-child { border-bottom: none; }

.bph-group-row-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 8px 14px;
  text-decoration: none;
  color: inherit;
}
.bph-group-row-link:hover { color: var(--ink-primary); }

.bph-group-name {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-primary);
}
.bph-group-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-mute);
  margin-left: 0.5rem;
  letter-spacing: 0;
}
.bph-group-counts {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--ink-body);
  white-space: nowrap;
}
.bph-group-counts .readout {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-primary);
}
.bph-group-desc {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-body);
}

/* Findings Mix chips on process_group.html — inline pills with lime
   left-rail and tabular-num count. */
.bph-findings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 4px 0 10px;
}
.bph-finding-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  background: var(--bg-panel);
  border-left: 2px solid var(--livery-lime);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.bph-finding-chip-label {
  color: var(--ink-body);
}
.bph-finding-chip-count {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--ink-primary);
}

/* ─── Findings rollup matrix (ProcessGroup × Classification) ───────── */
.findings-matrix-wrap {
  margin-top: 12px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--bg-panel);
}
.findings-matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
}
.findings-matrix th,
.findings-matrix td {
  padding: 8px 10px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.findings-matrix thead th {
  background: var(--bg-deep, var(--bg-panel));
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  white-space: nowrap;
}
.findings-matrix-rowhd {
  text-align: left;
  white-space: nowrap;
  min-width: 260px;
}
.findings-matrix-grouplink {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: inherit;
}
.findings-matrix-grouplink:hover .bph-group-name {
  color: var(--ink-primary);
}
.findings-matrix-cell {
  text-align: center;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.findings-matrix-cell a {
  color: var(--ink-primary);
  text-decoration: none;
  display: inline-block;
  min-width: 2.2em;
  padding: 2px 4px;
}
.findings-matrix-cell a:hover {
  background: rgba(150, 193, 33, 0.08);
}
.findings-matrix-empty {
  color: var(--ink-mute);
}
.findings-matrix-unclassified {
  background: rgba(230, 200, 120, 0.06);
}
.findings-matrix-row-total,
.findings-matrix-col-total,
.findings-matrix-grand {
  font-weight: 700;
  color: var(--ink-primary);
  background: rgba(150, 193, 33, 0.05);
}
.findings-matrix-totals td {
  background: rgba(0, 0, 0, 0.04);
  border-top: 2px solid var(--rule);
}
.findings-matrix-row:hover {
  background: rgba(150, 193, 33, 0.03);
}
.findings-matrix-row--cross {
  background: rgba(230, 200, 120, 0.04);
}
