/**
 * iPledge キャッチ＋リード見出し（.ipledge-htag）
 * 左縦線は .ipledge-htag__bar（SWELL の h2::before は使わない）
 */

.post_content .ipledge-htag,
.p-blogParts .ipledge-htag,
.editor-styles-wrapper .ipledge-htag {
	--ipledge-htag-bar-w: 4px;
	--ipledge-htag-bar-h: 1.35em;
	--ipledge-htag-gap-x: 12px;
	--ipledge-htag-gap-y: 8px;
	--ipledge-htag-catch-size: clamp(1.5rem, 4.5vw, 2.25rem);
	--ipledge-htag-lead-size: clamp(0.95rem, 2.5vw, 1.125rem);
	--ipledge-htag-bar-color: var(--color_htag, #008030);
	box-sizing: border-box;
	width: 100%;
	margin: 0 auto 8px;
}

.post_content .ipledge-htag.is-h3,
.p-blogParts .ipledge-htag.is-h3,
.editor-styles-wrapper .ipledge-htag.is-h3 {
	--ipledge-htag-bar-w: 3px;
	--ipledge-htag-bar-h: 1.2em;
	--ipledge-htag-gap-x: 10px;
	--ipledge-htag-gap-y: 6px;
	--ipledge-htag-catch-size: clamp(1.25rem, 3.8vw, 1.875rem);
	--ipledge-htag-lead-size: clamp(0.875rem, 2.2vw, 1rem);
}

/* 中央配置ラッパー */
.post_content .ipledge-htag__inner,
.p-blogParts .ipledge-htag__inner,
.editor-styles-wrapper .ipledge-htag__inner,
.post_content .ipledge-htag > .wp-block-group__inner-container,
.p-blogParts .ipledge-htag > .wp-block-group__inner-container,
.editor-styles-wrapper .ipledge-htag > .wp-block-group__inner-container {
	display: grid !important;
	grid-template-columns: var(--ipledge-htag-bar-w) minmax(0, max-content);
	grid-template-rows: auto auto;
	column-gap: var(--ipledge-htag-gap-x);
	row-gap: var(--ipledge-htag-gap-y);
	justify-content: center;
	justify-items: center;
	width: max-content !important;
	max-width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
	text-align: left;
}

/* 左の縦線（キャッチ1行目の高さのみ） */
.post_content .ipledge-htag__bar,
.p-blogParts .ipledge-htag__bar,
.editor-styles-wrapper .ipledge-htag__bar {
	grid-column: 1;
	grid-row: 1;
	align-self: center;
	display: block;
	width: var(--ipledge-htag-bar-w);
	height: var(--ipledge-htag-bar-h);
	background: var(--ipledge-htag-bar-color);
	border-radius: 2px;
	flex-shrink: 0;
}

/* キャッチ文 */
.post_content .ipledge-htag__catch-text,
.post_content .ipledge-htag .ipledge-member__heading,
.p-blogParts .ipledge-htag__catch-text,
.p-blogParts .ipledge-htag .ipledge-member__heading,
.editor-styles-wrapper .ipledge-htag__catch-text,
.editor-styles-wrapper .ipledge-htag .ipledge-member__heading,
.post_content .ipledge-htag > .wp-block-group__inner-container > :is(h2, h3).wp-block-heading,
.p-blogParts .ipledge-htag > .wp-block-group__inner-container > :is(h2, h3).wp-block-heading,
.editor-styles-wrapper .ipledge-htag > .wp-block-group__inner-container > :is(h2, h3).wp-block-heading {
	grid-column: 2;
	grid-row: 1;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-top: none !important;
	border-bottom: none !important;
	background: none !important;
	box-shadow: none !important;
	font-size: var(--ipledge-htag-catch-size) !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: #111 !important;
	text-align: left !important;
	width: auto !important;
	max-width: 100%;
}

.post_content .ipledge-htag__catch-text::before,
.post_content .ipledge-htag__catch-text::after,
.post_content .ipledge-htag .ipledge-member__heading::before,
.post_content .ipledge-htag .ipledge-member__heading::after,
.p-blogParts .ipledge-htag__catch-text::before,
.p-blogParts .ipledge-htag__catch-text::after,
.editor-styles-wrapper .ipledge-htag__catch-text::before,
.editor-styles-wrapper .ipledge-htag__catch-text::after,
.post_content .ipledge-htag :is(h2, h3).wp-block-heading::before,
.post_content .ipledge-htag :is(h2, h3).wp-block-heading::after,
.p-blogParts .ipledge-htag :is(h2, h3).wp-block-heading::before,
.p-blogParts .ipledge-htag :is(h2, h3).wp-block-heading::after,
.editor-styles-wrapper .ipledge-htag :is(h2, h3).wp-block-heading::before,
.editor-styles-wrapper .ipledge-htag :is(h2, h3).wp-block-heading::after {
	content: none !important;
	display: none !important;
}

/* リード（キャッチの下・中央） */
.post_content .ipledge-htag__lead,
.post_content .ipledge-htag :is(p.is-style-ipledge_lead, p.ipledge-member__lead),
.p-blogParts .ipledge-htag__lead,
.p-blogParts .ipledge-htag :is(p.is-style-ipledge_lead, p.ipledge-member__lead),
.editor-styles-wrapper .ipledge-htag__lead,
.editor-styles-wrapper .ipledge-htag :is(p.is-style-ipledge_lead, p.ipledge-member__lead),
.post_content .ipledge-htag > .wp-block-group__inner-container > p.is-style-ipledge_lead,
.p-blogParts .ipledge-htag > .wp-block-group__inner-container > p.is-style-ipledge_lead,
.editor-styles-wrapper .ipledge-htag > .wp-block-group__inner-container > p.is-style-ipledge_lead {
	grid-column: 2;
	grid-row: 2;
	justify-self: center;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	text-align: center !important;
	font-size: var(--ipledge-htag-lead-size) !important;
	font-weight: 400 !important;
	line-height: 1.5 !important;
	color: #666 !important;
	width: auto !important;
	max-width: 100%;
}

/* グループブロック：bar 用スペーサー（パターン互換） */
.post_content .ipledge-htag > .wp-block-group__inner-container::before,
.p-blogParts .ipledge-htag > .wp-block-group__inner-container::before,
.editor-styles-wrapper .ipledge-htag > .wp-block-group__inner-container::before {
	content: "" !important;
	display: block !important;
	grid-column: 1;
	grid-row: 1;
	width: var(--ipledge-htag-bar-w) !important;
	height: var(--ipledge-htag-bar-h) !important;
	background: var(--ipledge-htag-bar-color) !important;
	border: none !important;
	border-radius: 2px;
	margin: 0 !important;
	padding: 0 !important;
	position: static !important;
}

/* 旧構造フォールバック：inner なし + h2 + p */
.post_content .ipledge-htag:not(:has(.ipledge-htag__inner)) > :is(h2, h3).wp-block-heading,
.p-blogParts .ipledge-htag:not(:has(.ipledge-htag__inner)) > :is(h2, h3).wp-block-heading,
.editor-styles-wrapper .ipledge-htag:not(:has(.ipledge-htag__inner)) > :is(h2, h3).wp-block-heading {
	grid-column: 2;
	grid-row: 1;
}

.post_content .ipledge-htag:not(:has(.ipledge-htag__inner)) > p.is-style-ipledge_lead,
.p-blogParts .ipledge-htag:not(:has(.ipledge-htag__inner)) > p.is-style-ipledge_lead,
.editor-styles-wrapper .ipledge-htag:not(:has(.ipledge-htag__inner)) > p.is-style-ipledge_lead {
	grid-column: 2;
	grid-row: 2;
}

.post_content .ipledge-htag:not(:has(.ipledge-htag__inner)),
.p-blogParts .ipledge-htag:not(:has(.ipledge-htag__inner)),
.editor-styles-wrapper .ipledge-htag:not(:has(.ipledge-htag__inner)) {
	display: grid !important;
	grid-template-columns: var(--ipledge-htag-bar-w) minmax(0, max-content);
	grid-template-rows: auto auto;
	column-gap: var(--ipledge-htag-gap-x);
	row-gap: var(--ipledge-htag-gap-y);
	justify-content: center;
	justify-items: center;
	width: max-content !important;
	max-width: 100% !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.post_content .ipledge-htag:not(:has(.ipledge-htag__inner))::before,
.p-blogParts .ipledge-htag:not(:has(.ipledge-htag__inner))::before,
.editor-styles-wrapper .ipledge-htag:not(:has(.ipledge-htag__inner))::before {
	content: "" !important;
	display: block !important;
	grid-column: 1;
	grid-row: 1;
	align-self: center;
	width: var(--ipledge-htag-bar-w) !important;
	height: var(--ipledge-htag-bar-h) !important;
	background: var(--ipledge-htag-bar-color) !important;
	border-radius: 2px;
}

/* エディター余白リセット */
.editor-styles-wrapper .ipledge-htag .wp-block-heading,
.editor-styles-wrapper .ipledge-htag .wp-block-paragraph,
.editor-styles-wrapper .ipledge-htag [data-type="core/heading"],
.editor-styles-wrapper .ipledge-htag [data-type="core/paragraph"] {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
