/* 特集（/tokushu/ と /tokushu/{slug}/。includes/kb-tokushu.php）
 * 色・キーのカード・パンくずはソフトのページ（kb-app.css の .kba・kba-）をそのまま使い、ここでは特集の並びだけ（クラスは kbx-）
 * 本文は読みやすい幅（最大 760px）。カードは 1列（スマホ）〜 2列（PC）
 */

/* ---------- Cocoon の記事らしい部分を隠す（body.kbx-page は [kb_tokushu] のあるページだけに付く。kb-app.css と同じ） ---------- */
body.kbx-page .entry-title,
body.kbx-page .date-tags,
body.kbx-page .breadcrumb,
body.kbx-page .toc,
body.kbx-page .sns-share,
body.kbx-page .sns-follow,
body.kbx-page .author-info,
body.kbx-page .footer-meta,
body.kbx-page #comment-area,
body.kbx-page .comment-area,
body.kbx-page .comment-btn,
body.kbx-page .related-entries,
body.kbx-page .under-entry-content,
body.kbx-page .addtoany_share_save_container,
body.kbx-page .a2a_kit {
	display: none !important;
}

body.kbx-page #content {
	margin-top: 0;
}

body.kbx-page #main {
	padding-top: 0;
	padding-bottom: 0;
	border-top-width: 0;
	border-bottom-width: 0;
}

body.kbx-page #main .entry-content {
	margin-top: 0;
	margin-bottom: 0;
}

body.kbx-page #main .article,
body.kbx-page #main .entry-content > .kba {
	margin-bottom: 0;
}

/* ---------- 帯（パンくず・h1・更新日・対象の札） ---------- */
.kba.kbx .kbx-hero {
	gap: 12px;
}

.kbx .kbx-hero > * {
	width: 100%;
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

html body .kba.kbx h1.kbx-title {
	font-size: 24px;
	font-weight: 900;
	line-height: 1.45;
	letter-spacing: 0.01em;
}

.kbx .kbx-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.kbx .kbx-date {
	font-size: 13px;
	color: var(--kba-ink-3);
}

html body .kba.kbx .kbx-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

html body .kba.kbx .kbx-tag {
	padding: 1px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.8;
	color: var(--kba-accent-dark);
	background: #E3ECF8;
	border-radius: 12px;
}

html body .kba.kbx .kbx-intro {
	font-size: 15px;
	line-height: 1.8;
	color: var(--kba-ink-2);
}

/* ---------- 本文 ---------- */
.kbx .kbx-body {
	display: flex;
	flex-direction: column;
	gap: 26px;
	max-width: 760px;
	margin: 0 auto;
	padding: 22px 0 44px;
}

html body .kba.kbx .kbx-lead p,
html body .kba.kbx .kbx-p {
	font-size: 16px;
	line-height: 1.9;
}

html body .kba.kbx .kbx-lead p + p {
	margin-top: 12px;
}

/* Windows / Mac の切り替え（kb-app.css の .kba-os。本文の中なので左寄せ） */
.kba.kbx .kbx-os {
	align-self: flex-start;
	order: 0;
}

/* 目次 */
.kbx .kbx-toc {
	padding: 16px 18px;
	background: var(--kba-white);
	border-radius: 14px;
}

html body .kba.kbx .kbx-toc-head {
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--kba-ink-3);
}

html body .kba.kbx .kbx-toc-list li {
	padding: 3px 0;
	font-size: 15px;
	line-height: 1.6;
}

html body .kba.kbx .kbx-toc-list li.is-extra {
	margin-top: 4px;
	font-size: 14px;
}

.kbx .kbx-toc-list a {
	font-weight: 700;
	text-decoration: none;
}

/* 見出し（番号付き。おまけは番号なし） */
.kbx .kbx-sec {
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-margin-top: 16px;
}

html body .kba.kbx h2.kbx-h2 {
	margin: 6px 2px 2px;
	padding-left: 12px;
	font-size: 20px;
	font-weight: 900;
	line-height: 1.45;
	border-left: 5px solid var(--kba-key);
}

