/* EMRY interactive preset comparisons */

.presets-section {
  background: #382c24;
  color: #f7f1ea;
  padding: 72px 0 78px;
  overflow: hidden;
}

.presets-inner {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 0 20px;
}

.presets-copy {
  max-width: 450px;
  margin: 0 auto;
  text-align: center;
}

.presets-description {
  margin: 18px auto 0;
  max-width: 32ch;
  color: #cdbfb4;
  font-size: 15px;
  line-height: 1.58;
}

.preset-stage {
  position: relative;
  margin-top: 30px;
}

.preset-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  width: calc(100% + 20px);
  margin-right: -20px;
  padding: 0 20px 14px 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.preset-carousel::-webkit-scrollbar {
  display: none;
}

.preset-carousel.is-comparing {
  scroll-snap-type: none;
}

.preset-card {
  position: relative;
  flex: 0 0 80%;
  width: 80%;
  max-width: 340px;
  scroll-snap-align: start;
  overflow: hidden;
  border-radius: 23px;
  background: #46382e;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 46px rgba(0,0,0,.18);
}

.preset-compare {
  --position: 50%;
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #2f261f;
  user-select: none;
  -webkit-user-select: none;
  contain: layout paint;
}

.preset-compare img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.compare-after {
  z-index: 1;
}

.compare-before {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--position)) 0 0);
}

.compare-label {
  position: absolute;
  z-index: 4;
  top: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(36, 28, 23, .58);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  letter-spacing: .08em;
  pointer-events: none;
}

.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }

.compare-handle {
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  left: var(--position);
  width: 72px;
  padding: 0;
  margin: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  transform: translateX(-50%);
  cursor: ew-resize;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255,255,255,.96);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(0,0,0,.18);
}

.compare-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,.98);
  color: #3b3029;
  box-shadow: 0 8px 22px rgba(0,0,0,.24);
  font-size: 20px;
  line-height: 1;
  letter-spacing: -2px;
  pointer-events: none;
}

.preset-compare.is-active .compare-knob {
  transform: translate(-50%, -50%) scale(1.05);
}

.preset-card-label {
  padding: 14px 16px 16px;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 25px;
  line-height: 1;
}

.preset-nav {
  display: none;
}

.preset-nav:disabled {
  opacity: .28;
  cursor: default;
}

@media (max-width: 719px) {
  .preset-carousel {
    scroll-snap-type: x proximity;
  }

  .preset-card {
    scroll-snap-stop: normal;
  }
}

@media (max-width: 380px) {
  .presets-inner {
    padding-inline: 14px;
  }

  .preset-carousel {
    width: calc(100% + 14px);
    margin-right: -14px;
    padding-right: 14px;
    gap: 12px;
  }

  .preset-card {
    flex-basis: 82%;
    width: 82%;
  }
}

@media (min-width: 720px) {
  .presets-section {
    padding-top: 92px;
    padding-bottom: 96px;
  }

  .presets-inner {
    padding: 0 36px;
  }

  .preset-card {
    flex-basis: 46%;
    width: 46%;
    max-width: 390px;
  }

  .compare-handle {
    width: 60px;
  }

  .compare-knob {
    width: 44px;
    height: 44px;
  }
}

@media (min-width: 980px) {
  .presets-section {
    padding-top: 94px;
    padding-bottom: 100px;
  }

  .presets-inner {
    width: min(100% - 72px, 1440px);
    padding: 0;
    display: grid;
    grid-template-columns: .62fr 2fr;
    align-items: center;
    gap: 58px;
  }

  .presets-copy {
    margin: 0;
    text-align: left;
  }

  .presets-description {
    margin-left: 0;
    margin-right: 0;
  }

  .preset-stage {
    min-width: 0;
    margin-top: 0;
    padding: 0 42px;
  }

  .preset-carousel {
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 18px;
    scroll-padding: 0;
    scroll-snap-type: x mandatory;
  }

  .preset-card {
    flex: 0 0 calc((100% - 36px) / 3);
    width: calc((100% - 36px) / 3);
    max-width: none;
  }

  .preset-nav {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.09);
    color: #f7f1ea;
    transform: translateY(-50%);
    cursor: pointer;
    backdrop-filter: blur(12px);
    font-size: 22px;
    line-height: 1;
  }

  .preset-nav-prev { left: 0; }
  .preset-nav-next { right: 0; }
}
