/* =========================================================
   VAMOS FAMILIA QA大全 (qa/ 配下ページ専用) v2
   style.css の変数・共通コンポーネントを前提とする
   - ヒーロー/本文は全QAページで .container (1160px) に統一
   - L1/L2 ページは サイドバー + 本文 の2カラム
   ========================================================= */

/* --- ヒーロー (全QAページ共通) --- */
.qa-hero {
  background:
    linear-gradient(160deg, rgba(6, 36, 30, 0.92), rgba(11, 56, 46, 0.88)),
    repeating-linear-gradient(90deg, #0b382e 0 90px, #0d4237 90px 180px);
  color: var(--paper);
  padding: 46px 0 42px;
}

.qa-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(27px, 3.8vw, 40px);
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin: 8px 0 14px;
}

.qa-hero .section-eyebrow { color: var(--gold-400); }

.qa-lead {
  max-width: 780px;
  font-size: 16px;
  color: rgba(255, 250, 241, 0.92);
}

.qa-count-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 14px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--terracotta-500);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* --- グローバルナビの現在地 --- */
.global-nav a[aria-current="true"] { color: var(--terracotta-700); }

/* --- パンくず --- */
.breadcrumb { font-size: 13px; margin-bottom: 6px; }

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 6px;
  opacity: 0.55;
}

.qa-hero .breadcrumb { color: rgba(255, 250, 241, 0.75); }
.qa-hero .breadcrumb a { color: inherit; text-decoration: none; }
.qa-hero .breadcrumb a:hover { text-decoration: underline; }

/* --- 本文ラッパ / 2カラムレイアウト --- */
.qa-body-wrap { padding: 44px 0 72px; }

.qa-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.qa-main { min-width: 0; }

/* --- サイドバー (カテゴリツリー) --- */
.qa-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.qa-sidebar-wrap > summary {
  display: none; /* デスクトップでは常時展開 (モバイルで表示) */
}

.qa-sidebar-inner {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  padding: 14px;
}

.qa-sidebar-top {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--green-900);
  text-decoration: none;
  padding: 8px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.qa-sidebar-top:hover { color: var(--terracotta-700); }

.qa-sidebar-top[aria-current="page"] {
  background: var(--green-900);
  color: #fff;
  border-radius: 8px;
  border-bottom: none;
  margin-bottom: 12px;
}

.qa-sidebar-top[aria-current="page"]:hover { color: #fff; }

.qa-sidebar-cat { border-radius: 10px; }

.qa-sidebar-cat > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  border-radius: 8px;
  position: relative;
}

.qa-sidebar-cat > summary::-webkit-details-marker { display: none; }

.qa-sidebar-cat > summary:hover { background: var(--sand); }

.qa-sidebar-cat > summary span {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.qa-sidebar-cat > summary.is-current { color: var(--green-700); }

.qa-sidebar-cat[open] > summary { background: var(--sand); }

.qa-sidebar-cat ul {
  list-style: none;
  margin: 4px 0 10px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  margin-left: 12px;
  display: grid;
  gap: 2px;
}

.qa-sidebar-cat ul a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.5;
}

.qa-sidebar-cat ul a span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.qa-sidebar-cat ul a:hover { background: var(--sand); color: var(--terracotta-700); }

.qa-sidebar-cat ul a[aria-current="page"] {
  background: var(--green-900);
  color: #fff;
  font-weight: 700;
}

.qa-sidebar-cat ul a[aria-current="page"] span { color: rgba(255, 255, 255, 0.7); }

.qa-sidebar-l1link { font-weight: 700; color: var(--green-700) !important; }

/* --- 目次 (第3階層 小テーマ) --- */
.qa-toc {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px;
  margin-bottom: 38px;
}

.qa-toc h2 {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--green-700);
  margin-bottom: 10px;
}

.qa-toc ol {
  list-style: none;
  counter-reset: toc;
  display: grid;
  gap: 6px;
}

.qa-toc li { counter-increment: toc; font-weight: 500; }

.qa-toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-serif);
  color: var(--terracotta-700);
  margin-right: 10px;
}

.qa-toc a { color: var(--ink); text-decoration: none; }
.qa-toc a:hover { color: var(--terracotta-700); text-decoration: underline; }
.qa-toc li span { color: var(--muted); font-size: 13px; font-weight: 400; }

/* --- QAグループ --- */
.qa-group { margin-bottom: 44px; }

.qa-group-title {
  font-family: var(--font-serif);
  font-size: clamp(21px, 3vw, 26px);
  color: var(--green-900);
  border-top: 2px solid var(--green-900);
  padding-top: 14px;
  margin-bottom: 18px;
}

/* --- ページ内注意書き --- */
.qa-note { margin: 8px 0 40px; }

