/* =========================================================
   img.css
   本文中の画像の置き方。
   拡大・スライダーは lightbox / fancybox 側。
   左右開始位置は本文基準線が決まるまで触らない。
   ========================================================= */

/* ---------------------------------------------------------
   1枚
   figure.img-single > img + figcaption
   --------------------------------------------------------- */
.img-single {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 1rem 0;
}

.img-single img {
  display: block;
  width: 100%;
  height: auto;
}

.img-single figcaption {
  margin-top: 0.4rem;
  color: #666;
  font-size: 0.9em;
}

/* 旧 .box-img / .block-image 相当。幅を抑えたい1枚 */
.box-img {
  width: min(200px, 100%);
  text-align: center;
}

.box-img img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------
   横並び
   .img-row > .img-single + .img-single
   素 = 縦積み。769px以上で横並び。
   --------------------------------------------------------- */
.img-row {
  display: block;
}

.img-row .img-single {
  margin: 0;
}

.img-row .img-single + .img-single {
  margin-top: 1rem;
}

@media (min-width: 769px) {
  .img-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .img-row .img-single {
    flex: 1 1 16rem;
    min-width: 0;
    margin: 0;
  }

  .img-row .img-single + .img-single {
    margin-top: 0;
  }
}

/* ---------------------------------------------------------
   ギャラリー（タイル）
   クリック後の拡大は Fancybox 側。
   ここは並べ方と切り抜きだけ。
   --------------------------------------------------------- */
.gallery-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.gallery-container a {
  display: block;
  height: 220px;
}

.gallery-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--obj-pos, center 20%);
  border-radius: 4px;
}

@media (min-width: 769px) {
  .gallery-container {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  }

  .gallery-container a {
    height: 300px;
  }
}

.gallery .gallery-item {
  overflow: hidden;
  border-right: 3px solid var(--color-bg, #fff);
  border-bottom: 3px solid var(--color-bg, #fff);
}

.gallery .gallery-item img {
  transition: transform 0.4s;
}

.gallery .gallery-item:hover img {
  transform: scale(1.1);
}
