/* PresentTool™ Storytelling — section: before/after slider */

.story-beforeafter {
  position: relative;
  width: 100%;
  background: var(--pt-surface-1);
  color: var(--pt-text);
  padding: 96px 24px;
}
.ba-inner {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}
.ba-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--pt-mono);
  font-size: 11px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--pt-primary);
}
.ba-eyebrow-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--story-accent, var(--pt-primary));
}
.ba-title {
  font-family: var(--pt-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
}

/* ─── Slider stage ─── */
.ba-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  cursor: ew-resize;
  user-select: none;
  touch-action: pan-y;
}
.ba-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-clip {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  will-change: width;
}
/* The before image must stay full-width inside the clipped container so it
   doesn't squash as the clip narrows. */
.ba-clip .ba-img--before {
  width: 100vw;
  max-width: 980px;
}

.ba-tag {
  position: absolute;
  top: 16px;
  z-index: 4;
  font-family: var(--pt-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ba-tag--before { left: 16px; }
.ba-tag--after  { right: 16px; }

.ba-handle {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  z-index: 5;
  transform: translateX(-50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ba-handle-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.ba-handle-grip {
  position: relative;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

/* The actual range input is invisible but sits on top for keyboard / a11y. */
.ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 6;
}

@media (max-width: 768px) {
  .story-beforeafter { padding: 64px 18px; }
  .ba-title { margin-bottom: 24px; }
  .ba-stage { aspect-ratio: 4 / 3; }
  .ba-handle-grip { width: 34px; height: 34px; }
}
