/* ━━━ 記事個別ページ ━━━ */
/* article 要素に限定（body.single-post への意図しない適用を防ぐ） */
article.single-post {
	background: var(--c-white);
	border-radius: var(--r-card);
	box-shadow: var(--shadow-card);
	overflow: hidden;
	/* 本文の可読幅。 1fr メインカラムが 800px 超に伸びても、
	 * テキストブロック (header / toc / content / tags / actions) は
	 * この値で中央寄せにし、 一行の文字数を読みやすく抑える。
	 * アイキャッチとカード背景はカード幅のまま全幅。 */
	--single-content-w: 720px;
}

.single-post__header,
.single-post__content,
.single-post__tags,
.single-post__actions {
	max-width: var(--single-content-w);
	margin-inline: auto;
}

/* TOC は左ボーダー + 右側角丸の「左密着」デザインなので、 max-width のみ適用し
 * 中央寄せはしない。 元の margin (2rem 2rem 0) のインセットを保つ。 */
.single-post .toc {
	max-width: var(--single-content-w);
}

/* ━━━ ヘッダー ━━━ */
.single-post__header { padding: 2rem 2rem 1.25rem; }
.single-post__cats { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .85rem; }
.single-post__title {
	font-size: clamp(1.4rem, 4vw, 2.1rem);
	font-weight: 900;
	line-height: 1.35;
	letter-spacing: -.01em;
	margin-bottom: .9rem;
}
.single-post__meta {
	display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
	font-size: .78rem; color: var(--c-muted);
}
.single-post__date { display: flex; align-items: center; gap: .3rem; }

/* ━━━ アイキャッチ ━━━ */
.single-post__thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--c-border); }
.single-post__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.single-post__placeholder {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: clamp(3rem, 10vw, 5rem); font-weight: 900;
	letter-spacing: -.02em;
}

