/* ==========================================================================
   "לומדות. ואז עושות." — the learning-method story. Replaces the old dark
   LMS-mock demo (kept the id="lesson" anchor + approved headline; nothing
   else survives). One continuous scroll-driven story in three stages —
   רואות / עושות / יודעות לבד — never three feature cards.

   Two layered experiences, same markup:
   - BASE (always, zero JS required): three plain stacked blocks in normal
     document flow — this is what mobile, tablet-portrait, and
     prefers-reduced-motion all get, unmodified.
   - DESKTOP ENHANCEMENT (js/story-section.js, motion allowed, >900px):
     adds `.story-stage.is-pinned`, which switches the three blocks to an
     absolutely-stacked pin+scrub composition driven by GSAP/ScrollTrigger,
     mirroring the exact pin pattern already proven in js/lessons-fan.js.
   ========================================================================== */

.story{ background: var(--color-bg); }
/* Scoped spacing tighten (this section only — not the shared --space-section
   token used by every other section-pad on the site): the pinned stage
   below already reserves its own generous height, so the outer section
   padding + heading gap were stacking on top of that and reading as
   excessive blank cream above/below. Pure spacing, nothing else touched. */
.story.section-pad{ padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.story .section-head{ margin-bottom: clamp(1.25rem, 2.5vw, 2rem); }

/* ---- BASE: plain stacked flow, works with zero JS ---- */
.story-stage-inner{
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 7vw, 5rem);
}

.story-step{
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.story-visual-frame{
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1.5px solid var(--color-black);
  border-radius: 26px;
  overflow: hidden;
  background: #EDE6D8;
}
.story-img{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Shown only until the real photo at this path is supplied — a neutral
   empty frame, never a fake stand-in (see js/story-section.js comment /
   index.html for the exact missing asset). */
.story-visual-frame.is-missing{
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-visual-frame.is-missing::after{
  content: 'תמונה בקרוב';
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Thin technical ruler-tick line across the top of the frame — decorative,
   echoes the site's other measurement details (course-hero-media, etc). */
.story-ruler-line{
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 6px;
  background-image: repeating-linear-gradient(to right, var(--color-black) 0 1.5px, transparent 1.5px 11px);
  opacity: 0.3;
  pointer-events: none;
}

.story-play-badge{
  position: absolute;
  bottom: 20px;
  inset-inline-start: 20px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--color-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(17,17,17,0.22);
}
.story-play-badge svg{ width: 18px; height: 18px; color: var(--color-black); transform: translateX(-1px); }

.story-check{
  position: absolute;
  bottom: 20px;
  inset-inline-start: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--color-lime);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(17,17,17,0.22);
}
.story-check svg{ width: 20px; height: 20px; color: var(--color-black); }

.story-copy{ max-width: 46ch; }
.story-num{
  font-family: var(--font-display);
  font-weight: var(--weight-display-heavy);
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.6px var(--color-black);
  margin: 0 0 0.4rem;
}
.story-title{
  font-family: var(--font-display);
  font-weight: var(--weight-display-heavy);
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  letter-spacing: var(--tracking-display);
  color: var(--color-black);
  margin: 0 0 0.9rem;
}
.story-desc{
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-dark);
  margin: 0;
}

/* ==========================================================================
   DESKTOP ENHANCEMENT — pin + scroll-scrub (js/story-section.js only adds
   this class when: viewport > 900px AND !prefers-reduced-motion AND GSAP/
   ScrollTrigger are available). Same three blocks, now absolutely stacked
   inside one fixed-height stage; opacity/clip-path/position are all
   GSAP-driven from here — this block only sets up the stacking context and
   sane defaults so nothing breaks if the animation hasn't run yet.
   ========================================================================== */
@media (min-width: 901px){
  .story-stage.is-pinned{
    position: relative;
    height: 100vh;
    min-height: 560px;
    max-height: 640px; /* was 820 — the image/text pair (~520px) was being
      centered inside a much taller box, reading as dead space above+below
      the active step; ScrollTrigger's own scroll distance is computed from
      the viewport ('+=120%'), not this box, so this is purely visual and
      doesn't touch the pin/scrub mechanics at all. */
    overflow: hidden;
    display: flex;
    align-items: center;
  }
  .story-stage.is-pinned .story-stage-inner{
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
  }
  .story-stage.is-pinned .story-step{
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    opacity: 0;
    will-change: opacity, transform;
  }
  .story-stage.is-pinned .story-step[data-step="1"]{ opacity: 1; }
  .story-stage.is-pinned .story-visual-frame{
    aspect-ratio: auto;
    height: min(60vh, 520px);
  }
  .story-stage.is-pinned .story-img{ will-change: clip-path, transform; }
}

@media (max-width: 900px){
  .story-step{ grid-template-columns: 1fr; }
}
@media (max-width: 600px){
  .story-visual-frame{ border-radius: 20px; }
  .story-copy{ max-width: none; }
}