/* おまけ: 見出しの上に小さな札（audience の札 kbx-tag と同じ形）。h2 の外に置く */
.kbx .kbx-h2-wrap {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

html body .kba.kbx .kbx-h2-wrap h2.kbx-h2 {
	margin-top: 0;
}

html body .kba.kbx p.kbx-extra {
	margin: 6px 2px 0;
	padding: 1px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.8;
	color: #8A5A12;
	background: var(--kba-tip);
	border-radius: 12px;
}

/* キーのカード（kba-card をそのまま使う。下の段: 動き・★・リンク） */
.kba.kbx .kbx-cards {
	grid-template-columns: minmax(0, 1fr);
}

/* スマホ: 操作名の下にキー（別解のある長いキーでも、操作名がつぶれないように） */
@media (max-width: 767px) {
	.kba.kbx .kbx-card {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"name"
			"keys"
			"hint"
			"act";
		gap: 8px;
	}

	.kba.kbx .kbx-card .kba-card-keys {
		justify-self: start;
	}
}

.kbx .kbx-card-app {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 700;
	vertical-align: 2px;
	color: var(--kba-ink-3);
	background: var(--kba-bg);
	border-radius: 8px;
}

.kbx .kbx-card-foot {
	grid-area: act;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 34px;
}

.kbx .kbx-star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-left: auto;
	padding: 0;
	color: var(--kba-keyline);
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.kbx .kbx-star[hidden] {
	display: none;
}

.kbx .kbx-star svg {
	fill: currentColor;
}

.kbx .kbx-star.is-on {
	color: var(--kba-key);
}

.kbx .kbx-star:focus-visible {
	outline: 3px solid var(--kba-key);
	outline-offset: 1px;
}

.kbx .kbx-more {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	text-decoration: none;
}

/* ★ が無いとき（JS 無し）も、リンクは右にそろえる */
.kbx .kbx-star[hidden] + .kbx-more {
	margin-left: auto;
}

/* まとめ・次に見るリンク */
html body .kba.kbx .kbx-related {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.kbx .kbx-btn {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	font-size: 15px;
	font-weight: 700;
	color: var(--kba-accent);
	text-decoration: none;
	background: var(--kba-white);
	border: 2px solid var(--kba-accent);
	border-radius: 22px;
}

.kbx .kbx-btn--main {
	color: var(--kba-white);
	background: var(--kba-accent);
}

.kbx a.kbx-btn:hover {
	color: var(--kba-white);
	background: var(--kba-accent-dark);
	border-color: var(--kba-accent-dark);
}

/* ---------- 特集のカード（一覧・ほかの特集） ---------- */
html body .kba.kbx .kbx-list {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
}

.kbx .kbx-item-link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	padding: 18px;
	color: var(--kba-ink);
	text-decoration: none;
	background: var(--kba-white);
	border-radius: 14px;
	transition: box-shadow 0.15s;
}

.kbx a.kbx-item-link:hover {
	color: var(--kba-ink);
	box-shadow: 0 0 0 2px var(--kba-accent);
}

.kbx .kbx-item-title {
	font-size: 17px;
	font-weight: 900;
	line-height: 1.5;
	color: var(--kba-accent-dark);
}

.kbx .kbx-item-text {
	font-size: 14px;
	line-height: 1.7;
	color: var(--kba-ink-2);
}

.kbx .kbx-item-meta {
	margin-top: auto;
	font-size: 12px;
	color: var(--kba-ink-3);
}

html body .kba.kbx .kbx-tags--sm .kbx-tag {
	font-size: 11px;
	line-height: 1.7;
}

/* 一覧の絞り込み（JS があるときだけ出る） */
.kbx .kbx-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.kbx .kbx-filter[hidden] {
	display: none;
}

.kbx .kbx-chip {
	min-height: 36px;
	padding: 0 14px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	color: var(--kba-ink-2);
	background: var(--kba-white);
	border: 1.5px solid var(--kba-line);
	border-radius: 18px;
	cursor: pointer;
}

.kbx .kbx-chip.is-on {
	color: var(--kba-white);
	background: var(--kba-accent);
	border-color: var(--kba-accent);
}

.kbx .kbx-item.is-hidden {
	display: none;
}

/* ---------- 768px 以上: カードを2列 ---------- */
@media (min-width: 768px) {
	html body .kba.kbx h1.kbx-title {
		font-size: 30px;
	}

	.kba.kbx .kbx-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kbx .kbx-card-foot {
		margin-top: auto;
	}

	html body .kba.kbx .kbx-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	html body .kba.kbx h2.kbx-h2 {
		font-size: 22px;
	}
}

/* ---------- この記事のキー（lead の下） ---------- */
.kbx .kbx-sum {
	padding: 14px 18px 16px;
	background: var(--kba-white);
	border: 1px solid var(--kba-line);
	border-radius: 14px;
}

html body .kba.kbx .kbx-sum-head {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 900;
	line-height: 1.5;
}

html body .kba.kbx ul.kbx-sum-list {
	margin: 0;
	padding: 0 0 0 1.2em;
	list-style: disc;
}

html body .kba.kbx ul.kbx-sum-list li {
	margin: 0;
	font-size: 14px;
	line-height: 1.8;
}

.kbx .kbx-sum-name {
	font-weight: 700;
}

.kbx .kbx-sum-keys {
	color: var(--kba-ink-2);
}

.kbx .kbx-sum-more summary {
	margin-top: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--kba-accent);
	cursor: pointer;
}

