@charset "UTF-8";

/* コンテナ：PCでは最大726pt、スマホでは画面幅いっぱいに */
#thumbnail-container {
  max-width: 726pt;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 3pt;
  /* 画像間の隙間 */
  padding: 0 3pt;
  /* 左右に隙間と同じ分だけ余白を作る */
  box-sizing: border-box;
  /* パディングを幅に含める */
  padding-top: 8pt;
}

/* サムネイル：1行3枚を維持するための計算 */
.thumb-box {
  /* 100%から隙間2つ分(3pt * 2)を引いて、3等分する */
  width: calc((100% - (3pt * 2)) / 3);
  /* 正方形を維持するためのハック（アスペクト比固定） */
  aspect-ratio: 1 / 1;

  /* aspect-ratioが効かない古いブラウザへのフォールバック */
  @supports not (aspect-ratio: 1 / 1) {
    height: 240px;
    /* あるいはJSで動的に制御 */
  }

  background-color: var(--color-content-bg);
  overflow: hidden;
}

.thumb-box a {
  display: block;
  width: 100%;
  height: 100%;
}

.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: none;
  opacity: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* ローディング表示も幅を合わせる */
#loading {
  max-width: 726pt;
  width: 100%;
  margin: 20px auto;
  text-align: center;
}

/* スマホ向けのタップ感 */
.thumb-box a:active {
  opacity: 0.7;
}

/* サムネイルのホバーエフェクト） */
.thumb-box a {
  display: block;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s ease;
}

.thumb-box a:hover img {
  filter: brightness(70%);
  transform: scale(1.05);
}