/* 院展ギャラリーページ */

.gallery-nav {
  background: rgba(34, 34, 34, 0.92);
  padding: 8px 16px;
  position: relative;
  z-index: 10;
}

.gallery-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  max-width: 1000px;
  margin-inline: auto;
}

.gallery-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 95%;
}

.gallery-nav a:hover,
.gallery-nav a.is-current {
  color: #fff;
}

.gallery-page-title {
  font-size: 1.25rem;
  font-weight: normal;
  text-align: center;
  margin: 0 0 16px;
}

.gallery-page-title--first {
  position: relative;
  z-index: 20;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 16px 12px;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.6);
}

.gallery-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
  background: #fff;
}

.art-gallery {
  background: #fff;
  border: 1px solid #666;
  padding: 12px;
}

.art-gallery-thumbs-wrapper {
  position: relative;
  margin-bottom: 10px;
  border: 1px solid #ccc;
}

.art-gallery-thumbs-viewport {
  overflow: hidden;
}

.art-gallery-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 36px;
  -webkit-overflow-scrolling: touch;
}

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

.art-gallery-thumbs-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 32px;
  border: none;
  background: rgba(34, 34, 34, 0.85);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.art-gallery-thumbs-arrow:hover {
  background: rgba(0, 0, 0, 0.92);
}

.art-gallery-thumbs-arrow--left {
  left: 0;
}

.art-gallery-thumbs-arrow--right {
  right: 0;
}

.art-gallery-thumb {
  border: 2px solid #666;
  padding: 2px;
  background: #fff;
  cursor: pointer;
  line-height: 0;
  flex: 0 0 auto;
}

.art-gallery-thumb.is-active {
  border-color: #00cc99;
}

.art-gallery-thumb img {
  display: block;
  width: 100px;
  height: 60px;
  object-fit: cover;
}

.art-gallery-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 8px 0;
}

.art-gallery-controls button {
  padding: 4px 12px;
  border: 1px solid #666;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
}

.art-gallery-controls button:hover {
  background: #ddd;
}

.art-gallery-main {
  text-align: center;
  background: #111;
  min-height: 200px;
}

.art-gallery-main img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* 春の院展: 縦長作品が多いため、旧 p7IGM 同様に高さ 500px でフィット表示 */
.art-gallery--table2 .art-gallery-main {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 500px;
  min-height: 500px;
}

.art-gallery--table2 .art-gallery-main img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.art-gallery-desc {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #ccc;
  text-align: center;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .gallery-nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
  .art-gallery-thumb img {
    width: 72px;
    height: 54px;
  }
  .art-gallery--table2 .art-gallery-main {
    height: min(500px, 65vh);
    min-height: min(500px, 65vh);
  }
}
