/*
 * LightSpeedC 共通スタイル
 *
 * docs/ 配下の HTML から参照する。
 * 各 HTML 側に置くのは、その資料だけのもの（章アクセント .chNN、
 * counter-reset / counter-increment）に限る。
 */

:root {
	--navy1: #12224d;
	--navy2: #2f5fbf;
	--ink: #1c2330;
	--ink-soft: #4a5568;
	--line: #d9dfe8;
	--code-bg: #f4f6fa;
	--link: #1a4fa0;
	--accent: var(--navy1, #12224d);
	--accent2: var(--navy2, #2f5fbf);
	--soft: #f2f5fb;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	background: #ffffff;
	color: var(--ink, #1c2330);
	font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
	font-size: 15.5px;
	line-height: 1.85;
}

/* タイトルバー */
.titlebar {
	background: linear-gradient(135deg, var(--navy1, #12224d), var(--navy2, #2f5fbf));
	color: #fff;
	padding: 34px 30px 30px;
}
.titlebar .inner {
	max-width: 1600px;
	margin: 0 auto;
}
.titlebar h1 {
	font-size: 2.1em;
	margin: 0 0 6px;
	background: none;
	color: #fff;
}
.titlebar .lead {
	margin: 0;
	font-size: 1.02em;
	background: none;
	color: #d5e0f5;
}
.titlebar .date {
	margin: 10px 0 0;
	font-size: 0.86em;
	background: none;
	color: #b9c8e6;
}

/* 本文 */
.wrap {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 30px;
}

/* 目次 */
.toc {
	margin: 34px 0;
}
.toc h2 {
	font-size: 1.15em;
	margin: 0 0 12px;
	padding: 6px 12px;
	color: var(--accent, #12224d);
	background: linear-gradient(90deg, var(--soft, #f2f5fb), #fff);
	border-left: 6px solid var(--accent, #12224d);
}
.toc ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
}
.toc ol a {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: normal;
	width: 205px;
	max-width: 100%;
	padding: 9px 14px;
	border-radius: 8px;
	background: linear-gradient(100deg, var(--accent, #12224d), var(--accent2, #2f5fbf));
	color: #fff;
	text-decoration: none;
	font-size: 0.95em;
	font-weight: 700;
	line-height: 1.5;
}
.toc ol a::before {
	content: counter(toc) ". ";
	font-weight: 700;
}

/* 章 */
section {
	background: linear-gradient(180deg, var(--soft, #f2f5fb), #fff 55%);
	border: 1px solid var(--line, #d9dfe8);
	border-radius: 10px;
	padding: 4px 26px 26px;
	margin: 34px 0;
	color: var(--ink, #1c2330);
}
section h1 {
	font-size: 1.55em;
	margin: 26px 0 20px;
	padding: 14px 20px;
	color: #fff;
	background: linear-gradient(100deg, var(--accent, #12224d), var(--accent2, #2f5fbf));
	border-radius: 8px;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
}
section h2 {
	font-size: 1.16em;
	margin: 30px 0 12px;
	padding: 6px 12px;
	color: hsl(var(--dh, 220), 78%, 25%);
	background: linear-gradient(90deg, hsl(var(--dh, 220), 28%, 95%), #fff);
	border-left: 6px solid hsl(var(--dh, 220), 78%, 25%);
}
section h2 a {
	background: none;
	color: hsl(var(--dh, 220), 78%, 25%);
	text-decoration: none;
}
section h2 a:hover {
	text-decoration: underline;
}
p {
	margin: 0 0 12px;
}
.desc {
	background: none;
	color: var(--ink-soft, #4a5568);
	margin: 0 0 12px;
}
.links {
	margin: 0 0 22px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* バッジ（公開Web・GitHub 共通） */
.webbadge,
.ghbadge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 13px;
	border-radius: 6px;
	background: none;
	color: #fff;
	text-decoration: none;
	font-size: 0.86em;
	line-height: 1.6;
	white-space: nowrap;
}
.webbadge svg,
.ghbadge svg {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

/* 公開Web バッジ（紺。状態バッジの緑と区別する） */
.webbadge {
	background: linear-gradient(100deg, var(--navy1, #12224d), var(--navy2, #2f5fbf));
	color: #fff;
}
.webbadge:hover {
	background: linear-gradient(100deg, #1b3372, #4a78d0);
	color: #fff;
}
.webbadge svg {
	fill: none;
	stroke: #fff;
	stroke-width: 1.4;
}

/* GitHub バッジ */
.ghbadge {
	background: linear-gradient(100deg, #24292f, #57606a);
	color: #fff;
}
.ghbadge:hover {
	background: linear-gradient(100deg, #3a424b, #6e7781);
	color: #fff;
}
.ghbadge svg {
	fill: #fff;
}
