/* タグフィルター */
.tag-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-filter button {
  padding: 6px 12px;
  border: 2px solid #ccc;
  background: white;
  cursor: pointer;
  border-radius: 50px;
}

.tag-filter button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ギャラリー */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 16px;
}
.gallery-item {
  aspect-ratio: 1 / 1; /* 正方形の比率 */
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* ポップアップ */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.popup.hidden {
  display: none;
}
.popup-img {
  max-width: 90%;
  max-height: 90%;
}
.popup-caption {
  margin-top: 12px;
  color: #eee;
  font-size: 1rem;
  max-width: 90%;
  text-align: center;
  user-select: text;
}
.popup .close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}
