/* ============================================
   ギャラリー（活動記録）
   グリッドレイアウト + ライトボックス
   ============================================ */

/* --- ギャラリーグリッド --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xs);
}

/* --- ギャラリーアイテム --- */
.gallery-item {
  position: relative;
  overflow: hidden;
  /* アスペクト比を正方形に固定 */
  aspect-ratio: 1 / 1;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

/* ホバー時のオーバーレイ */
.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(139, 0, 0, 0.2);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover::after {
  opacity: 1;
}

/* --- ライトボックス（拡大表示モーダル） --- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.is-open {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--color-text-primary);
  font-size: var(--text-2xl);
  cursor: pointer;
}

/* --- レスポンシブ --- */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 小型スマートフォンでは1カラム */
@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
