/* ======================================
   タブメニューのスタイル
   ====================================== */

/* タブ全体の枠 */
.menu-tabs {
  margin: 40px auto;
  max-width: 1000px;
}

/* タブボタンと次ページリンクを左右に配置する枠 */
.tab-nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
  padding-left: 10px;
  gap: 20px;
}

/* タブボタンのリスト(左側) */
.tab-buttons {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 10px;
}

/* 各タブボタン */
.tab-button {
  padding: 15px 40px;
  font-size: 18px;
  font-weight: bold;
  color: #666;
  background-color: #f5f5f5;
  border: 2px solid #ddd;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  top: 2px;
}

/* タブボタンにマウスを乗せたとき */
.tab-button:hover {
  background-color: #fff;
  color: #333;
}

/* アクティブなタブボタン */
.tab-button.active {
  background-color: #fff;
  color: #c41e3a;
  border-color: #c41e3a;
  border-bottom: 2px solid #fff;
}

/* 次ページへのリンク(右側) */
.next-page-link {
  flex-shrink: 0; /* 縮まないようにする */
}

.next-page-link a {
  background-color: #dc554a;
  border-radius: 8px;
  padding: 12px 20px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  display: inline-block;
  transition: all 0.3s ease;
  white-space: nowrap; /* 改行させない */
}

.next-page-link a:hover {
  background-color: #e3aa73;
}

/* タブコンテンツの枠 */
.tab-contents {
  position: relative;
}

/* 各タブコンテンツ */
.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

/* アクティブなタブコンテンツ */
.tab-content.active {
  display: block;
}

/* フェードインアニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 画像を横幅いっぱいに表示(スマホ対応の基本) */
.tab-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ======================================
   スマホ対応(レスポンシブデザイン)
   ====================================== */

/* タブレット用 */
@media screen and (max-width: 1024px) {
  .menu-tabs {
    max-width: 95%;
  }
  
  #p_contents {
    width: 95% !important;
    padding: 0 10px;
  }
}

/* スマホ横向き〜タブレット縦向き */
@media screen and (max-width: 768px) {
  /* タブナビゲーション全体を縦積みに変更 */
  .tab-nav-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  /* タブボタンを中央寄せ */
  .tab-buttons {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .tab-button {
    padding: 12px 30px;
    font-size: 16px;
  }
  
  /* 次ページリンク（タブ横のもの）をスマホでは非表示 */
  .next-page-link {
    display: none;
  }
}

/* スマホ縦向き */
@media screen and (max-width: 480px) {
  .tab-button {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .tab-buttons {
    gap: 5px;
  }
  
  .next-page-link a {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* 非常に小さい画面用 */
@media screen and (max-width: 360px) {
  .tab-button {
    padding: 8px 15px;
    font-size: 13px;
  }
  
  .next-page-link a {
    font-size: 12px;
  }
}

/* ======================================
   スマホ専用: 画像の下の次ページリンク
   ====================================== */

/* PC版では非表示 */
.next-page-link-sp {
  display: none;
}

/* スマホ版で表示 */
@media screen and (max-width: 768px) {
  .next-page-link-sp {
    display: block;
    margin: 30px auto;
    text-align: center;
  }
  
  .next-page-link-sp a {
    display: inline-block;
    background-color: #dc554a;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 15px 25px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    line-height: 1.4;
  }
  
  .next-page-link-sp a:hover {
    background-color: #e3aa73;
  }
}

/* さらに小さい画面では文字サイズを調整 */
@media screen and (max-width: 480px) {
  .next-page-link-sp a {
    font-size: 14px;
    padding: 12px 20px;
  }
}

@media screen and (max-width: 360px) {
  .next-page-link-sp a {
    font-size: 13px;
    padding: 10px 15px;
  }
}
