/* --- レスポンシブグリッド --- */
.thumb-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: start;
  margin: 0;
  padding: 0;
}

/* 小さい画面での調整 */
@media (max-width: 480px) {
  .thumb-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* --- カード全体 --- */
.thumb-item {
  background-color: #eeeeee;               /* dafault #e6e6e6 カード背景（やや暗め） */
  padding: 12px;
  border-radius: 10px;                     /* カード角丸 10px */
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(0,0,0,0.02);  /* default 0,0,0,0,05 カードの薄いシャドウ（約5%） */
  transition: box-shadow 0.18s ease;
  overflow: hidden;                        /* 角丸内で画像がはみ出ないようにする */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* カードのホバー（カード自体は動かさず影だけ変える） */
.thumb-item:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.07);
  transform: none;
}

/* --- リンク --- */
.thumb-link {
  display: block;
  color: inherit;
  text-decoration: none;
  width: 100%;
}

/* --- 画像（正方形を安定して維持） --- */
.thumb-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;                      /* 正方形を維持（モダンブラウザ） */
  object-fit: cover;                        /* トリミングして枠を埋める */
  border-radius: 10px;                      /* 画像角丸 10px（カードと一致） */
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  will-change: transform, opacity;
  -webkit-user-drag: none;
  user-select: none;
  box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.06); /* 右下方向に薄いシャドウ */
  backface-visibility: hidden;
}

/* ホバー時：画像のみを 2% 拡大、透過 80%、影を少し強化 */
.thumb-link:hover .thumb-image,
.thumb-image:hover {
  transform: scale(1.02);                    /* 2% 拡大 */
  opacity: 0.9;                              /* default 0.8  透過80% = opacity:0.8 */
  box-shadow: 6px 6px 14px rgba(0, 0, 0, 0.09); /* default 6px 6px 14px rgba(0, 0, 0, 0.09) */
}

/* --- 名前表示 --- */
.thumb-name {
  margin-top: 12px;
  text-align: center;
  line-height: 1.2;
  font-size: 14px;
  color: #5ebff8;                               /* default #111 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 4px 6px 0;
}

/* --- フォールバック（古いブラウザで aspect-ratio 未対応の場合） */
@supports not (aspect-ratio: 1 / 1) {
  .thumb-image {
    width: 100%;
    height: auto;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.06);
  }
}

/* --- 安全措置：画像の基本スタイル上書き防止 --- */
.thumb-item img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* --- アクセシビリティ（フォーカス時） --- */
.thumb-link:focus-visible {
  outline: 2px solid #6aa0ff;
  outline-offset: 3px;
  border-radius: 10px;
}



/* 画像をホバーで上方向に-2px移動させる（既存のホバー効果と併用） 
.thumb-link:hover .thumb-image,
.thumb-image:hover {
  transform: translateY(-4px) scale(1.02);
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}
*/



/* ホバーで約2%拡大（既存の移動や他の transform と併用する場合は下のコメントを参照） */
.thumb-link:hover .thumb-image,
.thumb-image:hover {
  transform: scale(1.02);
  transition: transform 200ms ease, opacity 250ms ease, box-shadow 250ms ease;
}

/* フォーカス時も同じ視覚効果（キーボード操作対応） */
.thumb-link:focus-visible .thumb-image {
  transform: scale(1.02);
  transition: transform 200ms ease;
}



