/**
 * Pattern 3: Visual Process Strip
 * ================================
 *
 * Horizontal process strip with icon stickers, bold labels, connector arrows,
 * and short descriptions. Supports 4-6 configurable steps.
 *
 * Desktop: horizontal flex layout with CSS pseudo-element arrows between steps.
 * Mobile: vertical timeline with left-aligned icons and connecting line.
 *
 * Requirements: 10.1, 10.2, 10.3, 10.4, 26.2
 */

/* =========================================================================
   PROCESS STRIP - Container
   ========================================================================= */

.x-process-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: center;
  gap: var(--x-space-sm);
  padding: var(--x-space-md) 0;
}

/* =========================================================================
   PROCESS STRIP - Step Item
   ========================================================================= */

.x-process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 0 var(--x-space-xs);
}

/* =========================================================================
   PROCESS STRIP - Connector Arrow (CSS pseudo-element)
   ========================================================================= */

/**
 * Arrow connector between steps (appears after every step except the last).
 * Uses a CSS triangle + short line pointing right.
 */
.x-process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 32px; /* Center vertically on the 64px icon */
  right: -12px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 10px solid var(--x-orange-500);
  z-index: 1;
}

/**
 * Connecting line between steps (before the arrow).
 */
.x-process-step:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 31px; /* Align with arrow center */
  left: calc(50% + 36px);
  right: -2px;
  height: 2px;
  background: var(--x-border);
  z-index: 0;
}

/* =========================================================================
   PROCESS STRIP - Step Icon
   ========================================================================= */

.x-process-step .x-icon-sticker {
  margin-bottom: var(--x-space-sm);
  position: relative;
  z-index: 2;
}

/* =========================================================================
   PROCESS STRIP - Step Label
   ========================================================================= */

.x-process-step__label {
  font-family: var(--x-font-heading);
  font-weight: 800;
  font-size: clamp(0.875rem, 1.2vw, 1.125rem);
  line-height: 1.2;
  color: var(--x-teal-900);
  margin: 0 0 0.25rem;
}

/* =========================================================================
   PROCESS STRIP - Step Description
   ========================================================================= */

.x-process-step__desc {
  font-family: var(--x-font-body);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--x-muted);
  margin: 0;
  max-width: 160px;
}

/* =========================================================================
   PROCESS STRIP - Section Heading
   ========================================================================= */

.x-process-strip-heading {
  font-family: var(--x-font-heading);
  font-weight: 800;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  line-height: 1.15;
  color: var(--x-teal-900);
  text-align: center;
  margin: 0 0 var(--x-space-lg);
}

/* =========================================================================
   RESPONSIVE - Tablet (768px - 991px)
   ========================================================================= */

@media (max-width: 991px) {
  .x-process-strip {
    gap: var(--x-space-xs);
  }

  .x-process-step__desc {
    max-width: 130px;
    font-size: 0.8125rem;
  }

  .x-process-step:not(:last-child)::after {
    right: -8px;
    border-left-width: 8px;
    border-top-width: 6px;
    border-bottom-width: 6px;
    top: 32px;
  }

  .x-process-step:not(:last-child)::before {
    left: calc(50% + 34px);
  }
}

/* =========================================================================
   RESPONSIVE - Mobile (<768px) : Vertical Timeline
   ========================================================================= */

@media (max-width: 767px) {
  .x-process-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--x-space-sm) 0;
    position: relative;
  }

  /* Vertical connecting line on the left side */
  .x-process-strip::before {
    content: '';
    position: absolute;
    top: calc(var(--x-space-sm) + 32px); /* Start at center of first icon */
    bottom: calc(32px); /* End at center of last icon */
    left: 31px; /* Center of 64px icon = 32px, minus 1px for line width */
    width: 2px;
    background: var(--x-border);
    z-index: 0;
  }

  .x-process-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: var(--x-space-md);
    padding: var(--x-space-sm) 0;
    width: 100%;
  }

  .x-process-step .x-icon-sticker {
    margin-bottom: 0;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
  }

  /* Step content wrapper for mobile */
  .x-process-step__content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.75rem; /* Vertically center text with icon */
  }

  .x-process-step__label {
    font-size: 1rem;
  }

  .x-process-step__desc {
    max-width: none;
    font-size: 0.875rem;
  }

  /* Remove horizontal arrows on mobile */
  .x-process-step:not(:last-child)::after {
    display: none;
  }

  /* Remove horizontal connecting lines on mobile */
  .x-process-step:not(:last-child)::before {
    display: none;
  }
}

/* =========================================================================
   PROCESS STRIP - Inline HTML variant (wp:html block)
   =========================================================================
   When the process strip is rendered via wp:html (not pattern PHP),
   it uses native h4/p elements instead of span classes.
   ========================================================================= */

.x-process-strip h4 {
  font-family: var(--x-font-heading);
  font-weight: 800;
  font-size: clamp(0.875rem, 1.2vw, 1.125rem);
  line-height: 1.2;
  color: var(--x-teal-900);
  margin: var(--x-space-sm) 0 0.25rem;
}

.x-process-strip p {
  font-family: var(--x-font-body);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--x-muted);
  margin: 0;
  max-width: 180px;
}

.x-process-strip svg {
  flex-shrink: 0;
}

.x-process-arrow {
  display: flex;
  align-items: center;
  color: var(--x-orange-500);
  font-size: 1.5rem;
  font-weight: 700;
  padding-top: 0.75rem;
  user-select: none;
}

@media (max-width: 767px) {
  .x-process-strip h4 {
    font-size: 1rem;
  }

  .x-process-strip p {
    max-width: none;
  }

  .x-process-arrow {
    display: none;
  }

  .x-process-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--x-space-md);
  }
}

@media (max-width: 480px) {
  .x-process-strip {
    grid-template-columns: 1fr;
  }
}
