/* -------------------------------- 

File#: _1_sticky-feature
Title: Sticky Feature
Descr: List of product features with sticky images
Usage: codyhouse.co/license

-------------------------------- */
.sticky-feature {
  position: relative;
  z-index: 1;
}

.sticky-feature__content-figure {
  /* images visible on small screens */
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-md);
}
.sticky-feature__content-figure img {
  display: block;
  width: 100%;
}

.sticky-feature__media-list {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sticky-feature__media-item {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-feature__media-figure {
  /* images visible on bigger screens */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  opacity: 0;
}
.sticky-feature__media-figure img {
  display: block;
  width: 100%;
  max-height: 90vh;
}
.sticky-feature-current-item .sticky-feature__media-figure {
  opacity: 1;
}

@media (min-width: 64rem) {
  .sticky-feature__content-list {
    padding-top: 50vh;
    padding-bottom: 50vh;
  }

  .sticky-feature__title {
    font-size: var(--text-xl);
    cursor: pointer;
    opacity: 0.3;
  }
  .sticky-feature__title:hover, .sticky-feature-current-item .sticky-feature__title {
    opacity: 1;
  }

  .sticky-feature__content-figure {
    /* show only to screen readers */
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
            clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 0;
    border: 0;
    white-space: nowrap;
  }

  .sticky-feature__media-list {
    /* text overlay gradients */
  }
  .sticky-feature__media-list::before, .sticky-feature__media-list::after {
    content: "";
    position: absolute;
    right: 0;
    width: 100vw;
    height: 100px;
    pointer-events: none;
  }
  .sticky-feature__media-list::before {
    top: 0;
    background: linear-gradient(to bottom, var(--color-bg), hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0.8), hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0));
  }
  .sticky-feature__media-list::after {
    bottom: 0;
    background: linear-gradient(to top, var(--color-bg), hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0.8), hsla(var(--color-bg-h), var(--color-bg-s), var(--color-bg-l), 0));
  }
}