/* ラクハヤでんでん 子テーマ独自のスタイル（親テーマ XWRITE のあとに読み込まれる） */

/* ------------------------------------------------------------
 * 画像のスライド（assets/js/slider.js）
 * グループブロックに CSS クラス rh-slider を付け、中に画像ブロックを並べる。
 * 画像はすべて同じ縦横比にする（1 枚目の大きさで枠が決まる）。
 * XWRITE ではグループの中に .wp-block-group__inner-container が入るので、その中の画像を重ねる。
 * ------------------------------------------------------------ */
.rh-slider {
	max-width: 1024px;
	margin-left: auto;
	margin-right: auto;
}

.rh-slider,
.rh-slider > .wp-block-group__inner-container {
	display: grid;
	gap: 0;
}

/* すべてのスライドを同じマスに重ねる */
.rh-slider figure {
	grid-area: 1 / 1;
	margin: 0;
	transition: opacity 0.8s ease, visibility 0.8s;
}

.rh-slider figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

/* JavaScript が動く前・動かないときは 1 枚目だけ */
.rh-slider:not(.is-ready) figure:not(:first-of-type),
.rh-slider.is-ready figure:not(.is-active) {
	opacity: 0;
	visibility: hidden;
}

.rh-slider__dots {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
}

.rh-slider__dot {
	width: 12px;
	height: 12px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d8cfae;
	cursor: pointer;
}

.rh-slider__dot[aria-current="true"] {
	background: #2b875d;
}

.rh-slider__dot:focus-visible {
	outline: 2px solid #2b875d;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.rh-slider figure {
		transition: none;
	}
}

/* ------------------------------------------------------------
 * 機能説明の記事（例: 定型文の機能のご案内）
 * 記事全体をグループブロック rh-guide で囲み、章ごとにグループ rh-guide__sec に入れる。
 * 章の見出し（h2）には、上から順に 1, 2, 3… の番号が付く。
 * 部品（ブロックに付ける CSS クラス）:
 *   rh-guide__note     段落: 小さな灰色の注記
 *   rh-guide__points   グループ: 中に rh-guide__point のグループ（見出し h3 + 段落）を並べると、緑のカードが横に並ぶ
 *   rh-guide__steps    番号付きリスト: 丸数字の手順。文中のボタン名はキーボード入力の書式（kbd）にするとボタン風になる
 *   rh-guide__shot     画像: 枠付きの画面画像（キャプションは枠の下の帯）
 *   rh-guide__convert  グループ: 中に段落 rh-guide__box・rh-guide__arrow（→）・rh-guide__box を並べる。
 *                      box の先頭の小さい文字（small）がラベルになる
 *   rh-guide__table    表: 罫線だけの表。rh-guide__tokens を足すと 1 列目が記号・3 列目が緑の例、
 *                      rh-guide__compare を足すと見出しの行が緑・各行の見出し（th）が灰色になる
 *   rh-guide__samples  グループ: 中に rh-guide__sample のグループ（見出し h3 + 整形済みテキスト）を 2 列に並べる
 *   rh-guide__care     リスト: 注意点の箇条書き
 * XWRITE ではグループの中に .wp-block-group__inner-container が入るので、並べ方はその中に付ける。
 * ------------------------------------------------------------ */
.rh-guide {
	--rh-ink: #3b3328;
	--rh-muted: #6a6052;
	--rh-rule: #e6dcc6;
	--rh-green: #3a6e34;
	--rh-green-soft: #e2edd6;
	--rh-yellow: #f6d34a;
	--rh-btn: #ffc43d;
	--rh-btn-ink: #4d4135;
	--rh-shot-border: #d9cfb8;
	--rh-code-bg: #f1e4c2;
	counter-reset: rh-guide-sec;
	color: var(--rh-ink);
	font-size: 16px;
	line-height: 1.85;
	letter-spacing: 0.02em;
}

/* 中の要素は、XWRITE の余白を消して、並べ方（gap）で間をあける */
.rh-guide :is(p, h2, h3, ol, ul, figure, pre, table) {
	margin: 0;
}

.rh-guide > .wp-block-group__inner-container,
.rh-guide__sec > .wp-block-group__inner-container,
.rh-guide__point > .wp-block-group__inner-container,
.rh-guide__sample > .wp-block-group__inner-container {
	display: flex;
	flex-direction: column;
}

.rh-guide > .wp-block-group__inner-container {
	gap: 52px;
}

.rh-guide__sec > .wp-block-group__inner-container {
	gap: 20px;
}

.rh-guide__point > .wp-block-group__inner-container,
.rh-guide__sample > .wp-block-group__inner-container {
	gap: 6px;
}

.rh-guide :is(.rh-guide__sec, .rh-guide__points, .rh-guide__point, .rh-guide__convert, .rh-guide__samples, .rh-guide__sample) {
	margin: 0;
}

