/* ============================================
   AI Workforce — Sticky Stack Cards
   Layout: text LEFT + image RIGHT (flex row)
   Stack vertically only on mobile ≤767px
   ============================================ */

.ai-workforce {
  --aw-container-pad: clamp(16px, 4vw, 40px);
  /* Keep full CMS sticky offset so cards clear the fixed header (do not cap with vh) */
  --aw-sticky-top: max(120px, var(--aw-sticky-offset, 150px));
  width: 100%;
  max-width: 100%;
  background-color: var(--aw-section-bg, #ffffff);
  color: var(--aw-heading-color, #000000);
  box-sizing: border-box;
}

.ai-workforce *,
.ai-workforce *::before,
.ai-workforce *::after {
  box-sizing: border-box;
}

/* ---------- Container ---------- */


/* ---------- Header ---------- */
.ai-workforce__header {
  text-align: center;
}

.ai-workforce__label {
  margin: 0 0 16px;
  color: var(--aw-label-color, #FF624F);
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 600;
  line-height: 1.4;
}

.ai-workforce__heading {
  margin: 20px auto;
  color: var(--aw-heading-color, #000000);
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 700;
  line-height: 1.35;
  max-width: 900px;
}

.ai-workforce__description {
  margin: 0 auto 28px;
  max-width: 850px;
  color: var(--aw-description-color, #000000);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 400;
  line-height: 1.65;
  opacity: 0.7;
}

.ai-workforce__description p {
  margin: 0 0 0.75em;
}

.ai-workforce__description p:last-child {
  margin-bottom: 0;
}

/* ---------- Process flow ---------- */
.ai-workforce__process {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin: 0 0 50px;
  padding: 0;
  color: var(--aw-step-color, #000000);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 600;
  line-height: 1.5;
}

.ai-workforce__process-step {
  white-space: normal;
  text-align: center;
}

.ai-workforce__process-step.is-highlighted {
  background: linear-gradient(90deg, #19D3F3 1.35%, #3567FF 42.51%, #FF624F 105.74%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.ai-workforce__process-arrow {
  flex-shrink: 0;
  margin: 0 2px;
  color: var(--aw-step-color, #000000);
}

/* ---------- Sticky stack ---------- */
.ai-workforce__stack {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.ai-workforce__card {
  --aw-index: 0;
  position: sticky;
  width: 100%;
  max-width: 100%;
  margin-bottom: 28px;
  z-index: calc(var(--aw-index) + 1);
  top: calc(var(--aw-sticky-top) + (var(--aw-index) * var(--aw-stack-gap, 14px)));
}

.ai-workforce__card:last-child {
  margin-bottom: 0;
}

.ai-workforce__card:nth-child(1) { --aw-index: 0; }
.ai-workforce__card:nth-child(2) { --aw-index: 1; }
.ai-workforce__card:nth-child(3) { --aw-index: 2; }
.ai-workforce__card:nth-child(4) { --aw-index: 3; }
.ai-workforce__card:nth-child(5) { --aw-index: 4; }
.ai-workforce__card:nth-child(6) { --aw-index: 5; }
.ai-workforce__card:nth-child(7) { --aw-index: 6; }
.ai-workforce__card:nth-child(8) { --aw-index: 7; }
.ai-workforce__card:nth-child(9) { --aw-index: 8; }
.ai-workforce__card:nth-child(10) { --aw-index: 9; }
.ai-workforce__card:nth-child(11) { --aw-index: 10; }
.ai-workforce__card:nth-child(12) { --aw-index: 11; }

/* ---------- Card: flex row = text LEFT | image RIGHT ---------- */
.ai-workforce .ai-workforce__card-inner,
.ai-workforce__card-inner {
  --aw-card-max-height: min(
    640px,
    calc(
      100dvh
      - var(--aw-sticky-top)
      - (var(--aw-index) * var(--aw-stack-gap, 14px))
      - 24px
    )
  );
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2.5vw, 28px);
  width: 100%;
  min-height: 0;
  height: auto;
  max-height: var(--aw-card-max-height);
  padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 40px);
  border-radius: 10px 15px 15px 15px;
  border: 0.8px solid rgba(187, 187, 187, 0.50);
  background: linear-gradient(175deg, #FFF 3.67%, #F4EEFF 96.33%);
  transition: box-shadow 280ms ease, transform 280ms ease;
  overflow: hidden;
}

/* ---------- Card text (LEFT) ---------- */
.ai-workforce .ai-workforce__card-content,
.ai-workforce__card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0;
  width: auto;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.ai-workforce__card-title {
  flex-shrink: 0;
  margin: 0 0 16px;
  color: var(--aw-card-title, #000000);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.ai-workforce__card-number {
  font-weight: 700;
}

.ai-workforce__card-subtitle {
  flex-shrink: 0;
  margin: 0 0 12px;
  color: var(--aw-card-title, #000000);
  font-size: clamp(14px, 1.5vw, 16px);
  font-weight: 700;
  line-height: 1.4;
}

.ai-workforce__card-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--aw-card-text, #000000);
  font-size: clamp(13px, 1.35vw, 15px);
  font-weight: 400;
  line-height: 1.7;
  -webkit-overflow-scrolling: touch;
}

.ai-workforce__card-body p {
  margin: 0 0 0.75em;
}

.ai-workforce__card-body p:last-child {
  margin-bottom: 0;
}

.ai-workforce__card-body::after {
  content: "";
  display: table;
  clear: both;
}

.ai-workforce__card-body img,
.ai-workforce__card-body .hs-image-widget {
  float: none !important;
  display: block !important;
  margin: 12px 0 !important;
  max-width: 100% !important;
  height: auto !important;
}

/* ---------- Illustration (RIGHT) ---------- */
.ai-workforce .ai-workforce__card-media,
.ai-workforce__card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  width: auto;
  max-width: min(48%, 420px);
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: clamp(8px, 1.5vw, 16px);
  overflow: hidden;
}

.ai-workforce__card-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: min(100%, calc(var(--aw-card-max-height) - 48px));
  object-fit: contain;
  object-position: center;
}

.ai-workforce__card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 280px;
  height: auto;
  max-height: 100%;
}

.ai-workforce__card-placeholder svg {
  width: 100%;
  height: auto;
  max-height: 100%;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ai-workforce__card {
    position: relative;
    top: auto !important;
    margin-bottom: 0;
  }

  .ai-workforce__stack {
    gap: 24px;
  }

  .ai-workforce__card-inner {
    height: auto !important;
    max-height: none !important;
    transition: none;
  }

  .ai-workforce__card-body {
    overflow: visible;
  }
}

/* ---------- Laptop / ≤1399px ---------- */
@media (max-width: 1399px) {
  .ai-workforce__heading {
    max-width: 800px;
  }

  .ai-workforce__card-inner {
    gap: 24px;
  }
}

/* ---------- iPad / ≤1024px — keep row, tighter ---------- */
@media (max-width: 1024px) {
  .ai-workforce {
    --aw-sticky-top: max(100px, var(--aw-sticky-offset, 150px));
  }

  .ai-workforce__process {
    margin-bottom: 36px;
  }

  .ai-workforce__card {
    top: calc(var(--aw-sticky-top) + (var(--aw-index) * 10px));
    margin-bottom: 22px;
  }

  .ai-workforce .ai-workforce__card-inner,
  .ai-workforce__card-inner {
    --aw-card-max-height: min(
      560px,
      calc(
        100dvh
        - var(--aw-sticky-top)
        - (var(--aw-index) * 10px)
        - 20px
      )
    );
    gap: 16px;
    height: auto;
    max-height: var(--aw-card-max-height);
    padding: 22px 24px;
  }

  .ai-workforce .ai-workforce__card-media,
  .ai-workforce__card-media {
    max-width: min(46%, 360px);
    padding: 0;
  }

  .ai-workforce__card-title {
    margin: 0 0 12px;
  }

  .ai-workforce__card-subtitle {
    margin: 0 0 10px;
  }

  .ai-workforce__card-body {
    line-height: 1.6;
  }
}

/* ---------- Tablet / ≤991px — still row ---------- */
@media (max-width: 991.92px) {
  .ai-workforce__card-inner {
    gap: 14px;
    padding: 18px 20px;
  }

  .ai-workforce .ai-workforce__card-media,
  .ai-workforce__card-media {
    max-width: min(44%, 300px);
  }

  .ai-workforce__card-title {
    margin: 0 0 10px;
  }

  .ai-workforce__card-subtitle {
    margin: 0 0 8px;
  }

  .ai-workforce__card-body {
    line-height: 1.55;
  }
}

/* ---------- Mobile / ≤767px — stack ---------- */
@media (max-width: 767px) {
  .ai-workforce {
    --aw-sticky-top: max(80px, var(--aw-sticky-offset, 150px));
  }

  .ai-workforce__heading {
    margin: 16px auto;
  }

  .ai-workforce__description {
    margin-bottom: 20px;
  }

  .ai-workforce__process {
    flex-direction: column;
    gap: 4px;
    margin-bottom: 32px;
  }

  .ai-workforce__process-arrow {
    transform: rotate(90deg);
    margin: 2px 0;
  }

  .ai-workforce__card {
    top: calc(var(--aw-sticky-top) + (var(--aw-index, 0) * 10px));
    margin-bottom: 20px;
  }

  .ai-workforce .ai-workforce__card-inner,
  .ai-workforce__card-inner {
    --aw-card-max-height: min(
      720px,
      calc(
        100dvh
        - var(--aw-sticky-top)
        - (var(--aw-index, 0) * 10px)
        - 16px
      )
    );
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    height: auto;
    max-height: var(--aw-card-max-height);
    padding: 18px 16px;
  }

  .ai-workforce .ai-workforce__card-content,
  .ai-workforce__card-content {
    order: 2;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
  }

  .ai-workforce .ai-workforce__card-media,
  .ai-workforce__card-media {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    min-height: 120px;
    max-height: min(220px, 38%);
    padding: 0;
  }

  .ai-workforce__card-image {
    max-height: min(220px, 100%);
  }

  .ai-workforce__card-title {
    margin: 0 0 10px;
  }

  .ai-workforce__card-subtitle {
    margin: 0 0 8px;
  }

  .ai-workforce__card-body {
    line-height: 1.55;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .ai-workforce__card-inner {
    padding: 16px 14px;
  }

  .ai-workforce .ai-workforce__card-media,
  .ai-workforce__card-media {
    min-height: 100px;
    max-height: 180px;
  }

  .ai-workforce__card-image {
    max-height: 180px;
  }
}

/* Fallback when dvh is unsupported */
@supports not (height: 100dvh) {
  .ai-workforce__card-inner {
    --aw-card-max-height: min(
      640px,
      calc(
        100svh
        - var(--aw-sticky-top)
        - (var(--aw-index) * var(--aw-stack-gap, 14px))
        - 24px
      )
    );
  }

  @media (max-width: 1024px) {
    .ai-workforce__card-inner {
      --aw-card-max-height: min(
        560px,
        calc(
          100svh
          - var(--aw-sticky-top)
          - (var(--aw-index) * 10px)
          - 20px
        )
      );
    }
  }

  @media (max-width: 767px) {
    .ai-workforce__card-inner {
      --aw-card-max-height: min(
        720px,
        calc(
          100svh
          - var(--aw-sticky-top)
          - (var(--aw-index, 0) * 10px)
          - 16px
        )
      );
    }
  }
}

@supports not (height: 100svh) {
  .ai-workforce__card-inner {
    --aw-card-max-height: min(
      640px,
      calc(
        100vh
        - var(--aw-sticky-top)
        - (var(--aw-index) * var(--aw-stack-gap, 14px))
        - 24px
      )
    );
  }
}
