/* ===== התהליך – גרסה ב: כרטיסים רחבים שנערמים זה על זה =====
   החלק "ננעל" במסך. כל שלב עולה מלמטה, המסגרת הצבעונית מצטיירת סביבו,
   והשלב הבא נערם מעליו. בסוף כל הערימה ממשיכה יחד למעלה.
   המספר הגדול עומד בצד, מחוץ לכרטיסים, ומתחלף לפי השלב. */
.sprocess {
  position: relative;
  z-index: 2;
  background: #fff;
  padding-top: 12vh;
}
.sprocess__head { text-align: center; margin: 0 auto 2vh; padding-inline: 16px; }
.sprocess__title { font-size: max(34px, 3.2vw); font-weight: 700; color: #236382; line-height: 1.15; }
.sprocess__kicker { margin: .45em 0 0; font-size: max(20px, 1.5vw); font-weight: 300; color: #c91f2c; }

.sprocess__scroller { position: relative; height: calc(100vh + 7 * 70vh); } /* כמה גלילה החלק לוקח */
.sprocess__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  --cw: min(1080px, calc(100% - 2 * clamp(150px, 15vw, 260px)));
}
.sprocess__list { list-style: none; margin: 0; padding: 0; }
.sstep {
  position: absolute;
  top: calc(12vh + var(--i) * 22px); /* כל שלב נעצר קצת מתחת לקודם */
  left: 0;
  right: 0;
  width: var(--cw);
  margin: 0 auto;
  will-change: transform;
}
.sstep__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, .75fr) 1.6fr;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  min-height: min(48vh, 440px);
  padding: clamp(40px, 4.4vw, 72px) clamp(32px, 4.5vw, 80px);
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 -14px 34px -22px rgba(0, 60, 90, .28);
  transform-origin: 50% 0;
}
/* המסגרת: שני קווים שיוצאים מאמצע הקצה העליון ונפגשים למטה */
.sstep__frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sstep__frame path {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--draw, 0));
}
.sstep__side, .sstep__body {
  position: relative;
  opacity: var(--show, 0);
  transform: translateY(calc((1 - var(--show, 0)) * 18px));
}
.sstep__title { font-size: clamp(28px, 2.7vw, 46px); font-weight: 300; line-height: 1.2; color: #c91f2c; }
.sstep__body { font-size: clamp(19px, 1.5vw, 25px); font-weight: 400; line-height: 1.65; color: #236382; }
.sstep__body p { margin: 0 0 .6em; }
.sstep__goal {
  margin-top: 1.1em !important;
  padding: .8em 1.1em;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(78,170,72,.08), rgba(0,100,130,.07));
  border-inline-start: 4px solid #c91f2c;
  color: #236382;
  font-weight: 600;
}
.sstep__goal strong { color: #c91f2c; font-weight: 800; margin-inline-end: .2em; }

/* המספר הגדול – מחוץ לכרטיסים, בצד ימין */
.sprocess__count {
  position: absolute;
  top: calc(12vh + 70px);
  right: calc((100% - var(--cw)) / 4);
  translate: 50% 0;
  z-index: 20;
  height: 1.1em;
  overflow: hidden;
  font-size: clamp(120px, 11vw, 200px);
  font-weight: 900;
  line-height: 1.1;
}
.sprocess__count-num {
  display: block;
  padding-inline: .05em;
  background: linear-gradient(135deg, #006482, #4eaa48 55%, #d0162d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sprocess__count-num.is-out { animation: count-out .25s ease-in forwards; }
.sprocess__count-num.is-in { animation: count-in .35s ease-out; }
.sprocess__count-num.is-in.is-back { animation-name: count-in-back; }
@keyframes count-out { to { transform: translateY(-60%); opacity: 0; } }
@keyframes count-in { from { transform: translateY(60%); opacity: 0; } }
@keyframes count-in-back { from { transform: translateY(-60%); opacity: 0; } }

/* טבלט וטלפון: המספר עובר למעלה באמצע, מעל הכרטיסים */
@media (max-width: 1000px) {
  .sprocess__stage { --cw: calc(100% - 32px); }
  .sprocess__count { top: 1.5vh; right: 50%; font-size: 76px; }
  .sstep { top: calc(110px + var(--i) * 12px); }
}
@media (max-width: 760px) {
  .sprocess { padding-top: 56px; }
  .sprocess__scroller { height: calc(100vh + 7 * 80vh); }
  .sstep__card { grid-template-columns: 1fr; gap: 12px; min-height: 0; padding: 26px 20px 22px; text-align: center; }
  .sstep__title { font-size: 24px; }
  .sstep__body { font-size: 17px; line-height: 1.55; }
  .sstep__goal { text-align: start; }
}
/* בלי תנועה: כרטיסים אחד מתחת לשני, הכול מוצג מיד */
@media (prefers-reduced-motion: reduce) {
  .sprocess__scroller { height: auto; }
  .sprocess__stage { position: static; height: auto; overflow: visible; padding: 24px 0 60px; }
  .sprocess__count { display: none; }
  .sprocess__list { display: grid; gap: 28px; }
  .sstep { position: static; transform: none !important; }
  .sstep__card { transform: none !important; }
  .sstep__frame path { stroke-dashoffset: 0; }
  .sstep__side, .sstep__body { opacity: 1; transform: none; }
}
@media (max-width: 760px) { .sstep__card { align-content: center; } }

/* ===== המספר צמוד לכרטיס: ליד הפינה התחתונה הימנית של הכרטיס העליון ===== */
.sprocess__count {
  top: var(--count-y, 50vh);
  right: auto;
  left: calc(50% + var(--cw) / 2 + 10px);
  translate: 0 0;
  line-height: 1;
  height: 1em;
  transition: top .35s ease;
}
@media (max-width: 1000px) {
  /* אין מקום בצד: המספר יושב ממש מתחת לכרטיס, באמצע */
  .sprocess__count { left: 50%; translate: -50% 0; font-size: 80px; }
  .sstep { top: calc(64px + var(--i) * 12px); }
}

/* ===== סבב 3: פחות חלל לבן – הערימה באמצע המסך, והגלילה קצרה יותר ===== */
.sprocess { padding-top: 7vh; }
.sprocess__head { margin-bottom: 0; }
.sprocess__scroller { height: calc(100vh + 7 * 55vh); }
.sstep { top: calc(var(--stack-top, 12vh) + var(--i) * 22px); }
@media (max-width: 1000px) { .sstep { top: calc(var(--stack-top, 64px) + var(--i) * 12px); } }
@media (max-width: 760px) { .sprocess { padding-top: 44px; } .sprocess__scroller { height: calc(100vh + 7 * 65vh); } }

/* ===== סבב 4: הכותרת בתוך החלק הנעול, ממש מעל הכרטיסים ===== */
.sprocess { padding-top: 0; }
.sprocess__stage .sprocess__head { position: relative; z-index: 21; margin: 0 auto; padding-top: clamp(18px, 3.5vh, 40px); }
@media (max-width: 760px) { .sprocess__stage .sprocess__head { padding-top: 14px; } .sprocess__title { font-size: 28px; } .sprocess__kicker { font-size: 17px; } }
/* אורך הגלילה לפי מספר השלבים (--n נקבע בקוד) */
.sprocess__scroller { height: calc(100vh + var(--n, 7) * 55vh); }
@media (max-width: 760px) { .sprocess__scroller { height: calc(100vh + var(--n, 7) * 65vh); } }
