/***********************************************************************
通常投稿（single-post）の本文を読みやすくするスタイル
- is_single()のときだけ、common.cssの後に読み込む（functions.php）
- 固定ページ・ゲーム攻略テンプレートには影響させない
- 表・ショートコード部品（[反応]・目次・.table-fixed等）を壊さないよう、
  段落・見出し・リストは本文直下の要素（>）だけを対象にする
***********************************************************************/

article.single-post .entry-content{
	font-size: 1.0625rem; /* 17px */
	line-height: 1.95;
	letter-spacing: 0.01em;
	overflow-wrap: anywhere; /* 長いURL・英数字の列で本文がはみ出さないように */
}

/* 段落・リスト */
article.single-post .entry-content > p{ margin: 0 0 1.2em; }
article.single-post .entry-content > ul,
article.single-post .entry-content > ol{
	margin: 0 0 1.4em;
	padding-left: 1.6em;
}
article.single-post .entry-content > ul > li,
article.single-post .entry-content > ol > li{ margin: 0.3em 0; }

/* 見出し：背景色や太い罫線をやめ、アクセントカラーの細い線で区切る */
article.single-post .entry-content > h2{
	margin: 2.4em 0 0.9em;
	padding: 0 0 0.45em;
	border: 0;
	border-bottom: 2px solid var(--border);
	background: none;
	font-size: 1.4rem;
	line-height: 1.45;
	position: relative;
}
article.single-post .entry-content > h2::after{
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 3.2em;
	height: 2px;
	background: var(--accent);
}
article.single-post .entry-content > h3{
	margin: 2em 0 0.7em;
	padding: 0.05em 0 0.05em 0.7em;
	border-left: 4px solid var(--accent);
	background: none;
	font-size: 1.18rem;
	line-height: 1.5;
}
article.single-post .entry-content > h4{
	margin: 1.6em 0 0.5em;
	font-size: 1.05rem;
	color: var(--text);
}
article.single-post .entry-content > h4::before{
	content: "";
	display: inline-block;
	width: 0.55em;
	height: 0.55em;
	margin-right: 0.5em;
	border-radius: 50%;
	background: var(--accent);
	vertical-align: 0.05em;
}

/* リンク：本文中は下線を付けて、リンクだと分かるようにする */
article.single-post .entry-content > p a:not([class]),
article.single-post .entry-content > ul a:not([class]),
article.single-post .entry-content > ol a:not([class]){
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
article.single-post .entry-content > p a:not([class]):hover,
article.single-post .entry-content > ul a:not([class]):hover,
article.single-post .entry-content > ol a:not([class]):hover{ text-decoration-thickness: 2px; }

/* 画像 */
article.single-post .entry-content img{ border-radius: 6px; }

/* 引用：既存の見た目（style.css）を踏まえて、余白だけ整える */
article.single-post .entry-content blockquote:not(.twitter-tweet){
	margin: 1.6em 0 0;
	padding: 0.9em 1.3em;
	border-radius: 0 6px 6px 0;
	line-height: 1.85;
}

/***********************************************************************
コード
- インラインのcode: 薄い地色のチップ
- ブロックのpre: 折り返し表示（横にはみ出さない）＋ワンクリックコピーボタン
***********************************************************************/
article.single-post .entry-content code,
article.single-post .entry-content pre{
	font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Courier New", "BIZ UDGothic", "Yu Gothic", monospace;
}
article.single-post .entry-content :not(pre) > code{
	padding: 0.15em 0.45em;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: var(--surface);
	color: #be185d;
	font-size: 0.88em;
	overflow-wrap: anywhere;
}
article.single-post .entry-content pre{
	position: relative;
	margin: 1.4em 0;
	padding: 2.4em 1.1em 1em; /* 上側はコピーボタンの置き場 */
	border-radius: 8px;
	background: #1e293b;
	color: #e2e8f0;
	font-size: 0.88rem;
	line-height: 1.7;
	letter-spacing: 0;
	white-space: pre-wrap; /* 改行は保ちつつ、長い行は折り返す */
	overflow-wrap: anywhere;
	word-break: normal;
	tab-size: 4;
	max-width: 100%;
	overflow-x: auto;
}
article.single-post .entry-content pre code{
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	white-space: inherit;
	overflow-wrap: inherit;
}
/* コピーボタン（js/code-copy.jsが追加） */
article.single-post .entry-content pre .gg-code-copy{
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.3em 0.8em;
	border: 1px solid rgba(226,232,240,0.28);
	border-radius: 6px;
	background: rgba(255,255,255,0.08);
	color: #e2e8f0;
	font: inherit;
	font-family: var(--font-sans);
	font-size: 0.8rem;
	line-height: 1.5;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
article.single-post .entry-content pre .gg-code-copy:hover{
	background: rgba(255,255,255,0.18);
	border-color: rgba(226,232,240,0.5);
}
article.single-post .entry-content pre .gg-code-copy:focus-visible{
	outline: 2px solid #a5b4fc;
	outline-offset: 2px;
}
article.single-post .entry-content pre .gg-code-copy.is-copied{
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}
article.single-post .entry-content pre .gg-code-copy.is-error{
	background: #dc2626;
	border-color: #dc2626;
	color: #fff;
}

/***********************************************************************
表：幅が足りないときは、ページ全体ではなく表だけ横スクロールさせる
（js/code-copy.jsが<table>を.gg-table-scrollで包む）
***********************************************************************/
article.single-post .entry-content .gg-table-scroll{
	max-width: 100%;
	overflow-x: auto;
	margin: 1.2em 0;
	-webkit-overflow-scrolling: touch;
}
article.single-post .entry-content .gg-table-scroll > table{ margin: 0; }

@media (max-width: 480px){
	article.single-post .entry-content{ font-size: 1rem; line-height: 1.9; }
	article.single-post .entry-content > h2{ font-size: 1.28rem; }
	article.single-post .entry-content > h3{ font-size: 1.1rem; }
	article.single-post .entry-content pre{ padding-left: 0.9em; padding-right: 0.9em; font-size: 0.84rem; }
}