.rh-guide__note,
.rh-guide p.rh-guide__note {
	font-size: 13px;
	color: var(--rh-muted);
}

/* 章の見出し: 番号 + 下に黄色の線（XWRITE の見出しの飾りは消す）
 * XWRITE の見出しの指定は詳細度が高い（:not() が 5 つ）ので、:is() に ID を入れて詳細度を上げる。
 * #rh-guide という要素はなくてよい（:is() の詳細度は、中でいちばん高いものになる） */
:is(.rh-guide, #rh-guide) h2.wp-block-heading {
	counter-increment: rh-guide-sec;
	display: flex;
	gap: 10px;
	align-items: baseline;
	position: static;
	padding: 0 0 8px;
	border: 0;
	border-bottom: 2px solid var(--rh-yellow);
	border-radius: 0 !important; /* XWRITE が !important で角を丸めている */
	background: none;
	box-shadow: none;
	color: var(--rh-ink);
	font-size: 21px;
	line-height: 1.4;
	text-wrap: balance;
}

:is(.rh-guide, #rh-guide) h2.wp-block-heading::before {
	content: counter(rh-guide-sec);
	position: static;
	display: inline;
	width: auto;
	height: auto;
	border: 0;
	background: none;
	color: var(--rh-green);
	font-size: 15px;
	letter-spacing: 0.08em;
	transform: none;
}

:is(.rh-guide, #rh-guide) h2.wp-block-heading::after,
:is(.rh-guide, #rh-guide) h3.wp-block-heading::before,
:is(.rh-guide, #rh-guide) h3.wp-block-heading::after {
	content: none;
	display: none;
}

:is(.rh-guide, #rh-guide) h3.wp-block-heading {
	position: static;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rh-ink);
	font-size: 15px;
	line-height: 1.4;
}

/* できること（緑のカード） */
.rh-guide__points > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
}

.rh-guide__point {
	padding: 16px 18px;
	border-radius: 10px;
	background: var(--rh-green-soft);
}

:is(.rh-guide, #rh-guide) .rh-guide__point h3.wp-block-heading {
	color: var(--rh-green);
	font-size: 17px;
}

.rh-guide__point p {
	font-size: 16px;
}

/* 手順（丸数字） */
.rh-guide ol.rh-guide__steps {
	display: grid;
	gap: 10px;
	padding: 0;
	list-style: none;
	counter-reset: rh-guide-step;
}

.rh-guide ol.rh-guide__steps > li {
	counter-increment: rh-guide-step;
	position: relative;
	min-height: 1.9em;
	margin: 0;
	padding: 0 0 0 calc(2.2em + 10px);
}

.rh-guide ol.rh-guide__steps > li::before {
	content: counter(rh-guide-step);
	position: absolute;
	top: 2px;
	left: 0;
	display: grid;
	place-items: center;
	width: 1.9em;
	height: 1.9em;
	border-radius: 50%;
	background: var(--rh-green);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
}

.rh-guide ol.rh-guide__steps > li::marker {
	content: none;
}

.rh-guide kbd {
	display: inline-block;
	padding: 0 8px;
	border: 0;
	border-radius: 6px;
	background: var(--rh-btn);
	box-shadow: none;
	color: var(--rh-btn-ink);
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.7;
	white-space: nowrap;
}

/* 画面の画像 */
.rh-guide figure.rh-guide__shot {
	overflow: hidden;
	border: 1px solid var(--rh-shot-border);
	border-radius: 8px;
	background: #fffdf6;
}

.rh-guide figure.rh-guide__shot img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 0;
}

.rh-guide figure.rh-guide__shot figcaption {
	margin: 0;
	padding: 6px 12px;
	border-top: 1px solid var(--rh-shot-border);
	background: #fffdf6;
	color: var(--rh-muted);
	font-size: 12.5px;
	line-height: 1.6;
	text-align: left;
}

/* 置き換えの例（定型文 → 本文） */
.rh-guide__convert > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	gap: 12px;
	align-items: center;
}

.rh-guide p.rh-guide__box {
	min-width: 0;
	padding: 12px 14px;
	border-radius: 8px;
	background: var(--rh-code-bg);
	font-size: 16px;
}

.rh-guide p.rh-guide__box small {
	display: block;
	margin-bottom: 4px;
	color: var(--rh-muted);
	font-size: 13px;
}

.rh-guide p.rh-guide__arrow {
	color: var(--rh-green);
	font-size: 20px;
	font-weight: 700;
}

/* 表 */
.rh-guide figure.rh-guide__table {
	overflow-x: auto;
}

.rh-guide .rh-guide__table table {
	width: 100%;
	min-width: 560px;
	border: 0;
	border-collapse: collapse;
	font-size: 14.5px;
}

