/**
 * Greenheart FAQ 表示スタイル（1.2.0）
 *
 * 色は下の変数だけで決まる。本番 /faq/ のスクショ（docs/2026-10-22_design_basis.md）から拾った値:
 *   --gh-primary #cc433c … ナビの現在地（FAQ）の赤。白地とのコントラスト 4.6:1
 *   --gh-text    #222222 … テーマの本文・見出しの文字色
 * フォントは指定しない（テーマの本文フォントを継承する）。
 */

.gh-faq {
	--gh-text: #222222;
	--gh-muted: #666666;
	--gh-line: #e3e3e3;
	--gh-bg: #ffffff;
	--gh-bg-alt: #f7f6f5;
	--gh-primary: #cc433c;
	--gh-primary-hover: #a8332d;
	--gh-primary-tint: #fbefee;
	--gh-focus: #cc433c;

	box-sizing: border-box;
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 20px 64px;
	color: var(--gh-text);
	line-height: 1.8;
	overflow-wrap: anywhere;
	min-width: 0;
}

.gh-faq *,
.gh-faq *::before,
.gh-faq *::after {
	box-sizing: inherit;
}

.gh-faq--embed,
.gh-faq--single {
	padding: 0;
	max-width: none;
}

.gh-faq img {
	max-width: 100%;
	height: auto;
}

.gh-faq a {
	color: var(--gh-primary);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.gh-faq a:hover {
	color: var(--gh-primary-hover);
}

.gh-faq-q-btn:focus:not(:focus-visible) {
	outline: none;
}

.gh-faq a:focus-visible,
.gh-faq button:focus-visible {
	outline: 2px solid var(--gh-focus);
	outline-offset: 2px;
}

/* テーマの見出し装飾（左の縦線・下線・背景・疑似要素）を打ち消す */
.gh-faq h1,
.gh-faq h2,
.gh-faq h3 {
	border: 0;
	background: none;
	box-shadow: none;
	padding: 0;
	text-transform: none;
	letter-spacing: normal;
}

.gh-faq .gh-faq-title,
.gh-faq .gh-faq-cat-title,
.gh-faq .gh-faq-q {
	border: 0;
	background: none;
	box-shadow: none;
	padding: 0;
}

.gh-faq .gh-faq-title::before,
.gh-faq .gh-faq-title::after,
.gh-faq .gh-faq-cat-title::before,
.gh-faq .gh-faq-cat-title::after,
.gh-faq .gh-faq-q::before,
.gh-faq .gh-faq-q::after,
.gh-faq h1::before,
.gh-faq h1::after,
.gh-faq h2::before,
.gh-faq h2::after,
.gh-faq h3::before,
.gh-faq h3::after {
	content: none;
	display: none;
}

/* パンくず */
.gh-faq-crumbs {
	margin: 24px 0 0;
	font-size: 0.8125rem;
	color: var(--gh-muted);
}

.gh-faq-crumbs ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gh-faq-crumbs li {
	display: inline;
}

.gh-faq-crumbs li + li::before {
	content: "›";
	margin: 0 0.5em;
}

.gh-faq-crumbs a {
	color: var(--gh-muted);
}

/* ページ見出し */
.gh-faq-head {
	margin: 24px 0 28px;
}

.gh-faq .gh-faq-title {
	margin: 0 0 8px;
	font-size: 1.75em;
	font-weight: 700;
	line-height: 1.4;
	color: var(--gh-text);
}

.gh-faq-lead {
	margin: 0;
	color: var(--gh-muted);
}

.gh-faq-lead p {
	margin: 0 0 0.5em;
}

/* 目次（カテゴリー。押すとそのカテゴリーだけ表示） */
.gh-faq-toc {
	margin: 0 0 40px;
	padding: 20px 24px;
	background: var(--gh-bg-alt);
	border-radius: 8px;
}

.gh-faq-toc-title {
	margin: 0 0 12px;
	font-size: 0.875rem;
	font-weight: 700;
	color: var(--gh-muted);
}

.gh-faq-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.gh-faq-toc li {
	margin: 0;
	padding: 0;
}

.gh-faq-toc li::before {
	content: none;
}

.gh-faq .gh-faq-toc-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 16px;
	border: 1px solid #d6d6d6;
	border-radius: 999px;
	background: var(--gh-bg);
	color: var(--gh-text);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.gh-faq .gh-faq-toc-link:hover {
	border-color: var(--gh-primary);
	color: var(--gh-primary);
}

.gh-faq .gh-faq-toc-link.is-current {
	border-color: var(--gh-primary);
	background: var(--gh-primary);
	color: #ffffff;
}

.gh-faq-toc-count {
	min-width: 1.6em;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--gh-bg-alt);
	color: var(--gh-muted);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.6;
	text-align: center;
}

.gh-faq-toc-link.is-current .gh-faq-toc-count {
	background: rgba(255, 255, 255, 0.22);
	color: #ffffff;
}

/* カテゴリーの区切り */
.gh-faq-section {
	margin: 0 0 48px;
	scroll-margin-top: 96px;
}

.gh-faq-section[hidden] {
	display: none;
}

.gh-faq .gh-faq-cat-title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	font-size: 1.375em;
	font-weight: 700;
	line-height: 1.5;
	color: var(--gh-text);
}

.gh-faq-cat-count {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--gh-muted);
}

.gh-faq-cat-count::after {
	content: "件";
}

