.slideshow {
  position: relative;
  max-width: 500px;
  margin-top: 20px;
  margin-left: -80px;
  overflow: hidden;
  display: inline-block;
}
.slides {
  position: relative;
  width: 400px;
  height: 300px;
}
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 2s ease;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  fill: white;
  z-index: 10;
}
.arrow.prev { left: 10px; }
.arrow.next { right: 10px; }
.arrow svg {
  width: 100%;
  height: 100%;
}
.slide active img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: auto;
}


/* レスポンシブ対応 */
@media (max-width: 900px) {

  .slideshow {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -30px;
  }

  .slides {
    max-width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
  }

  .slide {
    position: absolute;
    margin: 0 auto; /* ← これで中央寄せ */
    top: 0;
    left: 0;
    max-width: 100%;
    max-height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .slide.active {
    opacity: 1;
    pointer-events: auto;
  }

  .slide img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
  }

  .arrow {
    position: absolute;
    top: 50%;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5); /* 任意：背景で視認性アップ */
    border: none;
    padding: 10px;
    cursor: pointer;
  }

  .arrow.prev {
    left: 10px;
  }

  .arrow.next {
    right: 10px;
  }

}

