/* =========================================================
   記事本文のデザイン（To美You）
   ・記事ページとブロックエディターの両方で読み込まれます
   ・普通の「見出し」「リスト」ブロックを使うだけで、
     黒帯見出し・グレーの箇条書きになります
   ・段落ブロックの「スタイル」で
     プチメモ / ポイント / 注意 / 導入 の囲みが選べます

   目次
   1. 本文の基本（文字・段落・リンク）
   2. 見出し
   3. リスト
   4. 囲みボックス（ブロックスタイル）
   5. 画像・表・引用・ボタン
   6. 以前のカスタムHTML記事との互換（.ty-* と inline style）
   7. スマホ調整
   ========================================================= */

:is(.entry-content, .editor-styles-wrapper) {
	font-size: 16px;
	line-height: 2;
	letter-spacing: 0.03em;
	color: #111;
}


/* ---------------------------------------------------------
   1. 本文の基本
   --------------------------------------------------------- */
.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.6em;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

:is(.entry-content, .editor-styles-wrapper) p {
	margin-top: 0;
	margin-bottom: 1.6em;
}

:is(.entry-content, .editor-styles-wrapper) a:not([class*="button"]):not([style*="background-color"]) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

:is(.entry-content, .editor-styles-wrapper) strong,
:is(.entry-content, .editor-styles-wrapper) b {
	font-weight: 700;
}

:is(.entry-content, .editor-styles-wrapper) hr,
:is(.entry-content, .editor-styles-wrapper) .wp-block-separator {
	width: 100%;
	height: 0;
	margin: 3em 0;
	border: none;
	border-top: 1px solid #e2e2e2;
}


/* ---------------------------------------------------------
   2. 見出し
   --------------------------------------------------------- */
/* h2：黒帯 */
:is(.entry-content, .editor-styles-wrapper) h2 {
	margin: 3.6em 0 1.4em;
	padding: 0.8em 1em;
	font-family: inherit;
	font-size: 1.3em;
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: 0.04em;
	color: #fff;
	background: #111;
	border: none;
}

/* h3：左線＋下線 */
:is(.entry-content, .editor-styles-wrapper) h3 {
	margin: 2.6em 0 1.1em;
	padding: 0.3em 0 0.3em 0.8em;
	font-size: 1.1em;
	font-weight: 700;
	line-height: 1.55;
	color: #111;
	background: none;
	border-left: 5px solid #111;
	border-bottom: 1px solid #ddd;
}

/* h4：四角マーク */
:is(.entry-content, .editor-styles-wrapper) h4 {
	position: relative;
	margin: 2.2em 0 0.9em;
	padding-left: 1.1em;
	font-size: 1.02em;
	font-weight: 700;
	line-height: 1.6;
}

:is(.entry-content, .editor-styles-wrapper) h4::before {
	content: "";
	position: absolute;
	top: 0.55em;
	left: 0;
	width: 0.55em;
	height: 0.55em;
	background: #111;
}

:is(.entry-content, .editor-styles-wrapper) h5,
:is(.entry-content, .editor-styles-wrapper) h6 {
	margin: 2em 0 0.8em;
	font-size: 1em;
	font-weight: 700;
}

.entry-content > :is(h2, h3, h4):first-child {
	margin-top: 0;
}


/* ---------------------------------------------------------
   3. リスト（リストブロック：グレーの箱＋●）
   ※inline style 付きの自作リストには効きません
   --------------------------------------------------------- */
:is(.entry-content, .editor-styles-wrapper) :is(ul.wp-block-list, ol.wp-block-list),
.entry-content > :is(ul, ol):not([style]):not([class]) {
	margin: 1.6em 0;
	padding: 1.2em 1.4em;
	list-style: none;
	background: #f4f4f4;
}

:is(.entry-content, .editor-styles-wrapper) :is(ul.wp-block-list, ol.wp-block-list) li,
.entry-content > :is(ul, ol):not([style]):not([class]) li {
	position: relative;
	margin: 0.4em 0;
	padding-left: 1.4em;
	line-height: 1.8;
}

:is(.entry-content, .editor-styles-wrapper) ul.wp-block-list > li::before,
.entry-content > ul:not([style]):not([class]) > li::before {
	content: "●";
	position: absolute;
	top: 0;
	left: 0;
	font-size: 0.8em;
	line-height: 2.25;
}

