/*
Theme Name:   Hello Elementor Child (Marunaka)
Theme URI:    https://c-marunaka.com/
Description:  有限会社マルナカ様 Hello Elementor 子テーマ。投稿本文の共通デザインとブロックパターンを管理します。
Author:       N-STYLE
Template:     hello-elementor
Version:      1.0.0
Requires at least: 6.5
Text Domain:  hello-elementor-child
*/

/* ==========================================================
   0. カラー（商品紹介ページと同じパレット）
   ========================================================== */
:root {
	--mn-green:   #007A3D;
	--mn-green2:  #00A650;
	--mn-green-bg:#EEF7F1;
	--mn-yellow:  #F1BF44;
	--mn-beige:   #F7F5EF;
	--mn-ink:     #333333;
	--mn-sub:     #777777;
	--mn-line:    #E3E3E3;
}

/* ==========================================================
   1. 投稿詳細ページの枠（公開ページのみ／商品紹介は除外）
   ========================================================== */
body.single-post .site-main:not(.category-products) {
	max-width: 800px;
	margin-inline: auto;
	padding: 48px 20px 88px;
}

body.single-post .site-main:not(.category-products) .page-header .entry-title {
	margin: 0 0 8px;
	font-size: clamp(22px, 3.6vw, 32px);
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .02em;
	color: var(--mn-ink);
}

/* 日付・カテゴリー */
.mn-post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	margin-bottom: 12px;
	font-size: 14px;
	color: var(--mn-sub);
}
.mn-post-meta__cat {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--mn-green2);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
}

/* アイキャッチ（16:9 に自動トリミング） */
.mn-post-thumb {
	margin: 24px 0 40px;
}
.mn-post-thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
}

/* ==========================================================
   2. 本文（公開ページ ＋ 投稿編集画面で共通）
   ========================================================== */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) {
	color: var(--mn-ink);
	font-size: 17px;
	line-height: 1.9;
	letter-spacing: .03em;
	overflow-wrap: anywhere;
}

/* 段落 */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) p {
	margin-block: 0 1.6em;
}

/* 太字 = 黄色マーカー */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) :is(p, li) > strong {
	font-weight: 700;
	background: linear-gradient(transparent 62%, rgba(241, 191, 68, .45) 62%);
}

/* H2 */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) h2 {
	margin-block: 2.8em 1.2em;
	padding: .7em 1em;
	border-left: 6px solid var(--mn-green2);
	border-radius: 0 6px 6px 0;
	background: var(--mn-green-bg);
	color: var(--mn-ink);
	font-size: 1.35em;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: .03em;
}

/* H3 */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) h3 {
	position: relative;
	margin-block: 2.2em 1em;
	padding-bottom: .5em;
	border-bottom: 2px solid var(--mn-line);
	color: var(--mn-ink);
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.5;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) h3::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -2px;
	width: 3em;
	height: 2px;
	background: var(--mn-green2);
}

:is(body.single-post .site-main:not(.category-products) .page-content) > :is(h2, h3):first-child {
	margin-top: 0;
}

/* リンク */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) a:not(.wp-block-button__link) {
	color: var(--mn-green);
	text-decoration: underline;
	text-underline-offset: 3px;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) a:not(.wp-block-button__link):hover {
	opacity: .75;
}

/* リスト */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) :is(ul, ol):not(.wp-block-gallery) {
	margin-block: 0 1.6em;
	padding-left: 1.5em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) li {
	margin-bottom: .4em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) ul li::marker {
	color: var(--mn-green2);
}

/* 画像：はみ出し防止 ＋ 横長(16:9)にそろえる */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) img {
	max-width: 100%;
	height: auto;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-image {
	margin-block: 2em 2.4em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 8px;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) :is(figcaption, .wp-element-caption) {
	margin-top: .6em;
	color: var(--mn-sub);
	font-size: 13px;
	line-height: 1.6;
	text-align: center;
}

/* 公開ページのみ：ブラウザ既定の figure 左右余白を消す */
body.single-post .site-main:not(.category-products) .page-content figure {
	margin-inline: 0;
}

/* 埋め込み（YouTube など） */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-embed {
	margin-block: 2em 2.4em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) iframe {
	max-width: 100%;
}

/* 区切り線 */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) hr.wp-block-separator {
	width: 100%;
	margin: 3em auto;
	border: 0;
	border-top: 1px solid var(--mn-line);
	opacity: 1;
}

/* 引用 */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) blockquote {
	margin-block: 2em;
	padding: 1em 1.4em;
	border-left: 4px solid var(--mn-line);
	background: var(--mn-beige);
	color: #555;
}

/* 情報ボックス（お知らせパターンの「日時・場所」欄） */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .mn-infobox {
	margin-block: 2em 2.4em;
	padding: 1.4em 1.6em;
	border-radius: 8px;
	background: var(--mn-beige);
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .mn-infobox p {
	margin-block: 0 .4em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .mn-infobox p:last-child {
	margin-bottom: 0;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .mn-infobox strong {
	background: none;
	color: var(--mn-green);
}

/* ボタン */
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-buttons {
	margin-block: 2.4em;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-button__link {
	display: inline-block;
	padding: .9em 2.6em;
	border-radius: 999px;
	background: var(--mn-green2);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(0, 122, 61, .2);
	transition: background-color .2s, transform .2s;
}
:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) .wp-block-button__link:hover {
	background: var(--mn-green);
	color: #fff;
	transform: translateY(-2px);
}

/* ==========================================================
   3. スマホ（767px以下）
   ========================================================== */
@media (max-width: 767px) {
	body.single-post .site-main:not(.category-products) {
		padding: 32px 20px 64px;
	}
	.mn-post-thumb {
		margin: 20px 0 32px;
	}
	:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) {
		font-size: 16px;
		line-height: 1.85;
	}
	:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) h2 {
		font-size: 1.25em;
		padding: .6em .8em;
	}
	:is(body.single-post .site-main:not(.category-products) .page-content, .editor-styles-wrapper) :is(.wp-block-button, .wp-block-button__link) {
		width: 100%;
		text-align: center;
	}
}

/* ==========================================================
   4. 編集画面のみ：本文の幅を公開ページとそろえる
   ========================================================== */
.editor-styles-wrapper .is-root-container > * {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
}
