@charset "UTF-8";

/* 全体のスタイル */
body {
  margin: 0;
  font-family: "Hiragino Maru Gothic Pro", "Meiryo UI", sans-serif;
  line-height: 1.8;
}

/* メインコンテンツを中央寄せ */
main {
  max-width: 90%;
  margin: 0 auto;
  padding: 70px;
  margin-top: 30px;
}

/* 問題全体の枠 */
section {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  background-color: #f9f9f9;
}

/* 小問（問題1の質問文と(1)(2)、答えの①～④） */
.sub-question {
  display: block; /* 縦に並べる */
  margin-bottom: 10px;
}

/* 番号（(1), (2), ①～④） */
.sub-question-number {
  display: inline-block; /* 番号とテキストを横に */
  width: 30px; /* 番号の幅 */
  text-align: right;
  margin-right: 10px; /* テキストとの間隔 */
}

/* 問題1の質問文と(1)(2)のテキスト */
.sub-question p {
  margin: 0 0 10px 0; /* 下に余白 */
}

/* 問題1の(1)(2)のコンテナ */
.sub-item {
  margin-left: 20px; /* サブ項目のインデント */
  margin-top: 10px; /* 質問文との間隔 */
  display: flex; /* 番号とテキストを横に */
  align-items: flex-start;
}

/* 問題1の(1)(2)のテキスト */
.sub-item p {
  margin: 0; /* 余白リセット */
  flex: 1; /* テキストが残りのスペースを埋める */
}

/* アコーディオン内のコンテンツ（答え） */
.answer-content {
  margin-top: 10px;
  padding-top: 10px;
}

/* 答えの小問（①～④） */
.answer-content .sub-question {
  display: flex; /* 番号とテキストを横に */
  align-items: flex-start;
}

/* 答えの小問のテキスト */
.answer-content .sub-question p {
  margin: 0; /* 余白リセット */
  flex: 1; /* テキストが残りのスペースを埋める */
}

/* 「答え」のsummaryをボタン風に */
details > summary {
  display: inline-block; /* ボタンの幅をコンテンツに合わせる */
  background-color: #0077cc; /* 青い背景（トップページボタンに合わせる） */
  color: white; /* 白色テキスト */
  font-weight: bold;
  font-size: 1.1em;
  padding: 10px 20px; /* ボタンらしい内余白 */
  margin: 10px 0;
  border-radius: 8px; /* 角丸 */
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s; /* ホバー時の滑らかさ */
  list-style: none; /* マーカー非表示 */
}

details > summary:hover {
  background-color: #005fa3; /* ホバー時に濃い青 */
}

/* 開いたときにsummaryの下にライン */
details[open] > summary {
  border-bottom: 2px solid #00acc1; /* 既存のラインを維持 */
}

/* メニューボタン */
.menu-button {
  position: fixed;
  top: 10px;
  left: 10px;
  padding: 10px 20px;
  background-color: #333;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  z-index: 1001;
  font-size: 14px;
  line-height: 1.5;
  font-family: "Hiragino Maru Gothic Pro", "Meiryo UI", sans-serif;
  width: auto;
  min-width: 120px;
  height: 40px;
  text-align: center;
  overflow: hidden;
}

.menu-button:hover {
  background-color: #555;
}

/* メニュー */
.menu {
  position: fixed;
  top: 50px;
  left: 10px;
  background-color: #f0f0f0;
  padding: 10px;
  margin: 0 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  z-index: 1000;
  max-height: 90vh;
  overflow-y: auto;
  display: none;
}

.menu.active {
  display: block;
}

.main-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-menu li {
  margin-bottom: 5px;
}

.main-menu-item {
  display: block;
  padding: 5px;
  background-color: #ddd;
  cursor: pointer;
  margin-bottom: 5px;
}

.sub-menu {
  display: none;
  list-style: none;
  padding: 0 0 0 20px;
  margin: 0;
}

.sub-menu.active {
  display: block;
}

.sub-menu li {
  margin: 5px 0;
}

.sub-menu a {
  text-decoration: none;
  color: #333;
}

.sub-menu a:hover {
  color: #0077cc;
}

/* メニュー閉じるボタン */
.menu-close-button {
  background-color: #ff0000;
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 8px;
  margin: 10px;
  display: block;
}

.menu-close-button:hover {
  background-color: #cc0000;
}

/* トップページへボタン */
.top-page-button {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 10px 20px;
  background-color: #0077cc;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1002;
  width: auto;
  min-width: 120px;
  height: 40px; /* 固定高さ */
  line-height: 1.5;
  box-sizing: border-box;
  text-align: center;
  font-size: 14px;
  font-family: "Hiragino Maru Gothic Pro", "Meiryo UI", sans-serif;
  overflow: hidden;
  white-space: nowrap;
}

.top-page-button:hover {
  background-color: #005fa3;
}

/* スマホ用の調整 */
@media (max-width: 600px) {
  main {
    max-width: 100%;
    padding: 5px;
  }

  .sub-item {
    margin-left: 10px; /* スマホでインデントを小さく */
  }

  .sub-question-number {
    width: 20px; /* スマホで番号幅を小さく */
  }

  .menu {
    width: 100%;
    left: 0;
    top: 50px;
  }

  .menu-button {
    top: 10px;
    left: 10px;
    padding: 8px 20px;
    min-width: 100px; /* スマホで少し小さく */
  }

  .top-page-button {
    top: 10px;
    right: 10px;
    bottom: auto; /* 下への伸びを防止 */
    padding: 8px 20px;
    min-width: 100px; /* スマホで少し小さく */
    height: 40px; /* 固定高さ */
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    white-space: nowrap;
  }

  details > summary {
    padding: 8px 15px; /* スマホで少しコンパクトに */
    font-size: 1em; /* フォントサイズを小さく */
  }
}

/* 答えの中身 */
.answer-content {
  margin: 10px 0 20px;
  padding: 15px;
  background-color: #f9f9f9;
  border-left: 5px solid #00acc1;
  border-radius: 5px;
}

/* 「補足」用に、ネストされたdetailsを維持 */
.answer-content > details > summary {
  background: linear-gradient(90deg, #fff3e0, #ffe0b2); /* 補足はオレンジグラデ */
  color: #333; /* テキスト色を濃く */
  border-left: 5px solid #fb8c00;
  padding: 10px 15px;
  border-radius: 5px;
}

.answer-content > details > summary:hover {
  background: linear-gradient(90deg, #ffe0b2, #ffcc80); /* ホバー時に濃いオレンジ */
}

/* 補足の中身 */
.answer-content > details > p {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 3px solid #fb8c00;
}

/* 現在のページのリンクハイライト */
.sub-menu a.active-link {
  font-weight: bold;
  color: #0077cc;
  pointer-events: none;
}

/*問題のなかの問題を四角で囲う*/
.nakagaki {
  border: 1px solid black;
  padding: 10px;
  margin: 10px 0;
}

/*文字を四角で囲う*/
.small-square {
  border: 1px solid black;
  padding: 2px 6px;
  margin: 0 3px;
  display: inline-block;
}
