/**
 * Blockman ブロック用スタイル（フロント側）
 * register_block_style / 独自ブロックのフロント表示を担当。
 */

/* ============================================================
 * ボタン（SWELL 風 / core/button のブロックスタイル）
 * ============================================================ */
.wp-block-button.is-style-blockman-fill .wp-block-button__link {
	background: var(--bm-accent);
	color: #fff;
	border-radius: 999px;
	padding: 14px 36px;
	font-weight: 700;
	box-shadow: 0 4px 0 rgba(0, 0, 0, .12);
	transition: transform .15s ease, box-shadow .15s ease;
}
.wp-block-button.is-style-blockman-fill .wp-block-button__link:hover {
	transform: translateY(2px);
	box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}

.wp-block-button.is-style-blockman-outline .wp-block-button__link {
	background: transparent;
	color: var(--bm-accent);
	border: 2px solid var(--bm-accent);
	border-radius: 999px;
	padding: 12px 34px;
	font-weight: 700;
}
.wp-block-button.is-style-blockman-outline .wp-block-button__link:hover {
	background: var(--bm-accent);
	color: #fff;
}

.wp-block-button.is-style-blockman-shiny .wp-block-button__link {
	position: relative;
	overflow: hidden;
	background: var(--bm-accent);
	color: #fff;
	border-radius: 999px;
	padding: 14px 36px;
	font-weight: 700;
}
.wp-block-button.is-style-blockman-shiny .wp-block-button__link::after {
	content: "";
	position: absolute;
	top: 0;
	left: -120%;
	width: 60%;
	height: 100%;
	background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .5), transparent);
	transform: skewX(-20deg);
	animation: bm-shine 3s ease-in-out infinite;
}
@keyframes bm-shine {
	0%, 60% { left: -120%; }
	100% { left: 130%; }
}

/* ============================================================
 * キャプションボックス（core/group のブロックスタイル）
 * ============================================================ */
.wp-block-group.is-style-blockman-caption-box {
	position: relative;
	margin-top: 2.4em;
	padding: 1.6em 1.4em 1.2em;
	border: 2px solid var(--bm-accent);
	border-radius: var(--bm-radius);
	background: #fff;
}
.wp-block-group.is-style-blockman-caption-box > .bm-caption-label,
.wp-block-group.is-style-blockman-caption-box > p:first-child.bm-caption-label {
	position: absolute;
	top: -0.9em;
	left: 1em;
	margin: 0;
	padding: 2px 14px;
	background: var(--bm-accent);
	color: #fff;
	font-size: .8rem;
	font-weight: 700;
	border-radius: 4px;
	line-height: 1.6;
}

.wp-block-group.is-style-blockman-caption-box-accent {
	margin-top: 1.6em;
	padding: 1.4em;
	border-radius: var(--bm-radius);
	background: color-mix(in srgb, var(--bm-accent) 10%, #fff);
	border-left: 6px solid var(--bm-accent);
}

/* ============================================================
 * リッチカラム（core/columns のブロックスタイル）
 * ============================================================ */
.wp-block-columns.is-style-blockman-rich-columns {
	gap: 24px;
}
.wp-block-columns.is-style-blockman-rich-columns > .wp-block-column {
	background: #fff;
	border-radius: var(--bm-radius);
	padding: 24px;
	box-shadow: var(--bm-shadow);
	border-top: 4px solid var(--bm-accent);
}

/* ============================================================
 * 投稿リストブロック（blockman/post-list）
 * カラム数は CSS 変数で制御（PC / SP を出し分け）
 * ============================================================ */
.bm-post-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 20px;
	/* スマホ（デフォルト）。カラム数はクラスで指定 */
	grid-template-columns: repeat(1, minmax(0, 1fr));
}
.bm-post-list.bm-pl--sp-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.bm-post-list.bm-pl--sp-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bm-post-list.bm-pl--sp-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.bm-post-list__item {
	margin: 0;
}

/* カード本体（リンクではなくコンテナ。中の各リンクが個別に動作する） */
.bm-post-list__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: #fff;
	border-radius: var(--bm-radius);
	border: var(--bm-border);
	overflow: hidden;
	box-shadow: var(--bm-shadow);
	color: var(--bm-text);
}

.bm-post-list__thumb-link {
	display: block;
}
.bm-post-list__thumb img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
	transition: transform .3s ease;
}
.bm-post-list__thumb-link:hover img {
	transform: scale(1.04);
}

