/* ============================================================
   Before After Slider Block — Shared Styles
   Works in both the Gutenberg editor and on the front-end.
   ============================================================ */

/* Section wrapper */
/* .bab-section {
  padding: 4rem 1.25rem;
  background-color: #f8f9fa;
} */

/* Centered container */
/* .bab-container {
  max-width: 1100px;
  margin: 0 auto;
} */

/* ── Header ── */
.bab-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.bab-eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.bab-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 1rem;
  color: #111827;
}

.bab-desc {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: #6b7280;
  margin: 0;
}

/* ── Slider ── */
.bab-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #e5e7eb;
  user-select: none;
  cursor: ew-resize;
}

.bab-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Before image is clipped by its wrapper */
.bab-before-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* width controlled inline via JS */
}

.bab-before-wrap .bab-img--before {
  /* stretches to fill regardless of wrapper width */
  width: auto;
  max-width: none;
  height: 100%;
}

/* ── Labels ── */
.bab-label {
  position: absolute;
  top: 1rem;
  padding: 0.25rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.bab-label--before {
  left: 1rem;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
}

.bab-label--after {
  right: 1rem;
  background: #e31c1c;
  color: #fff;
}

/* ── Divider ── */
.bab-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
}

/* ── Handle ── */
.bab-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border-radius: 9999px;
  background: #fff;
  border: 2px solid #e31c1c;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e31c1c;
}

/* ── CTA ── */
.bab-cta {
  text-align: center;
  margin-top: 2.25rem;
}

.bab-btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border: 2px solid #111827;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.bab-btn:hover,
.bab-btn:focus-visible {
  background: #111827;
  color: #fff;
  outline: none;
}

/* ── Editor-only placeholder ── */
.bab-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border: 2px dashed #d1d5db;
  border-radius: 1rem;
  color: #9ca3af;
  font-size: 0.9375rem;
  text-align: center;
  padding: 2rem;
}

/* ── Editor wrapper ── */
.bab-editor-wrap {
  /* lets the editor preview look like the front-end */
}

/* ── Responsive ── */
@media (max-width: 640px) {
  /* .bab-section {
    padding: 2.5rem 1rem;
  } */

  .bab-label {
    font-size: 0.625rem;
    padding: 0.2rem 0.6rem;
  }

  .bab-handle {
    width: 2.25rem;
    height: 2.25rem;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .bab-btn {
    transition: none;
  }
}