@charset "utf-8";
/* CSS Document */
.gallery-wrapper {
  width: 100%;
}
.gallery-title {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #333;
}
/* --------------------------------------------------
     * ギャラリー共通スタイル
     * -------------------------------------------------- */
.gallery-container {
  display: flex;
  flex-direction: row; /* 左サムネイル、右メイン画像 */
  gap: 12px;
  width: auto;
  padding: 12px;
}
/* 右サムネイルにしたい場合はこのクラスを付与 */
.gallery-container.right-thumb {
  flex-direction: row-reverse;
}
/* ラジオボタンを非表示 */
.gallery-container input[type="radio"] {
  display: none;
}
/* サムネイル一覧エリア */
.thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100px;
  flex-shrink: 0;
}
/* サムネイル単体 */
.thumbnail-label {
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  opacity: 0.6;
}
.thumbnail-label:hover {
  opacity: 0.9;
}
.thumbnail-label img {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  display: block;
}
/* メイン画像表示エリア */
.main-display {
  position: relative;
  flex-grow: 1;
  aspect-ratio: 5 / 6;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
}
.main-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
/* --------------------------------------------------
     * 連動処理（番号クラスで汎用化）
     * -------------------------------------------------- */
/* 1. 選択されたサムネイルの強調表示 */
.gallery-container input[class*="radio-1"]:checked ~ .thumbnails label[class*="thumb-1"], .gallery-container input[class*="radio-2"]:checked ~ .thumbnails label[class*="thumb-2"], .gallery-container input[class*="radio-3"]:checked ~ .thumbnails label[class*="thumb-3"], .gallery-container input[class*="radio-4"]:checked ~ .thumbnails label[class*="thumb-4"] {
  border-color: #fcb608;
  opacity: 1;
}
/* 2. 選択されたメイン画像の表示 */
.gallery-container input[class*="radio-1"]:checked ~ .main-display .main-1, .gallery-container input[class*="radio-2"]:checked ~ .main-display .main-2, .gallery-container input[class*="radio-3"]:checked ~ .main-display .main-3, .gallery-container input[class*="radio-4"]:checked ~ .main-display .main-4 {
  opacity: 1;
  visibility: visible;
}
/* レスポンシブ対応 (スマホ等) */
@media (max-width: 600px) {
  .gallery-container, .gallery-container.right-thumb {
    flex-direction: column-reverse;
  }
  .thumbnails {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
  }
  .thumbnail-label img {
    width: 80px;
  }
}