:is(.entry-content, .editor-styles-wrapper) ol.wp-block-list,
.entry-content > ol:not([style]):not([class]) {
	counter-reset: ty-ol;
}

:is(.entry-content, .editor-styles-wrapper) ol.wp-block-list > li,
.entry-content > ol:not([style]):not([class]) > li {
	padding-left: 2em;
	counter-increment: ty-ol;
}

:is(.entry-content, .editor-styles-wrapper) ol.wp-block-list > li::before,
.entry-content > ol:not([style]):not([class]) > li::before {
	content: counter(ty-ol);
	position: absolute;
	top: 0.3em;
	left: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.45em;
	height: 1.45em;
	font-size: 0.82em;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	background: #111;
}

/* 入れ子のリスト */
:is(.entry-content, .editor-styles-wrapper) .wp-block-list .wp-block-list {
	margin: 0.4em 0 0;
	padding: 0;
	background: none;
}

/* リストのスタイル「装飾なし」 */
:is(.entry-content, .editor-styles-wrapper) .wp-block-list.is-style-plain {
	padding: 0;
	background: none;
}


/* ---------------------------------------------------------
   4. 囲みボックス（段落ブロック・グループブロックのスタイル）
   --------------------------------------------------------- */
/* 共通：枠＋左上の黒ラベル */
:is(.entry-content, .editor-styles-wrapper) :is(p.is-style-memo, p.is-style-point, p.is-style-caution) {
	position: relative;
	margin: 2.4em 0 1.6em;
	padding: 1.7em 1.4em 1.2em;
	line-height: 2;
	background: #fff;
	border: 1px solid #111;
}

:is(.entry-content, .editor-styles-wrapper) :is(p.is-style-memo, p.is-style-point, p.is-style-caution)::before {
	position: absolute;
	top: -0.9em;
	left: 1em;
	padding: 0.2em 0.9em;
	font-size: 0.85em;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.1em;
	color: #fff;
	background: #111;
}

:is(.entry-content, .editor-styles-wrapper) p.is-style-memo::before {
	content: "プチメモ";
}

:is(.entry-content, .editor-styles-wrapper) p.is-style-point::before {
	content: "ポイント";
}

:is(.entry-content, .editor-styles-wrapper) p.is-style-caution::before {
	content: "注意";
}

:is(.entry-content, .editor-styles-wrapper) p.is-style-caution {
	background: #f7f7f7;
}

/* 導入（上下の線） */
:is(.entry-content, .editor-styles-wrapper) p.is-style-lead {
	padding: 1.2em 0;
	border-top: 2px solid #111;
	border-bottom: 1px solid #ccc;
}

/* グループ「囲み枠」：中に見出しや段落を自由に入れられる */
:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-box {
	margin: 2em 0;
	padding: 1.4em 1.4em;
	border: 2px solid #111;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-box > :last-child {
	margin-bottom: 0;
}

/* グループ「グレー背景」 */
:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-gray {
	margin: 2em 0;
	padding: 1.4em;
	background: #f4f4f4;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-group.is-style-gray > :last-child {
	margin-bottom: 0;
}


/* ---------------------------------------------------------
   5. 画像・表・引用・ボタン
   --------------------------------------------------------- */
:is(.entry-content, .editor-styles-wrapper) img {
	max-width: 100%;
	height: auto;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-image,
:is(.entry-content, .editor-styles-wrapper) figure {
	margin: 2em 0;
}

:is(.entry-content, .editor-styles-wrapper) figcaption {
	margin-top: 0.6em;
	font-size: 12px;
	line-height: 1.6;
	color: #6b6b6b;
	text-align: center;
}

/* 表：スマホは横スクロール */
:is(.entry-content, .editor-styles-wrapper) .wp-block-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

:is(.entry-content, .editor-styles-wrapper) table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	line-height: 1.7;
}

:is(.entry-content, .editor-styles-wrapper) :is(th, td) {
	padding: 0.8em 1em;
	text-align: left;
	vertical-align: top;
	border: 1px solid #ddd;
}

:is(.entry-content, .editor-styles-wrapper) th,
:is(.entry-content, .editor-styles-wrapper) thead td {
	font-weight: 700;
	background: #f4f4f4;
}

/* 引用 */
:is(.entry-content, .editor-styles-wrapper) blockquote,
:is(.entry-content, .editor-styles-wrapper) .wp-block-quote {
	margin: 2em 0;
	padding: 1em 1.4em;
	color: #444;
	background: #f7f7f7;
	border-left: 3px solid #111;
}

