/* ────────────────────────────
   マリオカートワールド Battle 記事専用 CSS
   ※ mario-kart-world-index.css を読み込んだ後に適用
──────────────────────────── */

/* 汎用 */
.article {
  padding: 0 1rem 2rem;
}

/* 見出し */
.sub-heading {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 1.5rem 0 1rem;
  color: var(--background-color);
  position: relative;
}

.sub-heading::before {
  content: "▶";
  margin-right: 0.4rem;
  color: var(--primary-color);
}

/* ハイライト */
.highlight {
  background: linear-gradient(transparent 60%, var(--accent-color) 60%);
  font-weight: bold;
}

/* コース・アイテム共通カード */
.course-card,
.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 0.8rem 0.5rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover,
.item-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.25);
  border-color: var(--accent-color);
}

.course-card img { width: 96px; height: 96px; }
.item-card  img { width: 128px; height: 128px; }

.course-name,
.item-name {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  text-align: center;
  line-height: 1.2;
}

/* NEW バッジ */
.badge.new {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--highlight-color);
  color: #222;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
}

/* グリッドレイアウト */
.course-grid,
.item-grid {
  display: grid;
  gap: 15px;
}

.course-grid {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.item-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

/* レスポンシブ調整 */
@media (max-width: 480px) {
  .course-card img { width: 72px; height: 72px; }
  .item-card  img { width: 96px; height: 96px; }
}
/* ────────────────────────────
   動画埋め込み
──────────────────────────── */
.video-section {            /* 見出し上部余白は既存 .article-section で確保 */
  text-align: center;       /* 中央寄せにしたい場合 */
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;         /* お好みで */
  margin: 1.5rem auto;      /* 中央配置 */
  padding-bottom: 56.25%;   /* 16:9 アスペクト比 */
  border: 4px solid var(--primary-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.video-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.35);
  border-color: var(--accent-color);
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
/* ────────────────────────────
   記事内画像（figure）
──────────────────────────── */
.article-figure {
  margin: 1.5rem auto;
  max-width: 100%;
  text-align: center;
  border: 4px solid var(--primary-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.article-figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
  border-color: var(--accent-color);
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.article-figure figcaption {
  padding: 0.6rem 1rem;
  background: var(--secondary-color);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  border-top: 2px solid var(--primary-color);
}
/* ────────────────────────────
   h2 直後に置くリードテキスト
──────────────────────────── */
.section-lead {
  display: inline-block;
  margin: 0.8rem 0 1.2rem;
  padding: 8px 14px;
  font-size: 1.25rem;       /* 本文より大きく、h3 相当 */
  font-weight: 800;          /* 極太で強調 */
  color: var(--background-color);
  background: var(--secondary-color);
  border-left: 6px solid var(--primary-color);
  border-radius: 6px;
  line-height: 1.4;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
}
/* ────────────────────────────
   セクション間の余白を拡張
──────────────────────────── */
.article-section {
  margin-bottom: 2.5rem;   /* お好みで数値を調整 */
}

.article-section:last-of-type {
  margin-bottom: 0;        /* フッター直前の余白は維持しない場合 */
}
/* ────────────────────────────
   目次（Table of Contents）
──────────────────────────── */
.article-toc {
  margin: 2rem 0 2.5rem;
  text-align: center;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.toc-btn {
  display: inline-block;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: 30px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.toc-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.35);
}

.toc-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ────────────────────────────
   目次ボタン ─ モバイルでも横並びに
   （既存の .toc-btn 3列指定を上書き）
──────────────────────────── */
@media (max-width: 480px) {

  /* リスト自体をグリッドにして自動で横並び */
  .toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    justify-items: center;   /* ボタン中央寄せ */
  }

  /* ボタンはグリッドのセル幅いっぱいに */
  .toc-btn {
    flex: none !important;   /* 以前の flex 指定を無効化 */
    width: 100%;
  }
}


/* ────────────────────────────
   ゲームモード ナビボタン
──────────────────────────── */
.mode-nav {
  margin: 2rem 0 3rem;
}

.game-modes {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.mode-link {
  text-decoration: none;
}

.mode-item {
  width: 140px;
  padding: 12px 10px;
  border: 3px solid var(--primary-color);
  border-radius: 16px;
  background: #fff;
  text-align: center;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.mode-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.mode-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px;
}

.mode-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.3;
}

/* スマホ：ボタンを 100% 幅に */
@media (max-width: 480px) {
  .mode-item { width: 100%; }
}
/* ────────────────────────────
   「このページの先頭へ」「TOPへ」ボタン
──────────────────────────── */
.page-nav-buttons {
  margin: 2.5rem 0 1.5rem;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-block;
  min-width: 160px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--background-color) 0%, var(--primary-color) 100%);
  border: 3px solid var(--primary-color);
  border-radius: 32px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: transform .2s, box-shadow .2s, background .2s;
}

.page-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}

