/* 施工前・施工後 比較スライダー */
.contents-archive .contents-list02 ul li .works-before-after-card {
  display: block;
  height: 100%;
  background: #15161A;
}

.contents-archive .contents-list02 ul li .works-before-after-card .contents-img {
  position: relative;
  overflow: hidden;
}

.contents-archive .contents-list02 ul li .works-before-after-card .contents-img::after {
  display: none;
}

.contents-archive .contents-list02 ul li .works-before-after-card .contents-text {
  padding: 16px;
}

.contents-archive .contents-list02 ul li .works-before-after-card .contents-text a {
  display: inline;
  height: auto;
  color: inherit;
  background: transparent;
}

.contents-archive .contents-list02 ul li .works-before-after-media-note {
  width: auto;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}

.contents-archive .contents-list02 ul li .before-after__frame {
  border-radius: 0;
  box-shadow: none;
}

.before-after {
  --before-after-position: 50%;
  --before-after-aspect-ratio: 4 / 3;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  isolation: isolate;
}

.contents-single .works-before-after-single {
  display: block;
}

.contents-single .works-before-after-single__slider {
  width: 100%;
}

.contents-single .works-before-after-single__text {
  margin: 24px 0 0;
  line-height: 1.8;
}

.before-after__frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--before-after-aspect-ratio);
  overflow: hidden;
  background: #e9e7e2;
  border-radius: 2px;
  box-shadow: 0 12px 30px rgba(24, 32, 39, 0.12);
  isolation: isolate;
}

.before-after__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}

.before-after__image--after {
  z-index: 1;
}

.before-after__image--before {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--before-after-position)) 0 0);
}

.before-after__label {
  position: absolute;
  top: 16px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  color: #fff;
  background: rgba(25, 31, 35, 0.72);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.before-after__label--before {
  left: 16px;
}

.before-after__label--after {
  right: 16px;
}

.before-after__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--before-after-position);
  z-index: 6;
  width: 0;
  pointer-events: none;
}

.before-after__divider::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(25, 31, 35, 0.08), 0 0 14px rgba(0, 0, 0, 0.24);
  content: '';
}

.before-after__handle {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: #fff;
  border: 1px solid rgba(25, 31, 35, 0.12);
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.22);
  transform: translate(-50%, -50%);
}

.before-after__handle::before,
.before-after__handle::after {
  width: 9px;
  height: 9px;
  border-top: 2px solid #27343b;
  border-bottom: 2px solid #27343b;
  content: '';
}

.before-after__handle::before {
  margin-right: 3px;
  border-left: 2px solid #27343b;
  transform: skewX(-20deg);
}

.before-after__handle::after {
  margin-left: 3px;
  border-right: 2px solid #27343b;
  transform: skewX(-20deg);
}

.before-after__range {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: ew-resize;
  opacity: 0;
  touch-action: none;
  -webkit-appearance: none;
  appearance: none;
}

.before-after__range::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
}

.before-after__range::-webkit-slider-thumb {
  width: 44px;
  height: 100%;
  background: transparent;
  border: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
}

.before-after__range::-moz-range-track {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
}

.before-after__range::-moz-range-thumb {
  width: 44px;
  height: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: ew-resize;
}

.before-after__range:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -6px;
  opacity: 0.08;
}

@media (max-width: 767px) {
  .before-after__label {
    top: 10px;
    min-height: 28px;
    padding: 4px 9px;
    font-size: 11px;
  }

  .before-after__label--before {
    left: 10px;
  }

  .before-after__label--after {
    right: 10px;
  }

  .before-after__handle {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .before-after__range {
    scroll-behavior: auto;
  }
}

/* TOPの施工実績：既存の自動横流れを使わず、厳選3件を固定表示する */
.contents06 .works-before-after-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin: 0 -60px;
}

.contents06 .works-before-after-home-grid__item {
  min-width: 0;
}

.contents06 .works-before-after-home-grid .works-before-after-card {
  display: block;
  height: 100%;
  background: #15161A;
}

.contents06 .works-before-after-home-grid .contents-img {
  position: relative;
  overflow: hidden;
}

.contents06 .works-before-after-home-grid .contents-img::after {
  display: none;
}

.contents06 .works-before-after-home-grid .contents-text {
  min-height: 96px;
  padding: 16px;
}

.contents06 .works-before-after-home-grid .contents-text a {
  display: inline;
  height: auto;
  color: inherit;
  background: transparent;
}

.contents06 .works-before-after-home-grid .works-before-after-media-note {
  width: auto;
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
}

.contents06 .works-before-after-home-grid .before-after__frame {
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 991px) and (min-width: 768px) {
  .contents06 .works-before-after-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 -30px;
  }
}

@media (max-width: 767px) {
  .contents06 .works-before-after-home-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 0;
  }

  .contents06 .works-before-after-home-grid .contents-text {
    min-height: 0;
  }
}
