.redesign-comparison {
  --comparison-position: 50%;

  position: relative;

  width: 100%;

  aspect-ratio: 16 / 10;

  overflow: hidden;

  border-radius: 27px;

  background: #dfe5df;

  cursor: ew-resize;

  user-select: none;

  touch-action: pan-y;

  box-shadow:
    inset 7px 7px 16px rgba(70, 87, 81, 0.12),
    inset -7px -7px 16px rgba(255, 255, 255, 0.8);

  isolation: isolate;
}

/* =========================================================
   COMPARISON LAYERS
========================================================= */

.redesign-comparison__layer {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;
}

.redesign-comparison__layer--after {
  z-index: 1;
}

.redesign-comparison__layer--before {
  z-index: 2;

  clip-path: inset(0 calc(100% - var(--comparison-position)) 0 0);
}

/* =========================================================
   IMAGES
========================================================= */

.redesign-comparison__image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  object-position: center;

  pointer-events: none;

  user-select: none;

  -webkit-user-drag: none;
}

/* =========================================================
   BADGES
========================================================= */

.redesign-comparison__badge {
  position: absolute;

  top: 17px;

  z-index: 10;

  display: flex;

  align-items: center;
  justify-content: center;

  min-width: 30px;
  height: 20px;

  padding: 0 14px;

  border-radius: 999px;

  font-size: 12px;

  font-weight: 800;

  white-space: nowrap;

  backdrop-filter: blur(15px);

  -webkit-backdrop-filter: blur(15px);

  pointer-events: none;
}

.redesign-comparison__badge--before {
  left: 17px;

  color: #ffffff;

  background: rgba(37, 43, 42, 0.68);

  border: 1px solid rgba(255, 255, 255, 0.16);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

.redesign-comparison__badge--after {
  right: 17px;

  color: #ffffff;

  background: rgba(8, 91, 82, 0.82);

  border: 1px solid rgba(255, 255, 255, 0.18);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
}

/* =========================================================
   DIVIDER
========================================================= */

.redesign-comparison__divider {
  position: absolute;

  top: 0;
  bottom: 0;

  left: var(--comparison-position);

  width: 2px;

  transform: translateX(-50%);

  z-index: 8;

  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.98) 30%,
    rgba(255, 255, 255, 0.98) 70%,
    rgba(255, 255, 255, 0.4)
  );

  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.8),
    0 0 24px rgba(11, 91, 82, 0.28);

  pointer-events: none;
}

/* =========================================================
   HANDLE
========================================================= */

.redesign-comparison__handle {
  position: absolute;

  top: 50%;
  left: var(--comparison-position);

  width: 58px;
  height: 58px;

  padding: 0;

  transform: translate(-50%, -50%);

  z-index: 12;

  display: flex;

  align-items: center;
  justify-content: center;

  border: 1px solid rgba(255, 255, 255, 0.95);

  border-radius: 50%;

  background: linear-gradient(145deg, #f7faf6, #dce4dc);

  box-shadow:
    9px 10px 22px rgba(44, 65, 59, 0.22),
    -8px -8px 18px rgba(255, 255, 255, 0.96),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);

  cursor: ew-resize;

  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;

  appearance: none;

  -webkit-tap-highlight-color: transparent;
}

.redesign-comparison__handle:hover {
  box-shadow:
    11px 12px 26px rgba(44, 65, 59, 0.25),
    -9px -9px 20px rgba(255, 255, 255, 0.98),
    0 0 0 5px rgba(11, 91, 82, 0.07);
}

.redesign-comparison__handle:active {
  transform: translate(-50%, -50%) scale(0.94);

  box-shadow:
    inset 5px 5px 10px rgba(70, 87, 81, 0.16),
    inset -5px -5px 10px rgba(255, 255, 255, 0.9);
}

.redesign-comparison__handle:focus-visible {
  outline: 3px solid rgba(11, 91, 82, 0.35);

  outline-offset: 4px;
}

/* =========================================================
   HANDLE ICON
========================================================= */

.redesign-comparison__handle-icon {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  border-radius: 50%;

  background: linear-gradient(
    145deg,
    rgba(11, 91, 82, 0.1),
    rgba(255, 255, 255, 0.5)
  );

  box-shadow:
    inset 2px 2px 5px rgba(52, 68, 63, 0.08),
    inset -2px -2px 5px rgba(255, 255, 255, 0.85);
}

.redesign-comparison__handle-icon svg {
  width: 20px;
  height: 20px;

  fill: none;

  stroke: var(--redesign-green, #0b5b52);

  stroke-width: 2;

  stroke-linecap: round;

  stroke-linejoin: round;
}

/* =========================================================
   CARD CONTENT
========================================================= */


/* بخش قبل/بعد: بدون تغییر چیدمان پایه و امکان اسکرول عمودی روی موبایل */
.redesign-comparison { --redesign-green:#0b5b52; direction:ltr; }
.redesign-comparison__handle { touch-action:pan-y; }
.redesign-comparison__badge { direction:rtl; }
.redesign-card__tags { flex-wrap:wrap; }
.redesign-tag { max-width:100%; overflow-wrap:anywhere; }
.redesign-card__title,.redesign-card__text { overflow-wrap:anywhere; }
#modalComparison[hidden] { display:none; }
.portfolio-comparison-archive { margin-block:24px; min-width:0; }
.portfolio-comparison-archive h2 { font-size:1.2rem; }
.portfolio-comparison-tags { display:flex; flex-wrap:wrap; gap:8px; padding:0; list-style:none; }
.portfolio-comparison-tags li { padding:5px 12px; border-radius:18px; background:#edf2ee; color:#0b5b52; overflow-wrap:anywhere; }
@media(max-width:600px){.redesign-comparison{border-radius:18px}.redesign-comparison__handle{width:42px;height:42px}}

.redesign-grid > .redesign-card:only-child {grid-column:1/-1; width:100%; max-width:560px; margin-inline:auto; box-sizing:border-box;}