/* --- 前後ナビ --- */
.qa-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 40px;
}

.qa-pager a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  background: var(--white);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.qa-pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.qa-pager a span {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.qa-pager-next { text-align: right; }

/* --- CTA --- */
.qa-cta {
  background: var(--green-950);
  color: var(--paper);
  border-radius: 18px;
  padding: 36px 30px;
  text-align: center;
}

.qa-cta h2 {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 26px);
  margin-bottom: 10px;
}

.qa-cta p {
  max-width: 560px;
  margin: 0 auto 22px;
  color: rgba(255, 250, 241, 0.88);
  font-size: 15px;
}

/* --- 大カテゴリページ --- */
.qa-cat-block { margin-bottom: 42px; }

.qa-cat-block h2 {
  font-family: var(--font-serif);
  font-size: clamp(21px, 3vw, 26px);
  color: var(--green-900);
  border-top: 2px solid var(--green-900);
  padding-top: 14px;
  margin-bottom: 8px;
}

.qa-cat-block h2 a { color: inherit; text-decoration: none; }
.qa-cat-block h2 a:hover { color: var(--terracotta-700); }
.qa-cat-block > p { color: var(--muted); margin-bottom: 14px; }

.qa-question-links {
  list-style: none;
  display: grid;
  gap: 8px;
}

.qa-question-links a {
  display: block;
  padding: 10px 16px 10px 40px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}

.qa-question-links a::before {
  content: "Q";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--terracotta-500);
}

.qa-question-links a:hover { border-color: var(--terracotta-500); color: var(--terracotta-700); }

/* --- ハブページ --- */
.qa-hub-cat { margin-bottom: 52px; }

.qa-hub-cat-head {
  display: flex;
  align-items: baseline;
  gap: 4px;
  border-top: 2px solid var(--green-900);
  padding-top: 16px;
}

.qa-hub-cat-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.4vw, 30px);
  color: var(--green-900);
}

.qa-hub-cat-head h2 a { color: inherit; text-decoration: none; }
.qa-hub-cat-head h2 a:hover { color: var(--terracotta-700); }

.qa-hub-tagline { color: var(--muted); margin: 6px 0 18px; max-width: 760px; }

.qa-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.qa-hub-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 20px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.qa-hub-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--terracotta-500);
}

.qa-hub-card h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--green-900);
}

.qa-hub-card p { font-size: 13.5px; color: var(--muted); flex: 1; }

.qa-hub-card-meta {
  font-size: 12px;
  color: var(--terracotta-700);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

/* --- 検索 --- */
.qa-search { max-width: 640px; margin-top: 26px; }

.qa-search label {
  display: block;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--gold-400);
  margin-bottom: 6px;
}

.qa-search input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid rgba(255, 250, 241, 0.35);
  background: rgba(255, 250, 241, 0.96);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
}

.qa-search input:focus { border-color: var(--gold-400); outline: none; }

.qa-search-status {
  font-size: 13px;
  color: rgba(255, 250, 241, 0.85);
  margin-top: 8px;
  min-height: 1.4em;
}

.qa-search-results {
  list-style: none;
  display: grid;
  gap: 6px;
  margin-top: 4px;
  max-height: 340px;
  overflow-y: auto;
}

.qa-search-results li {
  background: rgba(255, 250, 241, 0.97);
  border-radius: 10px;
  padding: 10px 14px;
}

.qa-search-results a {
  color: var(--green-900);
  font-weight: 700;
  text-decoration: none;
  display: block;
}

.qa-search-results a:hover { color: var(--terracotta-700); text-decoration: underline; }

.qa-search-results span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* --- レスポンシブ --- */
@media (max-width: 980px) {
  .qa-layout { grid-template-columns: 1fr; gap: 24px; }

  .qa-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .qa-sidebar-wrap > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--sand);
    padding: 14px 18px;
    font-weight: 700;
    color: var(--green-900);
  }

  .qa-sidebar-wrap > summary::-webkit-details-marker { display: none; }

  .qa-sidebar-wrap > summary::after {
    content: "+";
    color: var(--terracotta-700);
    font-size: 22px;
    line-height: 1;
  }

  .qa-sidebar-wrap[open] > summary::after { content: "-"; }

  .qa-sidebar-wrap[open] > summary {
    border-radius: 12px 12px 0 0;
    border-bottom: none;
  }

  .qa-sidebar-wrap[open] .qa-sidebar-inner {
    border-radius: 0 0 12px 12px;
  }
}

@media (max-width: 640px) {
  .qa-pager { grid-template-columns: 1fr; }
  .qa-pager-next { text-align: left; }
  .qa-count-badge { margin-left: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .qa-pager a, .qa-hub-card { transition: none; }
}
