/* =====================================================================
 * wiki.css — 用語辞典（single-glossary.php / archive-glossary.php）
 * bg #f8f6f1 / card #ffffff / accent #c8a45a / secondary #b5893a  (design unify v4.0)
 * ===================================================================== */

.wiki-page {
  --bg:         #f8f6f1;
  --card:       #ffffff;
  --card-hover: #faf8f4;
  --gold:       #c8a45a;
  --gold2:      #b5893a;
  --text:       #333333;
  --text-dim:   #666666;
  --border:     #e8e4dc;

  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
}

/* .wiki-page の外側（body・SWELLラッパー）も地色を揃える */
body.single-glossary,
body.post-type-archive-glossary,
body.tax-glossary_category {
  background: #f8f6f1 !important;
}
body.single-glossary #body_wrap,
body.single-glossary #content,
body.single-glossary .l-mainContent,
body.single-glossary .l-content,
body.post-type-archive-glossary #body_wrap,
body.post-type-archive-glossary #content,
body.post-type-archive-glossary .l-mainContent,
body.post-type-archive-glossary .l-content,
body.tax-glossary_category #body_wrap,
body.tax-glossary_category #content,
body.tax-glossary_category .l-mainContent,
body.tax-glossary_category .l-content {
  background: transparent !important;
}

/* ==================== パンくず ==================== */
.wiki-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  line-height: 1.9;
}

.wiki-breadcrumb a {
  color: var(--text-dim);
  transition: color 0.15s;
}

.wiki-breadcrumb a:hover {
  color: var(--gold);
}

.wiki-breadcrumb-sep {
  margin: 0 0.4em;
  opacity: 0.6;
}

.wiki-breadcrumb-current {
  color: var(--gold2);
}

/* ==================== レイアウト ==================== */
.wiki-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

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

/* ==================== 見出し ==================== */
.wiki-cat-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--gold);
  background: rgba(200, 164, 90, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 0.8rem;
}

.wiki-title {
  font-family: "Noto Serif JP", serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: 0.03em;
  line-height: 1.4;
  margin: 0 0 1.5rem;
}

/* ==================== 目次 ==================== */
.wiki-toc {
  background: rgba(0, 0, 0, 0.02);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.wiki-toc-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.6rem;
  letter-spacing: 0.05em;
}

.wiki-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-toc-item {
  font-size: 0.9rem;
  margin: 0.35rem 0;
}

.wiki-toc-item.is-h3 {
  padding-left: 1.2em;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.wiki-toc-item a {
  color: inherit;
  transition: color 0.15s;
}

.wiki-toc-item a:hover {
  color: var(--gold);
}

/* ==================== 本文 ==================== */
.wiki-content {
  line-height: 1.9;
  font-size: 1rem;
}

.wiki-content > * + * {
  margin-top: 1.2em;
}

.wiki-content h2 {
  font-family: "Noto Serif JP", serif;
  font-size: 1.35rem;
  color: var(--gold2);
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--gold);
  margin-top: 2.4em;
}

.wiki-content h3 {
  font-size: 1.1rem;
  color: var(--gold);
  margin-top: 2em;
}

.wiki-content a {
  color: var(--gold);
  text-decoration: underline;
}

.wiki-content ul,
.wiki-content ol {
  padding-left: 1.4em;
}

.wiki-content ul li {
  list-style: disc;
}

.wiki-content ol li {
  list-style: decimal;
}

.wiki-content li {
  margin: 0.4em 0;
}

.wiki-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.wiki-content th,
.wiki-content td {
  border: 1px solid var(--border);
  padding: 0.6em 0.8em;
  text-align: left;
}

.wiki-content th {
  background: var(--card);
  color: var(--gold2);
}

.wiki-content blockquote {
  border-left: 3px solid var(--gold);
  background: rgba(0, 0, 0, 0.02);
  padding: 0.8em 1.2em;
  color: var(--text-dim);
}

/* ==================== サイドバー ==================== */
.wiki-sidebar {
  position: sticky;
  top: 100px;
}

.wiki-side-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin: 0 0 0.8rem;
}

.wiki-related {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.wiki-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-related-list li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.wiki-related-list li:last-child {
  border-bottom: none;
}

.wiki-related-list a {
  display: block;
  padding: 0.6rem 0;
  font-size: 0.9rem;
  color: var(--text);
  transition: color 0.15s;
}

.wiki-related-list a:hover {
  color: var(--gold);
}

.wiki-cta {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}

.wiki-cta-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0 0.8rem;
}

.wiki-cta-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  transition: color 0.15s;
}

.wiki-cta-link:hover {
  color: var(--gold2);
}

/* ==================== アーカイブ ==================== */
.wiki-archive-head {
  text-align: center;
  margin-bottom: 2rem;
}

.wiki-archive-title {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--gold2);
  letter-spacing: 0.04em;
  margin: 0 0 0.6rem;
}

.wiki-archive-lead {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
}

/* --- 索引 --- */
.wiki-index {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.wiki-index-btn {
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  min-width: 2.2em;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wiki-index-btn:hover {
  border-color: rgba(200, 164, 90, 0.4);
}

.wiki-index-btn.is-active {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
  font-weight: 700;
}

/* --- カテゴリピル（checker-v3-pill 準拠） --- */
.wiki-cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.wiki-cat-pill {
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wiki-cat-pill:hover {
  border-color: rgba(200, 164, 90, 0.4);
}

.wiki-cat-pill.is-active {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
  font-weight: 700;
}

/* --- 検索 --- */
.wiki-search {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.wiki-search input {
  width: 100%;
  max-width: 420px;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.15s;
}

.wiki-search input::placeholder {
  color: var(--text-dim);
}

.wiki-search input:focus {
  border-color: var(--gold);
}

/* --- カードグリッド --- */
.wiki-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.wiki-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  min-height: 150px;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.wiki-card:hover {
  border-color: var(--gold);
  background: var(--card-hover);
  transform: translateY(-2px);
}

.wiki-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.wiki-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold2);
  margin: 0 0 0.4rem;
  line-height: 1.5;
}

.wiki-card-excerpt {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.7;
}

.wiki-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* ==================== レスポンシブ ==================== */
@media (max-width: 960px) {
  .wiki-layout {
    grid-template-columns: 1fr;
  }

  .wiki-sidebar {
    position: static;
  }

  .wiki-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .wiki-page {
    padding: 1.2rem 1rem 3rem;
  }

  .wiki-title {
    font-size: 1.5rem;
  }

  .wiki-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== FAQ（施策7） ==================== */
.wiki-faq {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.wiki-faq-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold2);
  margin: 0 0 1.2rem;
  letter-spacing: 0.02em;
}

.wiki-faq-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.wiki-faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
}

.wiki-faq-q {
  position: relative;
  padding-left: 1.7rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.6;
  margin: 0;
}

.wiki-faq-q::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold2);
}

.wiki-faq-a {
  position: relative;
  margin: 0.7rem 0 0;
  padding-left: 1.7rem;
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--text);
}

.wiki-faq-a::before {
  content: "A";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .wiki-faq-item {
    padding: 0.9rem 1rem;
  }

  .wiki-faq-q,
  .wiki-faq-a {
    padding-left: 1.4rem;
  }
}

/* ===== デザイン統一 v4.0: ライトカードの陰影 ===== */
.wiki-card,
.wiki-related,
.wiki-cta {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
