/* ▼ PC（641px以上）は横3枚 */
.dt-gallery {
  display: flex;
  justify-content: center;
  gap: 15px;
}

/* ▼ モバイル（641px未満）は1カラム */
@media (max-width: 640px) {
  .dt-gallery {
    display: block;
  }

  .dt-gallery picture {
    display: block;
    margin-bottom: 20px;
  }
}

/* ▼ 通常表示（PCだけ縮小） */
.dt-gallery picture img {
  width: var(--img-size, 100%);
  height: auto;
  cursor: pointer;
  margin: 0 0 10px 0;
  transition: opacity 0.3s ease;   /* ▼ hover のためのアニメーション（opacity のみ） */
}

/* ▼ hover 時の効果（半透明のみ） */
.dt-gallery picture img:hover {
  opacity: 0.5;
}

@media (min-width: 641px) {
  .dt-gallery picture img {
    --img-size: 100%;
  }
}

/* ▼ モーダル（拡大表示） */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);

  /* ▼ display を使わず、透明で非表示にする */
  opacity: 0;
  pointer-events: none;

  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  z-index: 9999;

  transition: opacity 0.1s ease;
}

/* モーダル表示時 */
.modal.show {
  opacity: 1;
  pointer-events: auto;
}

/* 画像を中央に固定（重要） */
#modal-picture {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;

  /* ▼ 開くときのアニメーション初期状態 */
  transform: scale(0.5);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

/* ▼ モーダルが開いたときの最終状態 */
.modal.show #modal-picture {
  transform: scale(1);
  opacity: 1;
}

/* モーダル画像のサイズ＋白枠 */
#modal-picture img {
  max-width: 55%;
  max-height: 55%;
  height: auto;
  display: block;

  border: 8px solid #fff;   /* ← 白の太線 */
  border-radius: 6px;       /* ← 角丸（好みで調整） */
}

/* 矢印を絶対配置にする */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 40px;
  cursor: pointer;
  user-select: none;
  z-index: 3;
}

/* 左右の位置を固定 */
.prev {
  left: 20px;
}

.next {
  right: 20px;
}

/* 閉じるボタン */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 4;
}