body {
  margin: 0;
  font-family: sans-serif;
  background: #f5f5f5;
}



.text-center{text-align: center;}

h1.gallery{background: #333;color:#fff;margin-top:0px;}

#gallery-body main{background-color: #fff;  border-radius: 10px; /* 角を半径10pxで丸める */
}

.gallery {
  display: flex;
  flex-wrap: wrap;   /* 折り返し */
  gap: 10px;         /* 画像間の余白 */
  padding: 16px;
}

.gallery img {
  /*flex: 1 1 calc(25% - 10px);  PCでは4列 */
  aspect-ratio: 4 / 3;        /* 表示枠を4:3に固定 */
  object-fit: cover;          /* 枠に合わせて切り抜き */
  border-radius: 6px;
  background: #ddd;
  transition: transform 0.2s ease;
  flex: 0 0 calc(25% - 10px); /* 幅を固定 */
  max-width: calc(25% - 10px);

}

.gallery img:hover {
  transform: scale(1.05);
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .gallery img { flex: 1 1 calc(33.333% - 10px); } /* タブレットでは3列 */
}
@media (max-width: 768px) {
  .gallery img { flex: 1 1 calc(50% - 10px); }     /* スマホ横では2列 */
}
@media (max-width: 480px) {
  .gallery img { flex: 1 1 100%; }                 /* スマホ縦では1列 */
}

.fade-in2 {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in2.loaded {
  opacity: 1;
  transform: scale(1);
}

/* モーダルの基本スタイル */
.lightbox {
  display: none;              /* 初期は非表示 */
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.lightbox .close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
}