/**
 * core/group「記事カード」（is-style-post-card）。地・角10・影 soft・中の余白はブロック属性。
 * ここは JSON で書けないものだけ：
 * - 画像の角を箱に合わせて切る（overflow:hidden）
 * - カード全体を押せるように、タイトルのリンクを ::after で広げる（ラベルはその下＝押せない。見本どおり）
 * - タイトルは3行で「…」
 * - ホバーは影だけ（背景・文字色・位置は変えない）
 * - スマホは横並び（画像 120px 左・本文右・角なし）。見本 .post-card の SP
 */

.wp-block-group.is-style-post-card {
	position: relative;
	height: 100%;
	overflow: hidden;
	transition: box-shadow 0.2s;
}

.wp-block-group.is-style-post-card:hover {
	box-shadow: var(--wp--preset--shadow--card-hover) !important; /* 影はブロック属性（style 属性）で持っているため */
}

.wp-block-group.is-style-post-card .wp-block-post-featured-image {
	margin: 0;
	background-color: #f7f6f3;
}

/* 本文側（ラベル・タイトル・日付）を残りの高さいっぱいにし、日付をいちばん下にそろえる（見本） */
.wp-block-group.is-style-post-card > .wp-block-group {
	flex: 1;
}

.wp-block-group.is-style-post-card .wp-block-post-date {
	margin-top: auto;
}

.wp-block-group.is-style-post-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
}

.wp-block-group.is-style-post-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.wp-block-group.is-style-post-card .wp-block-post-title a:focus-visible {
	outline: none;
}

.wp-block-group.is-style-post-card:has(.wp-block-post-title a:focus-visible) {
	outline: 3px solid var(--wp--preset--color--primary);
	outline-offset: 2px;
}

@media (width <= 640px) {
	.wp-block-group.is-style-post-card {
		flex-direction: row !important;
		align-items: stretch;
		border-radius: 0 !important;
	}

	.wp-block-group.is-style-post-card .wp-block-post-featured-image {
		flex: 0 0 120px;
		width: 120px;
	}

	.wp-block-group.is-style-post-card .wp-block-post-featured-image {
		align-self: stretch;
		min-height: 68px;
		aspect-ratio: auto !important;
	}

	.wp-block-group.is-style-post-card .wp-block-post-featured-image img {
		position: absolute;
		inset: 0;
		width: 100% !important;
		height: 100% !important;
		aspect-ratio: auto !important;
		object-fit: cover;
	}

	.wp-block-group.is-style-post-card .wp-block-post-featured-image {
		position: relative;
		overflow: hidden;
	}

	.wp-block-group.is-style-post-card .wp-block-post-title {
		font-size: 14px !important;
	}
}
