/**
 * 通常投稿（記事詳細）専用スタイル
 * body.single-post-page のときのみ読み込むため、他ページに影響しません
 * カテゴリアーカイブ・コラムとデザインを統一（ネイビー・BLOG・#062c52）
 */

/* パンくず：高さ固定・テキストを青バー内で上下中央に（line-height で確実に中央寄せ） */
body.single-post-page #branch {
	display: flex !important;
	align-items: center;
	height: 176px;
	min-height: 176px;
	padding-top: 120px;
	padding-bottom: 20px;
	box-sizing: border-box;
	color: #fff;
	background-color: #0d3b66;
}

/* パンくずテキストが入るエリアを 36px に固定し、その中で中央に */
body.single-post-page #branch .wrap {
	padding: 0 !important;
	width: 100%;
	height: 36px;
	min-height: 36px;
	display: flex !important;
	align-items: center !important;
}

body.single-post-page #branch .inner {
	width: 100%;
	height: 36px;
	display: flex !important;
	align-items: center !important;
	line-height: 1;
	margin: 0;
}

body.single-post-page #branch .inner ul,
body.single-post-page #branch .inner nav,
body.single-post-page #branch .inner > div {
	margin: 0;
	padding: 0;
	line-height: 36px;
	min-height: 36px;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

body.single-post-page #branch .inner li {
	line-height: 36px;
}

/* タイトルをヘッダーに重ねない：必ずパンくずの下・アイキャッチの上（通常フローで表示） */
body.single-post-page #contents {
	display: block;
}

body.single-post-page #single-post-main,
body.single-post-page #single-post-main .wrap,
body.single-post-page #single-post-main .inner {
	position: static !important;
	overflow: visible !important;
}

body.single-post-page #single-post-main {
	top: auto !important;
	left: auto !important;
	margin-top: 0 !important;
	display: block !important;
	z-index: auto !important;
}

body.single-post-page .single-post__flex.flex.parent {
	overflow: visible !important;
	position: static !important;
}

/* スクロール時にアイキャッチと公開日が重ならないよう、すべて static・枠なし */
/* common.js の trance は #headerNav の親 header のみに付与するよう修正済み。万一記事 header に trance が付いても以下で打ち消す */
body.single-post-page .single-post__header,
body.single-post-page .single-post__header.trance,
body.single-post-page .single-post__header .single-post__cat-above,
body.single-post-page .single-post__header .single-post__title,
body.single-post-page .single-post__header .single-post__date-below,
body.single-post-page .single-post__header * {
	position: static !important;
	top: auto !important;
	left: auto !important;
	z-index: auto !important;
	transform: none !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
}

body.single-post-page .single-post__header,
body.single-post-page .single-post__header.trance {
	background: transparent !important;
	height: auto !important;
}

body.single-post-page .single-post__article,
body.single-post-page .single-post__content-wrap,
body.single-post-page .single-post__eyecatch,
body.single-post-page .single-post__eyecatch img {
	position: static !important;
	transform: none !important;
}

/* 親に sticky が付与されても固定しない */
body.single-post-page .single-post__flex.flex.parent .single-post__content-wrap,
body.single-post-page .single-post__flex.flex.parent .single-post__header,
body.single-post-page .single-post__flex.flex.parent .single-post__eyecatch {
	position: static !important;
}

body.single-post-page #branch.smv a,
body.single-post-page #branch.smv p,
body.single-post-page #branch.smv ul li,
body.single-post-page #branch.smv ul li i {
	color: #fff;
	border-color: #fff;
}

/* タイトル・カテゴリ・公開日：メインエリアの先頭・アイキャッチの左端に揃えて左寄せ */
body.single-post-page .single-post__header {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0 0 24px;
	padding: 0;
	text-align: left !important;
	box-sizing: border-box;
}

body.single-post-page .single-post__header * {
	text-align: left !important;
}

