/* =========================================================
   DigitalShri – Process Journey (Elementor widget "DS Process Journey")
   Brand colours only: #851CF2 / #1E51F1 / #17181C / #F38218 (+ white).

   Default (mobile, no JS): centred heading + stacked timeline of all steps.
   .is-panel-mode  (JS, ≥768px): step list on the left, one step card on the right.
   .is-scroll-mode (panel mode + motion allowed): section pins and the card changes as you scroll.
   ========================================================= */

/* position:sticky needs every ancestor to have visible overflow. The theme sets
   overflow-x:hidden on html/body (ds-header.css); "clip" hides sideways overflow the
   same way without breaking sticky. Only on pages with this section, and not while
   the mobile menu's scroll lock is on. */
html:has(.ds-jr.is-scroll-mode):not(.ds-menu-open),
html:has(.ds-jr.is-scroll-mode):not(.ds-menu-open) body,
html:has(.ds-jr.is-scroll-mode):not(.ds-menu-open) #page,
html:has(.ds-jr.is-scroll-mode):not(.ds-menu-open) .site,
html:has(.ds-jr.is-scroll-mode):not(.ds-menu-open) .site-content {
  overflow-x: clip !important;
  overflow-y: visible !important;
}

.ds-jr {
  --jr-violet: #851CF2;
  --jr-blue: #1E51F1;
  --jr-ink: #17181C;
  --jr-orange: #F38218;
  --jr-white: #FFFFFF;
  --jr-muted: rgba(255, 255, 255, 0.7);
  --jr-line: rgba(255, 255, 255, 0.12);
  position: relative;
  font-family: "Montserrat", sans-serif;
  color: var(--jr-white);
  background: var(--jr-ink);
  isolation: isolate;
}
.ds-jr *, .ds-jr *::before, .ds-jr *::after { box-sizing: border-box; }

.ds-jr-sticky {
  position: relative;
  overflow: hidden;
  padding: 56px 0 64px;
  background:
    radial-gradient(55% 45% at 75% 35%, rgba(133, 28, 242, 0.2), transparent 70%),
    radial-gradient(40% 40% at 10% 85%, rgba(30, 81, 241, 0.14), transparent 70%),
    var(--jr-ink);
}
/* faint grid texture */
.ds-jr-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 25%, transparent);
          mask-image: linear-gradient(to bottom, #000 25%, transparent);
}

.ds-jr-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Centred heading ---------- */
.ds-jr-head { max-width: 900px; margin: 0 auto 52px; text-align: center; }
.ds-jr .ds-jr-head .ds-jr-text { max-width: 720px; }
/* first paint: no fade, so hidden cards don't flash while fading out */
.ds-jr.jr-no-anim .ds-jr-card { transition: none !important; }
.ds-jr-eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--jr-orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.ds-jr .ds-jr-title {
  margin: 0 0 14px;
  font-family: inherit;
  font-size: var(--ds-h2-size, 40px); /* global H2 scale */
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--jr-white);
}
.ds-jr .ds-jr-title span { color: var(--jr-violet); }
.ds-jr .ds-jr-text { margin: 0 auto; font-size: 16px; line-height: 1.7; color: var(--jr-muted); }
.ds-jr .ds-jr-btn { margin-top: 22px; }

/* ---------- Step list (panel mode only) ---------- */
.ds-jr-list { display: none; list-style: none; margin: 0; padding: 0; }
.ds-jr-list li { margin: 0; }
.ds-jr .ds-jr-step {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--jr-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--jr-muted);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.ds-jr .ds-jr-step:hover { border-color: rgba(133, 28, 242, 0.5); color: var(--jr-white); }
.ds-jr .ds-jr-step:focus-visible { outline: 2px solid var(--jr-orange); outline-offset: 2px; }
.ds-jr .ds-jr-step.is-active {
  border-color: var(--jr-violet);
  background: rgba(133, 28, 242, 0.16);
  color: var(--jr-white);
  box-shadow: inset 3px 0 0 var(--jr-violet), 0 12px 30px rgba(133, 28, 242, 0.25);
}
.ds-jr-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-weight: 700;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.ds-jr .ds-jr-step.is-active .ds-jr-step-num { background: var(--jr-violet); border-color: var(--jr-violet); color: var(--jr-white); }

/* ---------- Step cards ---------- */
.ds-jr-cards {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* timeline line + fill (stacked layout; fill set by JS) */
.ds-jr-cards::before,
.ds-jr-cards::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  width: 2px;
  border-radius: 2px;
}
.ds-jr-cards::before { bottom: 8px; background: var(--jr-line); }
.ds-jr-cards::after { height: var(--jr-fill, 0%); background: linear-gradient(var(--jr-violet), var(--jr-orange)); transition: height 0.2s linear; }

