/* WIKI: 記事一覧の行と、markdown から起こした本文の書式。
   枠・カード・バッジ・ページ送り・前後ナビは common/components.css の .th-* を使う。 */

/* --- 検索フォーム: 入力欄 + 検索ボタン --- */
.wiki-search {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

/* --- 記事詳細 --- */
.wiki-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.wiki-view-count {
  font-size: 12px;
  color: var(--th-color-text-muted);
}

/* 本文は管理画面の markdown から起こす。見出し・表のクラスを付けられないので要素で書く */
.wiki-body {
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.wiki-body h2 {
  margin-top: 32px;
  padding-bottom: 4px;
  border-bottom: var(--th-border-inner);
}

.wiki-body img {
  max-width: 100%;
  height: auto;
}

.wiki-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.wiki-body th,
.wiki-body td {
  padding: 8px 10px;
  border: var(--th-border-inner);
  text-align: left;
  vertical-align: top;
}

.wiki-body th { background: var(--th-brand-50); }

/* 出典: markdown の h2「出典」を wiki_extras.py が開閉見出しに変える */
.wiki-body .wiki-sources-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 16px;
  color: var(--th-color-text-muted);
  cursor: pointer;
}

.wiki-sources-arrow { transition: transform 0.15s; }

.wiki-sources-heading[aria-expanded="true"] .wiki-sources-arrow { transform: rotate(180deg); }

/* --- 役に立ったかの投票 --- */
.wiki-feedback {
  margin-top: 40px;
  padding: 20px;
  text-align: center;
  border: var(--th-border-inner);
}

.wiki-feedback-question {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--th-color-heading);
}

.wiki-feedback-buttons { justify-content: center; }

.wiki-feedback-btn { gap: 6px; }

/* 押した方を選択済みに。投票は1回なので、押せなくなったことが分かる程度に留める */
.wiki-feedback-btn.is-selected {
  color: #fff;
  background: var(--th-brand-800);
}

/* --- WIKIとは --- */
.wiki-about { margin-top: 32px; }

.wiki-about-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--th-color-text-muted);
}

.wiki-about-text:last-child { margin-bottom: 0; }

/* --- 前後の記事: タイトルが長いので枠内で折り返す --- */
.wiki-nav-btn {
  max-width: 40%;
  white-space: normal;
  text-align: left;
}
