/* Before & After — RedDent "Choose us Section": title + three feature cards (rise 50px),
   then a grid of REAL cases (layout ref: reodental.framer.website — two compare cards per
   row, each with a short caption). Every card has its own drag-to-compare slider
   (assets/js/ba.js). Images: old-site/before-after (patients' consent on record). */
.ba { background: var(--bg); }
.ba__top { padding-bottom: 64px; }
.ba__cards {
  margin-top: 80px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.ba-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.ba-card__icon {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #fff;
}
.ba-card__icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ba-card__title {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.3px;
  color: var(--navy);
}
.ba-card__text {
  margin: 0;
  font-size: 16px;
  line-height: 27.2px;
  letter-spacing: -0.3px;
  color: rgba(11, 41, 93, .75);
}

.ba__gallery { padding: 0 var(--gutter) var(--section-y); }
/* one case at a time (user: "one card with slider, not full screen, simple"):
   a compact card — compare image left, text right — the four cases stacked in one
   grid cell and crossfaded; arrows + counter sit under the text (assets/js/ba.js). */
.ba__slider {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}
.ba__slides { display: grid; }
.ba-case {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 24px 48px -36px rgba(var(--shadow-tint), .35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.ba-case.is-active { opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
.ba-case .ba__compare { aspect-ratio: 4 / 3; }
.ba__nav {
  position: absolute;
  right: clamp(20px, 2.4vw, 32px);
  bottom: clamp(20px, 2.4vw, 32px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ba__arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(206, 158, 69, .45);
  cursor: pointer;
  transition: background-color .3s ease;
}
.ba__arrow:hover { background: var(--light-yellow); }
.ba__arrow:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.ba__arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ba__count { font-size: var(--fs-small); letter-spacing: .06em; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ba__count b { font-weight: 600; color: var(--ink-strong); }
.ba-case__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: clamp(24px, 3vw, 40px) clamp(24px, 3vw, 40px) 96px;
}
.ba-case__meta {
  margin: 0 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.ba-case__num {
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(206, 158, 69, .45);
  color: var(--gold);
  letter-spacing: .06em;
}
.ba-case__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-strong);
}
.ba-case__text {
  margin: 0;
  max-width: 46ch;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--ink-soft);
}
.ba-case .link-arrow { margin-top: 2px; min-height: 36px; }

.ba__compare {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--navy-deep);
  cursor: ew-resize;
  user-select: none;
}
.ba__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba__before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.ba__tag {
  position: absolute;
  bottom: 14px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(11, 41, 93, .6);
  color: var(--cream);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ba__tag--before { left: 14px; }
.ba__tag--after { right: 14px; }
.ba__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--cream);
  pointer-events: none;
}
.ba__handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}
.ba__handle span::before,
.ba__handle span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border: solid var(--navy);
  border-width: 0 0 2px 2px;
}
.ba__handle span::before { left: 10px; transform: translateY(-50%) rotate(45deg); }
.ba__handle span::after { right: 10px; transform: translateY(-50%) rotate(-135deg); }
.ba__range {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.ba__range:focus-visible + * { outline: none; }
.ba__compare:has(.ba__range:focus-visible) .ba__handle span { outline: 3px solid var(--cream); outline-offset: 3px; }

@media (max-width: 1199.98px) {
  .ba__cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 809.98px) {
  .ba__cards { grid-template-columns: 1fr; margin-top: 40px; }
  .ba-case { grid-template-columns: 1fr; }
  .ba-case .ba__compare { aspect-ratio: 3 / 2; }
  .ba-case__body { padding: 22px 20px 84px; }
}