.rh-guide .rh-guide__table :is(th, td) {
	padding: 9px 10px;
	border: 0;
	border-bottom: 1px solid var(--rh-rule);
	background: none;
	color: var(--rh-ink);
	font-weight: 400;
	text-align: left;
	vertical-align: top;
}

.rh-guide .rh-guide__table thead :is(th, td) {
	border-bottom: 2px solid var(--rh-green);
	color: var(--rh-muted);
	font-size: 13px;
	font-weight: 700;
}

.rh-guide .rh-guide__table code {
	padding: 1px 6px;
	border-radius: 4px;
	background: var(--rh-code-bg);
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	white-space: nowrap;
}

.rh-guide .rh-guide__tokens tbody td:nth-child(3) {
	color: var(--rh-green);
	font-weight: 700;
}

.rh-guide .rh-guide__compare :is(th, td) {
	padding: 10px;
}

.rh-guide .rh-guide__compare thead th {
	color: var(--rh-green);
	font-size: 15px;
}

.rh-guide .rh-guide__compare tbody th {
	width: 9em;
	color: var(--rh-muted);
	font-size: 13.5px;
	font-weight: 700;
}

/* 例文（2 列のカード） */
.rh-guide__samples > .wp-block-group__inner-container {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.rh-guide__sample {
	min-width: 0;
	padding: 14px 16px;
	border: 1px solid var(--rh-rule);
	border-radius: 10px;
}

.rh-guide__sample pre.wp-block-preformatted {
	padding: 10px 12px;
	border: 0;
	border-radius: 6px;
	background: var(--rh-code-bg);
	color: var(--rh-ink);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.85;
	white-space: pre-wrap;
}

/* 注意点 */
.rh-guide ul.rh-guide__care {
	display: grid;
	gap: 8px;
	padding-left: 1.3em;
}

.rh-guide ul.rh-guide__care > li {
	margin: 0;
}

/* タブレットの縦向きより狭いとき: カードと例文は 1 列、置き換えの例は縦に並べる */
@media (max-width: 640px) {
	.rh-guide__points > .wp-block-group__inner-container,
	.rh-guide__samples > .wp-block-group__inner-container,
	.rh-guide__convert > .wp-block-group__inner-container {
		grid-template-columns: minmax(0, 1fr);
	}

	.rh-guide p.rh-guide__arrow {
		justify-self: center;
		transform: rotate(90deg);
	}
}

/* ------------------------------------------------------------
 * TOP ページの「こんな方におすすめです」（機能説明の記事 rh-guide の部品を使う）
 * 見出し h2 はグループの外に置く（TOP ページのほかの見出しと同じ形のまま）。
 * 見出しのあとのグループに rh-guide と rh-osusume の両方を付ける。
 *   rh-osusume__label      見出し h3: 小見出し（緑の縦線つき）
 *   rh-guide__point--wide  カード: 横いっぱいに広げる
 *   rh-guide__tags         リスト: 項目をタグにして並べる
 *   rh-guide__solve        グループ: rh-guide__convert と一緒に付ける。左の箱がお困りごと、右の箱が解決
 *   rh-guide__box--answer  段落: 解決の箱（緑）
 * ------------------------------------------------------------ */
.rh-osusume > .wp-block-group__inner-container {
	gap: 40px;
}

:is(.rh-guide, #rh-guide) h3.wp-block-heading.rh-osusume__label {
	padding-left: 12px;
	border-left: 4px solid var(--rh-green);
	font-size: 18px;
}

.rh-guide__point--wide {
	grid-column: 1 / -1;
}

.rh-guide ul.rh-guide__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.rh-guide ul.rh-guide__tags > li {
	margin: 0;
	padding: 3px 12px;
	border: 1px solid #bcd3ac;
	border-radius: 999px;
	background: #fff;
	font-size: 15px;
	line-height: 1.7;
}

.rh-guide ul.rh-guide__tags > li::before,
.rh-guide ul.rh-guide__tags > li::marker {
	content: none;
}

.rh-guide__solve > .wp-block-group__inner-container {
	grid-template-columns: minmax(0, 2fr) auto minmax(0, 3fr);
}

.rh-guide__solve p.rh-guide__box:not(.rh-guide__box--answer) {
	font-weight: 700;
}

.rh-guide p.rh-guide__box.rh-guide__box--answer {
	background: var(--rh-green-soft);
}

.rh-guide p.rh-guide__box--answer small {
	color: var(--rh-green);
	font-weight: 700;
}

@media (max-width: 640px) {
	.rh-guide__solve > .wp-block-group__inner-container {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ------------------------------------------------------------
 * 書体（エックスサーバーの Webフォント「TypeSquare」。プラグイン TypeSquare Webfonts for エックスサーバー が読み込む）
 * プラグインの書体の設定は使わず、ここで書体名を指定する（スクリプトが CSS の書体名を読んで配信する）。
 *   本文 TBUDゴシック R ／ 見出し 新ゴ B ／ 太字 TBUDゴシック E
 * Webフォントは太さが 1 つだけで、font-weight では太くならない。太字にする要素には TBUDゴシック E を当てる。
 * 配信が止まったとき（月 75,000 PV を超えたときなど）は、うしろに並べた今までの書体で表示される。
 * ------------------------------------------------------------ */
:root:root {
	--rh-font-text: "TBUDゴシック R", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
	--rh-font-head: "新ゴ B", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
	--rh-font-bold: "TBUDゴシック E", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
	--body-font-family: var(--rh-font-text); /* XWRITE の本文の書体 */
}

body,
button {
	font-family: "TBUDゴシック R", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
}

/* 入力欄の文字には TypeSquare が配信されないので、今までの書体にする（書体名だけだとブラウザの初期の書体になる） */
input,
select,
textarea {
	font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.wp-block-heading {
	font-family: "新ゴ B", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
}

/* 太字の要素: HTML の太字（strong・b・表の見出しなど）、XWRITE が CSS で太字にしている文字の部品、このサイトの部品 */
strong,
b,
th,
dt,
/* XWRITE のブロック */
.xw-block-faq__question, /* XWRITE では太字ではないが、このサイトでは質問を太字にする */
.xw-block-faq__accordion,
.xw-block-accordion__header,
.uqAccordion__header,
.xw-block-title-box > .xw-box-title,
.title_box > .title,
.xw-block-step__title,
.uqStep__title,
.xw-block-step--is-minimum .xw-block-step__number,
.uqStep--isMinimum .uqStep__number,
.xw-block-blog-card__details--title,
.uqBlogCard__details--title,
.xw-block-description-list-dt,
.xw-block-product-review__container .title,
.xw-block-product-review__item--title,
.uqProductReview__container .title,
.rating-count,
.uqIndex__btn,
/* XWRITE の記事一覧・目次・記事の周り */
.xw-article-media__body--title,
.xw-page-article-media__body--title,
.xw-post-article-media__body--title,
.pageArticleList .title,
.uqPostlist .title,
.xw-article-rank,
.toc__caption,
.toc_block .toc > ol > li > a,
a.post-page-numbers,
.articleFooter__relation .caption,
.articleFooter__author .name,
.profile__name,
.snsShare__copy,
.mainVisual .item__info--caption,
.blockTitle,
.footTitle,
.MobileNavTitle,
.widget-title,
.widgettitle,
.wp-block-search__label,
.wp-block-archives-dropdown > label,
.comments-area .comments-title,
.comments-area .comment-reply-title,
.header-notice--bold,
.notfound .title,
.notfound .desc,
/* このサイトの部品（site.css で太字にしているもの） */
.rh-guide__box small,
.rh-guide__solve p.rh-guide__box:not(.rh-guide__box--answer),
.rh-guide kbd,
.rh-guide .rh-guide__tokens tbody td:nth-child(3),
.rh-guide ol.rh-guide__steps > li::before,
.rh-guide p.rh-guide__arrow {
	font-family: "TBUDゴシック E", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
}

/* FAQ の質問（アコーディオンの形も）は XWRITE では太字ではない。Webフォントが届かないときも太字になるよう、太さも指定する
 * （TypeSquare の書体は太字として登録されるので、ブラウザが重ねて太くすることはない）
 * XWRITE は質問を見出し（h2〜h6）にしたときも太さを戻すので、:is() に ID を入れて詳細度を上げる（#rh-guide という要素はなくてよい） */
:is(body, #rh-guide) .xw-block-faq :is(.xw-block-faq__question, .xw-block-faq__accordion) {
	font-weight: 700;
}

/* フッターのメニュー（XWRITE が太字にするのは 768px 以上のときだけ）。
 * :has() に対応していないブラウザでも上の指定が消えないよう、別に書く */
@media (min-width: 768px) {
	.siteNavList--footer:has(.sub-menu) .siteNavList > .menu-item > a {
		font-family: "TBUDゴシック E", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", YuGothic, "Yu Gothic", Meiryo, sans-serif;
	}
}

/* ------------------------------------------------------------
 * 記事の見出し h2（緑の吹き出し）の文字を一段小さくする（768px 以上で 24px → 22px）
 * 768px より狭いときは、XWRITE の設定で 1.75rem（!important）になっているので、そのまま。
 * 見出しの型（is-style-heading…・is-style-normal）と FAQ の質問は変えない。機能説明の記事（rh-guide）の見出しは、そちらの指定のまま。
 * ------------------------------------------------------------ */
@media (min-width: 768px) {
	.articleBody h2:not([class*="is-style-heading"], .is-style-normal, .xw-block-faq__question, .xw-block-faq__accordion) {
		font-size: 2.2rem;
	}
}