.bm-post-list__body {
	display: block;
	padding: 14px 16px 18px;
}

.bm-post-list__title-link {
	display: block;
	color: var(--bm-text);
}
.bm-post-list__title {
	display: block;
	font-weight: 600;
	line-height: 1.45;
}
.bm-post-list__title-link:hover .bm-post-list__title {
	color: var(--bm-accent);
}

.bm-post-list__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 6px;
	font-size: .78rem;
	color: rgba(0, 0, 0, .5);
}

.bm-post-list__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}
.bm-post-list__cat {
	display: inline-block;
	padding: 2px 10px;
	font-size: .72rem;
	line-height: 1.6;
	color: #fff;
	background: var(--bm-accent);
	border-radius: 999px;
	transition: opacity .2s ease;
}
.bm-post-list__cat:hover {
	color: #fff;
	opacity: .82;
}

.bm-post-list__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin-top: 6px;
}
.bm-post-list__tag {
	font-size: .74rem;
	color: rgba(0, 0, 0, .55);
}
.bm-post-list__tag:hover {
	color: var(--bm-accent);
}

.bm-post-list__excerpt-link {
	display: block;
	color: rgba(0, 0, 0, .7);
}
.bm-post-list__excerpt {
	display: block;
	margin-top: 8px;
	font-size: .85rem;
	line-height: 1.7;
}

/* 本文の表示／非表示（PC・SP 出し分け） */
.bm-post-list.bm-pl--hide-body-sp .bm-post-list__excerpt {
	display: none;
}

/* ===== レイアウト：サムネイルのプレースホルダ ===== */
.bm-post-list__thumb--placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #ececec;
}

/* ===== レイアウト：リスト型（左サムネ＋右に情報） ===== */
.bm-pl--layout-list .bm-post-list__card {
	flex-direction: row;
	align-items: flex-start;
}
.bm-pl--layout-list .bm-post-list__thumb-link {
	flex: 0 0 38%;
	max-width: 38%;
}
.bm-pl--layout-list .bm-post-list__thumb {
	display: block;
}
.bm-pl--layout-list .bm-post-list__thumb img,
.bm-pl--layout-list .bm-post-list__thumb--placeholder {
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	min-height: 0;
}
.bm-pl--layout-list .bm-post-list__body {
	flex: 1 1 auto;
	min-width: 0;
}

/* ===== レイアウト：サムネイル型（画像のみ） ===== */
.bm-pl--layout-thumbnail .bm-post-list__card {
	border: none;
	box-shadow: none;
	background: transparent;
}

/* ===== 狭いウィジェット内（サイドバー等）に投稿リストを置いた場合はコンパクト化 =====
   ── 1カラム固定・サムネイルの高さを固定して縦長化を防ぐ */
.widget .bm-post-list,
.site-sidebar .bm-post-list,
.drawer-widgets .bm-post-list,
.footer-widgets .bm-post-list {
	grid-template-columns: 1fr;
	gap: 14px;
}
.widget .bm-post-list .bm-post-list__thumb img,
.site-sidebar .bm-post-list .bm-post-list__thumb img,
.drawer-widgets .bm-post-list .bm-post-list__thumb img,
.footer-widgets .bm-post-list .bm-post-list__thumb img,
.widget .bm-post-list .bm-post-list__thumb--placeholder,
.site-sidebar .bm-post-list .bm-post-list__thumb--placeholder,
.drawer-widgets .bm-post-list .bm-post-list__thumb--placeholder,
.footer-widgets .bm-post-list .bm-post-list__thumb--placeholder {
	aspect-ratio: 16 / 9;
	height: auto;
	min-height: 0;
}
.widget .bm-post-list__body,
.site-sidebar .bm-post-list__body,
.drawer-widgets .bm-post-list__body,
.footer-widgets .bm-post-list__body {
	padding: 10px 12px 12px;
}
.widget .bm-post-list__title,
.site-sidebar .bm-post-list__title,
.drawer-widgets .bm-post-list__title,
.footer-widgets .bm-post-list__title {
	font-size: .9rem;
}

