/* =============================
   FAQ CSS - 統合版 (faq.css + faq-overrides.css)
   ============================= */

/* ===== ベース（モバイルファースト） ===== */
.faq-view {
  width: 30px;
  border-bottom: solid 3px #14944a;
  margin: 0 auto;
  padding-top: 3px;
}
.menu-nav .faq-view { margin-left: 33px; }

.faq-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: left;
}

.faq-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 20px;
}

/* ===== 上部カテゴリータブ ===== */
.faq-cats {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin: 16px 0 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
}
.faq-cats .cat-tab {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  background: #f4f6f5;
  border: 1px solid #e5eaea;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  color: #333;
}
.faq-cats .cat-tab:hover, .faq-cats .cat-tab:focus {
  background: #14934a;
  border-color: #14934a;
  color: #fff;
  outline: none;
}
.faq-cats .cat-tab:focus-visible {
  outline: 2px solid #14934a;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ===== FAQセクション ===== */
.faq-section {
  margin: 40px 0;
  scroll-margin-top: clamp(64px, 10vh, 120px); /* 固定ヘッダー高さ分の余白 */
}
.faq-section .faq-heading {
  position: relative;
  margin: 0;
  padding: 8px 0 14px;
  font-weight: 700;
  line-height: 1.25;
  font-size: clamp(22px, 2.2vw, 32px);
  color: #1a8f4d;
}
.faq-section .faq-heading::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: #1a8f4d;
  border-radius: 2px;
}
.faq-section:target .faq-heading {
  background: linear-gradient(transparent 60%, rgba(20,147,74,0.15) 60%);
}


/* ===== Q/Aリスト ===== */
.faq-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: block;
}
.faq-item { padding: 14px 0; }
.faq-item + .faq-item { border-top: 1px solid #e8e8e8; }

/* ===== details/summary ===== */
.faq-item summary.faq-question {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-right: 26px;
}
.faq-item summary.faq-question:focus-visible {
  outline: 2px solid #14934a;
  outline-offset: 2px;
  border-radius: 6px;
}
.faq-item summary::-webkit-details-marker { display: none; }

/* Q/Aラベル */
.faq-item .label.q {
  font-weight: 700;
  color: #0b67c2;
}

/* フォント統一 */
.faq-item .question-text, .faq-item .answer-text {
  font: inherit;
  line-height: 1.85;
  color: #000;
}
.faq-item .answer-text p { margin: 0 0 0.8em; }

/* プラス/マイナスアイコン */
.faq-item summary.faq-question::before,
.faq-item summary.faq-question::after {
  content: "";
  position: absolute;
  right: 4px; top: 50%;
  width: 16px; height: 2px;
  background: #333;
  transform: translateY(-50%);
  transition: transform .25s ease, opacity .25s ease;
}
.faq-item summary.faq-question::after { transform: translateY(-50%) rotate(90deg); }
.faq-item[open] summary.faq-question::after { opacity: 0; }

/* 回答部分 */
.faq-item .faq-answer {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0 0
}
.faq-item .faq-answer .label.a {
  flex-shrink: 0;
  font-weight: 700;
  color: #d12f2f
}

.faq-cta {
  margin: 8px 0 0 2em;
  font-size: 0.9rem;
}
.faq-cta a {
  color: #14934a;
  font-weight: 600;
  text-decoration: none;
}
.faq-cta a:hover {
  text-decoration: underline;
}

/* ===== トップへ戻るボタン ===== */
.to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #14934a;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: background 0.3s ease;
  display: none;
  z-index: 9999;
}
.to-top:hover { background: #0f7a39; }
.to-top::before, .to-top::after {
  content: '';
  position: absolute;
  width: 2px;
  height: 12px;
  background: #fff;
  top: 18px;
  left: 50%;
  transform-origin: top center;
}
.to-top::before { transform: translateX(-50%) rotate(45deg); }
.to-top::after  { transform: translateX(-50%) rotate(-45deg); }

/* ===== レスポンシブ調整 ===== */
@media (min-width: 769px) {
  .faq-container { padding: 40px 20px; }
  .faq-title { font-size: 2rem; }
  .faq-section h2 { font-size: 1.5rem; }
  .faq-cats { gap: 12px; }
  .faq-cats .cat-tab { font-size: 1rem; }
}
@media (max-width: 640px) {
  .faq-cats { gap: 8px; }
  .faq-cats .cat-tab { font-size: 0.9rem; }
}

/* ===== スクロール挙動 ===== */
html { scroll-behavior: smooth; }
