/* カラー定義 */
:root {
  --baseColor: #ff8c00;
  --accentColor: #e81d2d;
  --borderColor: #dcdcdc;
}

html,
body {
  /* font-family: 'Noto Sans JP', sans-serif;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  overflow-x:hidden; */
}

/* FAQセクション全体のスタイリング */
.faq-section {
  /* background-color: #ffefd5;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 0;
  min-height: 50px;
  max-height: none; ← ← 固定解除
  width: 100%;      ← ← これでOK
  margin: 0;        ← ← 横ずれ防止
  box-sizing: border-box; */
}

/* 背景画像オーバーレイ（明るさ調整と装飾） */
.faq-section::before {
  /* 背景画像と明るさ調整が不要になったため、この擬似要素は削除するかコメントアウト */
  /* content: none;
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: brightness(110%) saturate(110%);
  z-index: 1; */
}

/* h2要素のスタイリング */
.faq-section h2 {
  /* font-size: 2.5em; 文字を調整（大きすぎないように）
  text-align: center; テキストを中央に配置
  position: relative; オーバーレイより手前に表示するために必要
  z-index: 2; オーバーレイより手前に配置
  letter-spacing: 0.1em; 文字間隔の調整
  text-shadow: none; 文字の影を削除
  color: #333; シンプルな黒文字に設定
  margin: 0; デフォルトのマージンをリセット
  line-height: 1.2; 行の高さの調整
  padding: 0; パディングを削除
  border-radius: 0; 角の丸みを削除
  box-shadow: none; h2の背景に影を削除
  max-width: 90%; レスポンシブ対応のために最大幅を設定
  box-sizing: border-box; パディングを含めて幅を計算
  width: 100%; 横幅いっぱいに広げる */
}

.normalText {
  text-align: center;
  /* font-size: 1rem;
  margin: 0 auto; 中央寄せ
  padding: 0 20px; 左右の余白を確保
  box-sizing: border-box; paddingを含めて幅を計算 */
  @media (width <= 768px) {
    text-align: left;
    font-size: 14px;
  }
}

.formText {
  font-size: 1.5em;
  /* margin: 0 auto; は上記で一括指定されるため、ここでは不要 */
  padding: 20px; /* 適度なパディングを追加 */
}

.formText a {
  display: block; /* aタグをブロック要素にして、中央寄せが効くように */
  width: fit-content; /* 内容の幅に合わせる */
  margin: 0 auto; /* 中央寄せ */
  color: inherit; /* 親要素の色を継承 */
  text-decoration: none; /* 下線が不要なら */
  /* その他ボタンのようなスタイルが必要なら追加 */
  background-color: #e0e0e0; /* 背景色 */
  padding: 10px 20px;
  border-radius: 5px;
}

/* tabs, searchInput, search-results, qa-container も横幅を確保 */
.tabs,
#searchInput,
#search-results,
#qa-container {
  width: 100%; /* 必要に応じて最大幅を設定 */
  /* padding: 0 20px; 左右の余白を確保 */
  box-sizing: border-box;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  justify-content: center; /* 横方向に中央配置 */
  gap: 8px 16px;
  flex-wrap: wrap; /* タブが多くても折り返す */
}

.tabs button {
  padding: 8px 16px;
  border: 1px solid var(--borderColor);
  background-color: color-mix(in srgb, var(--baseColor) 10%, transparent 0%);
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.125rem;
  color: #323232;
  /* width: 180px; */
  /* height: 64px; */
}

.tabs button.active {
  background-color: var(--accentColor);
  color: #fff;
}

.subcategory-buttons {
  /* 不要ですが、元のスタイルを残す */
  display: none;
}

.subcategory-title {
  margin-top: 40px;
  border-left: 4px solid var(--accentColor);
  padding-left: 16px;
  color: var(--accentColor);
}

.qa-section {
  max-width: 100%;
  margin-bottom: 15px;
  border: 1px solid var(--borderColor);
  border-radius: 4px;
}

summary {
  cursor: pointer;
  background-color: #f5f5f5;
  padding: 16px;
  font-weight: bold;
  position: relative;
  line-height: 1.5;
  padding-right: 25px; /* 前回の設定と同じでOK。必要に応じて調整 */
  height: auto;
}

#searchDiv {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  width: 100%;
  max-width: 800px;
  padding: 16px;
  box-sizing: border-box;
  background-color: #f5f5f5;
}

#searchInput {
  flex-grow: 1;
  padding: 8px;
  font-size: 1em;
  border: 1px solid var(--borderColor);
  border-right: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  height: 40px;
  box-sizing: border-box;
  &::placeholder {
    color: #999;
  }
}

#searchButton {
  padding: 8px;
  background-color: var(--accentColor);
  border: 1px solid var(--accentColor);
  border-left: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  color: #fff;
  width: 64px;
  height: 40px;
  box-sizing: border-box;
  font-size: 1.125rem;
}

.search-result summary {
  padding-right: 35px;
  min-height: 2.2em;
  line-height: 2.2em;
}

details[open] summary {
  background-color: color-mix(in srgb, var(--baseColor) 10%, transparent 0%);
}

.answer {
  padding: 16px;
  border-top: 1px solid var(--borderColor);
  line-height: 1.8;
}

/* 検索結果 */
#search-results {
  margin: 80px auto;
  border-top: 2px solid var(--borderColor);
  padding-top: 40px;
  display: none; /* 最初は非表示 */
  text-align: left;
}

#qa-container {
  margin: 80px auto;
  text-align: left;
}

.cat-label {
  position: absolute;
  right: 8px;
  bottom: 4px;
  font-size: 0.75em;
  color: #666;
  white-space: nowrap;
  font-weight: normal;
  line-height: normal;
  pointer-events: none;
}

/* 新しい質問番号ラベルのスタイル */
.question-number-label {
  position: absolute;
  right: 8px; /* カテゴリラベルと同じ右からの距離 */
  top: 2px; /* 上からの距離 */
  font-size: 0.6875rem;
  color: #666; /* cat-labelと同じ色 */
  white-space: nowrap;
  font-weight: normal;
  line-height: normal;
  pointer-events: none;
}

mark {
  background-color: color-mix(in srgb, var(--baseColor) 30%, transparent 0%);
  font-weight: bold;
}

.table_scroll {
  white-space: nowrap;
  overflow-x: auto;
}
/* 単線のテーブル */
.SimpleTableSet {
  /* <table> */
  border: 1px var(--borderColor) solid;
  border-collapse: collapse; /* 枠線の表示方法 */
}

/* SimpleTableSet 内の td, th にも同じ線を適用 */
.SimpleTableSet td,
.SimpleTableSet th {
  border: 1px var(--borderColor) solid;
}

.back-list-btn {
  margin: 20px auto 0;
  width: 100%;
  max-width: 480px;
}

@media (width <= 768px) {
  .tabs button {
    font-size: 1.125rem;
  }
}