body.single-post-page .single-post__header .single-post__cat-above {
	margin: 0 0 8px;
	padding: 0;
}

body.single-post-page .single-post__header .single-post__cat-link {
	display: inline-block;
	padding: 6px 14px;
	font-size: 1.3rem;
	color: #fff;
	text-decoration: none;
	background: #062c52;
	border-radius: 4px;
}

body.single-post-page .single-post__header .single-post__cat-link:hover {
	opacity: 0.9;
	color: #fff;
}

body.single-post-page .single-post__header .single-post__title {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	font-size: 2.2rem;
	line-height: 1.4;
	font-weight: 700;
	color: #333;
	text-align: left !important;
}

body.single-post-page .single-post__header .single-post__date-below {
	display: block;
	margin: 0;
	padding: 0;
	font-size: 1.4rem;
	color: #666;
	text-align: left !important;
}

/* アイキャッチ：タイトルの直下（DOM順＝カテゴリ→タイトル→公開日→アイキャッチ→本文、スクロールで重ならない） */
body.single-post-page .single-post__eyecatch {
	position: static !important;
	margin: 0 0 24px;
	padding: 0;
	line-height: 0;
}

body.single-post-page .single-post__eyecatch-img {
	width: 100%;
	height: auto;
	display: block;
	vertical-align: middle;
}

/* メインエリア（背景画像・絶対配置のリセットで重なり防止・左揃え） */
body.single-post-page #single-post-main.single-post-main,
body.single-post-page .single-post__article,
body.single-post-page .single-post__content-wrap {
	background: #fff !important;
	background-image: none !important;
	position: relative;
	text-align: left !important;
}

body.single-post-page .single-post__article.mainInner {
	text-align: left !important;
	margin-top: 20px;
}

body.single-post-page #single-post-main.single-post-main {
	padding: 40px 0 60px;
}

body.single-post-page .single-post__flex {
	align-items: flex-start;
}

body.single-post-page .single-post__content-wrap {
	text-align: left !important;
}

/* 本文エリア：すべてブロックとして縦に並べる（重なり防止） */
body.single-post-page .single-post__body {
	background: #fff !important;
	background-image: none !important;
	position: relative;
	overflow: visible;
}

body.single-post-page .single-post__body > * {
	position: static !important;
	display: block !important;
}

/* 本文内のカバー・ヒーロー系ブロックを通常のブロックに（画像の上にテキストが重ならないように） */
body.single-post-page .single-post__body .wp-block-cover {
	position: static !important;
	height: auto !important;
	min-height: 0 !important;
	max-height: 360px;
	display: block !important;
	margin: 1.5em 0 !important;
}

body.single-post-page .single-post__body .wp-block-cover .wp-block-cover__background {
	position: absolute !important;
	inset: 0;
	height: 100%;
}

body.single-post-page .single-post__body .wp-block-cover .wp-block-cover__inner-container {
	position: relative !important;
	z-index: 1;
	padding: 2em;
}

/* その他：背景画像を持ちうる要素のリセット */
body.single-post-page .single-post__body [class*="cover"],
body.single-post-page .single-post__body [class*="hero"],
body.single-post-page .single-post__body .imgWrap {
	background-image: none !important;
}

body.single-post-page .single-post__body .imgWrap {
	display: block;
	margin: 1.5em 0;
}

body.single-post-page .single-post__body .imgWrap img {
	display: block;
	max-width: 100%;
	height: auto;
}

/* 記事本文ラップ */
body.single-post-page .single-post__content-wrap {
	min-width: 0;
}

body.single-post-page .single-post__article {
	background: transparent;
	padding: 0;
}

/* 日付・カテゴリ（記事上部） */
body.single-post-page .single-post__meta-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e8e8e8;
}

body.single-post-page .single-post__date {
	font-size: 1.4rem;
	color: #666;
}

body.single-post-page .single-post__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