.kbx .kbx-sum-more summary:focus-visible {
	outline: 3px solid var(--kba-key);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- よくある質問（まとめの後） ---------- */
.kbx .kbx-faq-item {
	padding: 12px 16px;
	background: var(--kba-white);
	border: 1px solid var(--kba-line);
	border-radius: 12px;
}

html body .kba.kbx h3.kbx-faq-q {
	margin: 0 0 4px;
	padding: 0;
	font-size: 16px;
	font-weight: 900;
	line-height: 1.6;
	background: none;
	border: 0;
}

html body .kba.kbx p.kbx-faq-a {
	margin: 0;
	font-size: 15px;
	line-height: 1.8;
	color: var(--kba-ink-2);
}

/* ---------- 対応表（section の compare。kbx_compare_html()） ----------
 * 列: 操作（by_key は「キー」）｜ソフト1｜ソフト2｜ひとこと。キーは Win / Mac の両方が HTML にあり、kb-app.css の html[data-kbs-os] で出し分け
 * 「同じ」の札も OS ごと（kbx-same--win / --mac）。付くまでは Windows
 * 767px 以下: 1行を縦のカードに組み替える（操作名 → ソフト1 → ソフト2 → ひとこと。横にスクロールさせない）
 * Cocoon の .entry-content table の線・背景・余白を打ち消すため html body .kba.kbx から書く
 */
html body .kba.kbx .kbx-cmp-wrap {
	margin: 0;
}

html body .kba.kbx table.kbx-cmp {
	width: 100%;
	margin: 0;
	border: 1px solid var(--kba-line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--kba-white);
	font-size: 14px;
	line-height: 1.6;
	table-layout: auto;
}

html body .kba.kbx table.kbx-cmp th,
html body .kba.kbx table.kbx-cmp td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: middle;
	background: none;
	border: 0;
	border-top: 1px solid var(--kba-row-line);
}

html body .kba.kbx table.kbx-cmp thead th {
	font-size: 13px;
	font-weight: 700;
	color: var(--kba-ink-3);
	background: var(--kba-bg);
	border-top: 0;
	white-space: nowrap;
}

html body .kba.kbx table.kbx-cmp tbody th.kbx-cmp-label {
	font-weight: 700;
	color: var(--kba-ink);
}

/* PC: 操作の列が細くなりすぎないように */
html body .kba.kbx table.kbx-cmp thead th.kbx-cmp-label-h {
	width: 10em;
}

.kbx .kbx-cmp-label-text {
	margin-right: 6px;
}

/* 「同じ」の札（表示中の OS のものだけ） */
.kbx .kbx-same {
	display: inline-block;
	padding: 0 7px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.7;
	color: #1F6B3A;
	white-space: nowrap;
	vertical-align: 1px;
	background: #E2F3E7;
	border-radius: 9px;
}

