/* === ブログ用CSS ===
   - メインサイト(style.css)とテーマ変数を流用するが、ここでは独立して定義
   - フォントは普通のweb慣れたフォント (システムフォント) を使う
   - テーマはオレンジ1つに固定 */

:root {
	--bg: #fdf6ec;
	--bg-sub: #f5ecdb;
	--card: #ffffff;
	--line: #e3d8c4;
	--ink: #2b2620;
	--ink-soft: #6b5d4f;
	--ink-mute: #9a8d7d;
	--accent: #ff7043;
	--accent-soft: #ffd6c4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
	/* 普通のweb慣れたフォント */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
				"Yu Gothic", Meiryo, sans-serif;
	background: var(--bg);
	color: var(--ink);
	line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === 上部バー (スクロール固定なし) === */
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 24px;
	background: var(--bg-sub);
	border-bottom: 1px solid var(--line);
}
.logo {
	font-size: 20px;
	font-weight: 700;
	color: var(--ink);
	letter-spacing: .02em;
}
.logo .dot { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; position: relative; }
.avatar {
	width: 34px; height: 34px;
	border: none; border-radius: 50%;
	background: var(--accent); color: #fff;
	font-weight: 700; cursor: pointer;
}
.hamburger {
	width: 36px; height: 36px;
	border: none; background: transparent;
	border-radius: 8px;
	color: var(--ink-soft);
	cursor: pointer;
	display: grid; place-items: center;
}
.hamburger:hover { background: rgba(0,0,0,.05); }

/* 右上メニューのポップアップ */
.popup-menu {
	position: absolute;
	top: 100%; right: 0;
	margin-top: 8px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 6px;
	box-shadow: 0 8px 24px rgba(0,0,0,.1);
	display: flex; flex-direction: column;
	gap: 2px;
	min-width: 180px;
	z-index: 50;
}
.popup-menu[hidden] { display: none; }
.popup-menu a {
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 14px;
	color: var(--ink);
	text-decoration: none;
}
.popup-menu a:hover { background: var(--bg-sub); text-decoration: none; }

/* === レイアウト: 記事本体 + 右サイドバー === */
.blog-layout {
	max-width: 1080px;
	margin: 0 auto;
	padding: 32px 24px;
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 32px;
	align-items: start;
}

/* === 記事本体 === */
.article {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 40px 48px;
	min-width: 0;
}
.article-meta {
	font-size: 13px;
	color: var(--ink-mute);
	margin-bottom: 12px;
}

/* mdから生成した本文の装飾 */
.article-body h1 {
	font-size: 28px;
	font-weight: 700;
	margin: 8px 0 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--accent-soft);
}
.article-body h2 {
	font-size: 22px;
	font-weight: 700;
	margin: 32px 0 12px;
	padding-left: 12px;
	border-left: 4px solid var(--accent);
}
.article-body h3 {
	font-size: 18px;
	font-weight: 700;
	margin: 24px 0 8px;
}
.article-body p { margin: 12px 0; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body em { font-style: italic; color: var(--ink-soft); }
.article-body ul, .article-body ol { margin: 12px 0 12px 28px; }
.article-body li { margin: 6px 0; }
.article-body li > ul, .article-body li > ol { margin: 6px 0 6px 20px; }
.article-body blockquote {
	border-left: 3px solid var(--accent);
	background: var(--bg-sub);
	padding: 10px 16px;
	margin: 16px 0;
	color: var(--ink-soft);
}
.article-body hr {
	border: none;
	border-top: 1px dashed var(--line);
	margin: 32px 0;
}
.article-body code {
	background: var(--bg-sub);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: .92em;
	font-family: "SFMono-Regular", Consolas, "Menlo", monospace;
}
.article-body pre {
	background: #2b2620;
	color: #f5ecdb;
	padding: 16px 20px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 16px 0;
	font-size: 13px;
	line-height: 1.6;
}
.article-body pre code {
	background: transparent;
	color: inherit;
	padding: 0;
}
.article-body del { color: var(--ink-mute); }
/* 定義リスト */
.article-body dl { margin: 12px 0; }
.article-body dt { font-weight: 700; margin-top: 12px; }
.article-body dd { margin-left: 20px; color: var(--ink-soft); }
.article-body img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }

/* 表 */
.article-body table {
	border-collapse: collapse;
	margin: 16px 0;
	width: 100%;
	font-size: 14px;
	/* はみ出すほど横長の表でも崩れないように */
	display: block;
	overflow-x: auto;
}
.article-body th,
.article-body td {
	border: 1px solid var(--line);
	padding: 8px 12px;
	text-align: left;
	vertical-align: top;
}
.article-body th {
	background: var(--bg-sub);
	font-weight: 700;
	color: var(--ink);
}
/* 縞模様 (見出し以外の偶数行を薄く塗る) */
.article-body tbody tr:nth-child(even) td {
	background: rgba(0, 0, 0, .02);
}

/* === 右サイドバー (記事リンク一覧) === */
.article-side {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 20px;
}
.side-title {
	font-size: 13px;
	font-weight: 700;
	color: var(--ink-mute);
	letter-spacing: .12em;
	margin-bottom: 12px;
}
.side-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.side-item a {
	display: flex;
	gap: 10px;
	padding: 8px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--ink);
	transition: background .15s;
}
.side-item a:hover { background: var(--bg-sub); text-decoration: none; }
.side-item.active a { background: var(--accent-soft); }
.side-thumb {
	width: 56px; height: 56px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--bg-sub);
	flex-shrink: 0;
}
.side-text { min-width: 0; flex: 1; }
.side-name {
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	/* 2行で省略 (長すぎたら自動省略) */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.side-date {
	font-size: 11px;
	color: var(--ink-mute);
	margin-top: 4px;
}

/* === 記事一覧ページ === */
.list-wrap {
	max-width: 880px;
	margin: 0 auto;
	padding: 32px 24px;
}
.list-h1 {
	font-size: 24px;
	font-weight: 700;
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--accent-soft);
}
.list-grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}
.list-card a {
	display: flex;
	gap: 12px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px;
	text-decoration: none;
	color: var(--ink);
	transition: transform .15s, box-shadow .15s;
}
.list-card a:hover {
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0,0,0,.06);
}
.list-thumb {
	width: 72px; height: 72px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--bg-sub);
	flex-shrink: 0;
}
.list-text { min-width: 0; flex: 1; }
.list-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.list-date {
	font-size: 12px;
	color: var(--ink-mute);
	margin-top: 6px;
}

/* === モバイル === */
@media (max-width: 768px) {
	.topbar { padding: 10px 16px; }
	.blog-layout {
		grid-template-columns: 1fr;
		padding: 16px;
		gap: 20px;
	}
	.article { padding: 24px 20px; }
	.article-body h1 { font-size: 24px; }
	.article-body h2 { font-size: 19px; }
	.list-wrap { padding: 20px 16px; }
}