:is(.entry-content, .editor-styles-wrapper) blockquote > :last-child {
	margin-bottom: 0;
}

:is(.entry-content, .editor-styles-wrapper) blockquote cite {
	display: block;
	margin-top: 0.6em;
	font-size: 12px;
	font-style: normal;
	color: #6b6b6b;
}

/* ボタン：黒・四角 */
:is(.entry-content, .editor-styles-wrapper) .wp-block-button__link {
	display: inline-block;
	min-width: 260px;
	padding: 1em 2.4em;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-align: center;
	text-decoration: none;
	color: #fff;
	background: #111;
	border: 1px solid #111;
	border-radius: 0;
}

:is(.entry-content, .editor-styles-wrapper) .is-style-outline .wp-block-button__link {
	color: #111;
	background: #fff;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-buttons {
	margin: 2em 0;
}

/* 埋め込み（YouTubeなど） */
:is(.entry-content, .editor-styles-wrapper) .wp-block-embed {
	margin: 2em 0;
}


/* ---------------------------------------------------------
   6. 以前のカスタムHTML記事との互換
   （黒帯h2・ラベル付きボックス・目次・購入ボックスなど）
   --------------------------------------------------------- */
/* inline style の黒帯見出しは、上の h2 デザインと二重にならないよう素の状態に */
.entry-content h2[style] {
	letter-spacing: normal;
}

/* ラベル（プチメモ等）の位置ずれ防止 */
.entry-content div[style*="position:relative"] > span[style*="position:absolute"] {
	line-height: 1.6;
}

/* ボックスの中の最後の段落の余白 */
.entry-content div[style*="border"] > p:last-child {
	margin-bottom: 0;
}

/* inline style のリストは自前の●を使うので、テーマの装飾を付けない */
.entry-content ul[style] li::before,
.entry-content ol[style] li::before {
	content: none;
}

/* 購入ボタン（黒）は下線なし・白文字 */
.entry-content a[style*="background-color:#111111"] {
	color: #fff !important;
	text-decoration: none !important;
}


/* ---------------------------------------------------------
   7. スマホ調整（767px以下）
   --------------------------------------------------------- */
@media (max-width: 767px) {
	:is(.entry-content, .editor-styles-wrapper) {
		font-size: 15.5px;
		line-height: 1.95;
	}

	:is(.entry-content, .editor-styles-wrapper) p {
		margin-bottom: 1.4em;
	}

	:is(.entry-content, .editor-styles-wrapper) h2,
	.entry-content h2[style] {
		margin: 2.8em 0 1.2em !important;
		padding: 0.75em 0.9em !important;
		font-size: 1.12em !important;
	}

	:is(.entry-content, .editor-styles-wrapper) h3,
	.entry-content h3[style] {
		margin: 2.2em 0 0.9em !important;
		font-size: 1.04em !important;
	}

	:is(.entry-content, .editor-styles-wrapper) :is(ul.wp-block-list, ol.wp-block-list),
	.entry-content ul[style*="background-color:#f4f4f4"] {
		padding: 1em 1.05em !important;
	}

	:is(.entry-content, .editor-styles-wrapper) :is(p.is-style-memo, p.is-style-point, p.is-style-caution),
	.entry-content div[style*="position:relative"] {
		padding: 1.6em 1.1em 1em !important;
	}

	/* 以前の記事：目次・購入ボックスの余白を詰める */
	.entry-content div[style*="padding:1.4em 1.6em"] {
		padding: 1.1em !important;
	}

	.entry-content div[style*="padding:2em 1.6em"] {
		padding: 1.6em 1.1em !important;
	}

	/* 以前の記事：画像を画面幅に */
	.entry-content figure img[style*="width:500px"] {
		width: 100% !important;
	}

	/* ボタンは横幅いっぱい・押しやすい高さ */
	:is(.entry-content, .editor-styles-wrapper) .wp-block-button,
	:is(.entry-content, .editor-styles-wrapper) .wp-block-button__link,
	.entry-content a[style*="background-color:#111111"] {
		display: block !important;
		width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box;
	}

	.entry-content a[style*="background-color:#111111"] {
		padding: 1em 0.8em !important;
		font-size: 15px !important;
	}
}
