
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #333;
  font-family: Arial, sans-serif;
}

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

h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-align: center;
  margin: 0 0 12px;
}

.description {
  font-size: 13px;
  text-align: center;
  color: #888;
  margin-bottom: 50px;
}

/* 写真一覧 */
.gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.3s;
}

.gallery img:hover {
  opacity: 0.75;
}

/* 拡大表示 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 85vw;
  max-height: 85vh;
  object-fit: contain;
}

.close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  padding: 15px;
}

.prev {
  left: 10px;
}

.next {
  right: 10px;
}

.counter {
  position: absolute;
  bottom: 25px;
  color: white;
  font-size: 13px;
  letter-spacing: 0.1em;
}

/* 戻るリンク */
.back {
  display: block;
  text-align: center;
  margin-top: 60px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
}

.back:hover {
  opacity: 0.6;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item img {
  display: block;
  width: 100%;
  transition: transform 0.5s ease;
}

.gallery-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.6;
}
.gallery-item:hover .gallery-title {
  opacity: 1;
}

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

/* タブレット */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

/* スマホ */
@media (max-width: 600px) {
  .container {
    padding: 40px 12px;
  }

  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  h1 {
    font-size: 23px;
  }

  .lightbox-image {
    max-width: 90vw;
    max-height: 75vh;
  }

  .arrow {
    font-size: 28px;
    padding: 8px;
  }

  .prev {
    left: 0;
  }

  .next {
    right: 0;
  }
}
