/* Process — source: sections/Process.tsx
 *
 * The step cards are native containers + heading/text-editor widgets, so every
 * number, title and body is editable in Elementor. Two consequences run through
 * this file:
 *   1. Type belongs on .elementor-heading-title / .elementor-widget-text-editor p,
 *      never on the widget wrapper. Elementor resets the title at (0,1,0)
 *      — including line-height:1 — and that reset beats an inherited value.
 *   2. Elementor gives every container 10px padding on all four sides
 *      (--container-default-padding-*, 10px) and there is no e-child reset, so
 *      the new containers carry padding:0 in their JSON.
 */

#process {
  position: relative; /* containing block for the blob */
  background: var(--page-bg);
}

/* Elementor's default container gap (20px) would stack on top of the source's
   margins; the margins are the single source of truth here. */
#process,
#process .lt-proc-inner,
#process .lt-proc-head {
  gap: 0;
}

/* Elementor ships every container with --flex-wrap-mobile:wrap and lands it as
   flex-wrap:wrap at <=767 (.e-con.e-flex{--flex-wrap:var(--flex-wrap-mobile)}).
   Nothing here wraps in the source, and on the track it would break the carousel
   outright: each card is ~100vw wide, so all four would stack on their own lines
   instead of scrolling. */
#process .e-con {
  flex-wrap: nowrap;
}

/* .elementor-widget is position:relative, so the blob would otherwise resolve
   against its own zero-height wrapper instead of the section. */
#process > .lt-proc-blob-w,
#process > .lt-proc-blob-w > .elementor-widget-container {
  position: static;
}

/* Deliberately static — unlike Solution's, the source never animates this blob. */
#process .lt-proc-blob {
  top: -60px;
  inset-inline-end: -60px;
  width: 420px;
  height: 340px;
  border-radius: 60% 40% 50% 50% / 40% 60% 45% 55%;
  background: rgba(41, 128, 242, 0.06);
}

#process .lt-proc-inner {
  position: relative;
  z-index: 1;
}

/* tokens' .lt-eyebrow carries no colour of its own; the source paints it blue.
   align-self keeps the pill shrink-to-fit and centred — text-align alone cannot
   reach it, because a flex item would stretch to the head's full width. */
#process .lt-proc-eyebrow {
  align-self: center;
  color: var(--brand-primary);
  background: rgba(41, 128, 242, 0.08);
  box-shadow: inset 0 0 0 1px rgba(41, 128, 242, 0.18);
}

#process .lt-proc-h2 {
  margin-top: 18px;
}

/* Elementor hard-sets .elementor-heading-title{line-height:1}, so type has to be
   declared on the title itself — setting it on the widget wrapper never lands. */
#process .lt-proc-h2 .elementor-heading-title {
  font-size: var(--t-h2);
  font-weight: 900;
  line-height: 1.05;
  color: var(--page-fg-strong);
}

/* ---- Desktop: 4-up grid with the connector threaded behind the circles ----
 * .lt-process-desktop and .lt-proc-grid-wrap are one container: the source's
 * breakpoint wrapper and the positioning wrap were always coincident boxes.
 * Containers are position:relative by default, so it is already the connector's
 * containing block; the declaration below is kept as documentation of intent.
 */

#process .lt-proc-grid-wrap {
  position: relative;
}

/* Same trap as the blob: without this the connector resolves against its own
   zero-height widget wrapper and lands at the top of the card row. */
#process .lt-proc-connector-w,
#process .lt-proc-connector-w > .elementor-widget-container {
  position: static;
}

#process .lt-proc-connector {
  position: absolute;
  top: 40px; /* the circles' vertical centre: 80px / 2 */
  inset-inline: 12%;
  height: 2px;
  background: linear-gradient(to left, var(--brand-primary), var(--brand-light));
  opacity: 0.22;
  pointer-events: none;
}

/* display:grid is deliberately NOT !important so the .lt-process-desktop
   display:none !important below can hide the wrap outright, whatever the order. */
