.sunday-mozza {
  position: relative;
  background: var(--ss-color-bg);
  font-family: var(--ss-font-body);
  --sunday-mozza-aspect-ratio: 640 / 464;
  --sunday-mozza-stage-height: calc(50vw * 464 / 640);
  --sunday-mozza-preview-top: 25px;
  --sunday-mozza-preview-width: min(29vw, 668px);
  --sunday-mozza-preview-height: calc(var(--sunday-mozza-preview-width) * 464 / 640);
}

.sunday-mozza__stage {
  overflow: hidden;
}

.sunday-mozza__swiper {
  width: 100%;
  height: var(--sunday-mozza-stage-height);
}

.sunday-mozza__swiper .swiper-wrapper {
  align-items: stretch;
}

.sunday-mozza__slide {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  height: 100%;
  background: var(--ss-white);
  box-sizing: border-box;
}

.sunday-mozza__slide.swiper-slide-active {
  background: transparent;
}

.sunday-mozza__media-frame {
  aspect-ratio: var(--sunday-mozza-aspect-ratio);
  overflow: hidden;
  width: var(--sunday-mozza-preview-width);
  transition:
    width 0.7s cubic-bezier(0.22, 0.7, 0.2, 1),
    margin-top 0.7s cubic-bezier(0.22, 0.7, 0.2, 1),
    margin-left 0.7s cubic-bezier(0.22, 0.7, 0.2, 1);
}

.sunday-mozza__slide:not(.swiper-slide-active) .sunday-mozza__media-frame {
  margin-top: var(--sunday-mozza-preview-top);
  margin-left: calc((100% - var(--sunday-mozza-preview-width)) / 2);
}

.sunday-mozza__slide.swiper-slide-active .sunday-mozza__media-frame {
  width: 100%;
  margin-top: 0;
  margin-left: 0;
}

.sunday-mozza__swiper:not(.swiper-initialized)
  .sunday-mozza__slide:first-child {
  background: transparent;
}

.sunday-mozza__swiper:not(.swiper-initialized)
  .sunday-mozza__slide:first-child
  .sunday-mozza__media-frame {
  width: 100%;
  margin-top: 0;
  margin-left: 0;
}

.sunday-mozza__media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--sunday-mozza-object-position, bottom);
}

.sunday-mozza__bar {
  /* Absolutely positioned so it tucks directly beneath the inactive preview
     image without affecting the section height (the stage defines it). The
     image ends at (preview-top + preview-height) from the stage top. */
  position: absolute;
  inset-inline: 0;
  top: calc(
    var(--sunday-mozza-preview-top) + var(--sunday-mozza-preview-height) +
      var(--ss-space-2)
  );
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sunday-mozza__nav {
  grid-column: 2;
  display: flex;
  gap: var(--ss-space-2);
  justify-content: center;
}

.sunday-mozza__nav button {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  background: var(--ss-orange);
  color: var(--ss-white);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition:
    filter 0.15s ease,
    opacity 0.15s ease;
}

.sunday-mozza__nav button:hover:not(:disabled):not(.sunday-mozza__nav-button--disabled) {
  filter: brightness(1.1);
}

.sunday-mozza__nav button:disabled,
.sunday-mozza__nav button.sunday-mozza__nav-button--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.sunday-mozza__nav button svg {
  width: 22px;
  height: 16px;
  fill: currentColor;
}

.sunday-mozza__prev svg {
  transform: scaleX(-1);
}

@media (max-width: 820px) {
  .sunday-mozza {
    --sunday-mozza-stage-height: calc(100vw * 464 / 640);
    --sunday-mozza-preview-width: min(62vw, 300px);
  }

  .sunday-mozza__bar {
    position: static;
    inset-inline: auto;
    top: auto;
    grid-template-columns: 1fr;
    padding-block: var(--ss-space-3);
  }

  .sunday-mozza__nav {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunday-mozza__media-frame {
    transition: none;
  }
}
