/* ============================================================================
   SADER — SECTION: SADER INTRO  (s-sader-intro)
   The section has two states:

   • COLLAPSED (default, .s-sader-intro:not(.is-expanded)) — a simple two-column
     intro: framed photo on the start side, the first paragraph + a "Read more"
     button on the end side. No pinned animation.

   • EXPANDED (.s-sader-intro.is-expanded.is-scrolly) — the full scrollytelling:
     one framed photo PINNED in view that slides start <-> end as the reader
     scrolls, each narrative "step" sitting on the side opposite the photo. The
   motion is SCROLL-LINKED: sader-intro.js writes --sader-photo-x (0% = start
   side, 54% = end side) onto the section every frame.

   Fallback (mobile, no JS, reduced motion): a clean stacked layout — the photo
   on top, the narrative flowing beneath. Logical properties throughout, so the
   whole thing mirrors for the RTL build.
   ============================================================================ */

.s-sader-intro {
  position: relative;
  isolation: isolate;
  /* clip (not hidden) so the watermark is trimmed WITHOUT creating a scroll
     container — otherwise position: sticky on the photo would not pin. */
  overflow: clip;
  background-color: var(--bg);
  border-block-start: 1px solid var(--line);
  border-block-end: 1px solid var(--line);
  padding-block-start: clamp(var(--space-4), 2.5vw, var(--space-6));
  padding-block-end: clamp(var(--space-7), 5vw, var(--space-9));
}

/* Ghost establishing year, anchored bottom-end — echoes s-mission/s-culture. */
.s-sader-intro__watermark {
  position: absolute;
  z-index: 0;
  inset-block-end: -0.18em;
  inset-inline-end: -0.02em;
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-light);
  font-size: clamp(8rem, 22vw, 20rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(0, 0, 0, 0.035);
  user-select: none;
  pointer-events: none;
}

.s-sader-intro__scrolly { position: relative; z-index: 1; }

/* ---- The framed photograph ------------------------------------------------ */
.s-sader-intro__media { margin: 0; }
.s-sader-intro__plate { inline-size: 100%; }

.s-sader-intro__frame {
  position: relative;
  padding: var(--space-3);
  background-color: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.16);
}
.s-sader-intro__frame::before {
  content: "";
  position: absolute;
  inset: var(--space-2);
  border: 1px solid var(--line);
  pointer-events: none;
}
.s-sader-intro__frame img {
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: auto;
  filter: grayscale(0.15);
}
.s-sader-intro__caption {
  margin-block-start: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  text-align: center;
}

/* ---- The narrative -------------------------------------------------------- */
.s-sader-intro__text { max-inline-size: 42rem; }
.s-sader-intro__rule {
  display: block;
  inline-size: 40px;
  block-size: 1px;
  background: var(--accent);
  margin-block-end: var(--space-4);
}
.s-sader-intro__text .eyebrow {
  display: block;
  margin-block-end: var(--space-5);
  color: var(--text-muted);
}
.s-sader-intro__lead {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semi);
  font-style: italic;
  line-height: var(--lh-snug);
  color: var(--text);
}
.s-sader-intro__text p {
  inline-size: 100%;
  max-inline-size: none;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text-muted);
  text-align: justify;
  text-justify: inter-word;
  margin-block: 0 var(--space-5);
}
.s-sader-intro__text p:last-child { margin-block-end: 0; }
.s-sader-intro__closing {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-style: italic;
  line-height: var(--lh-snug);
  color: var(--text) !important;
  text-align: start !important;
}

/* ---- "Read more" — shown only while collapsed ----------------------------- */
.s-sader-intro__more-wrap { margin-block-start: var(--space-5); }
.s-sader-intro.is-expanded .s-sader-intro__more-wrap {
  visibility: hidden;
  pointer-events: none;
}

.s-sader-intro__more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text);
  background-color: var(--bg);
  border: 1px solid var(--line);
  padding: 0.85em 1.6em;
  cursor: pointer;
  transition:
    background-color var(--dur-base) var(--ease),
    color var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease);
}
.s-sader-intro__more:hover,
.s-sader-intro__more:focus-visible {
  background-color: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.s-sader-intro__more-icon {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease);
}
.s-sader-intro__more:hover .s-sader-intro__more-icon,
.s-sader-intro__more:focus-visible .s-sader-intro__more-icon {
  transform: translateY(2px);
}

/* While collapsed, only the first paragraph shows. */
.s-sader-intro:not(.is-expanded) .s-sader-intro__step:not(:first-child) {
  display: none;
}

/* ---- Fallback / mobile flow: photo on top, steps stacked ------------------ */
.s-sader-intro__plate {
  inline-size: min(520px, 100%);
  margin-inline: auto;
  margin-block-end: var(--space-6);
}
.s-sader-intro__step + .s-sader-intro__step { margin-block-start: var(--space-6); }

