/* ==========================================================================
   テーマブロックスタイル(段落バリエーション + 投稿一覧/記事詳細テンプレ)
   フロント・ブロックエディタ canvas の両方に読み込まれる。
   ========================================================================== */

/* マーカー(蛍光ペン風)— Wave 93 で Format API に移行。<mark class="mtr-marker-*"> を
   テキスト範囲にラップして使う(段落全体ではない)。
   <mark> はブラウザデフォルトで background-color:#ffff00 が付くので transparent で打ち消す。 */
.mtr-marker-yellow,
.mtr-marker-red,
.mtr-marker-blue {
	background-color: transparent;
	color: inherit;
	padding: 0 0.05em;
	background-repeat: no-repeat;
	background-position: 0 0;
	background-size: 100% 100%;
}
.mtr-marker-yellow {
	background-image: linear-gradient(transparent 60%, #fff59d 60%);
}
.mtr-marker-red {
	background-image: linear-gradient(transparent 60%, #ffcdd2 60%);
}
.mtr-marker-blue {
	background-image: linear-gradient(transparent 60%, #bbdefb 60%);
}

/* 強調枠 */
.wp-block-paragraph.is-style-mtr-emphasis {
	background: var(--wp--preset--color--base, #faf9f7);
	border-left: 4px solid var(--wp--preset--color--primary, #2c5282);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0 0.375rem 0.375rem 0;
}

/* 下線強調(段落幅いっぱいに下線) — Wave 95 で display:inline-block を削除。
   inline-block だと <p> が「最も長い行」幅に縮んで折り返し時の下線が左寄りに
   見える問題があったため、block のまま border-bottom を引く。 */
.wp-block-paragraph.is-style-mtr-underline {
	border-bottom: 2px solid var(--wp--preset--color--primary, #2c5282);
	padding-bottom: 0.375rem;
	margin-bottom: 1rem;
}

/* core/group - セクション(ボックス影) */
.wp-block-group.is-style-mtr-section {
	background: var(--wp--preset--color--white, #ffffff);
	border-radius: 0.5rem;
	box-shadow: var(--wp--preset--shadow--natural, 0 4px 12px rgba(0, 0, 0, 0.1));
	padding: 1.5rem;
}

/* ===== 枠線系 ===== */
.wp-block-paragraph.is-style-mtr-border-solid {
	border: 2px solid var(--wp--preset--color--primary, #2c5282);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0.25rem;
}
.wp-block-paragraph.is-style-mtr-border-dashed {
	border: 2px dashed var(--wp--preset--color--primary, #2c5282);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0.25rem;
}
.wp-block-paragraph.is-style-mtr-border-dotted {
	border: 2px dotted var(--wp--preset--color--muted, #718096);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0.25rem;
}
.wp-block-paragraph.is-style-mtr-border-double {
	border: 5px double var(--wp--preset--color--primary, #2c5282);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
}

/* ===== ボックス系 ===== */
.wp-block-paragraph.is-style-mtr-rounded-box {
	background: var(--wp--preset--color--base, #faf9f7);
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	border-radius: 0.75rem;
}
.wp-block-paragraph.is-style-mtr-shadow-card {
	background: var(--wp--preset--color--white, #ffffff);
	padding: 1.25rem 1.5rem;
	margin: 1.5rem 0;
	border-radius: 0.5rem;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
	border: 1px solid var(--wp--preset--color--border, #e2e8f0);
}

/* ===== 通知系(アイコン付き) ===== */
.wp-block-paragraph.is-style-mtr-info,
.wp-block-paragraph.is-style-mtr-warning,
.wp-block-paragraph.is-style-mtr-success,
.wp-block-paragraph.is-style-mtr-danger {
	padding: 1rem 1.25rem 1rem 3rem;
	margin: 1rem 0;
	border-radius: 0 0.375rem 0.375rem 0;
	border-left: 4px solid;
	position: relative;
	line-height: 1.6;
}
.wp-block-paragraph.is-style-mtr-info::before,
.wp-block-paragraph.is-style-mtr-warning::before,
.wp-block-paragraph.is-style-mtr-success::before,
.wp-block-paragraph.is-style-mtr-danger::before {
	content: '';
	position: absolute;
	left: 1rem;
	top: 1rem;
	width: 1.25rem;
	height: 1.25rem;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
}

.wp-block-paragraph.is-style-mtr-info {
	background: #eff6ff;
	border-left-color: #2563eb;
	color: #1e3a8a;
}
.wp-block-paragraph.is-style-mtr-info::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%232563eb'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 4a1.5 1.5 0 110 3 1.5 1.5 0 010-3zm1.5 12h-3v-1h.75v-4h-.75v-1h2.25v5h.75v1z'/%3E%3C/svg%3E");
}

.wp-block-paragraph.is-style-mtr-warning {
	background: #fffbeb;
	border-left-color: #d97706;
	color: #78350f;
}
.wp-block-paragraph.is-style-mtr-warning::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d97706'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 6l8.5 14.5h-17L12 8zm-1 5h2v4h-2v-4zm0 5h2v2h-2v-2z'/%3E%3C/svg%3E");
}

.wp-block-paragraph.is-style-mtr-success {
	background: #f0fdf4;
	border-left-color: #16a34a;
	color: #14532d;
}
.wp-block-paragraph.is-style-mtr-success::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2316a34a'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm-1 14l-4-4 1.5-1.5L11 13l5.5-5.5L18 9l-7 7z'/%3E%3C/svg%3E");
}

.wp-block-paragraph.is-style-mtr-danger {
	background: #fef2f2;
	border-left-color: #dc2626;
	color: #7f1d1d;
}
.wp-block-paragraph.is-style-mtr-danger::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc2626'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 4a1.5 1.5 0 011.5 1.5v6a1.5 1.5 0 01-3 0v-6A1.5 1.5 0 0112 6zm0 11a1.5 1.5 0 110 3 1.5 1.5 0 010-3z'/%3E%3C/svg%3E");
}

/* ===== 装飾系 ===== */
.wp-block-paragraph.is-style-mtr-quote {
	font-style: italic;
	padding: 1rem 1.5rem 1rem 3rem;
	margin: 1.5rem 0;
	background: var(--wp--preset--color--base, #faf9f7);
	position: relative;
	border-radius: 0.375rem;
	color: var(--wp--preset--color--text, #2d3748);
}
.wp-block-paragraph.is-style-mtr-quote::before {
	content: '\201C';
	position: absolute;
	left: 0.625rem;
	top: -0.25rem;
	font-size: 3.5rem;
	line-height: 1;
	color: var(--wp--preset--color--muted, #718096);
	font-family: Georgia, serif;
	opacity: 0.6;
}

.wp-block-paragraph.is-style-mtr-sticky-note {
	background: #fff9c4;
	padding: 1rem 1.25rem;
	margin: 1rem 0;
	box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.12);
	color: #3e2c1e;
	border-radius: 0 0 0.25rem 0.25rem;
	position: relative;
}
.wp-block-paragraph.is-style-mtr-sticky-note::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 60px;
	height: 18px;
	background: rgba(0, 0, 0, 0.08);
	border-radius: 0 0 4px 4px;
}

/* ==========================================================================
   見出しブロックスタイル(core/heading h1〜h6 共通)
   register_block_style('core/heading', ...) で登録、右サイドバー「スタイル」から選択。
   全 level で同じ CSS が効くよう .wp-block-heading.is-style-mtr-h-* セレクタを使用。
   ========================================================================== */

/* 共通: 余白基本(下線/帯系で見た目が整うよう micro-tune) */
.wp-block-heading[class*="is-style-mtr-h-"] {
	margin-top: 1.6em;
	margin-bottom: 0.8em;
	line-height: 1.4;
}

/* ① 下線(シンプル細線) */
.wp-block-heading.is-style-mtr-h-underline {
	border-bottom: 2px solid var(--wp--preset--color--primary, #635bff);
	padding-bottom: 0.35em;
}

/* ② 二重下線 */
.wp-block-heading.is-style-mtr-h-underline-double {
	border-bottom: 4px double var(--wp--preset--color--primary, #635bff);
	padding-bottom: 0.35em;
}

/* ③ 点線下線 */
.wp-block-heading.is-style-mtr-h-dot {
	border-bottom: 3px dotted var(--wp--preset--color--primary, #635bff);
	padding-bottom: 0.4em;
}

/* ④ ショート下線(SWELL 風)— display 変えずに ::after で左寄せの短い線 */
.wp-block-heading.is-style-mtr-h-slash {
	padding-bottom: 0.5em;
	position: relative;
}
.wp-block-heading.is-style-mtr-h-slash::after {
	content: '';
	display: block;
	width: clamp(40px, 8vw, 64px);
	height: 3px;
	background: var(--wp--preset--color--primary, #635bff);
	border-radius: 2px;
	margin-top: 0.35em;
}

/* ⑤ 左縦線 */
.wp-block-heading.is-style-mtr-h-leftbar {
	border-left: 5px solid var(--wp--preset--color--primary, #635bff);
	padding-left: 0.75em;
}

/* ⑥ 帯背景 */
.wp-block-heading.is-style-mtr-h-band {
	background: var(--wp--preset--color--primary, #635bff);
	color: #ffffff;
	padding: 0.5em 0.85em;
	border-radius: 6px;
}

/* ⑦ 帯背景+左バー */
.wp-block-heading.is-style-mtr-h-band-left {
	background: #f1f5f9;
	border-left: 5px solid var(--wp--preset--color--primary, #635bff);
	padding: 0.5em 0.85em;
	border-radius: 0 6px 6px 0;
}

/* ⑧ 枠線ボックス */
.wp-block-heading.is-style-mtr-h-box {
	border: 2px solid var(--wp--preset--color--primary, #635bff);
	padding: 0.5em 0.85em;
	border-radius: 6px;
}

/* ==========================================================================
   投稿一覧テンプレ(index.html)— SWELL/XWRITE 風カードグリッド
   ========================================================================== */

.mtr-archive {
	padding-top: clamp(1.5rem, 4vw, 3rem);
	padding-bottom: clamp(2rem, 6vw, 4rem);
}

/* query block 内の post-template に grid を強制(displayLayout.flex は WP コアが flex で出すが、
   gap だけ補正) */
.mtr-archive .wp-block-post-template.is-layout-flex {
	gap: 1.75rem !important;
}

/* === カード本体 === */
.mtr-card {
	background: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}
.mtr-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}

/* サムネイル */
.mtr-card__thumb {
	margin: 0 !important;
	overflow: hidden;
	background: #f3f4f6;
}
.mtr-card__thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.mtr-card:hover .mtr-card__thumb img {
	transform: scale(1.04);
}

/* アイキャッチが無いとき用のフォールバック */
.mtr-card:not(:has(.mtr-card__thumb img))::before,
.mtr-card:has(.mtr-card__thumb:empty)::before {
	content: '';
	display: block;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* カード本文 */
.mtr-card__body {
	padding: clamp(0.75rem, 3vw, 1rem) clamp(0.9rem, 3vw, 1.25rem) clamp(1rem, 3.5vw, 1.5rem) !important;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mtr-card__meta {
	gap: 0.75rem !important;
	font-size: 0.8125rem;
	color: #64748b;
	margin: 0 0 0.25rem !important;
	align-items: center;
}

.mtr-card__cat,
.mtr-card__cat a {
	color: #635bff;
	font-weight: 600;
	text-decoration: none;
	letter-spacing: 0.02em;
}
.mtr-card__cat a:hover {
	text-decoration: underline;
}

.mtr-card__date {
	color: #94a3b8;
	font-variant-numeric: tabular-nums;
}

.mtr-card__title {
	font-size: clamp(0.95rem, 2.4vw, 1.0625rem);
	line-height: 1.5;
	margin: 0 0 0.25rem !important;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: 0.01em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mtr-card__title a {
	color: inherit;
	text-decoration: none;
}
.mtr-card__title a:hover {
	color: #635bff;
}

.mtr-card__excerpt {
	font-size: 0.875rem;
	line-height: 1.7;
	color: #475569;
	margin: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mtr-card__excerpt p {
	margin: 0;
}

/* ページネーション */
.mtr-pagination {
	margin-top: 2.5rem !important;
	gap: clamp(0.25rem, 1.5vw, 0.5rem) !important;
}
.mtr-pagination .wp-block-query-pagination-numbers,
.mtr-pagination .page-numbers {
	display: inline-flex;
	gap: 0.25rem;
	font-size: 0.95rem;
}
.mtr-pagination .page-numbers {
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	border-radius: 6px;
	color: #475569;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	transition: background 0.15s ease, color 0.15s ease;
}
.mtr-pagination .page-numbers:hover {
	background: #e0e7ff;
	color: #635bff;
}
.mtr-pagination .page-numbers.current {
	background: #635bff;
	color: #ffffff;
}

.mtr-no-results {
	padding: 3rem 1rem;
	color: #64748b;
}

/* === レスポンシブ === */
@media (max-width: 960px) {
	.mtr-archive .wp-block-post-template.is-layout-flex {
		gap: 1.25rem !important;
	}
	.mtr-card__title {
		font-size: 1rem;
	}
}

/* ==========================================================================
   記事詳細テンプレ(single.html)— SWELL/XWRITE 風クリーン記事
   ========================================================================== */

.mtr-single {
	padding-top: clamp(1.5rem, 4vw, 3rem);
	padding-bottom: clamp(2rem, 6vw, 4rem);
}

.mtr-single__head {
	margin-bottom: 1.5rem !important;
}

.mtr-single__meta {
	gap: 1rem !important;
	font-size: 0.875rem;
	color: #64748b;
	margin: 0 0 0.75rem !important;
	align-items: center;
}

.mtr-single__cat,
.mtr-single__cat a {
	color: #635bff;
	font-weight: 600;
	text-decoration: none;
	letter-spacing: 0.02em;
}
.mtr-single__cat a:hover {
	text-decoration: underline;
}

.mtr-single__date,
.mtr-single__modified {
	color: #94a3b8;
	font-variant-numeric: tabular-nums;
}
.mtr-single__modified::before {
	content: '更新 ';
	color: #cbd5e1;
	margin-right: 0.15em;
}

.mtr-single__title {
	font-size: clamp(1.5rem, 4vw, 2.25rem) !important;
	line-height: 1.4;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: 0.01em;
	margin: 0 !important;
}

/* アイキャッチ */
.mtr-single__featured {
	margin: 0 0 clamp(1.5rem, 4vw, 2.5rem) !important;
	border-radius: 12px;
	overflow: hidden;
}
.mtr-single__featured img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}

/* 本文 */
.mtr-single__content {
	font-size: 1.0625rem;
	line-height: 1.9;
	color: #1e293b;
}
.mtr-single__content > * + * {
	margin-top: 1.1em;
}
.mtr-single__content h2 {
	font-size: clamp(1.25rem, 2.4vw, 1.5rem);
	margin-top: 2.5em;
	margin-bottom: 1em;
	padding-bottom: 0.4em;
	border-bottom: 2px solid #e5e7eb;
	font-weight: 700;
}
.mtr-single__content h3 {
	font-size: clamp(1.125rem, 2vw, 1.25rem);
	margin-top: 2em;
	margin-bottom: 0.75em;
	padding-left: 0.6em;
	border-left: 4px solid #635bff;
	font-weight: 700;
}
.mtr-single__content h4 {
	font-size: 1.0625rem;
	margin-top: 1.75em;
	margin-bottom: 0.5em;
	font-weight: 700;
	color: #334155;
}
.mtr-single__content a {
	color: #635bff;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
.mtr-single__content a:hover {
	color: #4f46e5;
}

/* タグ */
.mtr-single__tags {
	gap: 0.5rem !important;
	margin: 2rem 0 0 !important;
	font-size: 0.85rem;
}
.mtr-single__tags .wp-block-post-terms a {
	display: inline-block;
	padding: 0.25rem 0.7rem;
	background: #f1f5f9;
	border-radius: 999px;
	color: #475569;
	text-decoration: none;
	margin-right: 0.25rem;
	transition: background 0.15s ease, color 0.15s ease;
}
.mtr-single__tags .wp-block-post-terms a:hover {
	background: #e0e7ff;
	color: #635bff;
}

/* コメント */
.mtr-single__comments {
	margin-top: 3rem !important;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
}
.mtr-single__comments-heading {
	font-size: 1.125rem !important;
	font-weight: 700;
	margin: 0 0 1rem !important;
	color: #0f172a;
}
.mtr-single__comments .wp-block-comments {
	font-size: 0.9375rem;
	color: #334155;
}
