/* kd-site.css
 * ルートサイト(kaitoridan.com)に合わせた、ヘッダー・フッター・記事まわりのデザイン。
 * 色は kd-tokens.css の変数を使う。
 */

/* ---------------------------------------------------------------
 * ベース
 * ------------------------------------------------------------- */
html {
	scroll-padding-top: calc(var(--kd-header-h) + 16px);
}

body {
	background: var(--kd-page);
	color: var(--kd-text);
	font-family: var(--kd-font);
	font-size: 16px;
	line-height: 1.8;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--kd-link);
}

/* ---------------------------------------------------------------
 * 上部の帯(古物商許可・実績)
 * ------------------------------------------------------------- */
.kd-topbar {
	margin: 0;
	padding: 4px 12px;
	background: var(--kd-topbar);
	color: #fff;
	font-size: 12px;
	line-height: 1.6;
	text-align: center;
}

.kd-topbar__license {
	margin-right: 20px;
	color: var(--kd-topbar-text);
}

.kd-topbar small {
	margin-left: 8px;
	font-size: 12px;
}

@media (max-width: 767px) {
	.kd-topbar__license {
		display: none;
	}
}

/* ---------------------------------------------------------------
 * ヘッダー(ネイビー固定。ロゴ左・ボタン右)
 * ------------------------------------------------------------- */
.kd-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--kd-navy);
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.admin-bar .kd-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .kd-header {
		top: 46px;
	}
}

.kd-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 80rem;
	height: var(--kd-header-h);
	margin: 0 auto;
	padding: 8px 16px;
}

@media (min-width: 640px) {
	.kd-header__inner {
		padding-right: 24px;
		padding-left: 24px;
	}
}

@media (min-width: 1024px) {
	.kd-header__inner {
		padding-right: 32px;
		padding-left: 32px;
	}
}

.kd-header__logo {
	display: flex;
	align-items: center;
	height: 40px;
	flex-shrink: 0;
}

.kd-header__logo img {
	width: auto;
	height: 40px;
}

.kd-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* 投稿された口コミの件数(ボタンの左) */
.kd-header__count {
	display: flex;
	align-items: baseline;
	gap: 2px;
	margin: 0 8px 0 0;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
}

.kd-header__countLabel {
	margin-right: 6px;
}