/* ━━━ 本文タイポグラフィ ━━━ */
.single-post__content {
	padding: 2rem;
	font-size: 1rem;
	line-height: 1.9;
	color: var(--c-text);
}
.single-post__content > * + * { margin-top: 1.4em; }
.single-post__content h2 {
	font-size: 1.35rem; font-weight: 800; margin-top: 2.5em; margin-bottom: .6em;
	padding: .6em .9em; background: var(--c-blue-lt); border-left: 4px solid var(--c-blue);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.single-post__content h3 {
	font-size: 1.1rem; font-weight: 800; margin-top: 2em; margin-bottom: .5em;
	padding-bottom: .35em; border-bottom: 2px solid var(--c-border);
}
.single-post__content h4 { font-size: 1rem; font-weight: 700; margin-top: 1.5em; }
.single-post__content a { color: var(--c-blue); text-decoration: underline; text-underline-offset: 3px; }
.single-post__content a:hover { opacity: .75; }
.single-post__content img { max-width: 100%; height: auto; border-radius: var(--r-sm); }
.single-post__content blockquote {
	border-left: 4px solid var(--c-border); padding: .8em 1.2em;
	color: var(--c-muted); font-style: italic; background: var(--c-bg);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.single-post__content ul { list-style: disc; padding-left: 1.5em; }
.single-post__content ol { list-style: decimal; padding-left: 1.5em; }
.single-post__content li + li { margin-top: .4em; }
.single-post__content code {
	font-family: 'Courier New', Consolas, monospace; font-size: .88em;
	background: var(--c-bg); padding: .15em .45em; border-radius: 4px;
	border: 1px solid var(--c-border);
}
.single-post__content pre {
	background: #1A202C; color: #E2E8F0; border-radius: var(--r-sm);
	padding: 1.2em 1.5em; overflow-x: auto; font-size: .88em; line-height: 1.65;
}
.single-post__content pre code { background: none; border: none; padding: 0; color: inherit; }
.single-post__content table { width: 100%; border-collapse: collapse; font-size: .92em; }
.single-post__content th,
.single-post__content td { padding: .6em .9em; border: 1px solid var(--c-border); }
.single-post__content th { background: var(--c-blue-lt); font-weight: 700; }

/* ━━━ タグ ━━━ */
.single-post__tags { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 2rem 1.5rem; }
.single-post__tag {
	font-size: .75rem; font-weight: 700; color: var(--c-muted);
	border: 1.5px solid var(--c-border); border-radius: var(--r-pill);
	padding: .2rem .75rem; transition: all .2s;
}
.single-post__tag:hover { border-color: var(--c-blue); color: var(--c-blue); }

/* ━━━ いいね ━━━ */
.single-post__actions {
	display: flex; justify-content: center;
	padding: 1.25rem 2rem 2rem; border-top: 1px solid var(--c-border);
}
.like-btn--lg {
	padding: .75rem 2.5rem; font-size: 1rem; font-weight: 800;
	border-radius: var(--r-pill); gap: .55rem;
}

/* ━━━ 前後記事ナビ ━━━ */
.post-nav {
	display: grid; grid-template-columns: 1fr 1fr;
	gap: 1rem; margin-top: 1.5rem;
}
.post-nav__item {
	background: var(--c-white); border-radius: var(--r-card); padding: 1.1rem 1.25rem;
	box-shadow: var(--shadow-sm); border: 2px solid var(--c-border);
	transition: var(--trans); display: flex; flex-direction: column; gap: .3rem;
}
.post-nav__item:hover { border-color: var(--c-blue); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.post-nav__item--next { text-align: right; }
.post-nav__label { font-size: .72rem; font-weight: 700; color: var(--c-blue); }
.post-nav__title { font-size: .88rem; font-weight: 700; line-height: 1.5; color: var(--c-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 600px) {
	.post-nav { grid-template-columns: 1fr; }
	.post-nav__item--next { text-align: left; }
	.single-post__header, .single-post__content { padding-inline: 1.25rem; }
	.single-post__tags { padding-inline: 1.25rem; }
	.single-post__actions { padding-inline: 1.25rem; }
}

/* ━━━ カテゴリアーカイブ ヘッダー ━━━ */
.cat-archive-header {
	background: var(--cat-bg, var(--c-blue-lt));
	border-bottom: 3px solid var(--cat-color, var(--c-blue));
	padding-block: clamp(1.5rem, 3vw, 2.5rem);
}
.cat-archive-header__inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}
.cat-archive-header__icon {
	font-size: 2.5rem;
	line-height: 1;
	flex-shrink: 0;
}
.cat-archive-header__body { flex: 1; min-width: 0; }
.cat-archive-header__label {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: var(--cat-color, var(--c-blue));
	margin-bottom: .2rem;
}
.cat-archive-header__title {
	font-size: clamp(1.4rem, 4vw, 2rem);
	font-weight: 900;
	color: var(--c-text);
	margin-bottom: .4rem;
}
.cat-archive-header__desc {
	font-size: .88rem;
	color: var(--c-muted);
	line-height: 1.65;
}
.cat-archive-header__count {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: var(--cat-color, var(--c-blue));
	color: #fff;
	border-radius: var(--r-card);
	padding: .75rem 1.25rem;
	flex-shrink: 0;
	text-align: center;
	min-width: 72px;
}
.cat-archive-header__count-num {
	font-size: 1.5rem;
	font-weight: 900;
	line-height: 1;
}
.cat-archive-header__count-label {
	font-size: .68rem;
	font-weight: 700;
	opacity: .85;
	margin-top: .2rem;
}
.no-posts {
	text-align: center;
	padding: 4rem 2rem;
	color: var(--c-muted);
	font-size: 1rem;
}
@media (max-width: 480px) {
	.cat-archive-header__inner { flex-wrap: wrap; }
	.cat-archive-header__count { display: none; }
}

/* ━━━ 目次（TOC） ━━━ */
.toc {
	margin: 2rem 2rem 0;
	padding: 1.25rem 1.5rem;
	background: var(--c-blue-lt);
	border-left: 4px solid var(--c-blue);
	border-radius: 0 var(--r-card) var(--r-card) 0;
}
.toc__title {
	font-size: .85rem;
	font-weight: 900;
	color: var(--c-blue);
	letter-spacing: .06em;
	text-transform: uppercase;
	margin-bottom: .75rem;
}
.toc__title::before {
	content: '📋 ';
}
.toc__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: .35rem;
}
.toc__item a {
	font-size: .88rem;
	font-weight: 700;
	color: var(--c-blue);
	text-decoration: none;
	display: flex;
	align-items: baseline;
	gap: .4rem;
	line-height: 1.5;
	transition: opacity .2s;
}
.toc__item a::before {
	content: counter(toc-counter);
	counter-increment: toc-counter;
	font-size: .72rem;
	font-weight: 900;
	min-width: 1.4em;
	flex-shrink: 0;
}
.toc__list { counter-reset: toc-counter; }
.toc__item a:hover { opacity: .7; text-decoration: underline; text-underline-offset: 3px; }

/* h3 の字下げ */
.toc__item--sub {
	padding-left: 1.25rem;
}
.toc__item--sub a {
	font-weight: 600;
	font-size: .83rem;
	color: var(--c-text);
}
.toc__item--sub a::before {
	content: '–';
	font-weight: 400;
	color: var(--c-muted);
	counter-increment: none;
}

@media (max-width: 600px) {
	.toc { margin-inline: 1.25rem; padding: 1rem 1.1rem; }
	.toc__item a { font-size: .83rem; }
}

/* ━━━ 読了時間バッジ ━━━ */
/* タグ系バイオレットと色相を分離するため slate 系で構成。 */
.reading-time {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .25rem .65rem;
	border-radius: 999px;
	background: #F1F5F9;
	color: #475569;
	font-size: .82rem;
	line-height: 1;
}
.reading-time strong { color: #1E293B; font-weight: 700; }
.reading-time svg { color: inherit; flex: 0 0 auto; }

/* ━━━ スクロールプログレスバー ━━━ */
/* site-header (top:var(--banner-h); height:var(--header-h); z-index:1000) の真下に貼る。 */
.reading-progress {
	position: fixed;
	top: calc( var(--banner-h, 44px) + var(--header-h, 68px) );
	left: 0;
	right: 0;
	height: 4px;
	z-index: 1001;
	background: rgba( 0, 0, 0, .08 );
	pointer-events: none;
}
.reading-progress__bar {
	height: 100%;
	width: 0;
	background: var(--c-blue, #0055FF);
	transition: width 50ms linear;
}

/* WordPress 管理バー対応 */
.admin-bar .reading-progress {
	top: calc( 32px + var(--banner-h, 44px) + var(--header-h, 68px) );
}
@media screen and (max-width: 782px) {
	.admin-bar .reading-progress {
		top: calc( 46px + var(--banner-h, 44px) + var(--header-h, 68px) );
	}
}

/* JS 読み込み前のフラッシュ防止 + 動きを嫌うユーザーへの配慮 */
@media (prefers-reduced-motion: reduce) {
	.reading-progress { display: none; }
}