/* Q&A: 1件ずつカード */
.gh-faq-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gh-faq-item {
	margin: 0;
	border: 1px solid var(--gh-line);
	border-radius: 8px;
	background: var(--gh-bg);
	scroll-margin-top: 96px;
	transition: border-color 0.15s ease;
}

.gh-faq-item:hover,
.gh-faq-item:has(.gh-faq-q-btn[aria-expanded="true"]) {
	border-color: #cfcfcf;
}

.gh-faq .gh-faq-q {
	margin: 0;
	font-size: 1.0625em;
	font-weight: 700;
	line-height: 1.6;
}

.gh-faq .gh-faq-q-btn {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: 0;
	padding: 18px 20px;
	border: 0;
	border-radius: 8px;
	background: none;
	box-shadow: none;
	color: var(--gh-text);
	font: inherit;
	letter-spacing: normal;
	text-align: left;
	text-transform: none;
	cursor: pointer;
}

.gh-faq .gh-faq-q-btn:hover,
.gh-faq .gh-faq-q-btn:focus {
	background: none;
	color: var(--gh-text);
}

.gh-faq-q-btn:hover .gh-faq-q-text {
	color: var(--gh-primary);
}

/* Q・A の丸印 */
.gh-faq-q-label,
.gh-faq-a-label {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1;
	font-family: Arial, Helvetica, sans-serif;
}

.gh-faq-q-label {
	background: var(--gh-primary);
	color: #ffffff;
}

.gh-faq-a-label {
	background: var(--gh-bg);
	border: 1.5px solid var(--gh-primary);
	color: var(--gh-primary);
}

.gh-faq-q-text {
	flex: 1 1 auto;
	min-width: 0;
}

/* 開閉の印: 細い「＋」。開くと「−」 */
.gh-faq-q-mark {
	position: relative;
	flex: none;
	width: 14px;
	height: 14px;
	margin-left: 8px;
}

.gh-faq-q-mark::before,
.gh-faq-q-mark::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	width: 14px;
	height: 2px;
	margin-top: -1px;
	background: var(--gh-primary);
	transition: transform 0.15s ease;
}

.gh-faq-q-mark::after {
	transform: rotate(90deg);
}

.gh-faq-q-btn[aria-expanded="true"] .gh-faq-q-mark::after {
	transform: rotate(0deg);
}

/* 回答: 薄い地に A の印 */
.gh-faq-a {
	display: grid;
	grid-template-columns: 32px minmax(0, 1fr);
	column-gap: 14px;
	margin: 0 12px 12px;
	padding: 18px 20px 18px 8px;
	border-radius: 6px;
	background: var(--gh-primary-tint);
}

.gh-faq-a[hidden] {
	display: none;
}

.gh-faq-a-body,
.gh-faq-a-link {
	grid-column: 2;
}

.gh-faq-a-label {
	grid-row: 1 / span 2;
}

.gh-faq-a-body {
	padding-top: 2px;
	line-height: 1.9;
}

.gh-faq-a-body > :first-child {
	margin-top: 0;
}

.gh-faq-a-body > :last-child {
	margin-bottom: 0;
}

.gh-faq-a-body p {
	margin: 0 0 1em;
}

.gh-faq-a-link {
	margin: 10px 0 0;
	font-size: 0.8125rem;
}

/* 個別ページ・戻るリンク */
.gh-faq-single-foot {
	margin-top: 40px;
	padding-top: 16px;
	border-top: 1px solid var(--gh-line);
	font-size: 0.9375rem;
}

.gh-faq-single-foot p {
	margin: 0 0 8px;
}

.gh-faq-back {
	margin: 32px 0 0;
}

.gh-faq-empty {
	color: var(--gh-muted);
}

/* サイドバーのウィジェット */
.gh-faq-cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gh-faq-cats li {
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid #e5e5e5;
}

.gh-faq-cats .gh-faq-toc-count {
	margin-left: 0.4em;
	font-size: 0.8125rem;
	opacity: 0.75;
}

@media (max-width: 600px) {
	.gh-faq {
		padding: 0 16px 48px;
	}

	.gh-faq-head {
		margin: 16px 0 20px;
	}

	.gh-faq .gh-faq-title {
		font-size: 1.375rem;
	}

	.gh-faq-toc {
		margin-bottom: 28px;
		padding: 16px;
	}

	.gh-faq-toc ul {
		gap: 8px;
	}

	.gh-faq .gh-faq-toc-link {
		min-height: 36px;
		padding: 4px 12px;
		font-size: 0.875rem;
	}

	.gh-faq-section {
		margin-bottom: 36px;
	}

	.gh-faq .gh-faq-cat-title {
		font-size: 1.1875em;
	}

	.gh-faq .gh-faq-q {
		font-size: 1em;
	}

	.gh-faq .gh-faq-q-btn {
		gap: 10px;
		padding: 14px 14px;
	}

	.gh-faq-q-label,
	.gh-faq-a-label {
		width: 28px;
		height: 28px;
		font-size: 0.875rem;
	}

	.gh-faq-a {
		grid-template-columns: 28px minmax(0, 1fr);
		column-gap: 10px;
		margin: 0 8px 8px;
		padding: 14px 14px 14px 6px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gh-faq-q-mark::before,
	.gh-faq-q-mark::after,
	.gh-faq .gh-faq-toc-link,
	.gh-faq-item {
		transition: none;
	}
}