.kd-header__countNum {
	color: var(--kd-yellow);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.kd-header__countUnit {
	font-size: 12px;
	font-weight: 700;
}

@media (max-width: 599px) {
	.kd-header__countLabel {
		display: none;
	}

	.kd-header__count::before {
		margin-right: 4px;
		content: "口コミ";
		font-size: 11px;
	}

	.kd-header__countNum {
		font-size: 1.15rem;
	}
}

.kd-pill {
	display: inline-block;
	padding: 4px 16px;
	border-radius: 9999px;
	background: var(--kd-coral);
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.7;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s;
}

.kd-pill:hover {
	background: var(--kd-coral-dark);
}

@media (max-width: 480px) {
	.kd-header__logo img {
		height: 32px;
	}

	.kd-pill {
		padding: 4px 10px;
		font-size: 12px;
	}
}

/* ---------------------------------------------------------------
 * フッター(ルートサイトと同じ: 波形の境界・2列・中央揃え・雪の結晶アイコン)
 * ------------------------------------------------------------- */
.kd-footer {
	position: relative;
	margin-top: 72px;
	background: var(--kd-navy);
	color: #fff;
}

/* 上端の波形。色はフッターと同じネイビー(currentColor) */
.kd-footer__wave {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	z-index: 10;
	color: var(--kd-navy);
	pointer-events: none;
	transform: translateY(calc(-100% + 1px));
}

.kd-footer__wave svg {
	display: block;
	width: 100%;
	height: 16px;
}

@media (min-width: 768px) {
	.kd-footer__wave svg {
		height: 20px;
	}
}

.kd-footer__inner {
	max-width: 80rem;
	margin: 0 auto;
	padding: 48px 16px;
}

@media (min-width: 640px) {
	.kd-footer__inner {
		padding-right: 24px;
		padding-left: 24px;
	}
}

@media (min-width: 1024px) {
	.kd-footer__inner {
		padding: 64px 32px;
	}
}

.kd-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

@media (min-width: 768px) {
	.kd-footer__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.kd-footer__grid {
		gap: 48px;
	}
}

.kd-footer__nav {
	text-align: center;
}

.kd-footer__heading {
	margin: 0 0 16px;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
}

.kd-footer__nav ul,
.kd-footer__sub {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.kd-footer__nav li,
.kd-footer__sub li {
	margin: 0;
}

.kd-footer a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: #fff;
	font-size: 14px;
	line-height: 1.5;
	text-decoration: none;
	transition: color 0.15s;
}

.kd-footer a:hover {
	color: #e5e7eb;
}

.kd-snow {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

.kd-footer__line {
	border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.kd-footer__bottom {
	max-width: 80rem;
	margin: 0 auto;
	padding: 24px 16px;
}

/* ブログ側の固定ページへのリンク(ルートサイトにはない行。小さく横並び) */
.kd-footer__sub {
	flex-direction: row;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 20px;
	margin-bottom: 16px;
}

.kd-footer__sub a {
	font-size: 12px;
	color: rgba(255, 255, 255, 0.8);
}

.kd-footer__copy {
	margin: 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 14px;
	text-align: center;
}
/* ---------------------------------------------------------------
 * 記事まわりのレイアウト(1カラム・白いカード)
 * ------------------------------------------------------------- */
.l-content {
	padding-top: 24px;
}

.l-content__body {
	max-width: var(--ark-width--article);
	margin-right: auto;
	margin-left: auto;
}

/* 記事・固定ページの本文をカードにする */
.single .l-content__body > .l-mainContent,
.page .l-content__body > .l-mainContent,
.single #main_content,
.page #main_content {
	padding: 24px 16px;
	border-radius: var(--kd-radius);
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
}

@media (min-width: 768px) {
	.single .l-content__body > .l-mainContent,
	.page .l-content__body > .l-mainContent,
	.single #main_content,
	.page #main_content {
		padding: 40px 48px;
	}
}

/* タイトル */
.p-entry__title,
.c-pageTitle,
.c-postTitle__ttl {
	color: var(--kd-heading);
	font-weight: 700;
	line-height: 1.5;
}

h1.p-entry__title,
.c-pageTitle {
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
}

/* ---------------------------------------------------------------
 * 本文の見出し
 *   H2: ネイビーの帯 / H3: 空色の左線 / H4: コーラルの点
 * ------------------------------------------------------------- */
.c-postContent h2,
.c-postContent .wp-block-heading:is(h2) {
	margin: 3em 0 1.2em;
	padding: 0.7em 1em;
	border-radius: 8px;
	background: var(--kd-navy);
	color: #fff;
	font-size: 1.35rem;
	font-weight: 700;
	line-height: 1.5;
}

.c-postContent h2 a {
	color: inherit;
}

.c-postContent h3,
.c-postContent .wp-block-heading:is(h3) {
	margin: 2.4em 0 1em;
	padding: 0.2em 0 0.35em 0.8em;
	border-left: 6px solid var(--kd-sky);
	border-bottom: 1px solid var(--kd-border);
	color: var(--kd-heading);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.5;
}

.c-postContent h4,
.c-postContent .wp-block-heading:is(h4) {
	position: relative;
	margin: 2em 0 0.8em;
	padding-left: 1.2em;
	color: var(--kd-heading);
	font-size: 1.05rem;
	font-weight: 700;
}

.c-postContent h4::before {
	position: absolute;
	top: 0.55em;
	left: 0;
	width: 0.7em;
	height: 0.7em;
	border-radius: 50%;
	background: var(--kd-coral);
	content: "";
}

.c-postContent p {
	margin: 1.2em 0;
}

.c-postContent a {
	color: var(--kd-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.c-postContent img {
	max-width: 100%;
	height: auto;
}

/* ---------------------------------------------------------------
 * リスト
 * ------------------------------------------------------------- */
.c-postContent ul:not([class]),
.c-postContent ol:not([class]),
.c-postContent .wp-block-list {
	margin: 1.2em 0;
	padding-left: 1.6em;
}

.c-postContent li {
	margin: 0.35em 0;
}

/* ---------------------------------------------------------------
 * テーブル: ルートサイトの「現在の買取率」カードに合わせる
 *   角丸のカード / ネイビーの見出し / 薄い青の本文 / 区切りは細い線
 *   買取率の数字は kd-site.js が .kd-rate で包み、大きな紺色の数字にする
 * 旧 SWELL・旧独自CSSの表スタイルより優先させるため、一部に !important を使っている。
 * ------------------------------------------------------------- */
.c-postContent .wp-block-table {
	margin: 1.6em 0;
	overflow-x: auto;
	border-radius: 16px;
	box-shadow: 0 2px 6px rgba(16, 24, 40, 0.14);
}

.c-postContent .wp-block-table table {
	width: 100%;
	margin: 0;
	border: 0 !important;
	border-collapse: separate !important;
	border-spacing: 0;
	background: var(--kd-card-bg);
	font-size: 0.95rem;
}

.c-postContent .wp-block-table th,
.c-postContent .wp-block-table td {
	padding: 0.85em 1em;
	border: 0 !important;
	border-bottom: 1px solid var(--kd-card-line) !important;
	vertical-align: middle;
	color: var(--kd-navy);
}

.c-postContent .wp-block-table tr:last-child > * {
	border-bottom: 0 !important;
}

/* 見出し行 = カードの上部(ネイビー・白文字・中央) */
.c-postContent .wp-block-table thead th,
.c-postContent .wp-block-table thead td {
	background: var(--kd-navy) !important;
	color: #fff !important;
	font-weight: 700;
	text-align: center;
	border-bottom: 0 !important;
}

.c-postContent .wp-block-table thead tr > :first-child {
	border-top-left-radius: 16px;
}

.c-postContent .wp-block-table thead tr > :last-child {
	border-top-right-radius: 16px;
}

/* 見出し列 = 白いラベル(「初回」「2回目以降」のピルと同じ) */
.c-postContent .wp-block-table tbody th,
.c-postContent .wp-block-table tfoot th {
	background: #fff !important;
	color: var(--kd-navy) !important;
	font-weight: 700;
	white-space: nowrap;
}

.c-postContent .wp-block-table tbody td {
	background: transparent !important;
}

/* 見出し行のないテーブル(左の列が項目名)は、最初の行をカード上部にしない */
.c-postContent .wp-block-table table:not(:has(thead)) tbody tr:first-child > th {
	border-top-left-radius: 16px;
}

.c-postContent .wp-block-table table:not(:has(thead)) tbody tr:first-child > :last-child {
	border-top-right-radius: 16px;
}

.c-postContent .wp-block-table tbody tr:last-child > :first-child {
	border-bottom-left-radius: 16px;
}

.c-postContent .wp-block-table tbody tr:last-child > :last-child {
	border-bottom-right-radius: 16px;
}

/* 買取率の数字(JS が <span class="kd-rate"><b>90</b><small>.0%</small></span> にする) */
.kd-rate {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	color: var(--kd-navy);
	line-height: 1;
	white-space: nowrap;
}

.kd-rate b {
	font-size: 1.9rem;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.kd-rate small {
	margin-left: 1px;
	font-size: 0.95rem;
	font-weight: 700;
}

.c-postContent .wp-block-table td:has(> .kd-rate) {
	text-align: center;
}

@media (max-width: 599px) {
	.c-postContent .wp-block-table th,
	.c-postContent .wp-block-table td {
		padding: 0.7em 0.7em;
	}

	.kd-rate b {
		font-size: 1.5rem;
	}

	/* 列が4つ以上の表: 1文字ずつ縦に折り返さないよう列の最小幅を確保し、
	   はみ出した分は横スクロール。左端の列(業者名など)は固定して残す */
	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) {
		width: auto;
		min-width: 100%;
	}

	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) th,
	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) td {
		min-width: 6.6em !important; /* 親テーマの .wp-block-table td { min-width } より優先 */
		word-break: normal !important;
		font-size: 0.85rem;
	}

	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) td:has(> .kd-rate) {
		white-space: nowrap;
	}

	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) tr > :first-child {
		position: sticky;
		left: 0;
		z-index: 1;
		min-width: 6.5em !important;
		box-shadow: 2px 0 4px rgba(16, 24, 40, 0.1);
	}

	.c-postContent .wp-block-table table:has(tr > :nth-child(4)) thead tr > :first-child {
		z-index: 2;
	}
}

