
/* データ部分は画面に表示しない */
.uc-extra-gallery-data {
  display: none !important;
}

/* ギャラリー本体 */
.uc-extra-gallery {
  margin: 40px 0 60px;
}

.uc-extra-gallery__title {
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  font-size: 20px;
  font-weight: 600;
}

.uc-extra-gallery__guide {
  margin: 0 0 20px;
  color: #666;
  font-size: 13px;
  line-height: 1.6;
}

.uc-extra-gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 20px;
}

.uc-extra-gallery__item {
  display: block;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.uc-extra-gallery__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7f7f7;
  transition: opacity 0.2s;
}

.uc-extra-gallery__item:hover .uc-extra-gallery__thumb {
  opacity: 0.75;
}

.uc-extra-gallery__caption {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* モーダル */
.uc-gallery-modal[hidden] {
  display: none !important;
}

.uc-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.uc-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 85%);
}

.uc-gallery-modal__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  color: #fff;
}

.uc-gallery-modal__image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.uc-gallery-modal__caption {
  margin: 14px 48px 0;
  text-align: center;
  line-height: 1.6;
}

.uc-gallery-modal__counter {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.uc-gallery-modal__close,
.uc-gallery-modal__nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 15%);
  color: #fff;
  cursor: pointer;
}

.uc-gallery-modal__close {
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  font-size: 28px;
}

/* 拡大画像の前後移動ボタン */
.uc-gallery-modal__nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;

  width: 56px;
  height: 56px;
  padding: 0 0 6px;

  border: 2px solid #fff;
  border-radius: 50%;
  background: #fff;
  color: #222;

  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;

  transform: translateY(-50%);
  box-shadow: 0 2px 12px rgb(0 0 0 / 35%);
  transition:
    background-color 0.2s,
    color 0.2s,
    transform 0.2s;
}

.uc-gallery-modal__nav:hover {
  background: #222;
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}

.uc-gallery-modal__prev {
  left: 20px;
}

.uc-gallery-modal__next {
  right: 20px;
}

/* スマートフォン */
@media (max-width: 767px) {
  .uc-gallery-modal__nav {
    width: 44px;
    height: 44px;
	font-size: 30px;
	top: 47.6%;
  }

  .uc-gallery-modal__prev {
    left: 8px;
  }

  .uc-gallery-modal__next {
    right: 8px;
  }
}

/* スマートフォン */
@media (max-width: 767px) {
  .uc-extra-gallery {
    margin: 24px 0;
  }

  .uc-extra-gallery__title {
    font-size: 18px;
  }

  .uc-extra-gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
  }

  .uc-extra-gallery__caption {
    font-size: 12px;
  }

  .uc-gallery-modal {
    padding: 12px;
  }

  .uc-gallery-modal__image {
    max-height: 65vh;
  }

  .uc-gallery-modal__prev {
    left: 4px;
  }

  .uc-gallery-modal__next {
    right: 4px;
  }

  .uc-gallery-modal__caption {
    margin-right: 24px;
    margin-left: 24px;
  }
}