/* Reference horizontal moments rail. */
.yun-home .yun-moments {
  width: 100%;
  border-top: 1px solid var(--yun-home-line);
  background: var(--yun-home-paper);
  padding: 56px 0;
}

.yun-home .yun-moments__intro {
  display: flex;
  width: min(1120px, calc(100vw - 48px));
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-inline: auto;
}

.yun-home .yun-moments__heading {
  max-width: 65ch;
}

.yun-home .yun-moments .yun-eyebrow {
  display: block;
  margin-bottom: 16px;
  color: var(--yun-home-bronze);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.yun-home .yun-moments .yun-eyebrow::before {
  display: none;
}

.yun-home .yun-moments .yun-section-title {
  color: var(--yun-home-ink);
  font-family: var(--yun-font-serif);
  font-size: 34px;
  font-style: italic;
  font-weight: 300;
  letter-spacing: -.015em;
  line-height: 1.08;
}

.yun-home .yun-moments__heading::after {
  display: block;
  width: 28px;
  height: 1px;
  margin: 24px 0;
  background: var(--yun-home-bronze);
  content: "";
}

.yun-home .yun-moments__controls {
  display: none;
  flex: none;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.yun-home .yun-moments__status {
  color: rgba(17, 17, 17, .4);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.yun-home .yun-moments__viewport {
  position: relative;
  width: min(1120px, calc(100vw - 48px));
  margin: 32px auto 0;
  overflow: hidden;
}

.yun-home .yun-moments__rail {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0 0 24px;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scroll-padding-left: 0;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  user-select: none;
}

.yun-home .yun-moments__rail::-webkit-scrollbar {
  display: none;
}

/* A mouse drag moves the rail by hand (homepage-moments.js); snapping
   waits until the rail settles on a card. */
.yun-home .yun-moments__rail.is-dragging,
.yun-home .yun-moments__rail.is-settling {
  scroll-snap-type: none;
}

.yun-home .yun-moments__rail.is-dragging {
  cursor: grabbing;
}

/* The viewport clips the rail's own focus ring and the cards cover it, so
   the viewport draws the ring around the whole rail instead. */
.yun-home .yun-moments__viewport:has(> .yun-moments__rail:focus-visible) {
  outline: 2px solid var(--yun-home-ink);
  outline-offset: 4px;
}

.yun-home .yun-moments__viewport:has(> .yun-moments__rail:focus-visible) > .yun-moments__rail {
  outline: 0;
}

.yun-home .yun-moments__item {
  --yun-moment-scale: .96;
  flex: 0 0 calc(100% - 42px);
  scroll-snap-align: start;
}

/* Without scroll-driven animations, only the active card is full size. */
.yun-home .yun-moments__item.is-active {
  --yun-moment-scale: 1;
}

/* The figure scales, not the card the rail snaps to. WebKit snaps to a card's
   box as transformed, so a scaled card came to rest a few pixels past its
   edge and, back at full size, lost the start of its caption. The figure
   fills the card (neither has padding or margin), so it looks the same. */
.yun-home .yun-moments__item figure {
  margin: 0;
  transform: scale(var(--yun-moment-scale));
  transform-origin: center center;
  transition: transform 180ms ease;
}

.yun-home .yun-moments__image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid rgba(232, 224, 214, .6);
  border-radius: 2px;
  background: var(--yun-home-soft);
}

.yun-home .yun-moments__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.yun-home .yun-moments__item figcaption {
  margin-top: 12px;
}

.yun-home .yun-moments__item figcaption p {
  display: block;
  width: 100%;
  max-width: none;
  overflow: visible;
  color: rgba(17, 17, 17, .8);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

@media (max-width: 759px) {
  .yun-home .yun-moments__rail {
    padding-right: 42px;
  }

  /* Phone cards follow the rail's own scroll: full size at its start edge,
     slightly smaller as they come in from the right or leave on the left. */
  @supports (animation-timeline: view()) {
    .yun-home .yun-moments__item figure {
      animation-name: yun-moment-scale;
      animation-duration: auto;
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: view(inline);
    }
  }
}

@keyframes yun-moment-scale {
  entry 0% {
    transform: scale(.96);
  }

  exit 0% {
    transform: scale(1);
  }

  exit 100% {
    transform: scale(.96);
  }
}

@media (min-width: 760px) {
  .yun-home .yun-moments {
    padding: 80px 0;
  }

  .yun-home .yun-moments__controls {
    display: flex;
  }

  .yun-home .yun-moments .yun-section-title {
    font-size: 40px;
  }

  .yun-home .yun-moments__viewport {
    width: min(1120px, calc(100vw - 48px));
    margin: 56px auto 0;
  }

  .yun-home .yun-moments__rail {
    gap: 24px;
    padding-right: 0;
    padding-left: 0;
  }

  .yun-home .yun-moments__item {
    --yun-moment-scale: 1;
    flex-basis: 36%;
  }

  .yun-home .yun-moments__item figure {
    transform: none;
  }
}