.ds-jr-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px 22px 20px;
  border-radius: 22px;
  border: 1px solid rgba(133, 28, 242, 0.35);
  background: linear-gradient(145deg, rgba(133, 28, 242, 0.16), rgba(255, 255, 255, 0.02) 55%), var(--jr-ink);
  box-shadow: 0 24px 60px rgba(23, 24, 28, 0.35);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s linear 0.5s, border-color 0.3s ease;
}
/* timeline dot (stacked layout) */
.ds-jr-card::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--jr-ink);
  background: var(--jr-violet);
  box-shadow: 0 0 0 2px var(--jr-violet);
}

.ds-jr-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ds-jr-card-step { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--jr-muted); }
.ds-jr-badge {
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--jr-orange);
  color: var(--jr-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  white-space: nowrap;
}
.ds-jr-icon {
  width: 60px;
  height: 60px;
  margin: 22px 0 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--jr-violet);
  color: var(--jr-white);
  box-shadow: 0 12px 30px rgba(133, 28, 242, 0.4);
}
.ds-jr-icon svg { width: 26px; height: 26px; fill: currentColor; }
.ds-jr-icon i { font-size: 25px; }
.ds-jr .ds-jr-card-title {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--jr-white);
}
.ds-jr .ds-jr-card-text { margin: 0; max-width: 640px; font-size: 16px; line-height: 1.75; color: var(--jr-muted); }
/* reveal on scroll (stacked layout; JS adds .is-reveal-ready) */
.ds-jr.is-reveal-ready:not(.is-panel-mode) .ds-jr-card { opacity: 0; transform: translateY(26px); visibility: visible; }
.ds-jr.is-reveal-ready:not(.is-panel-mode) .ds-jr-card.is-visible { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }

/* =========================================================
   Panel mode (≥768px): list left, one card right
   ========================================================= */
.ds-jr.is-panel-mode .ds-jr-body {
  display: grid;
  grid-template-columns: minmax(200px, 270px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch; /* both columns take the taller one's height */
}
/* left: steps share the column height equally, so the list lines up with the card top and bottom */
.ds-jr.is-panel-mode .ds-jr-list { display: flex; flex-direction: column; gap: 12px; }
.ds-jr.is-panel-mode .ds-jr-list li { flex: 1 1 0; display: flex; }
.ds-jr.is-panel-mode .ds-jr-step { height: 100%; }
/* right: the card fills the column height */
.ds-jr.is-panel-mode .ds-jr-stage { display: flex; flex-direction: column; }
.ds-jr.is-panel-mode .ds-jr-cards { flex: 1 1 auto; display: grid; padding: 0; }
.ds-jr.is-panel-mode .ds-jr-cards::before,
.ds-jr.is-panel-mode .ds-jr-cards::after,
.ds-jr.is-panel-mode .ds-jr-card::before { display: none; }
/* all cards share one cell, so the box keeps the tallest card's height (no jumping) */
.ds-jr.is-panel-mode .ds-jr-card {
  grid-area: 1 / 1;
  padding: 34px 40px 26px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
}
.ds-jr.is-panel-mode .ds-jr-card.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  border-color: rgba(133, 28, 242, 0.6);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0s, border-color 0.3s ease;
}

/* =========================================================
   Scroll mode: pinned while scrolling through the steps
   ========================================================= */
.ds-jr.is-scroll-mode {
  height: calc(100vh + (var(--jr-steps) - 1) * 60vh); /* ~60% of a screen per step */
}
.ds-jr.is-scroll-mode .ds-jr-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  display: flex;
  align-items: center;
  padding: 100px 0 30px; /* top: room for the fixed site header */
}

@media (max-width: 1024px) {
  .ds-jr.is-panel-mode .ds-jr-body { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); gap: 18px; }
  .ds-jr.is-panel-mode .ds-jr-card { padding: 28px 28px 22px; }
  .ds-jr .ds-jr-step { padding: 12px 12px; font-size: 14px; }
}
/* short screens: tighten so the pinned view fits */
@media (max-height: 780px) {
  .ds-jr.is-scroll-mode .ds-jr-sticky { padding-top: 92px; padding-bottom: 16px; }
  .ds-jr.is-scroll-mode .ds-jr-head { margin-bottom: 40px; }
  .ds-jr.is-scroll-mode .ds-jr-eyebrow { margin-bottom: 8px; }
  .ds-jr.is-scroll-mode .ds-jr-title { margin-bottom: 8px; }
  .ds-jr.is-scroll-mode .ds-jr-text { font-size: 15px; line-height: 1.6; }
  .ds-jr.is-scroll-mode .ds-jr-step { padding: 10px 12px; }
  .ds-jr.is-scroll-mode .ds-jr-list { gap: 8px; }
  .ds-jr.is-scroll-mode .ds-jr-card { padding: 24px 32px 18px; }
  .ds-jr.is-scroll-mode .ds-jr-icon { width: 50px; height: 50px; margin: 14px 0 12px; }
  .ds-jr.is-scroll-mode .ds-jr-card-text { font-size: 15px; line-height: 1.6; }
}

@media (min-width: 600px) and (max-width: 767px) {
  .ds-jr-inner { padding: 0 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-jr *, .ds-jr *::before, .ds-jr *::after { animation: none !important; transition: none !important; }
}
