/* ════════════════════════════════════════════════
   COMPARE CAROUSEL — before/after slider with
   draggable divider that cycles through pairs
   ════════════════════════════════════════════════ */

.compare-carousel-section {
  background: rgb(10 12 15);
  border-top: 1px solid rgb(38 43 51);
  padding: 72px 0 24px;
  overflow: hidden;
}

/* ── Outer wrapper ── */
#compare-carousel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  user-select: none;
}

/* ── Stage ── */
.cc-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgb(38 43 51);
  background: #111;
  cursor: ew-resize;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

/* Fade animation on pair switch */
.cc-stage.cc-fade .cc-bad,
.cc-stage.cc-fade .cc-good {
  animation: ccFadeIn 0.4s ease both;
}
@keyframes ccFadeIn {
  from { opacity: 0.2; }
  to   { opacity: 1; }
}

/* ── Left / Right layers ── */
.cc-layer {
  position: absolute;
  inset: 0;
}

/* GOOD = right side (back layer, always full width) */
.cc-good {
  z-index: 1;
}

/* BAD = left side (front layer, clipped) */
.cc-bad {
  z-index: 2;
  clip-path: inset(0 58% 0 0); /* starts at DEFAULT_POS 42% */
  will-change: clip-path;
}

/* ── Divider line ── */
.cc-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42%; /* matches DEFAULT_POS */
  width: 3px;
  background: rgba(255,255,255,0.85);
  z-index: 10;
  transform: translateX(-50%);
  pointer-events: none;
  will-change: left;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* ── Handle ── */
.cc-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(calc(-50% + var(--hx, 0px)), -50%);
  width: 44px;
  height: 44px;
  pointer-events: all;
  cursor: ew-resize;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
  transition: transform 0.15s ease;
}
.cc-handle:hover {
  transform: translate(calc(-50% + var(--hx, 0px)), -50%) scale(1.12);
}
.cc-handle svg {
  width: 100%;
  height: 100%;
}
.cc-handle:focus-visible {
  outline: 3px solid rgb(255 90 31);
  outline-offset: 3px;
  border-radius: 50%;
}

/* ── Side labels (BAD / GOOD overlaid on image) ── */
.cc-side-label {
  position: absolute;
  top: 16px;
  z-index: 8;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 3px;
  pointer-events: none;
}
.cc-bad-label {
  left: 16px;
  background: rgba(180, 30, 30, 0.88);
  color: #fff;
  /* stays visible as long as bad side has width — clip doesn't affect this label */
}
.cc-good-label {
  right: 16px;
  background: rgba(255, 90, 31, 0.92);
  color: #fff;
}

/* ── Caption bar ── */
.cc-caption-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 0;
  border-top: 3px solid rgb(255 90 31);
}

.cc-caption {
  padding: 14px 20px;
  font-family: Inter, sans-serif;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgb(138 144 156);
}
.cc-caption--bad {
  background: rgb(23 27 33);
  border-right: 1px solid rgba(255,255,255,0.06);
}
.cc-caption--good {
  background: rgb(23 27 33);
}

/* ── Dots ── */
.cc-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.cc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.2s;
}
.cc-dot:hover {
  background: rgba(255,255,255,0.4);
}
.cc-dot.active {
  background: rgb(255 90 31);
  transform: scale(1.25);
}

/* ── Pair label ── */
.cc-pair-label {
  text-align: center;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgb(138 144 156);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  #compare-carousel {
    padding: 24px 12px 28px;
  }
  .cc-stage {
    aspect-ratio: 4 / 3;
    border-radius: 8px;
  }
  .cc-caption-bar {
    grid-template-columns: 1fr;
  }
  .cc-caption--bad { display: none; } /* show only the good caption on mobile */
  .cc-caption {
    font-size: 0.78rem;
    padding: 10px 14px;
  }
  .cc-handle {
    width: 36px;
    height: 36px;
  }
}

/* Heading (added 2026-11-23 to match live site sections) */
.cc-head { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.cc-kicker { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; letter-spacing: 0.2em; color: rgb(255 90 31); margin: 0 0 12px; }
.cc-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.75rem, 3.5vw, 2.75rem); line-height: 1.1; color: rgb(233 236 241); margin: 0; }
.cc-sub { font-family: Inter, sans-serif; color: rgb(138 144 156); margin: 12px 0 0; font-size: 1rem; }
.cc-caption--bad { color: rgb(200 205 214); }
@media (max-width: 600px) { .compare-carousel-section { padding-top: 48px; } .cc-head { padding: 0 12px; } }

/* 2026-11-24: label wrappers clipped at the divider so each label hides with its picture */
.cc-label-clip { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.cc-label-clip--bad  { clip-path: inset(0 58% 0 0); }
.cc-label-clip--good { clip-path: inset(0 0 0 42%); }
