/* No.20 写真のマスクワイプ登場 */

.mr-stage {
  padding: 0 clamp(16px, 4vw, 48px) clamp(48px, 8vw, 96px);
  background: var(--surface-1);
}

.mr-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: min(940px, 100%);
  margin: 0 auto clamp(28px, 6vw, 60px);
  padding: 14px 4px;
  background: linear-gradient(var(--surface-1) 72%, rgba(251, 250, 244, 0));
}
.mr-bar-text { margin: 0; color: var(--text-2); font-size: 14.9px; }

.mr-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.mr-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.mr-switch-track {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  background: rgba(63, 70, 72, 0.18);
  border-radius: 999px;
  transition: background-color 0.3s ease;
}
.mr-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(63, 70, 72, 0.28);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.mr-switch input:checked + .mr-switch-track { background: var(--brand-deep); }
.mr-switch input:checked + .mr-switch-track .mr-switch-knob { transform: translateX(20px); }
.mr-switch input:focus-visible + .mr-switch-track {
  outline: 3px solid rgba(83, 169, 175, 0.45);
  outline-offset: 3px;
}
.mr-switch-label { color: var(--text-2); font-size: 13px; font-weight: 700; }

.mr-list { width: min(940px, 100%); margin-inline: auto; }
.mr-item + .mr-item { margin-top: clamp(60px, 12vw, 130px); }
.mr-item:last-child { margin-bottom: clamp(30px, 8vw, 80px); }

.mr-figure { margin: 0; }

.mr-mask {
  overflow: hidden;
  aspect-ratio: 16 / 9.6;
  border-radius: 4px 22px 22px 22px;
  background: var(--surface-2);
  box-shadow: 0 22px 52px rgba(40, 107, 112, 0.13);
  transition: clip-path 1.05s cubic-bezier(0.22, 0.85, 0.2, 1), opacity 0.9s ease;
}
.mr-mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mr-item.is-in .mr-mask img { transform: scale(1); }

/* 現れる前の隠し方を向きごとに変える */
.mr-item[data-dir="left"] .mr-mask { clip-path: inset(0 100% 0 0); }
.mr-item[data-dir="up"] .mr-mask { clip-path: inset(100% 0 0 0); }
.mr-item[data-dir="center"] .mr-mask { clip-path: inset(0 50% 0 50%); }
.mr-item.is-in .mr-mask { clip-path: inset(0 0 0 0); }

/* 見比べ用: マスクをやめて、よくあるフェードだけにする */
.mr-stage.is-fade .mr-mask {
  clip-path: none !important;
  opacity: 0;
}
.mr-stage.is-fade .mr-item.is-in .mr-mask { opacity: 1; }
.mr-stage.is-fade .mr-mask img { transform: none; }

.mr-cap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 6px 14px;
  margin-top: 18px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.7s ease 0.35s, transform 0.7s ease 0.35s;
}
.mr-item.is-in .mr-cap { opacity: 1; transform: none; }
.mr-cap-no {
  grid-row: span 2;
  color: var(--brand-dark);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.mr-cap-title { color: var(--text); font-size: 15px; font-weight: 700; }
.mr-cap-desc { grid-column: 2; color: var(--text-2); font-size: 13px; line-height: 1.7; }

@media (max-width: 600px) {
  .mr-bar { display: block; padding-bottom: 10px; }
  .mr-switch { margin-top: 10px; }
  .mr-mask { aspect-ratio: 4 / 3.2; border-radius: 4px 16px 16px 16px; }
}
