/* =========================================================================
   HIRING COST DEMO (#hiringCostDemo).
   See src/components/HiringCostDemo.astro for the storyboard.
   Timeline: public/js/hiring-cost-demo.js toggles `is-*` classes and
   positions `.hcd__cursor` at runtime.

   A single steady scene, no crossfade — a requisition table (flex rows)
   with a push-open detail row beneath the opened total, same push-open
   language as QuotaReconcileDemo's .qrdDetail / RosterLoadDemo's
   .rldDetail. Same --xxx-canvas/card/border/accent palette (product
   likeness) as every other demo on the site.
   ========================================================================= */

.hcd {
  --hcd-canvas: #FAF9F5;
  --hcd-card: #FFFFFF;
  --hcd-border: #DBDBDE;
  --hcd-line: #EAEAEA;
  --hcd-head: #F6F6F7;
  --hcd-ink: #2B2B2B;
  --hcd-ink2: #777777;
  --hcd-accent: #6A5BC6;
  --hcd-accent-soft: #ECECFF;
}

.hcd__stage {
  position: relative; overflow: hidden; width: 100%;
  aspect-ratio: 3 / 2; min-height: 380px; max-width: 640px; margin: 0 auto;
  background: var(--hcd-canvas);
  display: flex; flex-direction: column;
  transition: opacity .5s ease;
}
.hcd.is-out .hcd__stage { opacity: 0; }

.hcd__topBar {
  flex: none; font-size: 11px; font-weight: 600; color: var(--hcd-ink);
  padding: 12px 14px 9px; border-bottom: 1px solid var(--hcd-line);
  white-space: nowrap;
}

.hcd__pane { flex: 1; min-height: 0; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; }

.hcdHead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.hcdHead__title { font-size: 12px; font-weight: 600; color: var(--hcd-ink); }
.hcdHead__sub { font-size: 9.5px; color: var(--hcd-ink2); }

.hcdTable { background: var(--hcd-card); border: 1px solid var(--hcd-border); border-radius: 8px; overflow: hidden; }
.hcdRow {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 9px; font-size: 9px; color: var(--hcd-ink2);
  border-bottom: 1px solid var(--hcd-line);
  transition: background .3s ease;
}
.hcdTable > .hcdRow:last-of-type { border-bottom: none; }
.hcdRow--head { background: var(--hcd-head); font-weight: 500; border-bottom: 1px solid var(--hcd-border); }
.hcdRow__role { flex: 1; min-width: 0; font-weight: 600; color: var(--hcd-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcdRow--head .hcdRow__role { font-weight: 500; color: var(--hcd-ink2); }
.hcdRow__status { flex: none; width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcdRow__start { flex: none; width: 46px; }
.hcdRow__total { flex: none; width: 48px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--hcd-ink); }
.hcdRow--head .hcdRow__total { font-weight: 500; color: var(--hcd-ink2); }

.hcd.is-press-se [data-el="row-se"] { background: var(--hcd-accent-soft); }
.hcd.is-drilled [data-el="total-se"] { color: var(--hcd-accent); }

/* ---------- the cost breakdown + monthly split, pushed open beneath
   the row. ---------- */
.hcdDetail {
  max-height: 0; overflow: hidden;
  padding: 0 12px; background: var(--hcd-accent-soft);
  transition: max-height .45s ease, padding .45s ease;
}
.hcd.is-drilled .hcdDetail { max-height: 150px; padding: 8px 12px 10px; }
.hcdDetail__row { display: flex; align-items: center; justify-content: space-between; font-size: 8.5px; color: var(--hcd-ink2); padding: 2px 0; }
.hcdDetail__row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--hcd-ink); }
.hcdDetail__row--total { margin-top: 3px; padding-top: 5px; border-top: 1px solid #CFC7EF; }
.hcdDetail__row--total span { font-weight: 700; color: var(--hcd-accent); font-size: 9.5px; }
.hcdDetail__split {
  margin-top: 6px; padding-top: 6px; border-top: 1px dashed #CFC7EF;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 8px; color: var(--hcd-ink2);
}
.hcdDetail__split span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--hcd-ink); }

.hcd__cursor {
  position: absolute; opacity: 0; pointer-events: none; z-index: 9;
  transition: left .6s cubic-bezier(.5, .05, .3, 1), top .6s cubic-bezier(.5, .05, .3, 1), opacity .3s ease;
}
.hcd.is-cursor-visible .hcd__cursor { opacity: 1; }

@media (max-width: 460px) {
  .hcd__stage { aspect-ratio: auto; min-height: 440px; }
  .hcdRow__status { width: 48px; }
  .hcdRow__start { width: 36px; }
  .hcdRow { padding: 6px 6px; font-size: 8px; }
}
