/* illustration.css — illustration.html 専用スタイル */

.illustration {
  position: relative;
  z-index: 2;
  padding: 100px 5% 34px;   /* フッターまでの間を詰める（以前は 140px） */
  max-width: 1200px;
  margin: 0 auto;
}

.illustration h2 {
  font-size: clamp(1.6rem, 8vw, 3.2rem);
  margin-bottom: 80px;
  letter-spacing: clamp(1px, 1vw, 4px);
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: center;
}

.gallery img {
  width: 100%;
  height: auto;
  border: 1px solid var(--fg);
  transition: transform 0.4s ease;
  cursor: zoom-in;
  transform: scale(0.8);
  transform-origin: center center;
}

.gallery img:nth-child(3n+2) {
  transform: scale(1);
}

.gallery img:hover {
  transform: scale(1);
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.35);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .lightbox {
    background: rgba(255, 255, 255, 0.9);
  }
}

.lightbox-img {
  max-width: 88vw;
  max-height: 82vh;
  border: 1px solid var(--fg);
  user-select: none;
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.25s ease;
  touch-action: none;
}

.lightbox-img.is-zoomed {
  cursor: grab;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  z-index: 201;
  transition: opacity 0.25s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 0.6;
}

.lightbox-close {
  top: 20px;
  right: 5%;
  font-size: 32px;
  line-height: 1;
  padding: 10px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  padding: 10px 18px;
}

.lightbox-prev { left: 2%; }
.lightbox-next { right: 2%; }

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg);
  opacity: 0.6;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    font-size: 30px;
    padding: 6px 10px;
  }

  .illustration {
    padding: 80px 0 34px;
  }

  .illustration h2 {
    padding: 0 5%;
  }

  .gallery {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 18px;
    padding: 16px 9% 28px;
    margin: 0;
    scrollbar-width: none;
    align-items: center;
  }

  .gallery::-webkit-scrollbar {
    display: none;
  }

  .gallery img {
    flex: 0 0 70%;
    width: 70%;
    max-height: 56vh;
    object-fit: cover;
    scroll-snap-align: center;
    transform: scale(0.8);
  }

  .gallery img:nth-child(3n+2) {
    transform: scale(0.8);
  }

  .gallery img.is-center {
    transform: scale(1);
  }

  .gallery img:hover {
    transform: scale(0.8);
  }

  .gallery img.is-center:hover {
    transform: scale(1);
  }
}