/* ===== レイアウト：テキスト型（画像なし・タイトル＋日付/カテゴリ） ===== */
.bm-pl--layout-text .bm-post-list__card {
	border: none;
	box-shadow: none;
	background: transparent;
	border-radius: 0;
}
.bm-pl--layout-text .bm-post-list__body {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 14px;
	row-gap: 4px;
	padding: 14px 2px;
	border-bottom: 1px solid rgba(0, 0, 0, .1);
}
/* 日付・カテゴリを1行目に、タイトル・本文を改行して下に */
.bm-pl--layout-text .bm-post-list__meta { order: 1; margin-top: 0; }
.bm-pl--layout-text .bm-post-list__cats { order: 2; margin-top: 0; gap: 4px; }
.bm-pl--layout-text .bm-post-list__title-link { order: 3; flex-basis: 100%; }
.bm-pl--layout-text .bm-post-list__tags { order: 4; flex-basis: 100%; margin-top: 4px; }
.bm-pl--layout-text .bm-post-list__excerpt-link { order: 5; flex-basis: 100%; }
.bm-pl--layout-text .bm-post-list__title {
	font-size: 1.02rem;
	line-height: 1.5;
}
.bm-pl--layout-text .bm-post-list__excerpt { margin-top: 4px; }
/* カテゴリはピルではなく控えめなテキスト表示に */
.bm-pl--layout-text .bm-post-list__cat {
	padding: 0;
	color: rgba(0, 0, 0, .55);
	background: transparent;
	border-radius: 0;
	font-size: .78rem;
}
.bm-pl--layout-text .bm-post-list__cat:hover {
	color: var(--bm-accent);
	opacity: 1;
}
/* 日付・カテゴリにアイコン（Font Awesome） */
.bm-pl--layout-text .bm-post-list__meta .bm-meta-date::before {
	content: "\f017";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	margin-right: 5px;
}
.bm-pl--layout-text .bm-post-list__cats::before {
	content: "\f07b";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	margin-right: 2px;
	color: rgba(0, 0, 0, .45);
	font-size: .78rem;
}

/* MORE リンク */
.bm-post-list__more {
	margin-top: 24px;
	text-align: center;
}
.bm-post-list__more-link {
	display: inline-block;
	padding: 12px 36px;
	border: 2px solid var(--bm-accent);
	border-radius: 999px;
	color: var(--bm-accent);
	font-weight: 700;
}
.bm-post-list__more-link:hover {
	background: var(--bm-accent);
	color: #fff;
}

@media (min-width: 783px) {
	.bm-post-list.bm-pl--pc-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
	.bm-post-list.bm-pl--pc-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bm-post-list.bm-pl--pc-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	/* PC では SP 用の非表示を一旦解除し、PC 用の指定を適用 */
	.bm-post-list.bm-pl--hide-body-sp .bm-post-list__excerpt {
		display: block;
	}
	.bm-post-list.bm-pl--hide-body-pc .bm-post-list__excerpt {
		display: none;
	}
}

/* ============================================================
 * タブブロック（blockman/tabs ＋ blockman/tab）
 * ============================================================ */
.bm-tabs {
	margin: 2em 0;
	/* タブの色（ブロック個別指定が無ければアクセントカラー） */
	--bm-tab: var(--bm-tabs-accent, var(--bm-accent));
}
/* タブ幅を均等割 */
.bm-tabs--equal .bm-tabs__nav .bm-tabs__tab {
	flex: 1 1 0;
	text-align: center;
	justify-content: center;
}
.bm-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 2px solid var(--bm-tab);
}
.bm-tabs__tab {
	padding: 10px 20px;
	background: rgba(0, 0, 0, .04);
	border-radius: 6px 6px 0 0;
	cursor: pointer;
	font-weight: 600;
	border: 0;
	color: var(--bm-text);
	transition: background .2s ease, color .2s ease;
}
.bm-tabs__tab:hover {
	background: rgba(0, 0, 0, .08);
}
.bm-tabs__tab.is-active,
.bm-tabs__tab[aria-selected="true"] {
	background: var(--bm-tab);
	color: #fff;
}
.bm-tabs__panel {
	display: none;
	padding: 20px 4px;
}
.bm-tabs__panel.is-active {
	display: block;
}