.kbx .kbx-same--mac,
html[data-kbs-os="mac"] .kbx .kbx-same--win {
	display: none;
}

html[data-kbs-os="mac"] .kbx .kbx-same--mac {
	display: inline-block;
}

/* ソフトの欄: キー（リンク）・確認中・動き */
.kbx .kbx-cmp-in {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
}

html body .kba.kbx a.kbx-cmp-keys {
	display: inline-flex;
	color: inherit;
	text-decoration: none;
	border-radius: 6px;
}

html body .kba.kbx a.kbx-cmp-keys:hover .kba-key {
	border-color: var(--kba-accent);
}

html body .kba.kbx a.kbx-cmp-keys:focus-visible {
	outline: 3px solid var(--kba-key);
	outline-offset: 2px;
}

.kba.kbx .kbx-cmp .kbs-demo-chip {
	height: 30px;
	min-width: 0;
	padding: 0 10px 0 9px;
	font-size: 12px;
}

.kbx .kbx-todo {
	display: inline-block;
	margin-left: 6px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.7;
	color: #8A5A12;
	white-space: nowrap;
	vertical-align: 1px;
	background: var(--kba-tip);
	border-radius: 8px;
}

.kbx .kbx-cmp-in > .kbx-todo {
	margin-left: 0;
}

html body .kba.kbx td.kbx-cmp-note {
	font-size: 13px;
	color: var(--kba-ink-3);
}

.kbx .kbx-cmp-none {
	color: #8A929C;
}

/* by_key の表: そのソフトの操作名を太字で大きく、キーは小さく */
.kbx .kbx-cmp--bykey .kbx-cmp-in {
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.kbx .kbx-cmp-action {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	color: var(--kba-ink);
}

.kba.kbx .kbx-cmp--bykey .kba-key {
	min-width: 24px;
	height: 24px;
	padding: 0 6px;
	font-size: 11px;
	border-bottom-width: 3px;
}

.kba.kbx .kbx-cmp--bykey .kbs-demo-chip {
	height: 26px;
}

/* 表のあとの段落（after） */
html body .kba.kbx .kbx-after {
	margin-top: 2px;
}

/* 767px 以下: 1行を縦のカードに */
@media (max-width: 767px) {
	html body .kba.kbx table.kbx-cmp,
	html body .kba.kbx table.kbx-cmp tbody,
	html body .kba.kbx table.kbx-cmp tr,
	html body .kba.kbx table.kbx-cmp th,
	html body .kba.kbx table.kbx-cmp td {
		display: block;
		width: auto;
	}

	html body .kba.kbx table.kbx-cmp {
		background: none;
		border: 0;
		border-radius: 0;
		overflow: visible;
	}

	/* 列の見出しは、各欄の data-label で代わりに出す（読み上げ用に残す） */
	html body .kba.kbx table.kbx-cmp thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	html body .kba.kbx table.kbx-cmp tbody {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}

	html body .kba.kbx table.kbx-cmp tr {
		padding: 12px 14px;
		background: var(--kba-white);
		border: 1px solid var(--kba-line);
		border-radius: 12px;
	}

	html body .kba.kbx table.kbx-cmp th,
	html body .kba.kbx table.kbx-cmp td {
		padding: 0;
		border: 0;
	}

	html body .kba.kbx table.kbx-cmp tbody th.kbx-cmp-label {
		margin-bottom: 8px;
		font-size: 15px;
	}

	html body .kba.kbx table.kbx-cmp td.kbx-cmp-cell {
		display: grid;
		grid-template-columns: 7.5em minmax(0, 1fr);
		align-items: center;
		gap: 8px;
		padding: 6px 0;
		border-top: 1px solid var(--kba-row-line);
	}

	html body .kba.kbx table.kbx-cmp td.kbx-cmp-cell::before {
		content: attr(data-label);
		font-size: 12px;
		font-weight: 700;
		line-height: 1.4;
		color: var(--kba-ink-3);
	}

	html body .kba.kbx table.kbx-cmp td.kbx-cmp-note {
		margin-top: 6px;
	}

	html body .kba.kbx table.kbx-cmp td.kbx-cmp-note[data-empty] {
		display: none;
	}
}
