/**
 * 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;
	/* スマホ（デフォルト）。--bm-pl-cols-sp はブロックが inline で指定 */
	grid-template-columns: repeat(var(--bm-pl-cols-sp, 1), 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);
	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;
}

/* 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 {
		grid-template-columns: repeat(var(--bm-pl-cols-pc, 2), 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）
 * ============================================================ */
.bm-tabs {
	margin: 2em 0;
}
.bm-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 2px solid var(--bm-accent);
}
.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);
}
.bm-tabs__tab[aria-selected="true"] {
	background: var(--bm-accent);
	color: #fff;
}
.bm-tabs__panel {
	display: none;
	padding: 20px 4px;
}
.bm-tabs__panel.is-active {
	display: block;
}

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