/* ==========================================================================
   corop — よくあるご質問ページ（page-faq.php 専用）
   基準: Figma PC 1280px を ×1.125 でスケール（トップページと同じ換算）
        Figma SP 402px → 実機 375px 想定
   ※色トークン・フォントは header-footer.css の :root で定義（先に読み込む）
   ========================================================================== */

/* ラッパーは .faq-page。トップページの FAQ リスト（style.css の .faq＝display:flex）
   とクラス名が衝突するため、.faq は使わないこと。 */
.faq-page {
	--faq-content: 928px;   /* Figma 825 × 1.125 */
	--faq-cat-grid: 952px;  /* Figma 846 × 1.125 */

	padding: 64px 24px 120px;
	color: var(--corop-ink, #4c4948);
	font-family: var(--corop-font, "Avenir", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif);
}

/* ===== ページ見出し ===== */
.faq-head {
	max-width: var(--faq-content);
	margin-inline: auto;
	text-align: center;
}
.faq-head__title {
	margin: 0;
	color: var(--corop-olive, #9d8a3c);
	font-size: 40px;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.35;
}
.faq-head__lead {
	margin: 16px 0 0;
	font-size: 19px;
	font-weight: 500;
	letter-spacing: 0.1em;
}

/* ===== 検索 ===== */
.faq-search {
	position: relative;
	max-width: 633px; /* Figma 563 × 1.125 */
	margin: 12px auto 0;
}
.faq-search__icon {
	position: absolute;
	top: 50%;
	left: 19px;
	transform: translateY(-50%);
	pointer-events: none;
}
.faq-search__input {
	width: 100%;
	height: 52px; /* Figma 46 × 1.125 */
	padding: 0 24px 0 55px;
	border: 1px solid var(--corop-ink, #4c4948);
	border-radius: 30px;
	background: var(--corop-white, #fff);
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	letter-spacing: 0.2em;
	appearance: none;
}
.faq-search__input::placeholder {
	color: var(--corop-ink, #4c4948);
	opacity: 1;
}
.faq-search__input:focus {
	outline: 2px solid var(--corop-olive, #9d8a3c);
	outline-offset: 2px;
}
.faq-search__empty {
	margin: 20px 0 0;
	font-size: 15px;
	letter-spacing: 0.1em;
}

/* ===== カテゴリ ===== */
.faq-cat__label {
	max-width: var(--faq-cat-grid);
	margin: 44px auto 0;
	text-align: center;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.2em;
}
.faq-cat {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px 29px;
	max-width: var(--faq-cat-grid);
	margin: 12px auto 0;
}
.faq-cat__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	min-height: 135px; /* Figma 120 × 1.125 */
	padding: 14px 8px 12px;
	border: 1px solid var(--corop-ink, #4c4948);
	border-radius: 5px;
	background: var(--corop-white, #fff);
	color: inherit;
	text-decoration: none;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}
.faq-cat__item:hover {
	background: var(--corop-olive-tint, rgba(157, 138, 60, 0.2));
}
.faq-cat__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 67px; /* ラベル位置（カード高の60%）に合わせる */
}
/* アイコンのサイズは img の width / height 属性（Figma 実寸 × 1.125）で決める。
   CSS 側で width/height を指定すると SVG の内在サイズが失われて潰れるため触らない。 */
.faq-cat__icon img {
	display: block;
}
.faq-cat__text {
	display: block;
	font-size: 19px;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.3;
	text-align: center;
}
.faq-cat__text span {
	display: block;
}

/* ===== セクション ===== */
.faq-section {
	max-width: var(--faq-content);
	margin: 176px auto 0; /* Figma のセクション間 157px × 1.125 */
	scroll-margin-top: 120px; /* sticky ヘッダー分のアンカーずれ補正 */
}
.faq-section__title {
	margin: 0 0 42px;
	text-align: center;
	font-size: 19px;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1.5;
}

/* ===== Q&A ===== */
.faq-item + .faq-item {
	margin-top: 34px;
}
/* 質問（クリックで回答を開閉するボタン） */
.faq-item__q {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 46px; /* Figma 41 × 1.125 */
	margin: 0;
	padding: 8px 24px;
	background: var(--corop-olive-tint, rgba(157, 138, 60, 0.2));
	cursor: pointer;
	list-style: none; /* ブラウザ既定の三角マークを消す */
	transition: background-color 0.2s ease;
}
.faq-item__q::-webkit-details-marker {
	display: none; /* Safari の三角マーク */
}
.faq-item__q:hover {
	background: var(--corop-olive-tint-hover, rgba(157, 138, 60, 0.28));
}
.faq-item__q:focus-visible {
	outline: 2px solid var(--corop-olive, #9d8a3c);
	outline-offset: 2px;
}
.faq-item__qtext {
	flex: 1 1 auto;
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	letter-spacing: 0.2em;
	line-height: 1.5;
}

/* トグルの矢印（閉じている＝∨ / 開いている＝∧）
   SVGをマスクにして currentColor で塗るため、文字色を変えれば矢印の色も揃う */
.faq-item__icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 2.5 L10 9.5 L18 2.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 12px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 2.5 L10 9.5 L18 2.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px 12px no-repeat;
	transition: transform 0.25s ease;
}
.faq-item[open] .faq-item__icon {
	transform: rotate(180deg);
}

/* 回答 */
.faq-item__a {
	padding: 0 22px 16px;
	font-size: 15px;
	letter-spacing: 0.1em;
	line-height: 1.5;
	animation: faq-open 0.25s ease;
}
@keyframes faq-open {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@media (prefers-reduced-motion: reduce) {
	.faq-item__a { animation: none; }
	.faq-item__icon { transition: none; }
}
.faq-item__a p {
	margin: 16px 0 0;
}
.faq-item__a .faq-note {
	margin-top: 8px;
}

/* 回答内の小見出しブロック（＜マイページより〜＞など） */
.faq-sub {
	margin-top: 20px;
}
.faq-sub__head {
	margin: 0;
	font-weight: 500;
}
.faq-sub p + p {
	margin-top: 4px;
}

/* フリーダイヤル枠 */
.faq-tel {
	max-width: 345px; /* Figma 307 × 1.125 */
	margin: 12px 0 0;
	padding: 8px 0;
	border-top: 1px solid var(--corop-ink, #4c4948);
	border-bottom: 1px solid var(--corop-ink, #4c4948);
}
.faq-tel p {
	margin: 0;
}
.faq-tel__num {
	font-size: 18px;
	font-weight: 500;
	letter-spacing: 0.08em;
}

/* リンク */
.faq-link {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.faq-link:hover {
	opacity: 0.6;
}

/* 検索で非表示になった要素 */
.faq-item[hidden],
.faq-section[hidden] {
	display: none;
}

/* ==========================================================================
   SP（Figma node 260:13286）
   ========================================================================== */
@media (max-width: 768px) {
	.faq-page {
		padding: 40px 20px 72px;
	}

	.faq-head__title {
		font-size: 28px;
	}
	.faq-head__lead {
		margin-top: 10px;
		font-size: 17px;
	}

	.faq-search {
		max-width: none;
		margin-top: 14px;
	}
	.faq-search__input {
		height: 46px;
		padding: 0 18px 0 48px;
		font-size: 15px;
	}
	.faq-search__icon {
		left: 17px;
		width: 19px;
	}

	.faq-cat__label {
		margin-top: 28px;
		font-size: 15px;
	}
	.faq-cat {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
		margin-top: 10px;
	}
	.faq-cat__item {
		min-height: 101px;
		padding: 10px 6px 10px;
	}
	.faq-cat__icon {
		height: 46px;
	}
	/* SP は PC 実寸の 0.72 倍で縮小（レイアウト箱は上の height で固定） */
	.faq-cat__icon img {
		transform: scale(0.72);
		transform-origin: center;
	}
	.faq-cat__text {
		font-size: 14px;
		letter-spacing: 0.04em;
	}

	.faq-section {
		margin-top: 88px;
		scroll-margin-top: 88px;
	}
	.faq-section__title {
		margin-bottom: 24px;
		font-size: 17px;
	}

	.faq-item + .faq-item {
		margin-top: 24px;
	}
	.faq-item__q {
		min-height: 60px;
		padding: 10px 13px;
		font-size: 14px;
		letter-spacing: 0.08em;
	}
	.faq-item__a {
		padding: 0 8px;
		font-size: 13px;
	}
	.faq-item__a p {
		margin-top: 12px;
	}
	.faq-tel {
		max-width: none;
	}
	.faq-tel__num {
		font-size: 17px;
	}
}
