/* Scrollytelling: a sticky stage beside (desktop) or above (narrow screens) a column of steps.
   src/scrolly.ts turns the scroll position into a step index u (step i runs while i <= u < i + 1). */

.scrolly {
  position: relative;
  padding: 0 1.5rem;
}

.scrolly-grid {
  display: grid;
  grid-template-columns: minmax(17rem, 1fr) minmax(0, 2.4fr);
  grid-template-areas: "steps graphic";
  column-gap: 2.5rem;
  max-width: 1500px;
  margin: 0 auto;
}

.scrolly-graphic {
  grid-area: graphic;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
}

.scrolly-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #ececec;
  border-radius: 10px;
}

.scrolly-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scrolly-steps {
  grid-area: steps;
  /* the last step ends with the stage still fixed in place */
  padding-bottom: 55vh;
}

/* Space before the first step, while the stage moves into place. Not a step. */
.scrolly-lead {
  height: 50vh;
  display: flex;
  align-items: center;
}

.scroll-hint {
  font-family: 'Google Sans', sans-serif;
  color: #7a7a7a;
}

.scroll-hint a {
  color: var(--bolero-navy);
}

.scrolly-step {
  min-height: 75vh;
}

.step-card {
  background: #FFFFFF;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 1.2rem 1.4rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  opacity: 0.35;
  transition: opacity 0.35s ease;
}

.scrolly-step.is-active .step-card {
  opacity: 1;
}

.step-label {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--bolero-terracotta);
  margin-bottom: 0.35rem;
}

/* Figure stages: every figure is stacked in the stage; src/figures.ts places, zooms and fades them. */
.scrolly-stage img.fig {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
  opacity: 0;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

@media (max-width: 1023px) {
  .scrolly {
    padding: 0 1rem;
  }

  .scrolly-grid {
    display: block;
  }

  .scrolly-graphic {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 2;
    padding: 0.5rem 0;
    background: #FFFFFF;
  }

  .scrolly-steps {
    position: relative;
    z-index: 1;
    padding-bottom: 45vh;
  }

  .scrolly-lead {
    height: 30vh;
  }

  .scrolly-step {
    min-height: 65vh;
  }
}
