/* =========================
   Before & Afters (Full CSS)
   Desktop: 2 images side-by-side (50/50) and FULL width
   Tablet/Mobile: horizontal swipe, 1 image per screen
   ========================= */

.beforeAfters {
  background: var(--beforeAfters-bg, #fffef2);
  padding: clamp(28px, 5vw, 80px) 0;
}

.beforeAfters__title {
  margin: 0 0 clamp(18px, 3vw, 36px);
  text-align: center;
  font-family: "Optima", "URW Classico", "Segoe UI", serif;
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 48px);
  line-height: 1.1;
  color: #111;
}

.beforeAfters__intro {
  max-width: 860px;
  margin: -10px auto clamp(18px, 3vw, 30px);
  text-align: center;
  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.75;
  color: rgba(17, 17, 17, 0.9);
}

.beforeAfters__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.beforeAfterCard {
  background: transparent;
  grid-column: 1 / -1;
}

.beforeAfterCard__groupTitle {
  margin: 0 0 12px 0;
  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 1.3vw, 20px);
  line-height: 1.2;
  color: #111;
}

.beforeAfterCard__pairWrap {
  width: 100%;
}

.beforeAfterCard__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  align-items: start;
}

.beforeAfterCard__shot {
  margin: 0;
  position: relative;
  height: clamp(220px, 22vw, 420px);
  overflow: hidden;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
}

.beforeAfterCard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.beforeAfterCard__caption {
  margin: 12px 0 0 0;
  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(200, 110, 130, 0.9);
}

.beforeAfterCard__credit {
  margin-left: 6px;
  white-space: nowrap;
}

/* =========================
   <= 900px
   改成横向滑动
   ========================= */
@media (max-width: 900px) {
  .beforeAfters__grid {
    grid-template-columns: 1fr;
  }

  .beforeAfterCard__pairWrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    padding-bottom: 6px;
  }

  .beforeAfterCard__pair {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(100vw - 48px);
    gap: 14px;
    width: max-content;
    min-width: 100%;
  }

  .beforeAfterCard__shot {
    scroll-snap-align: start;
    width: auto;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.04);
  }

  .beforeAfterCard__img {
    object-fit: contain;
    object-position: center;
    background: transparent;
  }
}

/* 小手机再微调 */
@media (max-width: 480px) {
  .beforeAfterCard__pair {
    grid-auto-columns: calc(100vw - 32px);
  }

  .beforeAfterCard__shot {
    aspect-ratio: 4 / 3;
  }
}

/* ===== 强制修复：图片区域不要拦截页面上下滑动 ===== */
@media (max-width: 900px) {
  .beforeAfterCard__pairWrap {
    touch-action: auto !important;          /* 关键：取消 pan-x 锁死 */
    overscroll-behavior-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .beforeAfterCard__shot,
  .beforeAfterCard__img {
    touch-action: auto !important;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
  }

  .beforeAfterCard__img {
    pointer-events: none;                   /* 避免图片本身抢手势 */
  }
}