/* ── Wrapper ─────────────────────────────────────────────── */
.compare-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 5px;
  background: var(--ink);
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
}

/* Both images fill the container */
.compare-slider img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Right image clip container */
.cs-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%); /* updated by JS */
  transition: clip-path 0.04s linear;
}
.cs-clip img {
  position: absolute;
  inset: 0;
}

/* ── Divider line ────────────────────────────────────────── */
.cs-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;           /* updated by JS */
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0,0,0,0.35);
  transition: left 0.04s linear;
}

/* ── Handle (the circular grip) ──────────────────────────── */
.cs-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  pointer-events: none;
}
.cs-handle svg {
  width: 14px;
  height: 14px;
  color: var(--ink);
  flex-shrink: 0;
}

/* ── Labels ──────────────────────────────────────────────── */
.cs-label {
  position: absolute;
  bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.28rem 0.65rem;
  border-radius: 3px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.cs-label-left  { left:  0.85rem; }
.cs-label-right { right: 0.85rem; }

/* ── Figure wrapper for caption ──────────────────────────── */
.compare-figure {
  margin-bottom: 2.5rem;
}
.compare-figure:last-child {
  margin-bottom: 0;
}
.compare-caption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--ink-light);
  line-height: 1.55;
}
.compare-caption strong {
  color: var(--ink-mid);
  font-weight: 500;
}


/* Ensure the container clips the zoomed images */
.compare-slider {
  overflow: hidden; 
  position: relative;
}

/* Apply nearest neighbor rendering */
.compare-slider img {
  image-rendering: pixelated;
  transition: transform 0.3s ease;
  width: 100%;
  display: block;
}

/* Zoom state */
.compare-slider.is-zoomed img {
  transform: scale(8);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #fff;
}

/* ── Zoom Button Styling ────────────────────────────────── */
.cs-zoom-btn {
  display: block;
  margin: 1rem auto;
  padding: 0.55rem 5.25rem;
  
  border: 1.5px solid var(--accent);
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  
  /* Interaction */
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.cs-zoom-btn:hover {
  background: var(--accent-warm);
  border-color: var(--accent-warm);
  color: #fff;
}