/* ベーススタイル */
body {
  font-family: sans-serif;
  margin: 0;
  padding: 20px;
  background-color: #f4f4f4;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

/* ローディング表示 */
.loader {
  text-align: center;
  font-size: 1.2rem;
  color: #666;
  padding: 20px;
  display: none; /* JSで制御 */
}

.loader.show {
  display: block;
}

/* フィルターボタン */
.filter-buttons {
  margin-bottom: 20px;
  text-align: center;
}

.btn {
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  background-color: #ddd;
  margin: 0 5px;
  border-radius: 4px;
  transition: background 0.3s;
}

.btn.active,
.btn:hover {
  background-color: #333;
  color: #fff;
}

/* ギャラリーグリッド */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.gallery-item {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 5px;
  transition:
    transform 0.3s,
    opacity 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

/* 学習ポイント：JSで制御する表示アニメーション */
.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

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

.gallery-item.hide {
  display: none;
}

/* モーダルウィンドウ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  display: block;
  opacity: 1;
}

.modal-content-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.modal-content {
  max-width: 80%;
  max-height: 70vh;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

#caption {
  margin-top: 15px;
  color: #ccc;
  font-size: 1.1rem;
}

/* 前へ・次へボタン */
.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -50px;
  color: white;
  font-weight: bold;
  font-size: 30px;
  transition: 0.3s;
  border-radius: 0 3px 3px 0;
  user-select: none;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev {
  left: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}
