/* --------------------------
   ギャラリー用サムネイルCSS
--------------------------- */
.maingallery-ul {
  list-style: none;
  margin: 20px auto;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;           /* サムネ間の隙間 */
  justify-content: flex-start;
  max-width: 1200px;  /* PCで広がりすぎない */
}

li.gallery-icon {
  flex: 0 0 11%;      /* PCで約8列 */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column; /* 画像の下に文字を置ける */
  align-items: center;
}

li.gallery-icon a {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;  /* 画像部分だけ正方形に */
}

li.gallery-icon a img {
  width: 100%;
  aspect-ratio: 1 / 1; 
  object-fit: cover;  /* 正方形に切り抜き */
  border-radius: 4px;
  border: 1px solid #000000;
  box-sizing: border-box;   
  transition: transform 0.2s ease;
}

li.gallery-icon a img:hover {
  filter: brightness(0.7);   /* 明度を下げる（0.7＝70%） */
}


li.gallery-icon .caption {
  margin-top: 4px;
  font-size: 0.8rem;
  text-align: center;
}


/* レスポンシブ調整 */
@media screen and (max-width: 1024px) {
  li.gallery-icon { flex: 0 0 18%; } /* タブレットで5列 */
}

@media screen and (max-width: 768px) {
  li.gallery-icon { flex: 0 0 22%; } /* スマホで3～4列 */
}

@media screen and (max-width: 480px) {
  li.gallery-icon { flex: 0 0 45%; } /* 小さいスマホ */
}
