@charset "utf-8";
/* CSS Document */

/* ========================================= */
/* 1. 全体コンテナ */
/* ========================================= */
.slider-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  max-height: none;
  height: auto; /* 高さを確定させ、はみ出しを防ぐ */
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 10px;
  padding-bottom: 30px
}

/* ========================================= */
/* 2. ラッパー (幅と1枚表示のコア修正) */
/* ========================================= */
.slider-wrapper {
  display: flex;
  flex-direction: row;
  transition: transform 0.5s ease-in-out;
  height: 100%;
  align-items: center;
  white-space: nowrap;
  width: 2500%; /* 例えば、スライド数(20) + クローン(2) = 22枚分確保 */
}

/* ========================================= */
/* 3. スライドアイテム (slider-item2) */
/* ========================================= */
.slider-item2 {
  flex: 0 0 100%;
  box-sizing: border-box !important;
  
  /* 画像とリンクを縦に並べるためにFlexboxを使用 */
  display: flex; 
  flex-direction: column;
  justify-content: flex-start; /* ★修正: コンテンツを上寄せにし、リンクエリアを確保★ */
  align-items: center;
  padding: 0 10px;
  height: auto;
}

/* 画像のサイズ調整 (テキスト消失/はみ出し防止) */
.slider-item2 picture {
    /* ★修正: height: 80%; を削除し、flex: 1 1 auto; で残りのスペースを埋める★ */
    flex: 1 1 auto; /* 画像エリアが可能な限り大きくなるが、navを圧迫しない */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.slider-item2 img {
  max-width: 90%;
  height: auto;         /* 画像比率を維持 */
  max-height: 100%;     /* pictureタグの高さ内に収める */
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ========================================= */
/* 4. リンクエリア (nav) */
/* ========================================= */
.slider-item2 nav {
  /* ★修正: flex-shrink: 0; を設定し、リンクエリアの縦幅を確保★ */
  flex-shrink: 0; /* 縮小させない */
  height: auto; /* 高さはコンテンツに合わせて自動調整 */
  padding: 10px 0; /* リンクエリアの上下パディングを確保 */
  display: flex;          
  justify-content: center; 
  gap: 10px;              
  width: 90%;            
  flex-wrap: nowrap;      
  overflow-x: auto;       
  -webkit-overflow-scrolling: touch; 
  margin: 10px auto;
}
.slider-item2 nav a {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: auto; 
  min-width: 100px;
  max-width: 350px;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 5px 10px;
  text-align: center;
  background-color: #fff;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  text-decoration: none;
  margin: 0 auto;
}


/* ========================================= */
/* 5. 汎用・ボタン類 (既存) */
/* ========================================= */
.slider-item {
  flex: 0 0 100%;
  width: 100% !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
  height: 100%;
}

.slider-item img {
  max-width: 90%;
  height: 100%;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.slider-nav {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  z-index: 10;
}

.slider-nav button {
  all: unset;
  cursor: pointer;
  display: block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  width: 50px;
  height: 50px;
  padding: 0;
  opacity: 1;
  color: transparent; 
  font-size: 0;
  transition: transform 0.2s ease, opacity 0.3s ease; 
  outline: none;
}

.slider-nav button:hover {
  transform: scale(1.1);
  opacity: 1;
}

#prevBtn, #prevBtn2 {
  background-image: url('https://www.g-stage-select.jp/pic-labo/sp-icon-previous.png'); 
  margin-left: 10px;
}

#nextBtn, #nextBtn2 {
  background-image: url('https://www.g-stage-select.jp/pic-labo/sp-icon-next.png');
  margin-right: 10px;
}