/* =========================================================================
 * Before / after showcase (front page, right under the services section).
 *
 * One shared markup for twelve presets: two stacked images, a divider driven by
 * the CSS variable --ba-x (0-100%), a native range input used as the accessible
 * drag handle, and a scroll-snap carousel that works in RTL and LTR.
 *
 * Enqueued only when the section is enabled (see functions.php), so the file
 * never costs anything on pages without a comparison.
 * ========================================================================= */

.wt-ba {
  --wt-ba-primary: var(--wt-primary, #2f68f5);
  --wt-ba-accent: var(--wt-accent, #85e8b6);
  --wt-ba-ink: var(--wt-ink, #101b31);
  --wt-ba-muted: var(--muted, #63718a);
  --wt-ba-line: var(--wt-line, #e3e8f1);
  --wt-ba-paper: var(--wt-paper, #f5f7fb);
  --wt-ba-radius: 24px;
  --wt-ba-gap: 22px;
  --wt-ba-per-view: 1;
  position: relative;
  padding-block: 62px 70px;
  background: #fff;
}

/* --- Section heading ---------------------------------------------------- */
.wt-ba-head {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}

.wt-ba-title {
  margin: 0;
  color: var(--wt-ba-ink);
  font-size: clamp(1.6rem, 3.4vw, 2.3rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.wt-ba-title::after {
  content: "";
  display: block;
  width: 74px;
  height: 4px;
  margin: 14px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wt-ba-primary), var(--wt-ba-accent));
}

.wt-ba-sub {
  margin: 14px 0 0;
  color: var(--wt-ba-muted);
  font-size: 1rem;
  line-height: 1.75;
}

/* --- Carousel shell ----------------------------------------------------- */
.wt-ba-carousel {
  position: relative;
}

.wt-ba-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-block: 6px;
  border-radius: var(--wt-ba-radius);
}

.wt-ba-viewport::-webkit-scrollbar {
  display: none;
}

.wt-ba-track {
  display: flex;
  gap: var(--wt-ba-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wt-ba-slide {
  flex: 0 0 calc((100% - (var(--wt-ba-per-view) - 1) * var(--wt-ba-gap)) / var(--wt-ba-per-view));
  min-width: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

/* --- Navigation --------------------------------------------------------- */
.wt-ba-nav {
  position: absolute;
  inset-block-start: calc(50% - 18px);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--wt-ba-ink);
  box-shadow: 0 10px 26px rgba(16, 27, 49, 0.18);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.wt-ba-nav:hover:not([disabled]) {
  background: var(--wt-ba-primary);
  color: #fff;
  transform: scale(1.06);
}

.wt-ba-nav[disabled] {
  opacity: 0.32;
  cursor: default;
}

.wt-ba-nav svg {
  width: 20px;
  height: 20px;
}

.wt-ba-prev {
  inset-inline-start: -8px;
}

.wt-ba-next {
  inset-inline-end: -8px;
}

/* Chevrons follow the reading direction: "next" always points to the end. */
.wt-ba-prev svg {
  transform: rotate(180deg);
}

html[dir="rtl"] .wt-ba-prev svg {
  transform: none;
}

html[dir="rtl"] .wt-ba-next svg {
  transform: rotate(180deg);
}

.wt-ba-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-block-start: 20px;
}

.wt-ba-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(16, 27, 49, 0.22);
  cursor: pointer;
  transition:
    width 0.25s ease,
    background 0.25s ease;
}

.wt-ba-dot.is-active {
  width: 28px;
  background: var(--wt-ba-primary);
}

/* --- The comparison stage ----------------------------------------------- */
.wt-ba-stage {
  --ba-x: 50%;
  position: relative;
  display: block;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--wt-ba-radius);
  background: #0b1220;
  box-shadow: 0 18px 44px rgba(16, 27, 49, 0.14);
  isolation: isolate;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.wt-ba-inner {
  position: absolute;
  inset: 0;
  display: block;
}

.wt-ba-frame {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}

.wt-ba-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.wt-ba-frame--before {
  z-index: 1;
}

.wt-ba-frame--after {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--ba-x)) 0 0);
  will-change: clip-path;
}

/* Labels sit on the stage (not inside the clipped frame) so they never cut
   off while the divider moves. */
.wt-ba-badge {
  position: absolute;
  z-index: 5;
  inset-block-start: 14px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(16, 27, 49, 0.74);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.2px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.wt-ba-badge--before {
  inset-inline-start: 14px;
}

.wt-ba-badge--after {
  inset-inline-end: 14px;
  background: rgba(47, 104, 245, 0.92);
}

.wt-ba-handle {
  position: absolute;
  z-index: 3;
  inset-block: 0;
  left: var(--ba-x);
  width: 3px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px rgba(16, 27, 49, 0.08),
    0 0 22px rgba(16, 27, 49, 0.3);
  pointer-events: none;
}

.wt-ba-grip {
  position: absolute;
  z-index: 5;
  inset-block-start: 50%;
  left: var(--ba-x);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  color: var(--wt-ba-primary);
  box-shadow: 0 10px 24px rgba(16, 27, 49, 0.28);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: box-shadow 0.2s ease;
}

.wt-ba-grip svg {
  width: 22px;
  height: 22px;
}

/* The native range is the real control: full-size, invisible, keyboard and
   touch friendly, and it needs no drag maths in JavaScript. */
.wt-ba-range {
  position: absolute;
  inset: 0;
  z-index: 6;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: ew-resize;
}

.wt-ba-range:focus {
  outline: 0;
}

.wt-ba-stage:focus-within .wt-ba-grip {
  box-shadow:
    0 0 0 4px rgba(47, 104, 245, 0.4),
    0 10px 24px rgba(16, 27, 49, 0.28);
}

.wt-ba-caption {
  position: absolute;
  z-index: 5;
  inset-block-end: 14px;
  inset-inline-start: 14px;
  max-width: calc(100% - 28px);
  margin: 0;
  padding: 8px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--wt-ba-ink);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(16, 27, 49, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

/* Static fallback for browsers without clip-path support: show the "after"
   image with a simple vertical wipe instead of a broken stack. */
/* Single slide needs no controls. */
.wt-ba-carousel[data-single="1"] .wt-ba-nav,
.wt-ba-carousel[data-single="1"] .wt-ba-dots {
  display: none;
}

/* =========================================================================
 * Preset 1 · split — the classic draggable divider (default)
 * ========================================================================= */
.wt-ba--split .wt-ba-grip {
  color: var(--wt-ba-primary);
}

/* =========================================================================
 * Preset 2 · curtain — thick luminous divider with a pill grip
 * ========================================================================= */
.wt-ba--curtain {
  background: linear-gradient(180deg, #fff 0%, var(--wt-ba-paper) 100%);
}

.wt-ba--curtain .wt-ba-stage {
  border-radius: 20px;
  box-shadow: 0 26px 60px rgba(16, 27, 49, 0.22);
}

.wt-ba--curtain .wt-ba-handle {
  width: 6px;
  background: linear-gradient(180deg, #fff, #dbe5fb, #fff);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.65),
    0 0 36px rgba(47, 104, 245, 0.55);
}

.wt-ba--curtain .wt-ba-grip {
  width: 34px;
  height: 82px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #eef4ff);
}

/* =========================================================================
 * Preset 3 · glass — frosted inner edge and a soft light sweep
 * ========================================================================= */
.wt-ba--glass {
  background: linear-gradient(135deg, #eef3ff 0%, #ffffff 55%, #eafaf3 100%);
}

.wt-ba--glass .wt-ba-stage {
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 0 0 9px rgba(255, 255, 255, 0.16),
    0 24px 54px rgba(16, 27, 49, 0.16);
}

.wt-ba--glass .wt-ba-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 38%, rgba(16, 27, 49, 0.2));
}

.wt-ba--glass .wt-ba-grip {
  background: rgba(255, 255, 255, 0.82);
  color: var(--wt-ba-primary);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 12px 28px rgba(16, 27, 49, 0.22);
}

/* =========================================================================
 * Preset 4 · minimal — hairline divider, no shadows, small flat grip
 * ========================================================================= */
.wt-ba--minimal {
  background: #fff;
}

.wt-ba--minimal .wt-ba-stage {
  border: 1px solid var(--wt-ba-line);
  border-radius: 10px;
  box-shadow: none;
}

.wt-ba--minimal .wt-ba-handle {
  width: 1px;
  background: rgba(16, 27, 49, 0.55);
  box-shadow: none;
}

.wt-ba--minimal .wt-ba-grip {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(16, 27, 49, 0.35);
  background: #fff;
  color: var(--wt-ba-ink);
  box-shadow: none;
}

.wt-ba--minimal .wt-ba-badge {
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--wt-ba-ink);
  box-shadow: 0 1px 0 rgba(16, 27, 49, 0.12);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wt-ba--minimal .wt-ba-badge--after {
  background: var(--wt-ba-ink);
  color: #fff;
}

.wt-ba--minimal .wt-ba-caption {
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 27, 49, 0.12);
}

/* =========================================================================
 * Preset 5 · frame — the comparison sits inside a device bezel
 * ========================================================================= */
.wt-ba--frame .wt-ba-stage {
  padding: 14px;
  border-radius: 36px;
  background: linear-gradient(160deg, #1b273d, #0c1526);
  box-shadow: 0 26px 60px rgba(16, 27, 49, 0.32);
}

.wt-ba--frame .wt-ba-frame {
  inset: 14px;
  border-radius: 24px;
}

.wt-ba--frame .wt-ba-handle {
  inset-block: 14px;
}

.wt-ba--frame .wt-ba-grip {
  width: 40px;
  height: 40px;
}

.wt-ba--frame .wt-ba-stage::before {
  content: "";
  position: absolute;
  z-index: 7;
  inset-block-start: 5px;
  inset-inline-start: 50%;
  width: 82px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-50%);
}

.wt-ba--frame .wt-ba-badge {
  inset-block-start: 26px;
}

.wt-ba--frame .wt-ba-badge--before {
  inset-inline-start: 26px;
}

.wt-ba--frame .wt-ba-badge--after {
  inset-inline-end: 26px;
}

.wt-ba--frame .wt-ba-caption {
  inset-block-end: 26px;
  inset-inline-start: 26px;
  max-width: calc(100% - 52px);
}

/* =========================================================================
 * Preset 6 · polaroid — printed photo card with a caption strip
 * ========================================================================= */
.wt-ba--polaroid {
  background: repeating-linear-gradient(45deg, #fbfcff 0 12px, #f6f8fc 12px 24px);
}

.wt-ba--polaroid .wt-ba-stage {
  aspect-ratio: 16 / 12;
  padding: 13px 13px 64px;
  border-radius: 6px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(16, 27, 49, 0.12),
    0 22px 48px rgba(16, 27, 49, 0.18);
}

.wt-ba--polaroid .wt-ba-frame {
  inset: 13px 13px 64px;
  border-radius: 3px;
}

.wt-ba--polaroid .wt-ba-handle {
  inset-block: 13px 64px;
}

.wt-ba--polaroid .wt-ba-badge {
  inset-block-start: 13px;
}

.wt-ba--polaroid .wt-ba-caption {
  inset: auto 18px 18px;
  max-width: none;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--wt-ba-ink);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* =========================================================================
 * Preset 7 · blueprint — technical drawing with a dashed frame and ruler
 * ========================================================================= */
.wt-ba--blueprint {
  background-color: #f7f9ff;
  background-image:
    linear-gradient(rgba(47, 104, 245, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 104, 245, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
}

.wt-ba--blueprint .wt-ba-stage {
  border: 1px dashed rgba(47, 104, 245, 0.6);
  border-radius: 6px;
  box-shadow: none;
}

.wt-ba--blueprint .wt-ba-handle {
  width: 2px;
  background: repeating-linear-gradient(180deg, var(--wt-ba-primary) 0 9px, transparent 9px 18px);
  box-shadow: none;
}

.wt-ba--blueprint .wt-ba-grip {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(47, 104, 245, 0.75);
  border-radius: 5px;
  background: #fff;
  color: var(--wt-ba-primary);
  box-shadow: 0 4px 12px rgba(47, 104, 245, 0.2);
}

.wt-ba--blueprint .wt-ba-badge {
  border: 1px solid rgba(47, 104, 245, 0.5);
  border-radius: 4px;
  background: #fff;
  color: var(--wt-ba-primary);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.wt-ba--blueprint .wt-ba-badge--after {
  background: var(--wt-ba-primary);
  color: #fff;
}

.wt-ba--blueprint .wt-ba-caption {
  border: 1px solid rgba(47, 104, 245, 0.25);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.96);
}

/* =========================================================================
 * Preset 8 · neon — dark band with a glowing divider
 * ========================================================================= */
.wt-ba--neon {
  --wt-ba-ink: #fff;
  --wt-ba-muted: #9db0d0;
  --wt-ba-line: rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 12% 8%, rgba(47, 104, 245, 0.28), transparent 52%),
    radial-gradient(circle at 88% 92%, rgba(133, 232, 182, 0.16), transparent 48%),
    #070d18;
}

.wt-ba--neon .wt-ba-title {
  color: #fff;
  text-shadow: 0 0 32px rgba(47, 104, 245, 0.55);
}

.wt-ba--neon .wt-ba-sub {
  color: #9db0d0;
}

.wt-ba--neon .wt-ba-stage {
  background: #060b14;
  box-shadow:
    0 0 0 1px rgba(133, 232, 182, 0.35),
    0 0 46px rgba(47, 104, 245, 0.45),
    0 26px 60px rgba(0, 0, 0, 0.55);
}

.wt-ba--neon .wt-ba-handle {
  width: 2px;
  background: linear-gradient(180deg, transparent, #85e8b6 20%, #85e8b6 80%, transparent);
  box-shadow: 0 0 18px rgba(133, 232, 182, 0.9);
}

.wt-ba--neon .wt-ba-grip {
  background: #0c1526;
  color: #85e8b6;
  box-shadow:
    0 0 0 1px rgba(133, 232, 182, 0.6),
    0 0 26px rgba(133, 232, 182, 0.55);
}

.wt-ba--neon .wt-ba-badge {
  background: rgba(9, 15, 28, 0.85);
  color: #eaf1ff;
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.4);
}

.wt-ba--neon .wt-ba-badge--after {
  background: rgba(133, 232, 182, 0.16);
  color: #85e8b6;
}

.wt-ba--neon .wt-ba-caption {
  background: rgba(9, 15, 28, 0.86);
  color: #eaf1ff;
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.28);
}

.wt-ba--neon .wt-ba-nav {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(122, 162, 255, 0.35);
}

.wt-ba--neon .wt-ba-nav:hover:not([disabled]) {
  background: #85e8b6;
  color: #06281c;
}

.wt-ba--neon .wt-ba-dot {
  background: rgba(255, 255, 255, 0.28);
}

.wt-ba--neon .wt-ba-dot.is-active {
  background: #85e8b6;
}

/* =========================================================================
 * Preset 9 · diagonal — a slanted wipe instead of a straight divider
 * ========================================================================= */
.wt-ba--diagonal .wt-ba-frame--after {
  clip-path: polygon(var(--ba-x) 0, 100% 0, 100% 100%, calc(var(--ba-x) - 14%) 100%);
}

.wt-ba--diagonal .wt-ba-handle {
  width: 3px;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.35));
  box-shadow: 0 0 26px rgba(16, 27, 49, 0.32);
  transform: translateX(-50%) skewX(-7deg);
}

.wt-ba--diagonal .wt-ba-badge {
  border-radius: 4px 14px 14px 14px;
}

/* =========================================================================
 * Preset 10 · circle — the "after" image grows out of a circle
 * ========================================================================= */
.wt-ba--circle .wt-ba-frame--after {
  clip-path: circle(calc(var(--ba-x) * 0.8) at 50% 50%);
}

.wt-ba--circle .wt-ba-handle,
.wt-ba--circle .wt-ba-grip {
  display: none;
}

.wt-ba--circle .wt-ba-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 58%, rgba(16, 27, 49, 0.34) 100%);
}

/* =========================================================================
 * Preset 11 · hover — reveal on hover / tap, no handle at all
 * ========================================================================= */
.wt-ba--hover .wt-ba-stage {
  cursor: pointer;
}

.wt-ba--hover .wt-ba-frame--after {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.wt-ba--hover .wt-ba-stage:hover .wt-ba-frame--after,
.wt-ba--hover .wt-ba-stage:focus-visible .wt-ba-frame--after,
.wt-ba--hover .wt-ba-stage.is-active .wt-ba-frame--after {
  clip-path: inset(0);
}

.wt-ba--hover .wt-ba-handle,
.wt-ba--hover .wt-ba-grip,
.wt-ba--hover .wt-ba-range {
  display: none;
}

.wt-ba--hover .wt-ba-badge--after {
  background: rgba(47, 104, 245, 0.95);
}

/* =========================================================================
 * Preset 12 · flip — a 3D card that turns from "before" to "after"
 * ========================================================================= */
.wt-ba--flip .wt-ba-stage {
  background: transparent;
  box-shadow: none;
  perspective: 1400px;
  cursor: pointer;
}

.wt-ba--flip .wt-ba-inner {
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.wt-ba--flip .wt-ba-stage.is-active .wt-ba-inner,
.wt-ba--flip .wt-ba-stage:hover .wt-ba-inner {
  transform: rotateY(180deg);
}

.wt-ba--flip .wt-ba-frame {
  border-radius: var(--wt-ba-radius);
  box-shadow: 0 18px 44px rgba(16, 27, 49, 0.16);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.wt-ba--flip .wt-ba-frame--after {
  clip-path: none;
  transform: rotateY(180deg);
}

.wt-ba--flip .wt-ba-handle,
.wt-ba--flip .wt-ba-grip,
.wt-ba--flip .wt-ba-range,
.wt-ba--flip .wt-ba-badge {
  display: none;
}

/* =========================================================================
 * Focus ring shared by the tap-to-reveal presets
 * ========================================================================= */
.wt-ba--hover .wt-ba-stage:focus-visible,
.wt-ba--flip .wt-ba-stage:focus-visible {
  outline: 3px solid rgba(47, 104, 245, 0.55);
  outline-offset: 4px;
}

/* =========================================================================
 * Responsive
 * ========================================================================= */
@media (max-width: 900px) {
  .wt-ba {
    --wt-ba-per-view: 1 !important;
    padding-block: 50px 58px;
  }

  .wt-ba-head {
    margin-block-end: 26px;
  }
}

@media (max-width: 720px) {
  .wt-ba {
    padding-block: 42px 50px;
  }

  .wt-ba-nav {
    width: 38px;
    height: 38px;
  }

  .wt-ba-prev {
    inset-inline-start: -2px;
  }

  .wt-ba-next {
    inset-inline-end: -2px;
  }

  .wt-ba-nav svg {
    width: 17px;
    height: 17px;
  }

  .wt-ba-grip {
    width: 40px;
    height: 40px;
  }

  .wt-ba-badge {
    inset-block-start: 10px;
    padding: 5px 10px;
    font-size: 0.7rem;
  }

  .wt-ba-badge--before {
    inset-inline-start: 10px;
  }

  .wt-ba-badge--after {
    inset-inline-end: 10px;
  }

  .wt-ba-caption {
    inset-block-end: 10px;
    inset-inline-start: 10px;
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  .wt-ba--frame .wt-ba-stage {
    padding: 9px;
    border-radius: 26px;
  }

  .wt-ba--frame .wt-ba-frame {
    inset: 9px;
    border-radius: 18px;
  }

  .wt-ba--frame .wt-ba-handle {
    inset-block: 9px;
  }

  .wt-ba--frame .wt-ba-badge {
    inset-block-start: 20px;
  }

  .wt-ba--frame .wt-ba-badge--before {
    inset-inline-start: 20px;
  }

  .wt-ba--frame .wt-ba-badge--after {
    inset-inline-end: 20px;
  }

  .wt-ba--frame .wt-ba-caption {
    inset-block-end: 20px;
    inset-inline-start: 20px;
    max-width: calc(100% - 40px);
  }

  .wt-ba--polaroid .wt-ba-stage {
    padding: 9px 9px 54px;
  }

  .wt-ba--polaroid .wt-ba-frame {
    inset: 9px 9px 54px;
  }

  .wt-ba--polaroid .wt-ba-handle {
    inset-block: 9px 54px;
  }
}

@media (max-width: 480px) {
  .wt-ba-stage {
    aspect-ratio: 4 / 3;
  }

  .wt-ba--polaroid .wt-ba-stage {
    aspect-ratio: 1 / 1;
  }

  .wt-ba-title {
    font-size: 1.35rem;
  }

  .wt-ba-sub {
    font-size: 0.92rem;
  }

  .wt-ba-grip {
    width: 36px;
    height: 36px;
  }

  .wt-ba-grip svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wt-ba-viewport {
    scroll-behavior: auto;
  }

  .wt-ba-frame--after,
  .wt-ba-grip,
  .wt-ba-nav,
  .wt-ba-dot,
  .wt-ba--flip .wt-ba-inner {
    transition: none !important;
  }
}

/* Browsers without clip-path: fall back to a simple width wipe so the "after"
   image is still reachable instead of stacking on top of "before". */
@supports not (clip-path: inset(0 0 0 0)) {
  .wt-ba-frame--after {
    clip-path: none;
    width: var(--ba-x);
    inset-inline-end: auto;
  }

  .wt-ba--circle .wt-ba-frame--after,
  .wt-ba--diagonal .wt-ba-frame--after,
  .wt-ba--flip .wt-ba-frame--after {
    clip-path: none;
  }

  .wt-ba--flip .wt-ba-frame--after {
    width: 100%;
  }
}
