/* ===========================================================
   CRJ WEB — faq.css
   よくある質問ページ専用: 2カラム(sticky目次 + アコーディオン)
   =========================================================== */

.faq-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 40px 120px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}

/* ===========================================================
   左: sticky 目次
   =========================================================== */
.faq-nav {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.faq-nav-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-subtle);
  font-weight: 600;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.faq-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: var(--fg-muted);
  font-size: 13px;
  transition: color 0.2s ease;
  letter-spacing: -0.005em;
}

.faq-nav-item::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--fg-subtle);
  transition: background 0.25s ease, width 0.25s ease;
  flex-shrink: 0;
}

.faq-nav-item:hover {
  color: var(--fg);
}

.faq-nav-item.is-active {
  color: var(--accent);
  font-weight: 500;
}

.faq-nav-item.is-active::before {
  background: var(--accent);
  width: 24px;
}

/* ===========================================================
   右: Q&A 本体
   =========================================================== */
.faq-body {
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.faq-category {
  scroll-margin-top: 120px;
}

.faq-category-head {
  margin-bottom: 28px;
}

.faq-category-kicker {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--fg-subtle);
  font-weight: 600;
  margin-bottom: 10px;
}

.faq-category-title {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

/* ===========================================================
   アコーディオン (details / summary)
   =========================================================== */
.faq-acc {
  list-style: none;
  border-top: 1px solid var(--line);
}

.faq-acc-item {
  border-bottom: 1px solid var(--line);
}

.faq-acc-summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 8px 22px 44px;
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  transition: background 0.2s ease;
}

.faq-acc-summary::-webkit-details-marker {
  display: none;
}

.faq-acc-summary::before {
  content: "Q";
  position: absolute;
  left: 8px;
  top: 23px;
  font-size: 13px;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--accent);
}

.faq-acc-summary:hover {
  background: rgba(242, 239, 232, 0.5);
}

.faq-acc-q {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--fg);
  line-height: 1.55;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* トグルボタン (+ / ×) */
.faq-acc-toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.3s ease;
  margin-top: 2px;
}

.faq-acc-toggle::before {
  content: "";
  width: 10px;
  height: 1.5px;
  background: currentColor;
  position: absolute;
}

.faq-acc-toggle::after {
  content: "";
  width: 1.5px;
  height: 10px;
  background: currentColor;
  position: absolute;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.faq-acc-item[open] .faq-acc-summary {
  background: var(--accent-soft);
}

.faq-acc-item[open] .faq-acc-toggle {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(180deg);
}

.faq-acc-item[open] .faq-acc-toggle::after {
  opacity: 0;
}

/* 回答 (JS でアニメーション制御: height / opacity / transform) */
.faq-acc-content {
  padding: 4px 8px 28px 44px;
  position: relative;
  overflow: hidden;
  transition:
    height 0.35s ease-out,
    opacity 0.3s ease-out,
    transform 0.35s ease-out;
  will-change: height, opacity, transform;
}

.faq-acc-content::before {
  content: "A";
  position: absolute;
  left: 8px;
  top: 4px;
  font-size: 13px;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--fg-muted);
}

/* 閉状態(非 open):高さ 0 + padding 0 に折りたたむ */
details:not([open]) > .faq-acc-content {
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-8px);
}

/* prefers-reduced-motion: アニメ無効化 */
@media (prefers-reduced-motion: reduce) {
  .faq-acc-content {
    transition: none;
  }
}

.faq-acc-a {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.85;
  max-width: 680px;
}

.faq-acc-a a {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.faq-acc-a a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 900px) {
  .faq-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding: 48px 24px 80px;
  }

  /* モバイルでは目次を上部に横スクロール形式で */
  .faq-nav {
    position: static;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin: 0 -24px;
    padding-left: 24px;
    padding-right: 24px;
    scrollbar-width: none;
  }

  .faq-nav::-webkit-scrollbar {
    display: none;
  }

  .faq-nav-title {
    display: none;
  }

  .faq-nav-item {
    flex-shrink: 0;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.4);
    font-size: 12px;
  }

  .faq-nav-item::before {
    display: none;
  }

  .faq-nav-item.is-active {
    background: var(--fg);
    color: #fff;
    border-color: var(--fg);
  }

  .faq-body {
    gap: 56px;
  }

  .faq-category {
    scroll-margin-top: 80px;
  }

  .faq-acc-summary {
    padding: 18px 4px 18px 36px;
  }

  .faq-acc-summary::before {
    left: 4px;
    top: 19px;
  }

  .faq-acc-q {
    font-size: 14px;
  }

  .faq-acc-content {
    padding: 4px 4px 22px 36px;
  }

  .faq-acc-content::before {
    left: 4px;
  }
}
