/* =============================================================================
   ブログ記事ページ — single-post.css
   AI開発実践ラボ
   サイトのデザインシステムと一貫した記事スタイリング
   ============================================================================= */

/* ── アイキャッチ画像 ──────────────────── */
.entry-featured-figure {
	margin: 0 0 32px;
	border-radius: 12px;
	overflow: hidden;
	line-height: 0;
}
.entry-featured-image {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 0;
	margin: 0;
	box-shadow: none;
	border: none;
}

/* ── 記事タイトル ──────────────────────── */
.entry-title {
	font-family: var(--font-family-heading, 'Space Grotesk', 'Noto Sans JP', sans-serif);
	font-size: 28px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
	line-height: 1.4;
	margin-bottom: 16px;
}

/* ── メタ情報（日付・カテゴリ・著者） ──── */
.entry-meta,
.ast-single-post-meta,
.post-meta {
	font-family: var(--font-family-heading, 'Space Grotesk', sans-serif);
	font-size: 13px;
	color: var(--color-sub, #718096);
	margin-bottom: 32px;
}
.entry-meta a,
.ast-single-post-meta a {
	color: var(--color-primary, #2B6CB0);
	text-decoration: none;
}
.entry-meta a:hover,
.ast-single-post-meta a:hover {
	text-decoration: underline;
}

/* ── 記事本文 ──────────────────────────── */
.entry-content {
	font-family: var(--font-family-base, 'Inter', 'Noto Sans JP', sans-serif);
	font-size: 16px;
	line-height: 1.9;
	color: var(--color-body, #4A5568);
}

/* 見出し */
.entry-content h2 {
	font-family: var(--font-family-heading);
	font-size: 22px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
	margin: 48px 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--color-primary, #2B6CB0);
	line-height: 1.4;
}
.entry-content h2:first-child {
	margin-top: 0;
}

.entry-content h3 {
	font-family: var(--font-family-heading);
	font-size: 18px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
	margin: 36px 0 12px;
	line-height: 1.4;
}

.entry-content h4 {
	font-family: var(--font-family-heading);
	font-size: 16px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
	margin: 28px 0 10px;
}

/* 本文テキスト */
.entry-content p {
	margin-bottom: 16px;
	line-height: 1.9;
}

/* リンク */
.entry-content a {
	color: var(--color-primary, #2B6CB0);
	text-decoration: none;
	transition: color var(--transition-base, 0.2s ease);
}
.entry-content a:hover {
	color: var(--color-primary-hover, #1E5A9E);
	text-decoration: underline;
}

/* 画像 */
.entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 16px 0;
}
.entry-content figure {
	margin: 24px 0;
}
.entry-content figcaption {
	font-size: 13px;
	color: var(--color-sub, #718096);
	text-align: center;
	margin-top: 8px;
}

/* リスト */
.entry-content ul,
.entry-content ol {
	margin: 16px 0;
	padding-left: 24px;
}
.entry-content li {
	margin-bottom: 8px;
	line-height: 1.7;
}

/* 引用 */
.entry-content blockquote {
	margin: 24px 0;
	padding: 16px 24px;
	border-left: 4px solid var(--color-primary, #2B6CB0);
	background: #F0F4F8;
	border-radius: 0 8px 8px 0;
	color: var(--color-body, #4A5568);
	font-style: normal;
}
.entry-content blockquote p:last-child {
	margin-bottom: 0;
}

/* コード */
.entry-content pre {
	background: #1A1A2E;
	color: #E2E8F0;
	padding: 20px;
	border-radius: 8px;
	overflow-x: auto;
	font-size: 14px;
	line-height: 1.6;
	margin: 16px 0;
}
.entry-content code {
	background: #EDF2F7;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 14px;
	font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.entry-content pre code {
	background: none;
	padding: 0;
	font-size: inherit;
}

/* テーブル */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0;
	font-size: 14px;
}
.entry-content th,
.entry-content td {
	border: 1px solid var(--color-border, #E8E8E8);
	padding: 10px 14px;
	text-align: left;
	line-height: 1.6;
}
.entry-content th {
	background: #F0F4F8;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
}
.entry-content tr:nth-child(even) td {
	background: #FAFAFA;
}

/* 水平線 */
.entry-content hr {
	border: none;
	border-top: 1px solid var(--color-border, #E8E8E8);
	margin: 40px 0;
}

/* ── サイドバー ─────────────────────────── */
.widget-area .widget {
	margin-bottom: 28px;
}
.widget-area .widget-title,
.widget-area h2 {
	font-family: var(--font-family-heading);
	font-size: 13px;
	font-weight: 700;
	color: var(--color-sub, #718096);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--color-border, #E8E8E8);
	margin-bottom: 12px;
}
.widget-area ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.widget-area li {
	padding: 6px 0;
	border-bottom: 1px solid #F0F0F0;
	font-size: 13px;
	line-height: 1.5;
}
.widget-area li:last-child {
	border-bottom: none;
}
.widget-area a {
	color: var(--color-body, #4A5568);
	text-decoration: none;
	transition: color 0.2s;
}
.widget-area a:hover {
	color: var(--color-primary, #2B6CB0);
}
/* 検索フォーム */
.widget-area .search-form {
	display: flex;
	gap: 0;
}
.widget-area .search-field {
	flex: 1;
	padding: 8px 12px;
	font-size: 13px;
	border: 1px solid var(--color-border, #E8E8E8);
	border-radius: 6px 0 0 6px;
	outline: none;
}
.widget-area .search-field:focus {
	border-color: var(--color-primary, #2B6CB0);
}
.widget-area .search-submit {
	padding: 8px 14px;
	font-size: 13px;
	background: var(--color-primary, #2B6CB0);
	color: #fff;
	border: none;
	border-radius: 0 6px 6px 0;
	cursor: pointer;
}

/* ── レスポンシブ ────────────────────────── */
@media (max-width: 768px) {
	.entry-title {
		font-size: 24px;
	}
	.entry-content h2 {
		font-size: 20px;
		margin-top: 36px;
	}
	.entry-content h3 {
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.entry-title {
		font-size: 22px;
	}
	.entry-content h2 {
		font-size: 18px;
	}
	.entry-content table {
		font-size: 13px;
	}
	.entry-content th,
	.entry-content td {
		padding: 8px 10px;
	}
}

/* ── 目次（自動生成）──────────────────── */
.entry-toc {
	background: var(--color-bg-alt, #F0F4F8);
	border-radius: 12px;
	padding: 24px 28px;
	margin: 0 0 40px;
	border: 1px solid var(--color-border, #E8E8E8);
}
.entry-toc-header {
	margin-bottom: 12px;
}
.entry-toc-title {
	font-family: var(--font-family-heading);
	font-size: 15px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
}
.entry-toc-list {
	margin: 0;
	padding-left: 20px;
	counter-reset: toc-counter;
}
.entry-toc-list li {
	margin-bottom: 6px;
	line-height: 1.5;
	list-style: none;
	counter-increment: toc-counter;
}
.entry-toc-list li::before {
	content: counter(toc-counter) ".";
	font-weight: 600;
	color: var(--color-primary, #2B6CB0);
	margin-right: 6px;
}
.entry-toc-list li a {
	font-size: 14px;
	color: var(--color-body, #4A5568);
	text-decoration: none;
	transition: color 0.2s ease;
}
.entry-toc-list li a:hover {
	color: var(--color-primary, #2B6CB0);
}
.entry-toc-sub {
	padding-left: 16px;
	font-size: 13px;
}
.entry-toc-sub::before {
	font-size: 12px;
}

/* ── 関連記事 ──────────────────────────── */
.related-posts {
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid var(--color-border, #E8E8E8);
}
.related-posts-title {
	font-family: var(--font-family-heading);
	font-size: 20px;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
	margin: 0 0 20px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--color-primary, #2B6CB0);
}
.related-posts-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}
.related-post-card {
	display: flex;
	gap: 12px;
	padding: 12px;
	background: #FFFFFF;
	border: 1px solid var(--color-border, #E8E8E8);
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s ease;
}
.related-post-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.related-post-img {
	flex-shrink: 0;
	width: 80px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
}
.related-post-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}
.related-post-body {
	flex: 1;
	min-width: 0;
}
.related-post-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-heading, #2D3748);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.related-post-card:hover .related-post-title {
	color: var(--color-primary, #2B6CB0);
}
.related-post-date {
	font-size: 11px;
	color: var(--color-sub, #718096);
	margin-top: 4px;
	display: block;
}

/* 記事末広告 */
.blog-ad-after-content {
	margin: 40px 0;
	background: #FAFAFA;
	border: 1px dashed var(--color-border, #E8E8E8);
	border-radius: 8px;
	padding: 16px;
	text-align: center;
	min-height: 100px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.blog-ad-after-content .blog-ad-label {
	font-size: 10px;
	color: var(--color-sub, #718096);
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* ── テンプレート記事の強化 ───────────── */

/* ダウンロードボタン（st-mybuttonの強化） */
.entry-content .cclt-compat-mybutton {
	margin: 32px 0;
}
.entry-content .cclt-compat-mybutton .cclt-compat-mybutton__link {
	transition: transform 0.2s, box-shadow 0.2s;
}
.entry-content .cclt-compat-mybutton .cclt-compat-mybutton__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* テンプレートプレビュー画像（ドキュメント感を演出） */
.entry-content img[src*="template"],
.entry-content img[src*="テンプレ"],
.entry-content figure img {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
	border: 1px solid var(--color-border, #E8E8E8);
}

/* 内部リンクカード（st-card）の統一感 */
.entry-content .cclt-compat-card {
	border-radius: 10px;
	border-color: var(--color-border, #E8E8E8);
}
.entry-content .cclt-compat-card:hover {
	border-color: var(--color-primary, #2B6CB0);
}

/* メモボックス（st-cmemo）の洗練 */
.entry-content .cclt-compat-cmemo {
	border-radius: 8px;
	font-size: 14px;
}

/* 吹き出し（kaiwa）内のテキスト */
.entry-content .cclt-compat-kaiwa__bubble {
	border-radius: 16px;
	font-size: 14px;
}

/* テーブルの改善（テンプレート記事にはHTMLテーブルが多い） */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0;
	font-size: 14px;
	border-radius: 8px;
	overflow: hidden;
}
.entry-content th,
.entry-content td {
	border: 1px solid var(--color-border, #E8E8E8);
	padding: 10px 14px;
	text-align: left;
	line-height: 1.6;
}
.entry-content th {
	background: #F0F4F8;
	font-weight: 700;
	color: var(--color-heading, #2D3748);
}
.entry-content tr:nth-child(even) td {
	background: #FAFAFA;
}
/* AFFINGERのinline style テーブル背景色をオーバーライド */
.entry-content tr[style*="background-color: #091e4d"] td,
.entry-content tr[style*="background-color: #091e4d"] th {
	background: var(--color-primary, #2B6CB0) !important;
	color: #fff !important;
}

/* ── パンくずリスト ─────────────────────── */
.entry-breadcrumb {
	font-size: 13px;
	color: var(--color-sub, #718096);
	margin-bottom: 16px;
	padding: 0;
}
.entry-breadcrumb a {
	color: var(--color-primary, #2B6CB0);
	text-decoration: none;
}
.entry-breadcrumb a:hover {
	text-decoration: underline;
}
.entry-breadcrumb .separator {
	margin: 0 6px;
	color: var(--color-sub, #718096);
}

@media (max-width: 768px) {
	.related-posts-grid {
		grid-template-columns: 1fr;
	}
}