/* ---------------------------------------------------------------
 * ボタン(コーラルの丸ボタン)
 * ------------------------------------------------------------- */
.c-postContent .swell-block-button a,
.c-postContent .wp-block-button__link,
.c-postContent .swell-block-button .swell-block-button__link {
	border-radius: 9999px;
	background: var(--kd-coral);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}

.c-postContent .swell-block-button a:hover {
	background: var(--kd-coral-dark);
}

/* ---------------------------------------------------------------
 * ブログパーツ・ふきだし・目次
 * ------------------------------------------------------------- */
.p-blogParts {
	margin: 1.6em 0;
}

.swell-toc-placeholder:empty {
	display: none;
}

.kd-toc {
	margin: 2em 0;
	padding: 1.2em 1.4em;
	border: 2px solid var(--kd-sky);
	border-radius: var(--kd-radius);
	background: var(--kd-sky-pale);
}

.kd-toc__title {
	margin: 0 0 0.6em;
	color: var(--kd-navy);
	font-weight: 700;
}

.kd-toc ol {
	margin: 0;
	padding-left: 1.4em;
}

.kd-toc ol ol {
	margin-top: 0.3em;
	font-size: 0.95em;
}

.kd-toc a {
	text-decoration: none;
}

/* ---------------------------------------------------------------
 * 星評価
 * ------------------------------------------------------------- */
.c-reviewStars {
	display: inline-flex;
	gap: 1px;
	color: #d9dde4;
	line-height: 1;
}

.c-reviewStars__star.-full {
	color: var(--color-review_star);
}

.c-reviewStars__star.-half {
	background: linear-gradient(90deg, var(--color-review_star) 50%, #d9dde4 50%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------
 * 前後の記事・関連記事(Arkhe の標準パーツ)
 * ------------------------------------------------------------- */
.c-pageTitle,
.p-entry__title {
	margin-bottom: 0.6em;
}

.p-entry__foot {
	margin-top: 40px;
}

/* ---------------------------------------------------------------
 * 「この記事を書いた人」: プロフィール写真はロゴ画像(横長なので丸の中に収める)
 * ------------------------------------------------------------- */
.p-authorBox__avatar {
	flex-shrink: 0;
	width: 100px;
	height: 100px;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--kd-border);
	border-radius: 50%;
	background: #fff;
}

.p-authorBox__avatar .kd-authorLogo {
	display: block;
	width: 100%;
	height: 100%;
	padding: 14px 10px;
	object-fit: contain;
}

/* ---------------------------------------------------------------
 * 印刷・モーション
 * ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.kd-pill {
		transition: none;
	}
}


