#gallery {
  width: 100%;
  height: 2100px;
  padding-top: 100px;
  padding-bottom: 80px;
  background-color: #eaf6f1;
  box-sizing: border-box;
}

#gallery-title {
  font-size: 36px;
  text-align: center;
  margin-bottom: 40px;
}

.gallery--itembox {
  width: 1200px;
  height: 100%;
  margin-top: 100px;
  margin-right: auto;
  margin-left: auto;
}

.gallery--item {
  width: 100%;
  height: 400px;
  margin-top: 60px;
  margin-right: auto;
  margin-left: auto;
  display: flex;
  background-color: #fff;
  border-radius: 30px;
  padding: 30px;
}

.gallery--item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery--item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery--item-img {
  width: 50%;
  height: 100%;
  border-radius: 10px;
}

.gallery--img1,
.gallery--img2,
.gallery--img3,
.gallery--img4 {
  /* No background-image: GIFs are loaded on demand via <img> */
  background-image: none !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

.gallery--item-textbox {
  width: 50%;
  height: 100%;
  padding: 50px 80px;
}

.gallery--item-no {
  color: #43c29a;
  font-weight: 700;
  font-size: 24px;
}

.gallery--item-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 16px;
  text-align: left;
}

.gallery--item-text {
  margin-top: 48px;
  line-height: 1.2;
  text-align: left;
  font-size: 16px;
}

/* タブレット表示 */
@media screen and (max-width: 1024px) {
  #gallery-title {
    font-size: 32px;
  }
}

/* スマホ表示 */
@media screen and (max-width: 1200px) {
  #gallery-title {
    font-size: 24px;
  }
  
  #gallery {
    height: auto;
    padding-bottom: 60px;
  }
  
  .gallery {
    height: 2600px;
  }

  .swiper {
    margin-top: 32px;
  }

  .gallery--itembox {
    width: 80vw;
    margin-right: auto;
    margin-left: auto;
    margin-top: 30px;
  }

  .gallery--item-textbox {
    padding: 0px;
    width: 100%;
    margin-top: 30px;
  }

  .gallery--item {
    flex-direction: column-reverse;
    width: 100%;
    height: auto;
    margin-top: 30px;
  }

  .gallery--item-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
  }
}

.gallery--img1,
.gallery--img2,
.gallery--img3,
.gallery--img4 {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery--item-img {
  background-color: #e6e6e6; /* グレーのプレースホルダ背景 */
  overflow: hidden;
}

/* 再生中はプレースホルダを白にしてGIFを目立たせる */
.gallery--item-img.playing {
  background-color: #ffffff;
  transition: background-color 0.2s ease;
}

.gallery--item-img .point-img {
  width: 100%;
  height: 100%;
  display: block;
  visibility: hidden; /* 初期は非表示。再生でvisibleに */
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  position: relative;
  z-index: 40; /* 画像は最前面 */
  object-fit: contain; /* アスペクト比を保ちながら領域にフィット */
  border-radius: 10px; /* コンテナに合わせる */
  box-sizing: border-box;
}

.gallery--item-img .gif-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.gallery--item-img .gif-play::before {
  /* simple triangle play icon */
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 20px solid #fff;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.gallery--item-img .gif-play:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.gallery--item-img.playing .gif-play {
  display: none;
}

.gallery--item-img.playing .point-img {
  visibility: visible;
  opacity: 1;
}