.page-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* スマホ：縦並びに */
@media (max-width: 480px) {
  .page-btn { flex: 1 1 100%; }
}
/* ────────────────────────────
   おすすめ記事カード
──────────────────────────── */
.recommend-section {
  margin: 3rem 0;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  justify-content: center;
}

/* JS が挿入する <a> と <br> の整形 */
.recommend-grid a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--primary-color);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  transition: transform .2s, box-shadow .2s, border-color .2s;
  color: var(--text-color);
  font-weight: 700;
  line-height: 1.4;
}

.recommend-grid a:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
}

.recommend-grid img.sneak {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 8px;
}

#recommendations br { display: none; }   /* 余計な改行を抑制 */

/* モバイル：カードを2列に */
@media (max-width: 480px) {
  .recommend-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
/* グランプリカップとサバイバルラリーのカードスタイル */
.cup-card,
.rally-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  background: #fff;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 0.8rem 0.5rem;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cup-card:hover,
.rally-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0,0,0,0.25);
  border-color: var(--accent-color);
}

.cup-card img,
.rally-card img {
  width: 96px;
  height: 96px;
}

.cup-name,
.rally-name {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  text-align: center;
  line-height: 1.2;
}

/* グリッドレイアウト */
.cup-grid,
.rally-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 15px;
}

/* レスポンシブ調整 */
@media (max-width: 480px) {
  .cup-card img,
  .rally-card img {
    width: 72px;
    height: 72px;
  }
}
/* キノコカップコース一覧 - シンプル版 */
.cup-icon {
  vertical-align: middle;
  margin-right: 8px;
}

.course-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2rem;
}

.course-item {
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
}

.course-link {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-item:hover {
  border-color: var(--accent-color);
}

.course-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.course-mini-icon {
  margin-right: 12px;
  border-radius: 4px;
}

.course-mini-name {
  font-weight: 700;
  color: var(--text-color);
}
/* ────────────────
   FAQセクション（改善版）
──────────────── */
.faq-section {
  margin: 3rem 0 2.5rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.faq-item {
  /* グラデーションを削除し、シンプルな背景色に変更 */
  background: var(--secondary-color);
  border: 2.5px solid var(--primary-color);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(255,179,71,0.10), 0 1.5px 6px rgba(157,220,255,0.10);
  overflow: hidden;
  transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
  position: relative;
}

.faq-item:hover {
  box-shadow: 0 8px 22px rgba(255,179,71,0.20), 0 4px 18px rgba(157,220,255,0.18);
  border-color: var(--accent-color);
  /* ホバー時に少しだけ色を変化させる */
  background: linear-gradient(135deg, var(--secondary-color) 95%, var(--accent-color) 100%);
}

/* 質問ボタン */
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.13rem;
  font-weight: 900;
  color: var(--background-color);
  padding: 18px 50px 18px 22px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  outline: none;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.faq-question:hover, .faq-question:focus {
  /* ホバー時のグラデーションも調整 */
  background: rgba(157, 220, 255, 0.15);
}

.faq-toggle-icon {
  margin-left: auto;
  font-size: 1.6rem;
  color: var(--primary-color);
  font-weight: bold;
  transition: transform 0.35s;
  display: inline-block;
}

/* 開いてるとき（JSで .open を付与） */
.faq-question[aria-expanded="true"] .faq-toggle-icon {
  transform: rotate(45deg);
}

/* 答え部分 */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  background: #fff;
  padding: 0 24px;
  border-top: 1.5px dashed var(--primary-color);
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--text-color);
  transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1), padding 0.35s;
  box-shadow: 0 2px 8px rgba(157,220,255,0.06) inset;
}

.faq-answer.open {
  padding: 16px 24px 20px 24px;
  max-height: 350px;  /* 答えが多い場合は増やしてOK */
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), padding 0.3s;
}

/* FAQ全体のリッチ感を底上げ */
.faq-item::before {
  content: "Q";
  position: absolute;
  top: 16px; left: 14px;
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--primary-color);
  background: var(--accent-color);
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(255,179,71,0.18);
  z-index: 1;
  letter-spacing: -0.04em;
}

.faq-answer p {
  margin: 0;
  padding-left: 10px;
  border-left: 4px solid var(--primary-color);
  /* グラデーションを削除してシンプルな白背景に */
  background: #fff;
  border-radius: 5px;
  /* 左側のボーダーがよく見えるように余白を調整 */
  margin-left: 3px;
  padding: 8px 12px 8px 10px;
}

/* オプション：微妙なハイライト効果を追加（必要に応じて） */
.faq-answer p:hover {
  background: rgba(157, 220, 255, 0.05);
  transition: background 0.2s;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
  .faq-question {
    font-size: 1rem;
    padding: 14px 36px 14px 20px;
  }
  .faq-answer {
    font-size: 0.97rem;
    padding: 0 12px;
  }
  .faq-answer.open {
    padding: 13px 12px 16px 12px;
  }
  .faq-item::before {
    top: 10px;
    left: 8px;
    width: 22px;
    height: 22px;
    font-size: 0.95rem;
  }
}
