/* Hoosha Before After Slider */
.hoosha-ba { width: 100%; }
.hoosha-ba-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #eee;
  --hoosha-pos: 50%;
  isolation: isolate;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.hoosha-ba-viewport[style*="height"] { aspect-ratio: auto; }

/* layers */
.hoosha-ba-after, .hoosha-ba-before {
  position: absolute; inset: 0;
  margin: 0;
}
.hoosha-ba-after img, .hoosha-ba-before img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  max-width: none;
  pointer-events: none;
  display: block;
}
.hoosha-ba-after { z-index: 1; }
.hoosha-ba-before {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--hoosha-pos)) 0 0);
}
/* vertical: before on top */
.hoosha-orientation-vertical .hoosha-ba-viewport { touch-action: pan-x; cursor: ns-resize; }
.hoosha-orientation-horizontal .hoosha-ba-viewport { cursor: ew-resize; }
.hoosha-orientation-vertical .hoosha-ba-before {
  clip-path: inset(0 0 calc(100% - var(--hoosha-pos)) 0);
}

/* overlay */
.hoosha-ba-overlay { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* divider */
.hoosha-ba-divider {
  position: absolute; z-index: 4;
  background: #fff;
  pointer-events: none;
}
.hoosha-orientation-horizontal .hoosha-ba-divider {
  top: 0; bottom: 0; left: var(--hoosha-pos);
  width: 3px; transform: translateX(-50%);
}
.hoosha-orientation-vertical .hoosha-ba-divider {
  left: 0; right: 0; top: var(--hoosha-pos);
  height: 3px; transform: translateY(-50%);
}
.hoosha-ba-divider-dashed { background: repeating-linear-gradient(to bottom, #fff 0 8px, transparent 8px 16px) !important; }
.hoosha-orientation-vertical .hoosha-ba-divider-dashed { background: repeating-linear-gradient(to right, #fff 0 8px, transparent 8px 16px) !important; }
.hoosha-ba-divider-dotted { background: radial-gradient(circle, #fff 1.5px, transparent 2px) !important; background-size: 8px 8px !important; }

/* handle */
.hoosha-ba-handle {
  position: absolute; z-index: 5;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff; color: #333;
  display: flex; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 18px; line-height: 1;
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
  border: 2px solid #fff;
  pointer-events: none;
  user-select: none;
}
.hoosha-orientation-horizontal .hoosha-ba-handle {
  left: var(--hoosha-pos); top: 50%;
  transform: translate(-50%, -50%);
  flex-direction: row;
}
.hoosha-orientation-vertical .hoosha-ba-handle {
  top: var(--hoosha-pos); left: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
}
.hoosha-orientation-vertical .hoosha-ba-arrow { transform: rotate(90deg); display: inline-block; }
.hoosha-ba-handle .hoosha-ba-arrow { font-weight: 700; padding: 0 1px; }
.hoosha-ba-handle svg { width: 1.2em; height: 1.2em; }
.hoosha-ba-dots { display: flex; gap: 4px; }
.hoosha-orientation-vertical .hoosha-ba-dots { flex-direction: column; }
.hoosha-ba-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: block; }

/* labels */
.hoosha-ba-label {
  position: absolute; z-index: 6;
  top: 16px;
  padding: 8px 16px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px; border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
}
.hoosha-ba-label-before { inset-inline-start: 16px; left: 16px; }
.hoosha-ba-label-after { inset-inline-end: 16px; right: 16px; }
[dir="rtl"] .hoosha-ba-label-before { left: auto; }
.hoosha-orientation-vertical .hoosha-ba-label-before { top: 16px; }
.hoosha-orientation-vertical .hoosha-ba-label-after { top: auto; bottom: 16px; }

/* label visibility modes */
.hoosha-labels-on_hover .hoosha-ba-label { opacity: 0; transition: opacity .25s; }
.hoosha-labels-on_hover .hoosha-ba-viewport:hover .hoosha-ba-label { opacity: 1; }
.hoosha-labels-always .hoosha-ba-label { opacity: 1; }

/* reset */
.hoosha-ba-reset {
  margin-top: 10px;
  border: 1px solid #ddd; background: #fff;
  padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer;
}
.hoosha-ba-reset:hover { background: #f5f5f5; }

/* dragging state */
.hoosha-ba-viewport.hoosha-dragging { cursor: grabbing; }
.hoosha-ba-viewport.hoosha-dragging img { pointer-events: none; }

@media (max-width: 640px) {
  .hoosha-ba-handle { box-shadow: 0 2px 10px rgba(0,0,0,.35); }
  .hoosha-ba-label { font-size: 12px; padding: 6px 12px; }
}
