.gallery-message {
  text-align: center;
  margin-top: 120px;
  margin-bottom: 100px;
  font-family: 'Shippori Mincho', serif;
  font-size: 0.9rem;
  line-height: 3;
  color: var(--text-white);
  letter-spacing: 0.05em;
}

.gallery-footer-img {
  text-align: center;
  margin: 0 0 10px;
}

.gallery-footer-img img {
  max-width: 100%;
  height: auto;
}

.footer {
  border-top: none;
}

.container {
  padding: 40px 20px 100px 20px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 60px;
}

/* Table of Contents style */
.toc {
  max-width: 600px;
  margin: -20px auto 60px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 30px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.toc h2 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 20px;
  letter-spacing: 0.1em;
}

.toc-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px 30px;
  list-style: none;
  padding: 0;
}

.toc-links a {
  color: var(--text-white);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  padding: 5px 0;
  position: relative;
}

.toc-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-gold);
  transition: width 0.3s ease;
}

.toc-links a:hover {
  color: var(--accent-gold);
}

.toc-links a:hover::after {
  width: 100%;
}

h1 {
  font-family: 'Kaisei Tokumin', serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: var(--text-white);
  margin: 50px 0 20px 0;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.section-description {
  max-width: 800px;
  margin: 0 auto 40px;
  font-family: var(--serif-font);
  font-size: 0.9rem;
  line-height: 2;
  color: var(--text-gray);
  opacity: 0.9;
  text-align: left;
  padding: 0 20px;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 40px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  border: 1px solid var(--card-border);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.gallery-item.show {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  pointer-events: none; /* 親要素のクリックイベントのみを有効にする */
  -webkit-touch-callout: none; /* iOSで長押しメニューを禁止 */
  user-select: none; /* テキストや画像の選択を禁止 */
}

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

/* Lightbox styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.lightbox.show {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 30px rgba(0,0,0,0.5);
  border: 4px solid var(--accent-gold);
  -webkit-touch-callout: none;
  user-select: none;
}

.close-lightbox {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 2001;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px; /* モバイル向けに隙間を狭く */
  }
  .container {
    padding: 20px 10px 60px 10px; /* 余白も調整 */
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px; /* さらに狭く */
  }
  .toc-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Floating section label on the right edge */
.section-label {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%) translateX(20px);
  writing-mode: vertical-rl;
  font-family: var(--serif-font);
  font-size: 1rem;
  color: var(--text-white); /*白色*/
  letter-spacing: 0.2em; /*字間*/
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  z-index: 500;
  pointer-events: none;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 20px 5px;
  border-right: 1px solid var(--card-border);
}

.section-label.show {
  opacity: 0.8; /*透明度*/
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 768px) {
  .section-label {
    right: 5px;
    font-size: 0.6rem;
    background: rgba(0, 23, 66, 0.4);
    backdrop-filter: blur(4px);
  }
}