#process .lt-proc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 32px);
}

/* ---- Step card (shared by the grid and the mobile track) ---- */

/* The source stamps --reveal-delay inline as i*80ms. An Elementor container
   cannot carry an inline style, so the stagger comes off the card's index —
   cards are the only children of the grid and of the track. */
#process .lt-proc-card:nth-child(2) { --reveal-delay: 80ms; }
#process .lt-proc-card:nth-child(3) { --reveal-delay: 160ms; }
#process .lt-proc-card:nth-child(4) { --reveal-delay: 240ms; }

/* The circle is the heading widget's wrapper; the number is its title.
   The connector is absolutely positioned and would paint over the circles;
   a stacking position on the circle puts the line back behind them.
   The explicit width keeps it 80px against the card's align-items:stretch. */
#process .lt-proc-num {
  position: relative;
  z-index: 1;
  width: 80px;
  height: 80px;
  margin-bottom: 22px;
  border: 2px solid var(--brand-primary);
  border-radius: 50%;
  background: var(--page-bg);
}

/* e_optimized_markup is ACTIVE, so .elementor-widget-container does not exist —
   the heading hangs straight off the widget. Centre the number on the widget
   (the circle) itself. */
#process .lt-proc-num {
  display: grid;
  place-items: center;
}

#process .lt-proc-num .elementor-heading-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--brand-primary);
}

#process .lt-proc-num-fill {
  background: var(--brand-primary);
  box-shadow: 0 8px 24px -4px rgba(41, 128, 242, 0.35);
}

#process .lt-proc-num-fill .elementor-heading-title {
  color: #fff;
}

#process .lt-proc-card-title {
  margin: 0 0 12px;
}

#process .lt-proc-card-title .elementor-heading-title {
  font-size: var(--t-h4);
  font-weight: 800;
  line-height: 1.2;
  color: var(--page-fg-strong);
}

#process .lt-proc-card-body p {
  margin: 0;
  font-size: var(--t-small);
  line-height: 1.65;
  color: var(--page-fg-muted);
}

/* ---- CTA (both variants) ----
   Both are button widgets now, so both style through .elementor-button. */

#process .lt-proc-cta-desktop {
  margin-top: clamp(36px, 5vw, 52px);
  text-align: center;
}

#process .lt-btn-blue .elementor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 32px;
  border-radius: var(--r-pill);
  background: var(--brand-primary);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 8px 28px -4px rgba(41, 128, 242, 0.35);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

#process .lt-btn-blue .elementor-button:hover {
  background: #1a6fd8;
  transform: translateY(-2px);
}

/* ---- Mobile: scroll-snap carousel (markup hooks bound in lifetec.js) ----
   Scoped to #process so the shared .lt-snap hooks in other sections are
   untouched. The track is a direct child of the section, outside .lt-container,
   so it can run full-bleed instead of being boxed in by the container padding. */

@media (max-width: 820px) {
  #process .lt-process-desktop,
  #process .lt-proc-cta-desktop { display: none !important; }

  #process .lt-snap-track {
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    gap: 14px;
    padding: 4px 20px 8px;
    scroll-padding-right: 20px;
    scrollbar-width: none;
  }
  #process .lt-snap-track::-webkit-scrollbar { display: none; }
  #process .lt-snap-track > * {
    flex: 0 0 calc(100vw - 56px);
    max-width: 360px;
    scroll-snap-align: start;
  }

  #process .lt-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 18px;
  }
  #process .lt-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(41, 128, 242, 0.25);
    transition: width 0.3s var(--ease);
    cursor: pointer;
  }
  #process .lt-dot.is-active {
    width: 24px;
    background: var(--brand-primary);
  }

  #process .lt-proc-cta-mobile {
    margin-top: 28px;
    padding: 0 20px;
    text-align: center;
  }
}

@media (min-width: 821px) {
  #process .lt-snap { display: none !important; }
}