body.single-post-page .single-post__cat {
	display: inline-block;
	padding: 4px 12px;
	font-size: 1.3rem;
	color: #062c52;
	text-decoration: none;
	background: #f0f4f8;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

body.single-post-page .single-post__cat:hover {
	background: #062c52;
	color: #fff;
}

/* 本文エリア（.txt は共通クラスのためスコープ内で上書き・style.css の 1.4rem を上書き） */
body.single-post-page .single-post__body.txt,
body.single-post-page .single-post__body.txt p {
	font-size: 16px !important;
}
body.single-post-page .single-post__body.txt {
	line-height: 1.9;
	color: #333;
}

body.single-post-page .single-post__body.txt p {
	margin: 0 0 1.2em;
}

body.single-post-page .single-post__body.txt h2 {
	margin: 2em 0 0.8em;
	padding: 0 0 8px;
	font-size: 2rem;
	font-weight: 700;
	color: #333;
	border-bottom: 2px solid #062c52;
}

body.single-post-page .single-post__body.txt h3 {
	margin: 1.8em 0 0.6em;
	font-size: 1.8rem;
	font-weight: 700;
	color: #333;
}

body.single-post-page .single-post__body.txt h4 {
	margin: 1.4em 0 0.5em;
	font-size: 1.6rem;
	font-weight: 700;
	color: #333;
}

body.single-post-page .single-post__body.txt ul,
body.single-post-page .single-post__body.txt ol {
	margin: 0 0 1.2em 1.2em;
	padding: 0;
}

body.single-post-page .single-post__body.txt li {
	margin-bottom: 0.5em;
}

body.single-post-page .single-post__body.txt a {
	color: #062c52;
	text-decoration: underline;
}

body.single-post-page .single-post__body.txt a:hover {
	opacity: 0.85;
}

body.single-post-page .single-post__body.txt img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

/* 本文内の画像とテキストの重なり防止（ブロック化・余白・float解除） */
body.single-post-page .single-post__body.txt figure,
body.single-post-page .single-post__body.txt .wp-block-image {
	display: block;
	margin: 1.5em 0;
	max-width: 100%;
}

body.single-post-page .single-post__body.txt figure img,
body.single-post-page .single-post__body.txt .wp-block-image img {
	display: block;
	max-width: 100%;
	height: auto;
}

body.single-post-page .single-post__body.txt .alignleft,
body.single-post-page .single-post__body.txt img.alignleft {
	float: left;
	margin: 0.5em 1.2em 1em 0;
	max-width: 50%;
}

body.single-post-page .single-post__body.txt .alignright,
body.single-post-page .single-post__body.txt img.alignright {
	float: right;
	margin: 0.5em 0 1em 1.2em;
	max-width: 50%;
}

body.single-post-page .single-post__body.txt .aligncenter,
body.single-post-page .single-post__body.txt img.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

body.single-post-page .single-post__body.txt::after {
	content: "";
	display: table;
	clear: both;
}

body.single-post-page .single-post__body.txt blockquote {
	margin: 1.5em 0;
	padding: 1em 1.5em;
	border-left: 4px solid #062c52;
	background: #f8f9fa;
	color: #555;
}

/* 目次・タブナビ（概要・入門など）が画像に重ならないように */
body.single-post-page .single-post__body #toc_container,
body.single-post-page .single-post__body .toc_container,
body.single-post-page .single-post__body [id*="toc"],
body.single-post-page .single-post__body [class*="toc"] {
	position: static !important;
	display: block !important;
	margin: 1.5em 0 !important;
	background: #f8f9fa !important;
	background-image: none !important;
	padding: 1em 1.25em !important;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
}

/* 本文先頭の大きな画像を1枚だけブロック表示（背景化しない） */
body.single-post-page .single-post__body > figure:first-child,
body.single-post-page .single-post__body > .wp-block-image:first-child,
body.single-post-page .single-post__body > p:first-child img:only-child {
	max-height: 360px;
	object-fit: cover;
}

body.single-post-page .single-post__body > figure:first-child img,
body.single-post-page .single-post__body > .wp-block-image:first-child img {
	max-height: 360px;
	width: 100%;
	object-fit: cover;
	display: block;
}

/* タグ（本文下） */
body.single-post-page .single-post__tags {
	margin: 24px 0 0;
	font-size: 1.4rem;
	color: #666;
}

body.single-post-page .single-post__tags-ttl {
	margin-right: 8px;
	font-weight: 700;
}

body.single-post-page .single-post__tags a {
	color: #062c52;
	text-decoration: none;
}

body.single-post-page .single-post__tags a:hover {
	text-decoration: underline;
}

/* 一覧へ戻る（本文下） */
body.single-post-page .single-post__back {
	margin: 32px 0 0;
}

body.single-post-page .single-post__back-link {
	display: inline-block;
	padding: 10px 24px;
	font-size: 1.4rem;
	color: #062c52;
	text-decoration: none;
	border: 1px solid #062c52;
	border-radius: 4px;
	transition: background 0.2s, color 0.2s;
}

body.single-post-page .single-post__back-link:hover {
	background: #062c52;
	color: #fff;
}

/* サイドバー：コラムページ /column/ と同じデザインを踏襲 */
body.single-post-page .single-post__sidebar.basis2 {
	border-left: 1px solid #ddd;
}

body.single-post-page .single-post__sidebar .sidebar {
	padding-top: 20px;
	margin-left: 20px;
}

body.single-post-page .single-post__sidebar .backBtn {
	margin-top: 20px;
}

body.single-post-page .single-post__sidebar .backBtn a {
	padding: 10px 20px;
	border-radius: 30px;
	background: #011726;
	color: #fff;
	display: table;
	text-decoration: none;
}

body.single-post-page .single-post__sidebar .backBtn a:hover {
	opacity: 0.9;
	color: #fff;
}

/* レスポンシブ：幅95%・パンくずの高さを抑える（モバイルでは青い背景をコンパクトに） */
@media screen and (max-width: 980px) {
	body.single-post-page #branch .wrap,
	body.single-post-page #branch .inner {
		width: 95%;
		max-width: 95%;
		margin-left: auto;
		margin-right: auto;
	}

	body.single-post-page #branch {
		height: auto;
		min-height: 0;
		padding-top: 12px;
		padding-bottom: 12px;
	}
	body.single-post-page #branch .wrap,
	body.single-post-page #branch .inner {
		height: auto;
		min-height: 0;
	}
	body.single-post-page #branch .inner ul,
	body.single-post-page #branch .inner nav,
	body.single-post-page #branch .inner > div {
		min-height: 0;
	}
	body.single-post-page #branch .inner li {
		line-height: 1.4;
	}
}

/* レスポンシブ：幅95%・サイドバーを下に */
@media screen and (max-width: 992px) {
	body.single-post-page #single-post-main .wrap,
	body.single-post-page #single-post-main .inner {
		width: 95%;
		max-width: 95%;
		margin-left: auto;
		margin-right: auto;
	}

	body.single-post-page .single-post__flex {
		flex-direction: column;
	}

	body.single-post-page .single-post__sidebar {
		width: 100%;
		max-width: 100%;
	}

	body.single-post-page .single-post-sidebar {
		position: static;
	}
}

@media screen and (max-width: 768px) {
	body.single-post-page .single-post__header .single-post__title {
		font-size: 1.9rem;
	}
}

@media screen and (max-width: 576px) {
	body.single-post-page #single-post-main.single-post-main {
		padding: 24px 0 40px;
	}

	body.single-post-page .single-post__meta-top {
		margin-bottom: 16px;
		padding-bottom: 12px;
	}

	body.single-post-page .single-post__body.txt {
		font-size: 16px;
	}

	body.single-post-page .single-post__body.txt h2 {
		font-size: 1.8rem;
	}

	body.single-post-page .single-post-sidebar {
		padding: 18px;
	}
}