/* --- タブデザイン: アンダーライン --- */
.bm-tabs.is-style-underline .bm-tabs__nav {
	gap: 6px;
	border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.bm-tabs.is-style-underline .bm-tabs__tab {
	position: relative;
	background: transparent;
	border-radius: 0;
	padding: 12px 18px;
	color: var(--bm-text);
}
.bm-tabs.is-style-underline .bm-tabs__tab:hover {
	background: transparent;
	color: var(--bm-tab);
}
.bm-tabs.is-style-underline .bm-tabs__tab.is-active,
.bm-tabs.is-style-underline .bm-tabs__tab[aria-selected="true"] {
	background: transparent;
	color: var(--bm-tab);
}
.bm-tabs.is-style-underline .bm-tabs__tab.is-active::after,
.bm-tabs.is-style-underline .bm-tabs__tab[aria-selected="true"]::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	background: var(--bm-tab);
}

/* --- タブデザイン: ピル --- */
.bm-tabs.is-style-pills .bm-tabs__nav {
	gap: 8px;
	border-bottom: 0;
}
.bm-tabs.is-style-pills .bm-tabs__tab {
	background: rgba(0, 0, 0, .05);
	border-radius: 999px;
	padding: 8px 20px;
}
.bm-tabs.is-style-pills .bm-tabs__tab.is-active,
.bm-tabs.is-style-pills .bm-tabs__tab[aria-selected="true"] {
	background: var(--bm-tab);
	color: #fff;
}

/* --- タブデザイン: ボックス --- */
.bm-tabs.is-style-box .bm-tabs__nav {
	gap: 6px;
	border-bottom: 0;
}
.bm-tabs.is-style-box .bm-tabs__tab {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, .15);
	border-radius: var(--bm-radius);
}
.bm-tabs.is-style-box .bm-tabs__tab.is-active,
.bm-tabs.is-style-box .bm-tabs__tab[aria-selected="true"] {
	background: var(--bm-tab);
	border-color: var(--bm-tab);
	color: #fff;
}
.bm-tabs.is-style-box .bm-tabs__panel.is-active {
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: var(--bm-radius);
	padding: 20px;
	margin-top: 8px;
}

/* --- タブデザイン: カード（タブとパネルを一体化） --- */
.bm-tabs.is-style-card .bm-tabs__nav {
	gap: 4px;
	border-bottom: 0;
	position: relative;
	z-index: 1;
}
.bm-tabs.is-style-card .bm-tabs__tab {
	background: rgba(0, 0, 0, .05);
	border-radius: var(--bm-radius) var(--bm-radius) 0 0;
	padding: 12px 22px;
}
.bm-tabs.is-style-card .bm-tabs__tab.is-active,
.bm-tabs.is-style-card .bm-tabs__tab[aria-selected="true"] {
	background: var(--bm-tab);
	color: #fff;
}
.bm-tabs.is-style-card .bm-tabs__panel.is-active {
	border: 1px solid color-mix(in srgb, var(--bm-tab) 35%, #fff);
	border-radius: 0 var(--bm-radius) var(--bm-radius) var(--bm-radius);
	padding: 24px 20px;
	background: #fff;
}

.bm-post-list-empty {
	padding: 20px;
	background: rgba(0, 0, 0, .04);
	border-radius: var(--bm-radius);
	text-align: center;
}

/* ============================================================
 * ブログパーツ（[blog_parts]）
 * ============================================================ */
.bm-blog-part {
	margin: 1.5em 0;
}

/* ============================================================
 * 入力ツールバー拡張（フロント表示・すべてクラス指定）
 * ============================================================ */
/* 蛍光マーカー（色ごとのクラス。下半分をハイライト） */
mark[class*="bm-marker--"] {
	background-color: transparent;
	color: inherit;
	padding: 0 .05em;
}
.bm-marker--yellow { background: linear-gradient(transparent 60%, #fff34d 60%); }
.bm-marker--pink   { background: linear-gradient(transparent 60%, #ffc3dd 60%); }
.bm-marker--blue   { background: linear-gradient(transparent 60%, #b9e2ff 60%); }
.bm-marker--green  { background: linear-gradient(transparent 60%, #c6f0bd 60%); }

/* フォントサイズ（クラス） */
.bm-fs-s   { font-size: 0.85em; }
.bm-fs-l   { font-size: 1.25em; }
.bm-fs-xl  { font-size: 1.5em; }
.bm-fs-xxl { font-size: 1.85em; }

/* 本文内 Font Awesome アイコン */
.entry-content i.fa-solid,
.entry-content i.fa-regular,
.entry-content i.fa-brands {
	margin: 0 .15em;
	color: var(--bm-accent);
}