/* ============================================================================
   COLLAPSED — desktop two-column intro (photo + first paragraph + button).
   The section must NOT carry .is-scrolly here, so the media and steps sit in
   SEPARATE grid columns (placed explicitly, with !important, to defeat the
   shared-cell rule the expanded state uses).
   ============================================================================ */
@media (min-width: 1024px) {
  .s-sader-intro:not(.is-expanded) .s-sader-intro__scrolly {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 46%);
    column-gap: 8%;
    align-items: center;
  }
  .s-sader-intro:not(.is-expanded) .s-sader-intro__media {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  .s-sader-intro:not(.is-expanded) .s-sader-intro__steps {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  /* In this state the photo is a normal in-column figure, not a pinned plate. */
  .s-sader-intro:not(.is-expanded) .s-sader-intro__plate {
    inline-size: 100%;
    margin-block-end: 0;
  }
}

/* ============================================================================
   EXPANDED SCROLLYTELLING — desktop + JS (.is-expanded.is-scrolly). The media
   pins to the viewport; the steps scroll past it; the photo's start<->end
   position is driven per-frame by --sader-photo-x written onto the section.
   ============================================================================ */
@media (min-width: 1024px) {
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__scrolly {
    display: grid;
    grid-template-columns: 1fr;
  }
  /* Media and steps share one grid cell so they overlap. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__media,
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__steps {
    grid-column: 1;
    grid-row: 1;
  }

  /* JS sizes this track from the centre of the first paragraph to the centre
     of the last. The plate, rather than the whole track, is sticky; this keeps
     its vertical travel inside those two narrative anchors. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__media {
    position: relative;
    block-size: var(--sader-media-height, 100%);
    padding-block-start: var(--sader-media-start, 0px);
    box-sizing: border-box;
    align-self: start;
    z-index: 0;
    pointer-events: none;
  }
  /* The plate sticks vertically at the captured/centred viewport position and
     travels horizontally from 0% (start) to 54% (end). */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__plate {
    position: sticky;
    inset-block-start: var(--sader-sticky-top, var(--header-h));
    inset-inline-start: auto;
    inline-size: 46%;
    margin-block: 0;
    margin-inline-start: var(--sader-photo-x, 0%);
    margin-inline-end: 0;
    transform: none;
    pointer-events: auto;
  }

  /* Steps overlap the media; each fills most of a screen and drops its text on
     the side OPPOSITE the photo, so the two never collide. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__steps { z-index: 1; }
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__step {
    min-block-size: 72vh;
    display: flex;
    align-items: center;
    margin: 0;
  }
  /* Keep the opening step at its natural height. Together with the invisible
     button placeholder, this preserves the exact pre-click paragraph geometry
     while the photograph remains centred against it. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__step:first-child {
    min-block-size: auto;
  }
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__text {
    inline-size: 46%;
    min-inline-size: 0;
    max-inline-size: none;
  }
  /* Odd steps (1st, 3rd): photo rests on the START side -> text to the END. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__step:nth-child(odd) {
    justify-content: flex-end;
  }
  /* Even steps (2nd, 4th): photo rests on the END side -> text to the START. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__step:nth-child(even) {
    justify-content: flex-start;
  }

  /* Copy stays visible until the photo reaches the handoff midpoint, then the
     outgoing and incoming steps crossfade without a textless gap. */
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__text {
    opacity: 0;
    transition: opacity 0.55s var(--ease);
  }
  .s-sader-intro.is-expanded.is-scrolly .s-sader-intro__step.is-active .s-sader-intro__text {
    opacity: 1;
  }
}

/* ============================================================================
   REDUCED-MOTION DESKTOP FALLBACK — retain the opening two-column geometry but
   let all paragraphs flow normally. There is no pinning or side-to-side motion.
   ============================================================================ */
@media (min-width: 1024px) {
  .s-sader-intro.is-expanded:not(.is-scrolly) .s-sader-intro__scrolly {
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 46%);
    column-gap: 8%;
    align-items: start;
  }
  .s-sader-intro.is-expanded:not(.is-scrolly) .s-sader-intro__media {
    grid-column: 1;
    grid-row: 1;
  }
  .s-sader-intro.is-expanded:not(.is-scrolly) .s-sader-intro__steps {
    grid-column: 2;
    grid-row: 1;
  }
  .s-sader-intro.is-expanded:not(.is-scrolly) .s-sader-intro__plate {
    inline-size: 100%;
    margin: 0;
  }
  .s-sader-intro.is-expanded:not(.is-scrolly) .s-sader-intro__text {
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: none;
  }
}

/* Reduced-motion users never get .is-scrolly (see sader-intro.js). */
