

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  padding: 10px;
  box-sizing: border-box;
  justify-items: center;  /* 画像を各セルの中央に配置 */
}

.gallery img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
         /* 幅いっぱいに */
  aspect-ratio: 1 / 1;      /* アスペクト比を正方形に */
  object-fit: cover;   
}



.gallery-container {
  display: flex;
  justify-content: center;
}

    .gallery img:hover {
      transform: scale(1.06);
    }

    @media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}



/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.3s;
}



.modal img {
  max-width: 80%;  /* 画像の最大幅を親要素(modal)の90%に制限し、画面内に収まるようにする */
  max-height: 100vh;  /* 画像の最大高さをビューポートの高さ(100vh)に制限し、画面内に収まるようにする  */
  object-fit: contain;  /* 画像の比率を保持しつつ、指定された高さと幅に収める */
}

.clickable-image:hover {
  cursor: zoom-in;  /* ホバー時にカーソルをズームインのアイコンに変更 */
  
}

.modal img:hover {

  cursor: zoom-out;  /* モーダル内の画像にホバー時にカーソルをズームアウトのアイコンに変更 */
}



@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}